1. 24 8月, 2022 5 次提交
    • L
      drm/display/dp_mst: Add nonblocking helpers for DP MST · a5c2c0d1
      Lyude Paul 提交于
      As Daniel Vetter pointed out, if we only use the atomic modesetting locks
      with MST it's technically possible for a driver with non-blocking modesets
      to race when it comes to MST displays - as we make the mistake of not doing
      our own CRTC commit tracking in the topology_state object.
      
      This could potentially cause problems if something like this happens:
      
      * User starts non-blocking commit to disable CRTC-1 on MST topology 1
      * User starts non-blocking commit to enable CRTC-2 on MST topology 1
      
      There's no guarantee here that the commit for disabling CRTC-2 will only
      occur after CRTC-1 has finished, since neither commit shares a CRTC - only
      the private modesetting object for MST. Keep in mind this likely isn't a
      problem for blocking modesets, only non-blocking.
      
      So, begin fixing this by keeping track of which CRTCs on a topology have
      changed by keeping track of which CRTCs we release or allocate timeslots
      on. As well, add some helpers for:
      
      * Setting up the drm_crtc_commit structs in the ->commit_setup hook
      * Waiting for any CRTC dependencies from the previous topology state
      
      v2:
      * Use drm_dp_mst_atomic_setup_commit() directly - Jani
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Fangzhi Zuo <Jerry.Zuo@amd.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Sean Paul <sean@poorly.run>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-9-lyude@redhat.com
      a5c2c0d1
    • L
      drm/display/dp_mst: Add helper for finding payloads in atomic MST state · 0b4e477e
      Lyude Paul 提交于
      We already open-code this quite often, and will be iterating through
      payloads even more once we've moved all of the payload tracking into the
      atomic state. So, let's add a helper for doing this.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Fangzhi Zuo <Jerry.Zuo@amd.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Sean Paul <sean@poorly.run>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-8-lyude@redhat.com
      0b4e477e
    • L
      drm/display/dp_mst: Fix confusing docs for drm_dp_atomic_release_time_slots() · 946c7014
      Lyude Paul 提交于
      For some reason we mention returning 0 if "slots have been added back to
      drm_dp_mst_topology_state->avail_slots". This is totally misleading,
      avail_slots is simply for figuring out the total number of slots available
      in total on the topology and has no relation to the current payload
      allocations.
      
      So, let's get rid of that comment.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Fangzhi Zuo <Jerry.Zuo@amd.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Sean Paul <sean@poorly.run>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-6-lyude@redhat.com
      946c7014
    • L
      drm/display/dp_mst: Call them time slots, not VCPI slots · df78f7f6
      Lyude Paul 提交于
      VCPI is only sort of the correct term here, originally the majority of this
      code simply referred to timeslots vaguely as "slots" - and since I started
      working on it and adding atomic functionality, the name "VCPI slots" has
      been used to represent time slots.
      
      Now that we actually have consistent access to the DisplayPort spec thanks
      to VESA, I now know this isn't actually the proper term - as the
      specification refers to these as time slots.
      
      Since we're trying to make this code as easy to figure out as possible,
      let's take this opportunity to correct this nomenclature and call them by
      their proper name - timeslots. Likewise, we rename various functions
      appropriately, along with replacing references in the kernel documentation
      and various debugging messages.
      
      It's important to note that this patch series leaves the legacy MST code
      untouched for the most part, which is fine since we'll be removing it soon
      anyhow. There should be no functional changes in this series.
      
      v2:
      * Add note that Wayne Lin from AMD suggested regarding slots being between
        the source DP Tx and the immediate downstream DP Rx
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Fangzhi Zuo <Jerry.Zuo@amd.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Sean Paul <sean@poorly.run>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-5-lyude@redhat.com
      df78f7f6
    • L
      drm/display/dp_mst: Rename drm_dp_mst_vcpi_allocation · 48b6b372
      Lyude Paul 提交于
      In retrospect, the name I chose for this originally is confusing, as
      there's a lot more info in here then just the VCPI. This really should be
      called a payload. Let's make it more obvious that this is meant to be
      related to the atomic state and is about payloads by renaming it to
      drm_dp_mst_atomic_payload. Also, rename various variables throughout the
      code that use atomic payloads.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Fangzhi Zuo <Jerry.Zuo@amd.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Sean Paul <sean@poorly.run>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220817193847.557945-4-lyude@redhat.com
      48b6b372
  2. 29 7月, 2022 1 次提交
  3. 22 6月, 2022 2 次提交
  4. 21 6月, 2022 1 次提交
  5. 17 6月, 2022 1 次提交
  6. 29 4月, 2022 1 次提交
  7. 25 4月, 2022 1 次提交
  8. 17 1月, 2022 4 次提交
  9. 11 1月, 2022 1 次提交
  10. 10 11月, 2021 1 次提交
  11. 26 10月, 2021 2 次提交
  12. 28 7月, 2021 1 次提交
  13. 17 6月, 2021 3 次提交
    • J
      drm/dp_mst: Add missing drm parameters to recently added call to drm_dbg_kms() · 24ff3dc1
      José Roberto de Souza 提交于
      Commit 3769e4c0 ("drm/dp_mst: Avoid to mess up payload table by
      ports in stale topology") added to calls to drm_dbg_kms() but it
      missed the first parameter, the drm device breaking the build.
      
      Fixes: 3769e4c0 ("drm/dp_mst: Avoid to mess up payload table by ports in stale topology")
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: stable@vger.kernel.org
      Signed-off-by: NJosé Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210616194415.36926-1-jose.souza@intel.com
      24ff3dc1
    • W
      drm/dp_mst: Avoid to mess up payload table by ports in stale topology · 3769e4c0
      Wayne Lin 提交于
      [Why]
      After unplug/hotplug hub from the system, userspace might start to
      clear stale payloads gradually. If we call drm_dp_mst_deallocate_vcpi()
      to release stale VCPI of those ports which are not relating to current
      topology, we have chane to wrongly clear active payload table entry for
      current topology.
      
      E.g.
      We have allocated VCPI 1 in current payload table and we call
      drm_dp_mst_deallocate_vcpi() to clean VCPI 1 in stale topology. In
      drm_dp_mst_deallocate_vcpi(), it will call drm_dp_mst_put_payload_id()
      tp put VCPI 1 and which means ID 1 is available again. Thereafter, if we
      want to allocate a new payload stream, it will find ID 1 is available by
      drm_dp_mst_assign_payload_id(). However, ID 1 is being used
      
      [How]
      Check target sink is relating to current topology or not before doing
      any payload table update.
      Searching upward to find the target sink's relevant root branch device.
      If the found root branch device is not the same root of current
      topology, don't update payload table.
      
      Changes since v1:
      * Change debug macro to use drm_dbg_kms() instead
      * Amend the commit message to add Cc tag.
      Signed-off-by: NWayne Lin <Wayne.Lin@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210616035501.3776-3-Wayne.Lin@amd.comReviewed-by: NLyude Paul <lyude@redhat.com>
      3769e4c0
    • W
      drm/dp_mst: Do not set proposed vcpi directly · 35d3e8cb
      Wayne Lin 提交于
      [Why]
      When we receive CSN message to notify one port is disconnected, we will
      implicitly set its corresponding num_slots to 0. Later on, we will
      eventually call drm_dp_update_payload_part1() to arrange down streams.
      
      In drm_dp_update_payload_part1(), we iterate over all proposed_vcpis[]
      to do the update. Not specific to a target sink only. For example, if we
      light up 2 monitors, Monitor_A and Monitor_B, and then we unplug
      Monitor_B. Later on, when we call drm_dp_update_payload_part1() to try
      to update payload for Monitor_A, we'll also implicitly clean payload for
      Monitor_B at the same time. And finally, when we try to call
      drm_dp_update_payload_part1() to clean payload for Monitor_B, we will do
      nothing at this time since payload for Monitor_B has been cleaned up
      previously.
      
      For StarTech 1to3 DP hub, it seems like if we didn't update DPCD payload
      ID table then polling for "ACT Handled"(BIT_1 of DPCD 002C0h) will fail
      and this polling will last for 3 seconds.
      
      Therefore, guess the best way is we don't set the proposed_vcpi[]
      diretly. Let user of these herlper functions to set the proposed_vcpi
      directly.
      
      [How]
      1. Revert commit 7617e962 ("drm/dp_mst: clear time slots for ports
      invalid")
      2. Tackle the issue in previous commit by skipping those trasient
      proposed VCPIs. These stale VCPIs shoulde be explicitly cleared by
      user later on.
      
      Changes since v1:
      * Change debug macro to use drm_dbg_kms() instead
      * Amend the commit message to add Fixed & Cc tags
      Signed-off-by: NWayne Lin <Wayne.Lin@amd.com>
      Fixes: 7617e962 ("drm/dp_mst: clear time slots for ports invalid")
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v5.5+
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210616035501.3776-2-Wayne.Lin@amd.comReviewed-by: NLyude Paul <lyude@redhat.com>
      35d3e8cb
  14. 28 5月, 2021 1 次提交
  15. 30 4月, 2021 1 次提交
  16. 28 4月, 2021 3 次提交
  17. 09 4月, 2021 1 次提交
  18. 27 3月, 2021 1 次提交
  19. 25 2月, 2021 2 次提交
  20. 18 2月, 2021 1 次提交
  21. 10 2月, 2021 1 次提交
  22. 05 2月, 2021 3 次提交
  23. 04 2月, 2021 1 次提交
  24. 02 2月, 2021 1 次提交