1. 10 1月, 2019 1 次提交
  2. 09 1月, 2019 1 次提交
  3. 02 1月, 2019 1 次提交
  4. 29 12月, 2018 1 次提交
  5. 18 12月, 2018 1 次提交
  6. 13 12月, 2018 1 次提交
  7. 12 12月, 2018 2 次提交
  8. 07 12月, 2018 5 次提交
  9. 05 12月, 2018 1 次提交
    • T
      drm/i915: Introduce per-engine workarounds · 90098efa
      Tvrtko Ursulin 提交于
      We stopped re-applying the GT workarounds after engine reset since commit
      59b449d5 ("drm/i915: Split out functions for different kinds of
      workarounds").
      
      Issue with this is that some of the GT workarounds live in the MMIO space
      which gets lost during engine resets. So far the registers in 0x2xxx and
      0xbxxx address range have been identified to be affected.
      
      This losing of applied workarounds has obvious negative effects and can
      even lead to hard system hangs (see the linked Bugzilla).
      
      Rather than just restoring this re-application, because we have also
      observed that it is not safe to just re-write all GT workarounds after
      engine resets (GPU might be live and weird hardware states can happen),
      we introduce a new class of per-engine workarounds and move only the
      affected GT workarounds over.
      
      Using the framework introduced in the previous patch, we therefore after
      engine reset, re-apply only the workarounds living in the affected MMIO
      address ranges.
      
      v2:
       * Move Wa_1406609255:icl to engine workarounds as well.
       * Rename API. (Chris Wilson)
       * Drop redundant IS_KABYLAKE. (Chris Wilson)
       * Re-order engine wa/ init so latest platforms are first. (Rodrigo Vivi)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=107945
      Fixes: 59b449d5 ("drm/i915: Split out functions for different kinds of workarounds")
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Acked-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181203133341.10258-1-tvrtko.ursulin@linux.intel.com
      (cherry picked from commit 4a15c75c)
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      90098efa
  10. 04 12月, 2018 6 次提交
    • C
      drm/i915: Allocate a common scratch page · 51797499
      Chris Wilson 提交于
      Currently we allocate a scratch page for each engine, but since we only
      ever write into it for post-sync operations, it is not exposed to
      userspace nor do we care for coherency. As we then do not care about its
      contents, we can use one page for all, reducing our allocations and
      avoid complications by not assuming per-engine isolation.
      
      For later use, it simplifies engine initialisation (by removing the
      allocation that required struct_mutex!) and means that we can always rely
      on there being a scratch page.
      
      v2: Check that we allocated a large enough scratch for I830 w/a
      
      Fixes: 06e562e7f515 ("drm/i915/ringbuffer: Delay after EMIT_INVALIDATE for gen4/gen5") # v4.18.20
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108850Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181204141522.13640-1-chris@chris-wilson.co.uk
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.18.20+
      51797499
    • T
      drm/i915: Fuse per-context workaround handling with the common framework · 452420d2
      Tvrtko Ursulin 提交于
      Convert the per context workaround handling code to run against the newly
      introduced common workaround framework and fuse the two to use the
      existing smarter list add helper, the one which does the sorted insert and
      merges registers where possible.
      
      This completes migration of all four classes of workarounds onto the
      common framework.
      
      Existing macros are kept untouched for smaller code churn.
      
      v2:
       * Rename to list name ctx_wa_list and move from dev_priv to engine.
      
      v3:
       * API rename and parameters tweaking. (Chris Wilson)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181203133357.10341-1-tvrtko.ursulin@linux.intel.com
      452420d2
    • T
      drm/i915: Move register white-listing to the common workaround framework · 69bcdecf
      Tvrtko Ursulin 提交于
      Instead of having a separate list of white-listed registers we can
      trivially move this to the common workarounds framework.
      
      This brings us one step closer to the goal of driving all workaround
      classes using the same code.
      
      v2:
       * Use GEM_DEBUG_WARN_ON for the sanity check. (Chris Wilson)
      
      v3:
       * API rename. (Chris Wilson)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181203125014.3219-6-tvrtko.ursulin@linux.intel.com
      69bcdecf
    • T
      drm/i915: Introduce per-engine workarounds · 4a15c75c
      Tvrtko Ursulin 提交于
      We stopped re-applying the GT workarounds after engine reset since commit
      59b449d5 ("drm/i915: Split out functions for different kinds of
      workarounds").
      
      Issue with this is that some of the GT workarounds live in the MMIO space
      which gets lost during engine resets. So far the registers in 0x2xxx and
      0xbxxx address range have been identified to be affected.
      
      This losing of applied workarounds has obvious negative effects and can
      even lead to hard system hangs (see the linked Bugzilla).
      
      Rather than just restoring this re-application, because we have also
      observed that it is not safe to just re-write all GT workarounds after
      engine resets (GPU might be live and weird hardware states can happen),
      we introduce a new class of per-engine workarounds and move only the
      affected GT workarounds over.
      
      Using the framework introduced in the previous patch, we therefore after
      engine reset, re-apply only the workarounds living in the affected MMIO
      address ranges.
      
      v2:
       * Move Wa_1406609255:icl to engine workarounds as well.
       * Rename API. (Chris Wilson)
       * Drop redundant IS_KABYLAKE. (Chris Wilson)
       * Re-order engine wa/ init so latest platforms are first. (Rodrigo Vivi)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=107945
      Fixes: 59b449d5 ("drm/i915: Split out functions for different kinds of workarounds")
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Acked-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181203133341.10258-1-tvrtko.ursulin@linux.intel.com
      4a15c75c
    • C
      drm/i915: Complete the fences as they are cancelled due to wedging · 3800960a
      Chris Wilson 提交于
      We inspect the requests under the assumption that they will be marked as
      completed when they are removed from the queue. Currently however, in the
      process of wedging the requests will be removed from the queue before they
      are completed, so rearrange the code to complete the fences before the
      locks are dropped.
      
      <1>[  354.473346] BUG: unable to handle kernel NULL pointer dereference at 0000000000000250
      <6>[  354.473363] PGD 0 P4D 0
      <4>[  354.473370] Oops: 0000 [#1] PREEMPT SMP PTI
      <4>[  354.473380] CPU: 0 PID: 4470 Comm: gem_eio Tainted: G     U            4.20.0-rc4-CI-CI_DRM_5216+ #1
      <4>[  354.473393] Hardware name: Intel Corporation NUC7CJYH/NUC7JYB, BIOS JYGLKCPX.86A.0027.2018.0125.1347 01/25/2018
      <4>[  354.473480] RIP: 0010:__i915_schedule+0x311/0x5e0 [i915]
      <4>[  354.473490] Code: 49 89 44 24 20 4d 89 4c 24 28 4d 89 29 44 39 b3 a0 04 00 00 7d 3a 41 8b 44 24 78 85 c0 74 13 48 8b 93 78 04 00 00 48 83 e2 fc <39> 82 50 02 00 00 79 1e 44 89 b3 a0 04 00 00 48 8d bb d0 03 00 00
      <4>[  354.473515] RSP: 0018:ffffc900001bba90 EFLAGS: 00010046
      <4>[  354.473524] RAX: 0000000000000003 RBX: ffff8882624c8008 RCX: f34a737800000000
      <4>[  354.473535] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8882624c8048
      <4>[  354.473545] RBP: ffffc900001bbab0 R08: 000000005963f1f1 R09: 0000000000000000
      <4>[  354.473556] R10: ffffc900001bba10 R11: ffff8882624c8060 R12: ffff88824fdd7b98
      <4>[  354.473567] R13: ffff88824fdd7bb8 R14: 0000000000000001 R15: ffff88824fdd7750
      <4>[  354.473578] FS:  00007f44b4b5b980(0000) GS:ffff888277e00000(0000) knlGS:0000000000000000
      <4>[  354.473590] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      <4>[  354.473599] CR2: 0000000000000250 CR3: 000000026976e000 CR4: 0000000000340ef0
      <4>[  354.473611] Call Trace:
      <4>[  354.473622]  ? lock_acquire+0xa6/0x1c0
      <4>[  354.473677]  ? i915_schedule_bump_priority+0x57/0xd0 [i915]
      <4>[  354.473736]  i915_schedule_bump_priority+0x72/0xd0 [i915]
      <4>[  354.473792]  i915_request_wait+0x4db/0x840 [i915]
      <4>[  354.473804]  ? get_pwq.isra.4+0x2c/0x50
      <4>[  354.473813]  ? ___preempt_schedule+0x16/0x18
      <4>[  354.473824]  ? wake_up_q+0x70/0x70
      <4>[  354.473831]  ? wake_up_q+0x70/0x70
      <4>[  354.473882]  ? gen6_rps_boost+0x118/0x120 [i915]
      <4>[  354.473936]  i915_gem_object_wait_fence+0x8a/0x110 [i915]
      <4>[  354.473991]  i915_gem_object_wait+0x113/0x500 [i915]
      <4>[  354.474047]  i915_gem_wait_ioctl+0x11c/0x2f0 [i915]
      <4>[  354.474101]  ? i915_gem_unset_wedged+0x210/0x210 [i915]
      <4>[  354.474113]  drm_ioctl_kernel+0x81/0xf0
      <4>[  354.474123]  drm_ioctl+0x2de/0x390
      <4>[  354.474175]  ? i915_gem_unset_wedged+0x210/0x210 [i915]
      <4>[  354.474187]  ? finish_task_switch+0x95/0x260
      <4>[  354.474197]  ? lock_acquire+0xa6/0x1c0
      <4>[  354.474207]  do_vfs_ioctl+0xa0/0x6e0
      <4>[  354.474217]  ? __fget+0xfc/0x1e0
      <4>[  354.474225]  ksys_ioctl+0x35/0x60
      <4>[  354.474233]  __x64_sys_ioctl+0x11/0x20
      <4>[  354.474241]  do_syscall_64+0x55/0x190
      <4>[  354.474251]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      <4>[  354.474260] RIP: 0033:0x7f44b3de65d7
      <4>[  354.474267] Code: b3 66 90 48 8b 05 b1 48 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 81 48 2d 00 f7 d8 64 89 01 48
      <4>[  354.474293] RSP: 002b:00007fff974948e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      <4>[  354.474305] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f44b3de65d7
      <4>[  354.474316] RDX: 00007fff97494940 RSI: 00000000c010646c RDI: 0000000000000007
      <4>[  354.474327] RBP: 00007fff97494940 R08: 0000000000000000 R09: 00007f44b40bbc40
      <4>[  354.474337] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000c010646c
      <4>[  354.474348] R13: 0000000000000007 R14: 0000000000000000 R15: 0000000000000000
      
      v2: Avoid floating requests.
      v3: Can't call dma_fence_signal() under the timeline lock!
      v4: Can't call dma_fence_signal() from inside another fence either.
      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/20181203113701.12106-2-chris@chris-wilson.co.uk
      3800960a
    • C
      drm/i915/vgpu: Disallow loading on old vGPU hosts · 46592892
      Chris Wilson 提交于
      Since commit fd8526e5 ("drm/i915/execlists: Trust the CSB") we
      actually broke the force-mmio mode for our execlists implementation. No
      one noticed, so ergo no one is actually using an old vGPU host (where we
      required the older method) and so can simply remove the broken support.
      
      v2: csb_read can go as well (Mika)
      Reported-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Fixes: fd8526e5 ("drm/i915/execlists: Trust the CSB")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181130125954.11924-1-chris@chris-wilson.co.uk
      46592892
  11. 29 11月, 2018 1 次提交
  12. 12 11月, 2018 1 次提交
  13. 09 11月, 2018 1 次提交
  14. 08 11月, 2018 1 次提交
  15. 18 10月, 2018 1 次提交
    • T
      drm/i915: GEM_WARN_ON considered harmful · bbb8a9d7
      Tvrtko Ursulin 提交于
      GEM_WARN_ON currently has dangerous semantics where it is completely
      compiled out on !GEM_DEBUG builds. This can leave users who expect it to
      be more like a WARN_ON, just without a warning in non-debug builds, in
      complete ignorance.
      
      Another gotcha with it is that it cannot be used as a statement. Which is
      again different from a standard kernel WARN_ON.
      
      This patch fixes both problems by making it behave as one would expect.
      
      It can now be used both as an expression and as statement, and also the
      condition evaluates properly in all builds - code under the conditional
      will therefore not unexpectedly disappear.
      
      To satisfy call sites which really want the code under the conditional to
      completely disappear, we add GEM_DEBUG_WARN_ON and convert some of the
      callers to it. This one can also be used as both expression and statement.
      
      >From the above it follows GEM_DEBUG_WARN_ON should be used in situations
      where we are certain the condition will be hit during development, but at
      a place in code where error can be handled to the benefit of not crashing
      the machine.
      
      GEM_WARN_ON on the other hand should be used where condition may happen in
      production and we just want to distinguish the level of debugging output
      emitted between the production and debug build.
      
      v2:
       * Dropped BUG_ON hunk.
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Tomasz Lis <tomasz.lis@intel.com>
      Reviewed-by: NTomasz Lis <tomasz.lis@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181012063142.16080-1-tvrtko.ursulin@linux.intel.com
      bbb8a9d7
  16. 03 10月, 2018 1 次提交
  17. 02 10月, 2018 2 次提交
  18. 01 10月, 2018 1 次提交
  19. 27 9月, 2018 3 次提交
  20. 25 9月, 2018 2 次提交
  21. 21 9月, 2018 1 次提交
  22. 14 9月, 2018 2 次提交
  23. 05 9月, 2018 1 次提交
    • C
      drm/i915: Reduce context HW ID lifetime · 288f1ced
      Chris Wilson 提交于
      Future gen reduce the number of bits we will have available to
      differentiate between contexts, so reduce the lifetime of the ID
      assignment from that of the context to its current active cycle (i.e.
      only while it is pinned for use by the HW, will it have a constant ID).
      This means that instead of a max of 2k allocated contexts (worst case
      before fun with bit twiddling), we instead have a limit of 2k in flight
      contexts (minus a few that have been pinned by the kernel or by perf).
      
      To reduce the number of contexts id we require, we allocate a context id
      on first and mark it as pinned for as long as the GEM context itself is,
      that is we keep it pinned it while active on each engine. If we exhaust
      our context id space, then we try to reclaim an id from an idle context.
      In the extreme case where all context ids are pinned by active contexts,
      we force the system to idle in order to recover ids.
      
      We cannot reduce the scope of an HW-ID to an engine (allowing the same
      gem_context to have different ids on each engine) as in the future we
      will need to preassign an id before we know which engine the
      context is being executed on.
      
      v2: Improved commentary (Tvrtko) [I tried at least]
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=107788Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180904153117.3907-1-chris@chris-wilson.co.uk
      288f1ced
  24. 04 9月, 2018 1 次提交
    • T
      drm/i915/icl: Fix context RPCS programming · b212f0a4
      Tvrtko Ursulin 提交于
      There are two issues with the current RPCS programming for Icelake:
      
      Expansion of the slice count bitfield has been missed, as well as the
      required programming workaround for the subslice count bitfield size
      limitation.
      
      1)
      
      Bitfield width for configuring the active slice count has grown so we need
      to program the GEN8_R_PWR_CLK_STATE accordingly.
      
      Current code was always requesting eight times the number of slices (due
      writing to a bitfield starting three bits higher than it should). These
      requests were luckily a) capped by the hardware to the available number of
      slices, and b) we haven't yet exported the code to ask for reduced slice
      configurations.
      
      Due both of the above there was no impact from this incorrect programming
      but we should still fix it.
      
      2)
      
      Due subslice count bitfield being only three bits wide and furthermore
      capped to a maximum documented value of four, special programming
      workaround is needed to enable more than four subslices.
      
      With this programming driver has to consider the GT configuration as
      2x4x8, while the hardware internally translates this to 1x8x8.
      
      A limitation stemming from this is that either a subslice count between
      one and four can be selected, or a subslice count equaling the total
      number of subslices in all selected slices. In other words, odd subslice
      counts greater than four are impossible, as are odd subslice counts
      greater than a single slice subslice count.
      
      This also had no impact in the current code base due breakage from 1)
      always reqesting more than one slice.
      
      While fixing this we also add some asserts to flag up any future bitfield
      overflows.
      
      v2:
       * Use a local in all branches for clarity. (Lionel)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Bspec: 12247
      Reported-by: tony.ye@intel.com
      Suggested-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Cc: tony.ye@intel.com
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180903113007.2643-1-tvrtko.ursulin@linux.intel.com
      b212f0a4
  25. 29 8月, 2018 1 次提交
    • C
      drm/i915/execlists: Flush tasklet directly from reset-finish · 9e4fa012
      Chris Wilson 提交于
      On finishing the reset, the intention is to restart the GPU before we
      relinquish the forcewake taken to handle the reset - the goal being the
      GPU reloads a context before it is allowed to sleep. For this purpose,
      we used tasklet_flush() which although it accomplished the goal of
      restarting the GPU, carried with it a sting in its tail: it cleared the
      TASKLET_STATE_SCHED bit. This meant that if another CPU queued a new
      request to this engine, we would clear the flag and later attempt to
      requeue the tasklet on the local CPU, breaking the per-cpu softirq
      lists.
      
      Remove the dangerous tasklet_kill() and just run the tasklet func
      directly as we know it is safe to do so (the tasklets are internally
      locked to allow mixed usage from direct submission).
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180828152702.27536-1-chris@chris-wilson.co.uk
      9e4fa012