1. 15 6月, 2015 1 次提交
  2. 10 4月, 2015 1 次提交
    • C
      drm/i915: Split the batch pool by engine · 06fbca71
      Chris Wilson 提交于
      I woke up one morning and found 50k objects sitting in the batch pool
      and every search seemed to iterate the entire list... Painting the
      screen in oils would provide a more fluid display.
      
      One issue with the current design is that we only check for retirements
      on the current ring when preparing to submit a new batch. This means
      that we can have thousands of "active" batches on another ring that we
      have to walk over. The simplest way to avoid that is to split the pools
      per ring and then our LRU execution ordering will also ensure that the
      inactive buffers remain at the front.
      
      v2: execlists still requires duplicate code.
      v3: execlists requires more duplicate code
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      06fbca71
  3. 01 4月, 2015 1 次提交
  4. 18 3月, 2015 1 次提交
  5. 26 2月, 2015 1 次提交
    • J
      drm/i915: Rename 'flags' to 'dispatch_flags' for better code reading · 8e004efc
      John Harrison 提交于
      There is a flags word that is passed through the execbuffer code path all the
      way from initial decoding of the user parameters down to the very final dispatch
      buffer call. It is simply called 'flags'. Unfortuantely, there are many other
      flags words floating around in the same blocks of code. Even more once the GPU
      scheduler arrives.
      
      This patch makes it more obvious exactly which flags word is which by renaming
      'flags' to 'dispatch_flags'. Note that the bit definitions for this flags word
      already have an 'I915_DISPATCH_' prefix on them and so are not quite so
      ambiguous.
      
      OTC-Jira: VIZ-1587
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      [danvet: Resolve conflict with Chris' rework of the bb parsing.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8e004efc
  6. 24 2月, 2015 1 次提交
  7. 14 2月, 2015 1 次提交
  8. 27 1月, 2015 2 次提交
  9. 03 12月, 2014 6 次提交
  10. 20 11月, 2014 3 次提交
    • C
      drm/i915: Remove DRI1 ring accessors and API · 5c6c6003
      Chris Wilson 提交于
      With the deprecation of UMS, and by association DRI1, we have a tough
      choice when updating the ring access routines. We either rewrite the
      DRI1 routines blindly without testing (so likely to be broken) or take
      the liberty of declaring them no longer supported and remove them
      entirely. This takes the latter approach.
      
      v2: Also remove the DRI1 sarea updates
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Fix rebase conflicts.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5c6c6003
    • T
      drm/i915/bdw: Pin the ringbuffer backing object to GGTT on-demand · 7ba717cf
      Thomas Daniel 提交于
      Same as with the context, pinning to GGTT regardless is harmful (it
      badly fragments the GGTT and can even exhaust it).
      
      Unfortunately, this case is also more complex than the previous one
      because we need to map and access the ringbuffer in several places
      along the execbuffer path (and we cannot make do by leaving the
      default ringbuffer pinned, as before). Also, the context object
      itself contains a pointer to the ringbuffer address that we have to
      keep updated if we are going to allow the ringbuffer to move around.
      
      v2: Same as with the context pinning, we cannot really do it during
      an interrupt. Also, pin the default ringbuffers objects regardless
      (makes error capture a lot easier).
      
      v3: Rebased. Take a pin reference of the ringbuffer for each item
      in the execlist request queue because the hardware may still be using
      the ringbuffer after the MI_USER_INTERRUPT to notify the seqno update
      is executed.  The ringbuffer must remain pinned until the context save
      is complete.  No longer pin and unpin ringbuffer in
      populate_lr_context() - this transient address is meaningless and the
      pinning can cause a sleep while atomic.
      
      v4: Moved ringbuffer pin and unpin into the lr_context_pin functions.
      Downgraded pinning check BUG_ONs to WARN_ONs.
      
      v5: Reinstated WARN_ONs for unexpected execlist states.  Removed unused
      variable.
      
      Issue: VIZ-4277
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Reviewed-by: Deepak S<deepak.s@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7ba717cf
    • T
      drm/i915/bdw: Clean up execlist queue items in retire_work · c86ee3a9
      Thomas Daniel 提交于
      No longer create a work item to clean each execlist queue item.
      Instead, move retired execlist requests to a queue and clean up the
      items during retire_requests.
      
      v2: Fix legacy ring path broken during overzealous cleanup
      
      v3: Update idle detection to take execlists queue into account
      
      v4: Grab execlist lock when checking queue state
      
      v5: Fix leaking requests by freeing in execlists_retire_requests.
      
      Issue: VIZ-4274
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NDeepak S <deepak.s@linux.intel.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c86ee3a9
  11. 14 11月, 2014 1 次提交
    • M
      drm/i915: Initialize workarounds in logical ring mode too · 771b9a53
      Michel Thierry 提交于
      Following the legacy ring submission example, update the
      ring->init_context() hook to support the execlist submission mode.
      
      v2: update to use the new workaround macros and cleanup unused code.
      This takes care of both bdw and chv workarounds.
      
      v2.1: Add missing call to init_context() during deferred context creation.
      
      v3: Split init_context (emit) in legacy/lrc modes. For lrc, get the ringbuf
      from the context (Mika/Daniel).
      
      v4: Merge init_context interfaces back, the legacy mode only needs the ring,
      but the lrc mode needs the ring and context (Mika).
      
      Issue: VIZ-4092
      Issue: GMIN-3475
      Change-Id: Ie3d093b2542ab0e2a44b90460533e2f979788d6c
      Cc: Deepak S <deepak.s@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NArun Siluvery <arun.siluvery@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      [danvet: Align function paramater lists properly.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      771b9a53
  12. 03 9月, 2014 1 次提交
    • A
      drm/i915/bdw: Apply workarounds in render ring init function · 86d7f238
      Arun Siluvery 提交于
      For BDW workarounds are currently initialized in init_clock_gating() but
      they are lost during reset, suspend/resume etc; this patch moves the WAs
      that are part of register state context to render ring init fn otherwise
      default context ends up with incorrect values as they don't get initialized
      until init_clock_gating fn.
      
      v2: Add workarounds to golden render state
      This method has its own issues, first of all this is different for
      each gen and it is generated using a tool so adding new workaround
      and mainitaining them across gens is not a straightforward process.
      
      v3: Use LRIs to emit these workarounds (Ville)
      Instead of modifying the golden render state the same LRIs are
      emitted from within the driver.
      
      v4: Use abstract name when exporting gen specific routines (Chris)
      
      For: VIZ-4092
      Signed-off-by: NArun Siluvery <arun.siluvery@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      86d7f238
  13. 15 8月, 2014 3 次提交
    • T
      drm/i915/bdw: Handle context switch events · e981e7b1
      Thomas Daniel 提交于
      Handle all context status events in the context status buffer on every
      context switch interrupt. We only remove work from the execlist queue
      after a context status buffer reports that it has completed and we only
      attempt to schedule new contexts on interrupt when a previously submitted
      context completes (unless no contexts are queued, which means the GPU is
      free).
      
      We canot call intel_runtime_pm_get() in an interrupt (or with a spinlock
      grabbed, FWIW), because it might sleep, which is not a nice thing to do.
      Instead, do the runtime_pm get/put together with the create/destroy request,
      and handle the forcewake get/put directly.
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      
      v2: Unreferencing the context when we are freeing the request might free
      the backing bo, which requires the struct_mutex to be grabbed, so defer
      unreferencing and freeing to a bottom half.
      
      v3:
      - Ack the interrupt inmediately, before trying to handle it (fix for
      missing interrupts by Bob Beckett <robert.beckett@intel.com>).
      - Update the Context Status Buffer Read Pointer, just in case (spotted
      by Damien Lespiau).
      
      v4: New namespace and multiple rebase changes.
      
      v5: Squash with "drm/i915/bdw: Do not call intel_runtime_pm_get() in an
      interrupt", as suggested by Daniel.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [danvet: Checkpatch ...]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e981e7b1
    • M
      drm/i915/bdw: Two-stage execlist submit process · acdd884a
      Michel Thierry 提交于
      Context switch (and execlist submission) should happen only when
      other contexts are not active, otherwise pre-emption occurs.
      
      To assure this, we place context switch requests in a queue and those
      request are later consumed when the right context switch interrupt is
      received (still TODO).
      
      v2: Use a spinlock, do not remove the requests on unqueue (wait for
      context switch completion).
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      
      v3: Several rebases and code changes. Use unique ID.
      
      v4:
      - Move the queue/lock init to the late ring initialization.
      - Damien's kmalloc review comments: check return, use sizeof(*req),
      do not cast.
      
      v5:
      - Do not reuse drm_i915_gem_request. Instead, create our own.
      - New namespace.
      
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v1)
      Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> (v2-v5)
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [davnet: Checkpatch + wash-up s/BUG_ON/WARN_ON/.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      acdd884a
    • O
      drm/i915: Add temporary ring->ctx backpointer · 582d67f0
      Oscar Mateo 提交于
      The execlist patches have a bit a convoluted and long history and due
      to that have the actual submission still misplaced deeply burried in
      the low-level ringbuffer handling code. This design goes back to the
      legacy ringbuffer code with its tricky lazy request and simple work
      submissiion using ring tail writes. For that reason they need a
      ring->ctx backpointer.
      
      The goal is to unburry that code and move it up into a level where the
      full execlist context is available so that we can ditch this
      backpointer. Until that's done make it really obvious that there's
      work still to be done.
      
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Thomas Daniel <thomas.daniel@intel.com>
      Acked-by: NThomas Daniel <thomas.daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      582d67f0
  14. 12 8月, 2014 5 次提交
  15. 11 8月, 2014 4 次提交
  16. 07 8月, 2014 1 次提交
  17. 08 7月, 2014 3 次提交
  18. 11 6月, 2014 1 次提交
  19. 23 5月, 2014 3 次提交
    • O
      drm/i915: s/i915_hw_context/intel_context · 273497e5
      Oscar Mateo 提交于
      Up until now, contexts had one (and only one) backing object that was
      used by the hardware to save/restore render ring contexts (via the
      MI_SET_CONTEXT command). Other rings did not have or need this, so
      our i915_hw_context struct had a 1:1 relationship with a a real HW
      context.
      
      With Logical Ring Contexts and Execlists, this is not possible anymore:
      all rings need a backing object, and it cannot be reused. To prepare
      for that, rename our contexts to the more generic term intel_context.
      
      No functional changes.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      273497e5
    • O
      drm/i915: Split the ringbuffers from the rings (3/3) · 93b0a4e0
      Oscar Mateo 提交于
      Manual cleanup after the previous Coccinelle script.
      
      Yes, I could write another Coccinelle script to do this but I
      don't want labor-replacing robots making an honest programmer's
      work obsolete (also, I'm lazy).
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      93b0a4e0
    • O
      drm/i915: Split the ringbuffers from the rings (2/3) · ee1b1e5e
      Oscar Mateo 提交于
      This refactoring has been performed using the following Coccinelle
      semantic script:
      
          @@
          struct intel_engine_cs r;
          @@
          (
          - (r).obj
          + r.buffer->obj
          |
          - (r).virtual_start
          + r.buffer->virtual_start
          |
          - (r).head
          + r.buffer->head
          |
          - (r).tail
          + r.buffer->tail
          |
          - (r).space
          + r.buffer->space
          |
          - (r).size
          + r.buffer->size
          |
          - (r).effective_size
          + r.buffer->effective_size
          |
          - (r).last_retired_head
          + r.buffer->last_retired_head
          )
      
          @@
          struct intel_engine_cs *r;
          @@
          (
          - (r)->obj
          + r->buffer->obj
          |
          - (r)->virtual_start
          + r->buffer->virtual_start
          |
          - (r)->head
          + r->buffer->head
          |
          - (r)->tail
          + r->buffer->tail
          |
          - (r)->space
          + r->buffer->space
          |
          - (r)->size
          + r->buffer->size
          |
          - (r)->effective_size
          + r->buffer->effective_size
          |
          - (r)->last_retired_head
          + r->buffer->last_retired_head
          )
      
          @@
          expression E;
          @@
          (
          - LP_RING(E)->obj
          + LP_RING(E)->buffer->obj
          |
          - LP_RING(E)->virtual_start
          + LP_RING(E)->buffer->virtual_start
          |
          - LP_RING(E)->head
          + LP_RING(E)->buffer->head
          |
          - LP_RING(E)->tail
          + LP_RING(E)->buffer->tail
          |
          - LP_RING(E)->space
          + LP_RING(E)->buffer->space
          |
          - LP_RING(E)->size
          + LP_RING(E)->buffer->size
          |
          - LP_RING(E)->effective_size
          + LP_RING(E)->buffer->effective_size
          |
          - LP_RING(E)->last_retired_head
          + LP_RING(E)->buffer->last_retired_head
          )
      
      Note: On top of this this patch also removes the now unused ringbuffer
      fields in intel_engine_cs.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      [danvet: Add note about fixup patch included here.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ee1b1e5e