1. 24 9月, 2014 2 次提交
  2. 03 9月, 2014 5 次提交
  3. 14 8月, 2014 1 次提交
  4. 13 8月, 2014 1 次提交
    • D
      drm/i915: Only track real ppgtt for a context · ae6c4806
      Daniel Vetter 提交于
      There's a bit a confusion since we track the global gtt,
      the aliasing and real ppgtt in the ctx->vm pointer. And not
      all callers really bother to check for the different cases and just
      presume that it points to a real ppgtt.
      
      Now looking closely we don't actually need ->vm to always point at an
      address space - the only place that cares actually has fixup code
      already to decide whether to look at the per-proces or the global
      address space.
      
      So switch to just tracking the ppgtt directly and ditch all the
      extraneous code.
      
      v2: Fixup the ppgtt debugfs file to not oops on a NULL ctx->ppgtt.
      Also drop the early exit - without aliasing ppgtt we want to dump all
      the ppgtts of the contexts if we have full ppgtt.
      
      v3: Actually git add the compile fix.
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Cc: "Thierry, Michel" <michel.thierry@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      OTC-Jira: VIZ-3724
      [danvet: Resolve conflicts with execlist patches while applying.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ae6c4806
  5. 07 8月, 2014 4 次提交
  6. 23 7月, 2014 2 次提交
    • R
      drm/i915: Fix possible overflow when recording semaphore states. · b4558b46
      Rodrigo Vivi 提交于
      semaphore _sync_seqno, _seqno and _mbox are smaller than number of rings.
      This optimization is to remove the ring itself from the list and the logic to do that
      is at intel_ring_sync_index as below:
      
      /*
       * rcs -> 0 = vcs, 1 = bcs, 2 = vecs, 3 = vcs2;
       * vcs -> 0 = bcs, 1 = vecs, 2 = vcs2, 3 = rcs;
       * bcs -> 0 = vecs, 1 = vcs2. 2 = rcs, 3 = vcs;
       * vecs -> 0 = vcs2, 1 = rcs, 2 = vcs, 3 = bcs;
       * vcs2 -> 0 = rcs, 1 = vcs, 2 = bcs, 3 = vecs;
      */
      
      v2: Skip when from == to (Damien).
      v3: avoid computing idx when from == to (Damien).
          use ring == to instead of ring->id == to->id (Damien).
          use continue instead of return (Rodrigo).
      v4: avoid all unecessary computation (Damien).
          reduce idx to loop scope (Damien).
      
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b4558b46
    • B
      drm/i915/error: Check the potential ctx obj's vm · 36362ad3
      Ben Widawsky 提交于
      The bound list is global (all objects which back the VMAs are stored
      here). Recently the BUG() in the offset lookup was demoted to a WARN,
      but the fault actually lies in the caller, here.
      
      This bug has existed since the initial introduction of PPGTT (however,
      it was fixed in unmerged patches to fix up the error state).
      
      Note: The reason for the BUG_ON to WARN_ON demotion was _not_ to
      duct-tape over this bug here but another but triggerable without
      ppgtt. See the commit for details:
      
      commit f25748ea
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Jun 17 22:34:38 2014 +0200
      
          drm/i915: Don't BUG_ON in i915_gem_obj_offset
      
          A WARN_ON is perfectly fine.
      
          The BUG in here seems to be the cause behind hard-hangs when I cat the
          i915_gem_pageflip debugfs file (which calls this from an irq
          spinlock). But only while running a full igt run after a while. I
          still need to root cause the underlying issue.
      
          I'll also start reject patches which add new BUG_ON but don't come
          with a really good justification for it. The general rule really
          should be to just WARN and hope the driver survives for long enough.
      
          v2: Make the WARN a bit more useful per Chris' suggestion.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Clarfy that the WARN_ON (former BUG_ON) in ggtt_offset caught
      more than just this bug fixed in this patch here.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      36362ad3
  7. 08 7月, 2014 2 次提交
  8. 11 6月, 2014 1 次提交
  9. 23 5月, 2014 2 次提交
    • 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
    • O
      drm/i915: s/intel_ring_buffer/intel_engine_cs · a4872ba6
      Oscar Mateo 提交于
      In the upcoming patches we plan to break the correlation between
      engine command streamers (a.k.a. rings) and ringbuffers, so it
      makes sense to refactor the code and make the change obvious.
      
      No functional changes.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a4872ba6
  10. 17 5月, 2014 1 次提交
    • C
      drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl · 5cc9ed4b
      Chris Wilson 提交于
      By exporting the ability to map user address and inserting PTEs
      representing their backing pages into the GTT, we can exploit UMA in order
      to utilize normal application data as a texture source or even as a
      render target (depending upon the capabilities of the chipset). This has
      a number of uses, with zero-copy downloads to the GPU and efficient
      readback making the intermixed streaming of CPU and GPU operations
      fairly efficient. This ability has many widespread implications from
      faster rendering of client-side software rasterisers (chromium),
      mitigation of stalls due to read back (firefox) and to faster pipelining
      of texture data (such as pixel buffer objects in GL or data blobs in CL).
      
      v2: Compile with CONFIG_MMU_NOTIFIER
      v3: We can sleep while performing invalidate-range, which we can utilise
      to drop our page references prior to the kernel manipulating the vma
      (for either discard or cloning) and so protect normal users.
      v4: Only run the invalidate notifier if the range intercepts the bo.
      v5: Prevent userspace from attempting to GTT mmap non-page aligned buffers
      v6: Recheck after reacquire mutex for lost mmu.
      v7: Fix implicit padding of ioctl struct by rounding to next 64bit boundary.
      v8: Fix rebasing error after forwarding porting the back port.
      v9: Limit the userptr to page aligned entries. We now expect userspace
          to handle all the offset-in-page adjustments itself.
      v10: Prevent vma from being copied across fork to avoid issues with cow.
      v11: Drop vma behaviour changes -- locking is nigh on impossible.
           Use a worker to load user pages to avoid lock inversions.
      v12: Use get_task_mm()/mmput() for correct refcounting of mm.
      v13: Use a worker to release the mmu_notifier to avoid lock inversion
      v14: Decouple mmu_notifier from struct_mutex using a custom mmu_notifer
           with its own locking and tree of objects for each mm/mmu_notifier.
      v15: Prevent overlapping userptr objects, and invalidate all objects
           within the mmu_notifier range
      v16: Fix a typo for iterating over multiple objects in the range and
           rearrange error path to destroy the mmu_notifier locklessly.
           Also close a race between invalidate_range and the get_pages_worker.
      v17: Close a race between get_pages_worker/invalidate_range and fresh
           allocations of the same userptr range - and notice that
           struct_mutex was presumed to be held when during creation it wasn't.
      v18: Sigh. Fix the refactor of st_set_pages() to allocate enough memory
           for the struct sg_table and to clear it before reporting an error.
      v19: Always error out on read-only userptr requests as we don't have the
           hardware infrastructure to support them at the moment.
      v20: Refuse to implement read-only support until we have the required
           infrastructure - but reserve the bit in flags for future use.
      v21: use_mm() is not required for get_user_pages(). It is only meant to
           be used to fix up the kernel thread's current->mm for use with
           copy_user().
      v22: Use sg_alloc_table_from_pages for that chunky feeling
      v23: Export a function for sanity checking dma-buf rather than encode
           userptr details elsewhere, and clean up comments based on
           suggestions by Bradley.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: "Volkin, Bradley D" <bradley.d.volkin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NBrad Volkin <bradley.d.volkin@intel.com>
      [danvet: Frob ioctl allocation to pick the next one - will cause a bit
      of fuss with create2 apparently, but such are the rules.]
      [danvet2: oops, forgot to git add after manual patch application]
      [danvet3: Appease sparse.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5cc9ed4b
  11. 05 5月, 2014 4 次提交
  12. 09 4月, 2014 1 次提交
    • B
      drm/i915: Dump the whole context object. · 17d36749
      Ben Widawsky 提交于
      As we've learned over time, the HW context is just a series of GPU
      commands that we're able to decode without any changes in
      intel_error_decode. Since many bugs recently have been implicated in
      the HW context state, it makes sense to dump the whole context object
      in a form which can be parsed.
      
      Sample:
      render ring --- HW Context = 0x042db000
      ringbuffer (render ring) at 0x0160c000; HEAD points to: 0x0160c000
      0x0160c000:      0x00000000: MI_NOOP
      0x0160c004:      0x00000000: MI_NOOP
      0x0160c008:      0x00000000: MI_NOOP
      0x0160c00c:      0x00000000: MI_NOOP
      0x0160c010:      0x00000000: MI_NOOP
      0x0160c014:      0x00000000: MI_NOOP
      0x0160c018:      0x00000000: MI_NOOP
      0x0160c01c:      0x00000000: MI_NOOP
      
      Unfortunately, our decoder isn't quite smart enough to deal with the
      variable length LRIs - but that is a tools problem.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Clarify commit message a bit, seems to have lost a few
      crucial words.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      17d36749
  13. 02 4月, 2014 1 次提交
  14. 31 3月, 2014 1 次提交
  15. 29 3月, 2014 2 次提交
    • C
      drm/i915: Split 64bit hexadecimal addresses to make them easier to read · e3243d16
      Chris Wilson 提交于
      Broadwell introduces large address spaces, greater than 32bits in width.
      These require that we then store and print 64bit values. If we were to
      zero pad them out to 16 hexadecimal places, we have to carefully count
      the leading zeroes - which is easy to make a mistake. Conversely, if we
      do not zero pad out to 16, but keep it padding to 8 hexadecimal places,
      it is very easy to miss an address that is actually larger than 4GiB. A
      suggested compromise is to insert a space between the upper and lower
      dwords of the address so that we can continue with our accustom 32bit
      parser. (Alternatively, we could do the equivalent in our userspace
      decoder.)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e3243d16
    • C
      drm/i915: Broadwell expands ACTHD to 64bit · 50877445
      Chris Wilson 提交于
      As Broadwell has an increased virtual address size, it requires more
      than 32 bits to store offsets into its address space. This includes the
      debug registers to track the current HEAD of the individual rings, which
      may be anywhere within the per-process address spaces. In order to find
      the full location, we need to read the high bits from a second register.
      We then also need to expand our storage to keep track of the larger
      address.
      
      v2: Carefully read the two registers to catch wraparound between
          the reads.
      v3: Use a WARN_ON rather than loop indefinitely on an unstable
          register read.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Timo Aaltonen <tjaalton@ubuntu.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: Drop spurious hunk which conflicted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      50877445
  16. 18 3月, 2014 1 次提交
  17. 06 3月, 2014 6 次提交
  18. 11 2月, 2014 1 次提交
  19. 06 2月, 2014 1 次提交
    • B
      drm/i915: Generate a hang error code · 011cf577
      Ben Widawsky 提交于
      We get a large number of bugs which have a, "hey I have that too"
      because they see a GPU hang in dmesg. While two machines of the same
      model having a GPU hang is indeed a coincidence, it is far from enough
      evidence to suggest they are the same.
      
      In order to reduce this effect, and hopefully get people to file new bug
      reports, clearly the error message itself has been insufficient (see ref
      at the bottom for a new bug report with this characteristic).
      
      The algorithm is purposely pretty naive. I don't think we need much in
      order to avoid the problem I am trying to solve, and keeping it naive
      gives us some ability to make a decent test case.
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=73276Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      011cf577
  20. 31 1月, 2014 1 次提交