1. 10 4月, 2015 8 次提交
  2. 01 4月, 2015 2 次提交
  3. 30 3月, 2015 1 次提交
  4. 27 3月, 2015 2 次提交
  5. 26 3月, 2015 1 次提交
    • C
      drm/i915: Keep ring->active_list and ring->requests_list consistent · 832a3aad
      Chris Wilson 提交于
      If we retire requests last, we may use a later seqno and so clear
      the requests lists without clearing the active list, leading to
      confusion. Hence we should retire requests first for consistency with
      the early return. The order used to be important as the lifecycle for
      the object on the active list was determined by request->seqno. However,
      the requests themselves are now reference counted removing the
      constraint from the order of retirement.
      
      Fixes regression from
      
      commit 1b5a433a
      Author: John Harrison <John.C.Harrison@Intel.com>
      Date:   Mon Nov 24 18:49:42 2014 +0000
      
          drm/i915: Convert 'i915_seqno_passed' calls into 'i915_gem_request_completed
      '
      
      and a
      
      	WARNING: CPU: 0 PID: 1383 at drivers/gpu/drm/i915/i915_gem_evict.c:279 i915_gem_evict_vm+0x10c/0x140()
      	WARN_ON(!list_empty(&vm->active_list))
      
      Identified by updating WATCH_LISTS:
      
      	[drm:i915_verify_lists] *ERROR* blitter ring: active list not empty, but no requests
      	WARNING: CPU: 0 PID: 681 at drivers/gpu/drm/i915/i915_gem.c:2751 i915_gem_retire_requests_ring+0x149/0x230()
      	WARN_ON(i915_verify_lists(ring->dev))
      
      Note that this is only a problem in evict_vm where the following happens
      after a retire_request has cleaned out all requests, but not all active
      bo:
      - intel_ring_idle called from i915_gpu_idle notices that no requests are
        outstanding and immediately returns.
      - i915_gem_retire_requests_ring called from i915_gem_retire_requests also
        immediately returns when there's no request, still leaving the bo on the
        active list.
      - evict_vm hits the WARN_ON(!list_empty(&vm->active_list)) after evicting
        all active objects that there's still stuff left that shouldn't be
        there.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: John Harrison <John.C.Harrison@Intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      832a3aad
  6. 23 3月, 2015 2 次提交
    • T
      drm/i915/skl: Support secondary (rotated) frame buffer mapping · 50470bb0
      Tvrtko Ursulin 提交于
      90/270 rotated scanout needs a rotated GTT view of the framebuffer.
      
      This is put in a separate VMA with a dedicated ggtt view and wired such that
      it is created when a framebuffer is pinned to a 90/270 rotated plane.
      
      Rotation is only possible with Yb/Yf buffers and error is propagated to
      user space in case of a mismatch.
      
      Special rotated page view is constructed at the VMA creation time by
      borrowing the DMA addresses from obj->pages.
      
      v2:
          * Do not bother with pages for rotated sg list, just populate the DMA
            addresses. (Daniel Vetter)
          * Checkpatch cleanup.
      
      v3:
          * Rebased on top of new plane handling (create rotated mapping when
            setting the rotation property).
          * Unpin rotated VMA on unpinning from display plane.
          * Simplify rotation check using bitwise AND. (Chris Wilson)
      
      v4:
          * Fix unpinning of optional rotated mapping so it is really considered
            to be optional.
      
      v5:
         * Rebased for fb modifier changes.
         * Rebased for atomic commit.
         * Only pin needed view for display. (Ville Syrjälä, Daniel Vetter)
      
      v6:
         * Rebased after preparatory work has been extracted out. (Daniel Vetter)
      
      v7:
         * Slightly simplified tiling geometry calculation.
         * Moved rotated GGTT view implementation into i915_gem_gtt.c (Daniel Vetter)
      
      v8:
         * Do not use i915_gem_obj_size to get object size since that actually
           returns the size of an VMA which may not exist.
         * Rebased for ggtt view changes.
      
      v9:
         * Rebased after code review changes on the preceding patches.
         * Tidy function definitions. (Joonas Lahtinen)
      
      For: VIZ-4726
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: Michel Thierry <michel.thierry@intel.com> (v4)
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      50470bb0
    • T
      drm/i915: Use GGTT view when (un)pinning objects to planes · e6617330
      Tvrtko Ursulin 提交于
      To support frame buffer rotation we need to be able to pass on the information
      on what kind of GGTT view is required for display.
      
      This patch just adds the parameter and makes all the callers default to the
      normal view.
      
      v2: Rebased for ggtt view changes.
      v3: Don't limit PIN_MAPPABLE to normal views just yet. (Joonas Lahtinen)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> (v3)
      [danvet: s/BUG/WARN/ in the patch hunk because. At least where the
      BUG_ON isn't fatal right away.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e6617330
  7. 20 3月, 2015 5 次提交
    • B
      drm/i915: Track page table reload need · 563222a7
      Ben Widawsky 提交于
      This patch was formerly known as, "Force pd restore when PDEs change,
      gen6-7." I had to change the name because it is needed for GEN8 too.
      
      The real issue this is trying to solve is when a new object is mapped
      into the current address space. The GPU does not snoop the new mapping
      so we must do the gen specific action to reload the page tables.
      
      GEN8 and GEN7 do differ in the way they load page tables for the RCS.
      GEN8 does so with the context restore, while GEN7 requires the proper
      load commands in the command streamer. Non-render is similar for both.
      
      Caveat for GEN7
      The docs say you cannot change the PDEs of a currently running context.
      We never map new PDEs of a running context, and expect them to be
      present - so I think this is okay. (We can unmap, but this should also
      be okay since we only unmap unreferenced objects that the GPU shouldn't
      be tryingto va->pa xlate.) The MI_SET_CONTEXT command does have a flag
      to signal that even if the context is the same, force a reload. It's
      unclear exactly what this does, but I have a hunch it's the right thing
      to do.
      
      The logic assumes that we always emit a context switch after mapping new
      PDEs, and before we submit a batch. This is the case today, and has been
      the case since the inception of hardware contexts. A note in the comment
      let's the user know.
      
      It's not just for gen8. If the current context has mappings change, we
      need a context reload to switch
      
      v2: Rebased after ppgtt clean up patches. Split the warning for aliasing
      and true ppgtt options. And do not break aliasing ppgtt, where to->ppgtt
      is always null.
      
      v3: Invalidate PPGTT TLBs inside alloc_va_range.
      
      v4: Rename ppgtt_invalidate_tlbs to mark_tlbs_dirty and move
      pd_dirty_rings from i915_address_space to i915_hw_ppgtt. Fixes when
      neither ctx->ppgtt and aliasing_ppgtt exist.
      
      v5: Removed references to teardown_va_range.
      
      v6: Updated needs_pd_load_pre/post.
      
      v7: Fix pd_dirty_rings check in needs_pd_load_post, and update/move
      comment about updated PDEs to object_pin/bind (Mika).
      
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      563222a7
    • B
      drm/i915: Track GEN6 page table usage · 678d96fb
      Ben Widawsky 提交于
      Instead of implementing the full tracking + dynamic allocation, this
      patch does a bit less than half of the work, by tracking and warning on
      unexpected conditions. The tracking itself follows which PTEs within a
      page table are currently being used for objects. The next patch will
      modify this to actually allocate the page tables only when necessary.
      
      With the current patch there isn't much in the way of making a gen
      agnostic range allocation function. However, in the next patch we'll add
      more specificity which makes having separate functions a bit easier to
      manage.
      
      One important change introduced here is that DMA mappings are
      created/destroyed at the same page directories/tables are
      allocated/deallocated.
      
      Notice that aliasing PPGTT is not managed here. The patch which actually
      begins dynamic allocation/teardown explains the reasoning for this.
      
      v2: s/pdp.page_directory/pdp.page_directories
      Make a scratch page allocation helper
      
      v3: Rebase and expand commit message.
      
      v4: Allocate required pagetables only when it is needed, _bind_to_vm
      instead of bind_vma (Daniel).
      
      v5: Rebased to remove the unnecessary noise in the diff, also:
       - PDE mask is GEN agnostic, renamed GEN6_PDE_MASK to I915_PDE_MASK.
       - Removed unnecessary checks in gen6_alloc_va_range.
       - Changed map/unmap_px_single macros to use dma functions directly and
         be part of a static inline function instead.
       - Moved drm_device plumbing through page tables operation to its own
         patch.
       - Moved allocate/teardown_va_range calls until they are fully
         implemented (in subsequent patch).
       - Merged pt and scratch_pt unmap_and_free path.
       - Moved scratch page allocator helper to the patch that will use it.
      
      v6: Reduce complexity by not tearing down pagetables dynamically, the
      same can be achieved while freeing empty vms. (Daniel)
      
      v7: s/i915_dma_map_px_single/i915_dma_map_single
      s/gen6_write_pdes/gen6_write_pde
      Prevent a NULL case when only GGTT is available. (Mika)
      
      v8: Rebased after s/page_tables/page_table/.
      
      v9: Reworked i915_pte_index and i915_pte_count.
      Also exercise bitmap allocation here (gen6_alloc_va_range) and fix
      incorrect write_page_range in i915_gem_restore_gtt_mappings (Mika).
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v3+)
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      678d96fb
    • D
      drm/i915: Extract i915_gem_shrinker.c · be6a0376
      Daniel Vetter 提交于
      Two code changes:
      - Extract i915_gem_shrinker_init.
      - Inline i915_gem_object_is_purgeable since we open-code it everywhere
        else too.
      
      This already has the benefit of pulling all the shrinker code
      together, next patch adds a bit of kerneldoc.
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      be6a0376
    • T
      drm/i915: Turn on PIN_GLOBAL in i915_gem_object_ggtt_pin · 6fafab76
      Tvrtko Ursulin 提交于
      This makes the interface consistent to old i915_gem_obj_ggtt_pin.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6fafab76
    • J
      drm/i915: Do not use ggtt_view with (aliasing) PPGTT · ec7adb6e
      Joonas Lahtinen 提交于
      GGTT views are only applicable when dealing with GGTT. Change the code to
      reject ggtt_view where it should not be used and require it when it should
      be.
      
      v2:
      - Dropped _ppgtt_ infixes, allow both types to be passed
      - Disregard other but normal views when no view is specified
      - More checks that valid parameters are passed
      - More readable error checking
      
      v3:
      - Prefer WARN_ONCE over BUG_ON when there is code path for failure
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      [danvet: Drop unecessary forward decl from earlier patch iterations.]
      [danvet: Remove unused variable spotted by Tvrtko.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ec7adb6e
  8. 18 3月, 2015 2 次提交
  9. 10 3月, 2015 2 次提交
  10. 28 2月, 2015 1 次提交
  11. 27 2月, 2015 1 次提交
  12. 26 2月, 2015 1 次提交
    • J
      drm/i915: Cache ringbuf pointer in request structure · 98e1bd4a
      John Harrison 提交于
      In execlist mode, the ringbuf is a function of the ring and context whereas in
      legacy mode, it is derived from the ring alone. Thus the calculation required to
      determine the ringbuf pointer from the ring (and context) also needs to test
      execlist mode or not. This is messy.
      
      Further, the request structure holds a pointer to both the ring and the context
      for which it was created. Thus, given a request, it is possible to derive the
      ringbuf in either legacy or execlist mode. Hence it is necessary to pass just
      the request in to all the low level functions rather than some combination of
      request, ring, context and ringbuf. However, rather than recalculating it each
      time, it is much simpler to just cache the ringbuf pointer in the request
      structure itself.
      
      Caching the pointer means the calculation is done once at request creation time
      and all further code and simply read it directly from the request structure.
      
      OTC-Jira: VIZ-5115
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      [danvet: Drop contentless comment in lrc alloc request entirely. And
      spelling fix in the commit message.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      98e1bd4a
  13. 24 2月, 2015 1 次提交
    • N
      drm/i915: Fix a use after free, and unbalanced refcounting · b3a38998
      Nick Hoath 提交于
      When converting from implicitly tracked execlist queue items to ref counted
      requests, not all frees of requests were replaced with unrefs, and extraneous
      refs/unrefs of contexts were added.
      Correct the unbalanced refcount & replace the frees.
      Remove a noisy warning when hitting the request creation path.
      
      drm_i915_gem_request and intel_context are both kref reference counted
      structures. Upon allocation, drm_i915_gem_request's ref count should be
      bumped using kref_init. When a context is assigned to the request,
      the context's reference count should be bumped using i915_gem_context_reference.
      i915_gem_request_reference will reduce the context reference count when
      the request is freed.
      
      Problem introduced in
      commit 6d3d8274
      Author:     Nick Hoath <nicholas.hoath@intel.com>
      AuthorDate: Thu Jan 15 13:10:39 2015 +0000
      
           drm/i915: Subsume intel_ctx_submit_request in to drm_i915_gem_request
      
      v2: Added comments explaining how the ctx pointer and the request object should
      be ref-counted. Removed noisy warning.
      
      v3: Cleaned up the language used in the commit & the header
      description (Thanks David Gordon)
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88652Signed-off-by: NNick Hoath <nicholas.hoath@intel.com>
      Reviewed-by: NThomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      b3a38998
  14. 14 2月, 2015 2 次提交
  15. 29 1月, 2015 2 次提交
  16. 27 1月, 2015 6 次提交
  17. 26 1月, 2015 1 次提交