1. 19 Jul, 2019 5 commits
    • Tvrtko Ursulin's avatar
      drm/i915: Fix and improve MCR selection logic · 6c2b0103
      Tvrtko Ursulin authored
      A couple issues were present in this code:
      
      1.
      fls() usage was incorrect causing off by one in subslice mask lookup,
      which in other words means subslice mask of all zeroes is always used
      (subslice mask of a slice which is not present, or even out of bounds
      array access), rendering the checks in wa_init_mcr either futile or
      random.
      
      2.
      Condition in WARN_ON was not correct. It is doing a bitwise and operation
      between a positive (present subslices) and negative mask (disabled L3
      banks).
      
      This means that with corrected fls() usage the assert would always
      incorrectly fail.
      
      We could fix this by inverting the fuse bits in the check, but instead do
      one better and improve the code so it not only asserts, but finds the
      first common index between the two masks and only warns if no such index
      can be found.
      
      v2:
       * Simplify check for logic and redability.
       * Improve commentary explaining what is really happening ie. what the
         assert is really trying to check and why.
      
      v3:
       * Find first common index instead of just asserting.
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Fixes: fe864b76 ("drm/i915: Implement WaProgramMgsrForL3BankSpecificMmioReads")
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v1
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Stuart Summers <stuart.summers@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190717180624.20354-4-tvrtko.ursulin@linux.intel.com
      6c2b0103
    • Tvrtko Ursulin's avatar
      drm/i915: Trust programmed MCR in read_subslice_reg · 7405cb77
      Tvrtko Ursulin authored
      Instead of re-calculating the MCR selector in read_subslice_reg do the
      rwm on its existing value and restore it when done.
      
      This consolidates MCR programming to one place for cnl+, and avoids
      re-calculating its default value on older platforms during hangcheck.
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190717180624.20354-3-tvrtko.ursulin@linux.intel.com
      7405cb77
    • Tvrtko Ursulin's avatar
      drm/i915: Fix GEN8_MCR_SELECTOR programming · 15160879
      Tvrtko Ursulin authored
      fls returns bit positions starting from one for the lsb and the MCR
      register expects zero based (sub)slice addressing.
      
      Incorrent MCR programming can have the effect of directing MMIO reads of
      registers in the 0xb100-0xb3ff range to invalid subslice returning zeroes
      instead of actual content.
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Fixes: 1e40d4ae ("drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads")
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190717180624.20354-2-tvrtko.ursulin@linux.intel.com
      15160879
    • YueHaibing's avatar
      drm/i915: Remove set but not used variable 'src_y' · 0d392cb9
      YueHaibing authored
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/gpu/drm/i915/display/intel_sprite.c: In function 'g4x_sprite_check_scaling':
      drivers/gpu/drm/i915/display/intel_sprite.c:1494:13: warning:
       variable 'src_y' set but not used [-Wunused-but-set-variable]
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190719024100.64738-1-yuehaibing@huawei.com
      0d392cb9
    • Chris Wilson's avatar
      drm/i915/execlists: Cancel breadcrumb on preempting the virtual engine · 7d6b60db
      Chris Wilson authored
      As we unwind the requests for a preemption event, we return a virtual
      request back to its original virtual engine (so that it is available for
      execution on any of its siblings). In the process, this means that its
      breadcrumb should no longer be associated with the original physical
      engine, and so we are forced to decouple it. Previously, as the request
      could not complete without our awareness, we would move it to the next
      real engine without any danger. However, preempt-to-busy allowed for
      requests to continue on the HW and complete in the background as we
      unwound, which meant that we could end up retiring the request before
      fixing up the breadcrumb link.
      
      [51679.517943] INFO: trying to register non-static key.
      [51679.517956] the code is fine but needs lockdep annotation.
      [51679.517960] turning off the locking correctness validator.
      [51679.517966] CPU: 0 PID: 3270 Comm: kworker/u8:0 Tainted: G     U            5.2.0+ #717
      [51679.517971] Hardware name: Intel Corporation NUC7i5BNK/NUC7i5BNB, BIOS BNKBL357.86A.0052.2017.0918.1346 09/18/2017
      [51679.518012] Workqueue: i915 retire_work_handler [i915]
      [51679.518017] Call Trace:
      [51679.518026]  dump_stack+0x67/0x90
      [51679.518031]  register_lock_class+0x52c/0x540
      [51679.518038]  ? find_held_lock+0x2d/0x90
      [51679.518042]  __lock_acquire+0x68/0x1800
      [51679.518047]  ? find_held_lock+0x2d/0x90
      [51679.518073]  ? __i915_sw_fence_complete+0xff/0x1c0 [i915]
      [51679.518079]  lock_acquire+0x90/0x170
      [51679.518105]  ? i915_request_cancel_breadcrumb+0x29/0x160 [i915]
      [51679.518112]  _raw_spin_lock+0x27/0x40
      [51679.518138]  ? i915_request_cancel_breadcrumb+0x29/0x160 [i915]
      [51679.518165]  i915_request_cancel_breadcrumb+0x29/0x160 [i915]
      [51679.518199]  i915_request_retire+0x43f/0x530 [i915]
      [51679.518232]  retire_requests+0x4d/0x60 [i915]
      [51679.518263]  i915_retire_requests+0xdf/0x1f0 [i915]
      [51679.518294]  retire_work_handler+0x4c/0x60 [i915]
      [51679.518301]  process_one_work+0x22c/0x5c0
      [51679.518307]  worker_thread+0x37/0x390
      [51679.518311]  ? process_one_work+0x5c0/0x5c0
      [51679.518316]  kthread+0x116/0x130
      [51679.518320]  ? kthread_create_on_node+0x40/0x40
      [51679.518325]  ret_from_fork+0x24/0x30
      [51679.520177] ------------[ cut here ]------------
      [51679.520189] list_del corruption, ffff88883675e2f0->next is LIST_POISON1 (dead000000000100)
      
      Fixes: 22b7a426 ("drm/i915/execlists: Preempt-to-busy")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190716124931.5870-4-chris@chris-wilson.co.uk
      7d6b60db
  2. 18 Jul, 2019 6 commits
  3. 17 Jul, 2019 5 commits
  4. 16 Jul, 2019 4 commits
  5. 15 Jul, 2019 4 commits
  6. 13 Jul, 2019 11 commits
  7. 12 Jul, 2019 5 commits