drm/amd/display: explicitly set is_dsc_supported to false before use
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 5 Jan 2022 18:48:16 +0000 (12:48 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jan 2022 20:44:25 +0000 (15:44 -0500)
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.

Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1956497
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index e6ad1d426ba393e8482d540b0de46733617e39f0..b7dc98c9f08b6cad8a5b2f110044a74b65c9554c 100644 (file)
@@ -6097,6 +6097,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)) {