Skip to contentSkip to conversation

drm/amd/display: explicitly set is_dsc_supported to false before use

PATCH In review Mario Limonciello 2 participants 2 messages Jan 6, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: explicitly set is_dsc_supported to false before use

When UBSAN is enabled a case is shown on unplugging the display that this variable hasn't been initialized by update_dsc_caps, presumably when the display was unplugged it wasn't copied from the DPCD.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index 5d20807b6f88..3d81314e6cb4 100644
@@ -6093,6 +6093,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
 							struct dsc_dec_dpcd_caps *dsc_caps)
 {
 	stream->timing.flags.DSC = 0;
+	dsc_caps->is_dsc_supported = false;
 
 	if (aconnector->dc_link && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
 		sink->sink_signal == SIGNAL_TYPE_EDP)) {
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Mario Limonciello

When UBSAN is enabled a case is shown on unplugging the display that this variable hasn't been initialized by update_dsc_caps, presumably when the display was unplugged it wasn't copied from the DPCD.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 5d20807b6f88..3d81314e6cb4 100644
@@ -6093,6 +6093,7 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
                                                        struct dsc_dec_dpcd_caps *dsc_caps)
 {
        stream->timing.flags.DSC = 0;
+       dsc_caps->is_dsc_supported = false;
 
        if (aconnector->dc_link && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
                sink->sink_signal == SIGNAL_TYPE_EDP)) {
--

2.25.1