]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/dp_mst: Fix drm RAD print
authorWayne Lin <Wayne.Lin@amd.com>
Mon, 13 Jan 2025 09:10:59 +0000 (17:10 +0800)
committerLyude Paul <lyude@redhat.com>
Fri, 24 Jan 2025 22:50:23 +0000 (17:50 -0500)
commit6bbce873a9c97cb12f5455c497be279ac58e707f
treec08db2d8afc48fcd67cbf18d1ca9974bc44c981e
parentce8c69ec90ca83fd4eacb246e2be699e6b439e97
drm/dp_mst: Fix drm RAD print

[Why]
The RAD of sideband message printed today is incorrect.
For RAD stored within MST branch
- If MST branch LCT is 1, it's RAD array is untouched and remained as 0.
- If MST branch LCT is larger than 1, use nibble to store the up facing
  port number in cascaded sequence as illustrated below:

  u8 RAD[0] = (LCT_2_UFP << 4) | LCT_3_UFP
     RAD[1] = (LCT_4_UFP << 4) | LCT_5_UFP
     ...

In drm_dp_mst_rad_to_str(), it wrongly to use BIT_MASK(4) to fetch the port
number of one nibble.

[How]
Adjust the code by:
- RAD array items are valuable only for LCT >= 1.
- Use 0xF as the mask to replace BIT_MASK(4)

V2:
- Document how RAD is constructed (Imre)

V3:
- Adjust the comment for rad[] so kdoc formats it properly (Lyude)

Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests")
Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250113091100.3314533-2-Wayne.Lin@amd.com
drivers/gpu/drm/display/drm_dp_mst_topology.c
include/drm/display/drm_dp_mst_helper.h