1. 13 Jul, 2020 7 commits
    • Lee Shawn C's avatar
      drm/i915/mst: filter out the display mode exceed sink's capability · e398d7c1
      Lee Shawn C authored
      So far, max dot clock rate for MST mode rely on physcial
      bandwidth limitation. It would caused compatibility issue
      if source display resolution exceed MST hub output ability.
      
      For example, source DUT had DP 1.2 output capability.
      And MST docking just support HDMI 1.4 spec. When a HDMI 2.0
      monitor connected. Source would retrieve EDID from external
      and get max resolution 4k@60fps. DP 1.2 can support 4K@60fps
      because it did not surpass DP physical bandwidth limitation.
      Do modeset to 4k@60fps, source output display data but MST
      docking can't output HDMI properly due to this resolution
      already over HDMI 1.4 spec.
      
      Refer to commit <fcf46380> ("drm/dp_mst: Use full_pbn
      instead of available_pbn for bandwidth checks").
      Source driver should refer to full_pbn to evaluate sink
      output capability. And filter out the resolution surpass
      sink output limitation.
      
      Changes since v1:
      * Using mgr->base.lock to protect full_pbn.
      Changes since v2:
      * Add ctx lock.
      Changes since v3:
      * s/intel_dp_mst_mode_clock_exceed_pbn_bandwidth/
        intel_dp_mst_mode_clock_exceeds_pbn_bw/
      * Use the new drm_connector_helper_funcs.mode_valid_ctx to properly pipe
        down the drm_modeset_acquire_ctx that the probe helpers are using, so
        we can safely grab &mgr->base.lock without deadlocking
      Changes since v4:
      * Move drm_dp_calc_pbn_mode(mode->clock, bpp, false) > port->full_pbn
        check
      * Fix the bpp we use in drm_dp_calc_pbn_mode()
      * Drop leftover (!mgr) check
      * Don't check for if full_pbn is unset. To be clear - it _can_ be unset,
        but if it is then it's certainly a bug in DRM or a non-compliant sink
        as full_pbn should always be populated by the time we call
        ->mode_valid_ctx.
        We should workaround non-compliant sinks with full_pbn=0, but that
        should happen in the DP MST helpers so we can estimate the full_pbn
        value as best we can.
      Tested-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Co-developed-by: default avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarLee Shawn C <shawn.c.lee@intel.com>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200713170746.254388-3-lyude@redhat.com
      e398d7c1
    • Lyude Paul's avatar
      drm/probe_helper: Add drm_connector_helper_funcs.mode_valid_ctx · 1c26b8e0
      Lyude Paul authored
      This is just an atomic version of mode_valid, which is intended to be
      used for situations where a driver might need to check the atomic state
      of objects other than the connector itself. One such example is with
      MST, where the maximum possible bandwidth on a connector can change
      dynamically irregardless of the display configuration.
      
      Changes since v1:
      * Use new drm logging functions
      * Make some corrections in the mode_valid_ctx kdoc
      * Return error codes or 0 from ->mode_valid_ctx() on fail, and store the
        drm_mode_status in an additional function parameter
      Changes since v2:
      * Don't accidentally assign ret to mode->status on success, or we'll
        squash legitimate mode validation results
      * Don't forget to assign MODE_OK to status in drm_connector_mode_valid()
        if we have no callbacks
      * Drop leftover hunk in drm_modes.h around enum drm_mode_status
      Changes since v3:
      * s/return ret/return 0/ in drm_mode_validate_pipeline()
      * Minor cleanup in drm_connector_mode_valid()
      Tested-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Cc: Lee Shawn C <shawn.c.lee@intel.com>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200713170746.254388-2-lyude@redhat.com
      1c26b8e0
    • Chris Wilson's avatar
      drm/i915: Skip signaling a signaled request · 1d9221e9
      Chris Wilson authored
      Preempt-to-busy introduces various fascinating complications in that the
      requests may complete as we are unsubmitting them from HW. As they may
      then signal after unsubmission, we may find ourselves having to cleanup
      the signaling request from within the signaling callback. This causes us
      to recurse onto the same i915_request.lock.
      
      However, if the request is already signaled (as it will be before we
      enter the signal callbacks), we know we can skip the signaling of that
      request during submission, neatly evading the spinlock recursion.
      
      unsubmit(ve.rq0) # timeslice expiration or other preemption
       -> virtual_submit_request(ve.rq0)
      dma_fence_signal(ve.rq0) # request completed before preemption ack
       -> submit_notify(ve.rq1)
         -> virtual_submit_request(ve.rq1) # sees that we have completed ve.rq0
            -> __i915_request_submit(ve.rq0)
      
      [  264.210142] BUG: spinlock recursion on CPU#2, sample_multi_tr/2093
      [  264.210150]  lock: 0xffff9efd6ac55080, .magic: dead4ead, .owner: sample_multi_tr/2093, .owner_cpu: 2
      [  264.210155] CPU: 2 PID: 2093 Comm: sample_multi_tr Tainted: G     U
      [  264.210158] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake S UDIMM RVP, BIOS CNLSFWR1.R00.X212.B01.1909060036 09/06/2019
      [  264.210160] Call Trace:
      [  264.210167]  dump_stack+0x98/0xda
      [  264.210174]  spin_dump.cold+0x24/0x3c
      [  264.210178]  do_raw_spin_lock+0x9a/0xd0
      [  264.210184]  _raw_spin_lock_nested+0x6a/0x70
      [  264.210314]  __i915_request_submit+0x10a/0x3c0 [i915]
      [  264.210415]  virtual_submit_request+0x9b/0x380 [i915]
      [  264.210516]  submit_notify+0xaf/0x14c [i915]
      [  264.210602]  __i915_sw_fence_complete+0x8a/0x230 [i915]
      [  264.210692]  i915_sw_fence_complete+0x2d/0x40 [i915]
      [  264.210762]  __dma_i915_sw_fence_wake+0x19/0x30 [i915]
      [  264.210767]  dma_fence_signal_locked+0xb1/0x1c0
      [  264.210772]  dma_fence_signal+0x29/0x50
      [  264.210871]  i915_request_wait+0x5cb/0x830 [i915]
      [  264.210876]  ? dma_resv_get_fences_rcu+0x294/0x5d0
      [  264.210974]  i915_gem_object_wait_fence+0x2f/0x40 [i915]
      [  264.211084]  i915_gem_object_wait+0xce/0x400 [i915]
      [  264.211178]  i915_gem_wait_ioctl+0xff/0x290 [i915]
      
      Fixes: 22b7a426 ("drm/i915/execlists: Preempt-to-busy")
      References: 6d06779e ("drm/i915: Load balancing across a virtual engine")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: "Nayana, Venkata Ramana" <venkata.ramana.nayana@intel.com>
      Cc: <stable@vger.kernel.org> # v5.4+
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200713141636.29326-1-chris@chris-wilson.co.uk
      1d9221e9
    • Chris Wilson's avatar
      drm/i915/gt: Only swap to a random sibling once upon creation · 90a98720
      Chris Wilson authored
      The danger in switching at random upon intel_context_pin is that the
      context may still actually be inflight, as it will not be scheduled out
      until a context switch after it is complete -- that may be a long time
      after we do a final intel_context_unpin.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2118
      Fixes: 6d06779e ("drm/i915: Load balancing across a virtual engine")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: <stable@vger.kernel.org> # v5.3+
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200713160549.17344-1-chris@chris-wilson.co.uk
      90a98720
    • Colin Ian King's avatar
      drm/i915/selftest: fix an error return path where err is not being set · d2921096
      Colin Ian King authored
      There is an error condition where err is not being set and an uninitialized
      garbage value in err is being returned.  Fix this by assigning err to an
      appropriate error return value before taking the error exit path.
      
      Addresses-Coverity: ("Uninitialized scalar value")
      Fixes: ed2690a9 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200713142551.423649-1-colin.king@canonical.com
      d2921096
    • Chris Wilson's avatar
      drm/i915/gt: Ignore irq enabling on the virtual engines · 4fe6abb8
      Chris Wilson authored
      We do not use the virtual engines for interrupts (they have physical
      components), but we do use them to decouple the fence signaling during
      submission. Currently, when we submit a completed request, we try to
      enable the interrupt handler for the virtual engine, but we never disarm
      it. A quick fix is then to mark the irq as enabled, and it will then
      remain enabled -- and this prevents us from waking the device and never
      letting it sleep again.
      
      Fixes: f8db4d05 ("drm/i915: Initialise breadcrumb lists on the virtual engine")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: <stable@vger.kernel.org> # v5.5+
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200711203236.12330-1-chris@chris-wilson.co.uk
      4fe6abb8
    • Chris Wilson's avatar
      drm/i915/gt: Always reset the engine, even if inactive, on execlists failure · 2730055d
      Chris Wilson authored
      If something has gone awry with the CSB processing, we need to pause,
      unwind and restart the request submission and event processing. However,
      currently we skip the engine reset if we raise an error but discover no
      active context, in the mistaken belief that it was merely a glitch in
      the matrix. The glitches are real enough, and we do need to unwind even
      if the engine appears idle (as it has gone permanently idle!) The
      simplest way to unwind and recover is simply do the engine reset, which
      should be very fast and _safe_ as nothing is active.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200711091349.28865-1-chris@chris-wilson.co.uk
      2730055d
  2. 10 Jul, 2020 4 commits
  3. 09 Jul, 2020 16 commits
  4. 08 Jul, 2020 13 commits