1. 23 12月, 2019 1 次提交
  2. 20 12月, 2019 1 次提交
  3. 09 12月, 2019 1 次提交
  4. 25 11月, 2019 1 次提交
  5. 18 11月, 2019 1 次提交
  6. 14 11月, 2019 1 次提交
    • B
      drm/i915: Avoid atomic context for error capture · 48715f70
      Bruce Chang 提交于
      io_mapping_map_atomic/kmap_atomic are occasionally taken in error capture
      (if there is no aperture preallocated for the use of error capture), but
      the error capture and compression routines are now run in normal
      context:
      
      <3> [113.316247] BUG: sleeping function called from invalid context at mm/page_alloc.c:4653
      <3> [113.318190] in_atomic(): 1, irqs_disabled(): 0, pid: 678, name: debugfs_test
      <4> [113.319900] no locks held by debugfs_test/678.
      <3> [113.321002] Preemption disabled at:
      <4> [113.321130] [<ffffffffa02506d4>] i915_error_object_create+0x494/0x610 [i915]
      <4> [113.327259] Call Trace:
      <4> [113.327871] dump_stack+0x67/0x9b
      <4> [113.328683] ___might_sleep+0x167/0x250
      <4> [113.329618] __alloc_pages_nodemask+0x26b/0x1110
      <4> [113.334614] pool_alloc.constprop.19+0x14/0x60 [i915]
      <4> [113.335951] compress_page+0x7c/0x100 [i915]
      <4> [113.337110] i915_error_object_create+0x4bd/0x610 [i915]
      <4> [113.338515] i915_capture_gpu_state+0x384/0x1680 [i915]
      
      However, it is not a good idea to run the slow compression inside atomic
      context, so we choose not to.
      
      Fixes: 895d8ebe ("drm/i915: error capture with no ggtt slot")
      Signed-off-by: NBruce Chang <yu.bruce.chang@intel.com>
      Reviewed-by: NBrian Welty <brian.welty@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191113231104.24208-1-yu.bruce.chang@intel.com
      48715f70
  7. 07 11月, 2019 1 次提交
  8. 30 10月, 2019 2 次提交
  9. 29 10月, 2019 1 次提交
  10. 26 10月, 2019 1 次提交
  11. 24 10月, 2019 1 次提交
  12. 04 10月, 2019 2 次提交
    • C
      drm/i915: Remove logical HW ID · 2935ed53
      Chris Wilson 提交于
      With the introduction of ctx->engines[] we allow multiple logical
      contexts to be used on the same engine (e.g. with virtual engines).
      According to bspec, aach logical context requires a unique tag in order
      for context-switching to occur correctly between them. [Simple
      experiments show that it is not so easy to trick the HW into performing
      a lite-restore with matching logical IDs, though my memory from early
      Broadwell experiments do suggest that it should be generating
      lite-restores.]
      
      We only need to keep a unique tag for the active lifetime of the
      context, and for as long as we need to identify that context. The HW
      uses the tag to determine if it should use a lite-restore (why not the
      LRCA?) and passes the tag back for various status identifies. The only
      status we need to track is for OA, so when using perf, we assign the
      specific context a unique tag.
      
      v2: Calculate required number of tags to fill ELSP.
      
      Fixes: 976b55f0 ("drm/i915: Allow a context to define its set of engines")
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111895Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-14-chris@chris-wilson.co.uk
      2935ed53
    • C
      drm/i915: Coordinate i915_active with its own mutex · b1e3177b
      Chris Wilson 提交于
      Forgo the struct_mutex serialisation for i915_active, and interpose its
      own mutex handling for active/retire.
      
      This is a multi-layered sleight-of-hand. First, we had to ensure that no
      active/retire callbacks accidentally inverted the mutex ordering rules,
      nor assumed that they were themselves serialised by struct_mutex. More
      challenging though, is the rule over updating elements of the active
      rbtree. Instead of the whole i915_active now being serialised by
      struct_mutex, allocations/rotations of the tree are serialised by the
      i915_active.mutex and individual nodes are serialised by the caller
      using the i915_timeline.mutex (we need to use nested spinlocks to
      interact with the dma_fence callback lists).
      
      The pain point here is that instead of a single mutex around execbuf, we
      now have to take a mutex for active tracker (one for each vma, context,
      etc) and a couple of spinlocks for each fence update. The improvement in
      fine grained locking allowing for multiple concurrent clients
      (eventually!) should be worth it in typical loads.
      
      v2: Add some comments that barely elucidate anything :(
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-6-chris@chris-wilson.co.uk
      b1e3177b
  13. 10 9月, 2019 1 次提交
  14. 30 8月, 2019 1 次提交
  15. 24 8月, 2019 1 次提交
  16. 19 8月, 2019 1 次提交
  17. 15 8月, 2019 1 次提交
  18. 13 8月, 2019 1 次提交
  19. 09 8月, 2019 2 次提交
  20. 07 8月, 2019 1 次提交
  21. 31 7月, 2019 2 次提交
  22. 29 7月, 2019 1 次提交
  23. 26 7月, 2019 2 次提交
    • G
      drm/i915: Mark expected switch fall-throughs · 2defb94e
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      drivers/gpu/drm/i915/gem/i915_gem_mman.c: In function ‘i915_gem_fault’:
      drivers/gpu/drm/i915/gem/i915_gem_mman.c:342:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (!i915_terminally_wedged(i915))
            ^
      drivers/gpu/drm/i915/gem/i915_gem_mman.c:345:2: note: here
        case -EAGAIN:
        ^~~~
      
      drivers/gpu/drm/i915/gem/i915_gem_pages.c: In function ‘i915_gem_object_map’:
      ./include/linux/compiler.h:78:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
       # define unlikely(x) __builtin_expect(!!(x), 0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/asm-generic/bug.h:136:2: note: in expansion of macro ‘unlikely’
        unlikely(__ret_warn_on);     \
        ^~~~~~~~
      drivers/gpu/drm/i915/i915_utils.h:49:25: note: in expansion of macro ‘WARN’
       #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
                               ^~~~
      drivers/gpu/drm/i915/gem/i915_gem_pages.c:270:3: note: in expansion of macro ‘MISSING_CASE’
         MISSING_CASE(type);
         ^~~~~~~~~~~~
      drivers/gpu/drm/i915/gem/i915_gem_pages.c:272:2: note: here
        case I915_MAP_WB:
        ^~~~
      
      drivers/gpu/drm/i915/i915_gpu_error.c: In function ‘error_record_engine_registers’:
      ./include/linux/compiler.h:78:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
       # define unlikely(x) __builtin_expect(!!(x), 0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/asm-generic/bug.h:136:2: note: in expansion of macro ‘unlikely’
        unlikely(__ret_warn_on);     \
        ^~~~~~~~
      drivers/gpu/drm/i915/i915_utils.h:49:25: note: in expansion of macro ‘WARN’
       #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
                               ^~~~
      drivers/gpu/drm/i915/i915_gpu_error.c:1196:5: note: in expansion of macro ‘MISSING_CASE’
           MISSING_CASE(engine->id);
           ^~~~~~~~~~~~
      drivers/gpu/drm/i915/i915_gpu_error.c:1197:4: note: here
          case RCS0:
          ^~~~
      
      drivers/gpu/drm/i915/display/intel_dp.c: In function ‘intel_dp_get_fia_supported_lane_count’:
      ./include/linux/compiler.h:78:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
       # define unlikely(x) __builtin_expect(!!(x), 0)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/asm-generic/bug.h:136:2: note: in expansion of macro ‘unlikely’
        unlikely(__ret_warn_on);     \
        ^~~~~~~~
      drivers/gpu/drm/i915/i915_utils.h:49:25: note: in expansion of macro ‘WARN’
       #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
                               ^~~~
      drivers/gpu/drm/i915/display/intel_dp.c:233:3: note: in expansion of macro ‘MISSING_CASE’
         MISSING_CASE(lane_info);
         ^~~~~~~~~~~~
      drivers/gpu/drm/i915/display/intel_dp.c:234:2: note: here
        case 1:
        ^~~~
      
      drivers/gpu/drm/i915/display/intel_display.c: In function ‘check_digital_port_conflicts’:
        CC [M]  drivers/gpu/drm/nouveau/nvkm/engine/disp/cursgv100.o
      drivers/gpu/drm/i915/display/intel_display.c:12043:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
          if (WARN_ON(!HAS_DDI(to_i915(dev))))
             ^
      drivers/gpu/drm/i915/display/intel_display.c:12046:3: note: here
         case INTEL_OUTPUT_DP:
         ^~~~
      
      Also, notice that the Makefile is modified to stop ignoring
      fall-through warnings. The -Wimplicit-fallthrough option
      will be enabled globally in v5.3.
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      2defb94e
    • C
      drm/i915: Capture vma contents outside of spinlock · 79c7a28e
      Chris Wilson 提交于
      Currently we use the engine->active.lock to ensure that the request is
      not retired as we capture the data. However, we only need to ensure that
      the vma are not removed prior to use acquiring their contents, and
      since we have already relinquished our stop-machine protection, we
      assume that the user will not be overwriting the contents before we are
      able to record them.
      
      In order to capture the vma outside of the spinlock, we acquire a
      reference and mark the vma as active to prevent it from being unbound.
      However, since it is tricky allocate an entry in the fence tree (doing
      so would require taking a mutex) while inside the engine spinlock, we
      use an atomic bit and special case the handling for i915_active_wait.
      
      The core benefit is that we can use some non-atomic methods for mapping
      the device pages, we can remove the slow compression phase out of atomic
      context (i.e. stop antagonising the nmi-watchdog), and no we longer need
      large reserves of atomic pages.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111215Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMatthew Auld <matthew.william.auld@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190725223843.8971-1-chris@chris-wilson.co.uk
      79c7a28e
  24. 25 7月, 2019 1 次提交
  25. 23 7月, 2019 1 次提交
    • C
      drm/i915: Rely on spinlock protection for GPU error capture · 3bdd4f84
      Chris Wilson 提交于
      Trust that we now have adequate protection over the low level structures
      via the engine->active.lock to allow ourselves to capture the GPU error
      state without the heavy hammer of stop_machine(). Sadly this does mean
      that we have to forgo some of the lesser used information (not derived
      from the active state) that is not controlled by the active locks. This
      includes the list of buffers in the ppGTT and pinned globally in the
      GGTT. Originally this was used to manually verify relocations, but
      hasn't been required for sometime and modern mesa now has the habit of
      ensuring that all interesting buffers within a batch are captured in their
      entirety (that are the auxiliary state buffers, but not the textures).
      
      A useful side-effect is that this allows us to restore error capturing
      for Braswell and Broxton.
      
      v2: Use pagevec for a typical arbitrary number of preallocated pages
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190722222847.24178-1-chris@chris-wilson.co.uk
      3bdd4f84
  26. 16 7月, 2019 1 次提交
  27. 14 7月, 2019 1 次提交
  28. 21 6月, 2019 3 次提交
  29. 20 6月, 2019 1 次提交
    • C
      drm/i915/execlists: Preempt-to-busy · 22b7a426
      Chris Wilson 提交于
      When using a global seqno, we required a precise stop-the-workd event to
      handle preemption and unwind the global seqno counter. To accomplish
      this, we would preempt to a special out-of-band context and wait for the
      machine to report that it was idle. Given an idle machine, we could very
      precisely see which requests had completed and which we needed to feed
      back into the run queue.
      
      However, now that we have scrapped the global seqno, we no longer need
      to precisely unwind the global counter and only track requests by their
      per-context seqno. This allows us to loosely unwind inflight requests
      while scheduling a preemption, with the enormous caveat that the
      requests we put back on the run queue are still _inflight_ (until the
      preemption request is complete). This makes request tracking much more
      messy, as at any point then we can see a completed request that we
      believe is not currently scheduled for execution. We also have to be
      careful not to rewind RING_TAIL past RING_HEAD on preempting to the
      running context, and for this we use a semaphore to prevent completion
      of the request before continuing.
      
      To accomplish this feat, we change how we track requests scheduled to
      the HW. Instead of appending our requests onto a single list as we
      submit, we track each submission to ELSP as its own block. Then upon
      receiving the CS preemption event, we promote the pending block to the
      inflight block (discarding what was previously being tracked). As normal
      CS completion events arrive, we then remove stale entries from the
      inflight tracker.
      
      v2: Be a tinge paranoid and ensure we flush the write into the HWS page
      for the GPU semaphore to pick in a timely fashion.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190620142052.19311-1-chris@chris-wilson.co.uk
      22b7a426
  30. 17 6月, 2019 1 次提交
  31. 15 6月, 2019 1 次提交
  32. 13 6月, 2019 1 次提交
  33. 12 6月, 2019 1 次提交