1. 23 Nov, 2020 1 commit
  2. 21 Nov, 2020 3 commits
    • Rob Clark's avatar
      drm/msm/shrinker: Only iterate dontneed objs · 3edfa30f
      Rob Clark authored
      In situations where the GPU is mostly idle, all or nearly all buffer
      objects will be in the inactive list.  But if the system is under memory
      pressure (from something other than GPU), we could still get a lot of
      shrinker calls.  Which results in traversing a list of thousands of objs
      and in the end finding nothing to shrink.  Which isn't so efficient.
      
      Instead split the inactive_list into two lists, one inactive objs which
      are shrinkable, and a second one for those that are not.  This way we
      can avoid traversing objs which we know are not shrinker candidates.
      
      v2: Fix inverted logic think-o
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      3edfa30f
    • Rob Clark's avatar
      drm/msm/shrinker: We can vmap shrink active_list too · fcd371c2
      Rob Clark authored
      Just because a obj is active, if the vmap_count is zero, we can still
      tear down the vmap.
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      fcd371c2
    • Rob Clark's avatar
      drm/msm: Protect obj->active_count under obj lock · ab5c54cb
      Rob Clark authored
      Previously we only held obj lock in the _active_get() path, and relied
      on atomic_dec_return() to not be racy in the _active_put() path where
      obj lock was not held.
      
      But this is a false sense of security.  Unlike obj lifetime refcnt,
      where you do not expect to *increase* the refcnt after the last put
      (which would mean that something has gone horribly wrong with the
      object liveness reference counting), the active_count can increase
      again from zero.  Racing _active_put()s and _active_get()s could leave
      the obj on the wrong mm list.
      
      But in the retire path, immediately after the _active_put(), the
      _unpin_iova() would acquire obj lock.  So just move the locking earlier
      and rely on that to protect obj->active_count.
      
      Fixes: c5c1643c ("drm/msm: Drop struct_mutex from the retire path")
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      ab5c54cb
  3. 10 Nov, 2020 8 commits
    • Abhinav Kumar's avatar
      drm/msm/dp: do not notify audio subsystem if sink doesn't support audio · e8c76581
      Abhinav Kumar authored
      For sinks that do not support audio, there is no need to notify
      audio subsystem of the connection event.
      
      This will make sure that audio routes only to the primary display
      when connected to such sinks.
      
      changes in v2:
        - Added fixes tag
        - Removed nested if condition and removed usage of global pointer
      
      Fixes: d13e36d7 ("drm/msm/dp: add audio support for Display Port on MSM")
      Signed-off-by: default avatarAbhinav Kumar <abhinavk@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      e8c76581
    • Kuogee Hsieh's avatar
      drm/msm/dp: promote irq_hpd handle to handle link training correctly · 26b8d66a
      Kuogee Hsieh authored
      Some dongles require link training done at irq_hpd request instead
      of plugin request. This patch promote irq_hpd handler to handle link
      training and setup hpd_state correctly.
      Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      26b8d66a
    • Kuogee Hsieh's avatar
      drm/msm/dp: skip checking LINK_STATUS_UPDATED bit · ea530388
      Kuogee Hsieh authored
      Some dongle will not clear LINK_STATUS_UPDATED bit after
      DPCD read which cause link training failed. This patch
      just read 6 bytes of DPCD link status from sink and return
      without checking LINK_STATUS_UPDATED bit.
      Only 8 bits are used to represent link rate at sinker DPCD.
      The really link rate is 2.7Mb times the 8 bits value.
      For example, 0x0A at DPCD is equal to 2.7Gb (10 * 2.7Mb).
      This patch also convert 8 bits value of DPCD to really link
      rate to fix worng link rate error during phy compliance test.
      
      Fixes: 6625e263 ("drm/msm/dp: DisplayPort PHY compliance tests fixup")
      Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      ea530388
    • Kuogee Hsieh's avatar
      drm/msm/dp: deinitialize mainlink if link training failed · 231a04fc
      Kuogee Hsieh authored
      DP compo phy have to be enable to start link training. When
      link training failed phy need to be disabled so that next
      link traning can be proceed smoothly at next plug in. This
      patch de-initialize mainlink to disable phy if link training
      failed. This prevent system crash due to
      disp_cc_mdss_dp_link_intf_clk stuck at "off" state.  This patch
      also perform checking power_on flag at dp_display_enable() and
      dp_display_disable() to avoid crashing when unplug cable while
      display is off.
      Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      231a04fc
    • Kuogee Hsieh's avatar
      drm/msm/dp: fixes wrong connection state caused by failure of link train · 62671d2e
      Kuogee Hsieh authored
      Connection state is not set correctly happen when either failure of link
      train due to cable unplugged in the middle of aux channel reading or
      cable plugged in while in suspended state. This patch fixes these problems.
      This patch also replace ST_SUSPEND_PENDING with ST_DISPLAY_OFF.
      
      Changes in V2:
      -- Add more information to commit message.
      
      Changes in V3:
      -- change base
      
      Changes in V4:
      -- add Fixes tag
      Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      62671d2e
    • Kuogee Hsieh's avatar
      drm/msm/dp: return correct connection status after suspend · 19e52bcb
      Kuogee Hsieh authored
      During suspend, dp host controller and hpd block are disabled due to
      both ahb and aux clock are disabled. Therefore hpd plug/unplug interrupts
      will not be generated. At dp_pm_resume(), reinitialize both dp host
      controller and hpd block so that hpd plug/unplug interrupts will be
      generated and handled by driver so that hpd connection state is updated
      correctly. This patch will fix link training flaky issues.
      
      Changes in v2:
      -- use container_of to cast correct dp_display_private pointer
         at both dp_pm_suspend() and dp_pm_resume().
      
      Changes in v3:
      -- replace hpd_state atomic_t  with u32
      
      Changes in v4
      -- call dp_display_host_deinit() at dp_pm_suspend()
      -- call dp_display_host_init() at msm_dp_display_enable()
      -- fix phy->init_count unbalance which causes link training failed
      
      Changes in v5
      --  add Fixes tag
      
      Fixes:  8ede2ecc (drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets)
      Tested-by: default avatarStephen Boyd <swboyd@chromium.org>
      Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      19e52bcb
    • Rob Clark's avatar
      drm/msm/a5xx: Clear shadow on suspend · 5771de5d
      Rob Clark authored
      Similar to the previous patch, clear shadow on suspend to avoid timeouts
      waiting for ringbuffer space.
      
      Fixes: 8907afb4 ("drm/msm: Allow a5xx to mark the RPTR shadow as privileged")
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      5771de5d
    • Rob Clark's avatar
      drm/msm/a6xx: Clear shadow on suspend · e8b0b994
      Rob Clark authored
      Clear the shadow rptr on suspend.  Otherwise, when we resume, we can
      have a stale value until CP_WHERE_AM_I executes.  If we suspend near
      the ringbuffer wraparound point, this can lead to a chicken/egg
      situation where we are waiting for ringbuffer space to write the
      CP_WHERE_AM_I (or CP_INIT) packet, because we mistakenly believe that
      the ringbuffer is full (due to stale rptr value in the shadow).
      
      Fixes errors like:
      
        [drm:adreno_wait_ring [msm]] *ERROR* timeout waiting for space in ringbuffer 0
      
      in the resume path.
      
      Fixes: d3a569fc ("drm/msm: a6xx: Use WHERE_AM_I for eligible targets")
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      e8b0b994
  4. 05 Nov, 2020 25 commits
  5. 04 Nov, 2020 3 commits