From: Cruise Hung <[email protected]>

[Why]
The DPIA number field is 6 bits in the spec.
In dp_type, it only defines 5 bits.
The driver ID is only 4 bits in the spec.

[How]
Set DPIA number field size to 6.
And only update 4 bits for driver id.

Reviewed-by: Meenakshikumar Somasundaram <[email protected]>
Signed-off-by: Cruise Hung <[email protected]>
Signed-off-by: Ivan Lipski <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dc_dp_types.h                 | 4 ++--
 drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_dp_types.h 
b/drivers/gpu/drm/amd/display/dc/dc_dp_types.h
index 5e3646b7550c..9540f0ead279 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dp_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_dp_types.h
@@ -947,8 +947,8 @@ union dp_tun_cap_support {
 /* DPCD[0xE000E] DP_IN_ADAPTER_INFO register. */
 union dpia_info {
        struct {
-               uint8_t dpia_num :5;
-               uint8_t rsvd :3;
+               uint8_t dpia_num :6;
+               uint8_t rsvd :2;
        } bits;
        uint8_t raw;
 };
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c 
b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c
index 9b2f1a7da1d1..766b54631c79 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c
@@ -71,7 +71,7 @@ enum dc_status dpcd_get_tunneling_device_data(struct dc_link 
*link)
        link->dpcd_caps.usb4_dp_tun_info.dpia_info.raw =
                        dpcd_dp_tun_data[DP_IN_ADAPTER_INFO - 
DP_TUNNELING_CAPABILITIES_SUPPORT];
        link->dpcd_caps.usb4_dp_tun_info.usb4_driver_id =
-                       dpcd_dp_tun_data[DP_USB4_DRIVER_ID - 
DP_TUNNELING_CAPABILITIES_SUPPORT];
+                       dpcd_dp_tun_data[DP_USB4_DRIVER_ID - 
DP_TUNNELING_CAPABILITIES_SUPPORT] & 0x0F;
 
        if (link->dpcd_caps.usb4_dp_tun_info.dp_tun_cap.bits.dpia_bw_alloc) {
                status = core_link_read_dpcd(link, USB4_DRIVER_BW_CAPABILITY,
-- 
2.43.0

Reply via email to