1. 19 8月, 2013 5 次提交
  2. 09 8月, 2013 1 次提交
  3. 07 8月, 2013 11 次提交
  4. 05 8月, 2013 1 次提交
  5. 01 8月, 2013 1 次提交
    • D
      drm/mm: include required headers in drm_mm.h · 86e81f0e
      David Herrmann 提交于
      We need BUG_ON(), spinlock_t and standard kernel data-types so include the
      right headers.
      
      Subject: [drm-intel:drm-intel-nightly 154/166] include/drm/drm_mm.h:67:2:
       error: unknown type name 'spinlock_t'
      Message-ID: <51f14693.g5HGdcuw2v3m8FOd%fengguang.wu@intel.com>
      
      In case it didn't link to it correctly. Somehow this bug doesn't occur
      here on my machine, hmm. But I think fixing drm_mm.h is better than
      changing the include-order in drm_vma_manager.h, so this is what I
      did.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      86e81f0e
  6. 27 7月, 2013 4 次提交
  7. 26 7月, 2013 1 次提交
  8. 25 7月, 2013 13 次提交
    • I
      drm/i915: dvo_ch7xxx: fix vsync polarity setting · 3b27af35
      Imre Deak 提交于
      This fixes a typo which set the wrong vsync and possibly also hsync
      polarity for any modes with positive vsync polarity.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3b27af35
    • D
      drm/i915: fix the racy object accounting · c20e8355
      Daniel Vetter 提交于
      Just use a spinlock to protect them.
      
      v2: Rebase onto the new object create refcount fix patch.
      
      v3: Don't kill dev_priv->mm.object_memory as requested by Chris and
      hence just use a spinlock instead of atomic_t.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67287Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c20e8355
    • C
      drm/i915: Convert the register access tracepoint to be conditional · ed71f1b4
      Chris Wilson 提交于
      The TRACE_EVENT_CONDITION is supposed to generate more efficient code
      than if (cond) trace(), which is what we are currently using inside the
      register access functions.
      
      v2: Rebase onto uncore
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ed71f1b4
    • C
      drm/i915: Squash gen lookup through multiple indirections inside GT access · a7f31ee0
      Chris Wilson 提交于
      The INTEL_INFO() macro extracts the dev_private pointer from the device,
      so passing in the dev_private->dev is a long winded circumlocution.
      
      v2: rebase onto uncore
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a7f31ee0
    • C
      drm/i915: Use the common register access functions for NOTRACE variants · dba8e41f
      Chris Wilson 提交于
      Detangle the confusion that NOTRACE variants of the register read/write
      routines were directly using the raw register access. We need for those
      routines to reuse the common code for serializing register access and
      ensuring the correct register power states. This is only possible now
      that the only routines that required raw access use their own API.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dba8e41f
    • C
      drm/i915: Use a private interface for register access within GT · 6af5d92f
      Chris Wilson 提交于
      The GT functions for enabling register access also need to occasionally
      write to and read from registers. To avoid the potential recursion as we
      modify the public interface to be stricter, introduce a private register
      access API for the GT functions.
      
      v2: Rebase
      v3: Rebase onto uncore
      v4: Use raw interfaces consistently so that we only use the low-level
          readN functions from a single location.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6af5d92f
    • C
      drm/i915: Colocate all GT access routines in the same file · 907b28c5
      Chris Wilson 提交于
      Currently, the register access code is split between i915_drv.c and
      intel_pm.c. It only bares a superficial resemblance to the reset of the
      powermanagement code, so move it all into its own file. This is to ease
      further patches to enforce serialised register access.
      
      v2: Scan for random abuse of I915_WRITE_NOTRACE
      v3: Take the opportunity to rename the GT functions as uncore. Uncore is
      the term used by the hardware design (and bspec) for all functions
      outside of the GPU (and CPU) cores in what is also known as the System
      Agent.
      v4: Rebase onto SNB rc6 fixes
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Wrestle patch into applying and inline
      intel_uncore_early_sanitize (plus move the old comment to the new
      function). Also keep the _santize postfix for intel_uncore_sanitize.]
      [danvet: Squash in fixup spotted by Chris on irc: We need to call
      intel_pm_init before intel_uncore_sanitize since the later will call
      cancel_work on the delayed rps setup work the former initializes.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      907b28c5
    • D
      Merge commit 'Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux' · cb54b53a
      Daniel Vetter 提交于
      This backmerges Linus' merge commit of the latest drm-fixes pull:
      
      commit 549f3a12
      Merge: 42577ca8 058ca4a2
      Author: Linus Torvalds <torvalds@linux-foundation.org>
      Date:   Tue Jul 23 15:47:08 2013 -0700
      
          Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
      
      We've accrued a few too many conflicts, but the real reason is that I
      want to merge the 100% solution for Haswell concurrent registers
      writes into drm-intel-next. But that depends upon the 90% bandaid
      merged into -fixes:
      
      commit a7cd1b8f
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Fri Jul 19 20:36:51 2013 +0100
      
          drm/i915: Serialize almost all register access
      
      Also, we can roll up on accrued conflicts.
      
      Usually I'd backmerge a tagged -rc, but I want to get this done before
      heading off to vacations next week ;-)
      
      Conflicts:
      	drivers/gpu/drm/i915/i915_dma.c
      	drivers/gpu/drm/i915/i915_gem.c
      
      v2: For added hilarity we have a init sequence conflict around the
      gt_lock, so need to move that one, too. Spotted by Jani Nikula.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cb54b53a
    • D
      drm/vma: provide drm_vma_node_unmap() helper · 51335df9
      David Herrmann 提交于
      Instead of unmapping the nodes in TTM and GEM users manually, we provide
      a generic wrapper which does the correct thing for all vma-nodes.
      
      v2: remove bdev->dev_mapping test in ttm_bo_unmap_virtual_unlocked() as
      ttm_mem_io_free_vm() does nothing in that case (io_reserved_vm is 0).
      v4: Fix docbook comments
      v5: use drm_vma_node_size()
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      51335df9
    • D
      drm/ttm: convert to unified vma offset manager · 72525b3f
      David Herrmann 提交于
      Use the new vma-manager infrastructure. This doesn't change any
      implementation details as the vma-offset-manager is nearly copied 1-to-1
      from TTM.
      
      The vm_lock is moved into the offset manager so we can drop it from TTM.
      During lookup, we use the vma locking helpers to take a reference to the
      found object.
      In all other scenarios, locking stays the same as before. We always
      guarantee that drm_vma_offset_remove() is called only during destruction.
      Hence, helpers like drm_vma_node_offset_addr() are always safe as long as
      the node has a valid offset.
      
      This also drops the addr_space_offset member as it is a copy of vm_start
      in vma_node objects. Use the accessor functions instead.
      
      v4:
       - remove vm_lock
       - use drm_vma_offset_lock_lookup() to protect lookup (instead of vm_lock)
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Martin Peres <martin.peres@labri.fr>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Thomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      72525b3f
    • D
      drm/gem: convert to new unified vma manager · 0de23977
      David Herrmann 提交于
      Use the new vma manager instead of the old hashtable. Also convert all
      drivers to use the new convenience helpers. This drops all the
      (map_list.hash.key << PAGE_SHIFT) non-sense.
      
      Locking and access-management is exactly the same as before with an
      additional lock inside of the vma-manager, which strictly wouldn't be
      needed for gem.
      
      v2:
       - rebase on drm-next
       - init nodes via drm_vma_node_reset() in drm_gem.c
      v3:
       - fix tegra
      v4:
       - remove duplicate if (drm_vma_node_has_offset()) checks
       - inline now trivial drm_vma_node_offset_addr() calls
      v5:
       - skip node-reset on gem-init due to kzalloc()
       - do not allow mapping gem-objects with offsets (backwards compat)
       - remove unneccessary casts
      
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      0de23977
    • D
      drm: add unified vma offset manager · fe3078fa
      David Herrmann 提交于
      If we want to map GPU memory into user-space, we need to linearize the
      addresses to not confuse mm-core. Currently, GEM and TTM both implement
      their own offset-managers to assign a pgoff to each object for user-space
      CPU access. GEM uses a hash-table, TTM uses an rbtree.
      
      This patch provides a unified implementation that can be used to replace
      both. TTM allows partial mmaps with a given offset, so we cannot use
      hashtables as the start address may not be known at mmap time. Hence, we
      use the rbtree-implementation of TTM.
      
      We could easily update drm_mm to use an rbtree instead of a linked list
      for it's object list and thus drop the rbtree from the vma-manager.
      However, this would slow down drm_mm object allocation for all other
      use-cases (rbtree insertion) and add another 4-8 bytes to each mm node.
      Hence, use the separate tree but allow for later migration.
      
      This is a rewrite of the 2012-proposal by David Airlie <airlied@linux.ie>
      
      v2:
       - fix Docbook integration
       - drop drm_mm_node_linked() and use drm_mm_node_allocated()
       - remove unjustified likely/unlikely usage (but keep for rbtree paths)
       - remove BUG_ON() as drm_mm already does that
       - clarify page-based vs. byte-based addresses
       - use drm_vma_node_reset() for initialization, too
      v4:
       - allow external locking via drm_vma_offset_un/lock_lookup()
       - add locked lookup helper drm_vma_offset_lookup_locked()
      v5:
       - fix drm_vma_offset_lookup() to correctly validate range-mismatches
         (fix (offset > start + pages))
       - fix drm_vma_offset_exact_lookup() to actually do what it says
       - remove redundant vm_pages member (add drm_vma_node_size() helper)
       - remove unneeded goto
       - fix documentation
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      fe3078fa
    • D
      drm/i915: fix reference counting in i915_gem_create · d861e338
      Daniel Vetter 提交于
      This function is called without the dev->struct_mutex held, hence we
      need to use the _unlocked unreference variants.
      
      As soon as the object is registered userspace can sneak in here with a
      gem_close ioctl call, so the object can (and with my new evil tests
      actually does) get the final unreference in this place. The lack of
      locking then results in hilarity and some good leakage.
      
      To fix this we simply need to revert
      
      Chris Wilson <chris@chris-wilson.co.uk>
      
      v2: We need to make the trace call _before_ we drop our ref - the
      object might very well be gone by then already.
      
      v3: Just revert the original patch as suggested by Chris Wilson.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Remove the added white line again to tighten the return
      block, requested by Chris.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d861e338
  9. 24 7月, 2013 3 次提交
    • C
      drm/i915: Use Graphics Base of Stolen Memory on all gen3+ · 17fec8a0
      Chris Wilson 提交于
      So I made the mistake of missing that the desktop and mobile chipsets
      have different layouts in their PCI configurations, and we were
      incorrectly setting the wrong physical address for stolen memory on
      mobile chipsets.
      
      Since all gen3+ are actually consistent in the location of the GBSM
      register in the PCI configuration space on device 2 (the GPU), use it.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      [danvet: Drop cc: stable and fudge conflicts.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      17fec8a0
    • D
      drm/i915: disable stolen mem for OVERLAY_NEEDS_PHYSICAL · f63a484c
      Daniel Vetter 提交于
      Our phys_object code can't deal with stolen memory and so blows up.
      Fixing this is quite a bit of work and not worth it much for a single
      page object, so just opt-out.
      
      This is necessary prep work to enable stolen on gen2/3 platforms where
      the overlay register file isn't stored in the gtt.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f63a484c
    • P
      drm/i915: add functions to disable and restore LCPLL · be256dc7
      Paulo Zanoni 提交于
      For now there are no callers, but these functions are going to be
      needed for the code that allows Package C8+. Other future features may
      also require this code.
      
      Also merge the commit which introduced assert_can_disable_lcpll and
      had the following commit message:
      
      Most of the hardware needs to be disabled before LCPLL is disabled, so
      let's add a function to assert some of items listed in the "Display
      Sequences for LCPLL disabling" documentation.
      
      The idea is that hsw_disable_lcpll should not disable the hardware,
      the callers need to take care of calling hsw_disable_lcpll only once
      everything is already disabled.
      
      v2: - Rebase.
          - Fix D_COMP wait timeout.
      v3: - Use wait_for_atomic_use (Ben)
          - Remove/add a useless/needed POSTING_READ (Ben)
          - Early return in case LCPLL is already restored (Ben)
          - Add ndelay(100) (Ben)
      v4: - Merge the commit that added assert_can_disable_lcpll (Ben)
          - Add interrupt assertions (Ben)
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Fix compile fail since there's no HAS_LP_PCH yet.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      be256dc7