]> www.infradead.org Git - linux.git/commitdiff
drm/amd/display: Skip on writeback when it's not applicable
authorAlex Hung <alex.hung@amd.com>
Sat, 16 Mar 2024 03:25:25 +0000 (21:25 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 03:21:05 +0000 (23:21 -0400)
[WHY]
dynamic memory safety error detector (KASAN) catches and generates error
messages "BUG: KASAN: slab-out-of-bounds" as writeback connector does not
support certain features which are not initialized.

[HOW]
Skip them when connector type is DRM_MODE_CONNECTOR_WRITEBACK.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3199
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 173438fc753750c0592b09e2ef5186d0d62e0cd7..6cf0d5f276feb8de133a7f74204eeff6904f5348 100644 (file)
@@ -3047,6 +3047,10 @@ static int dm_resume(void *handle)
        /* Do mst topology probing after resuming cached state*/
        drm_connector_list_iter_begin(ddev, &iter);
        drm_for_each_connector_iter(connector, &iter) {
+
+               if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
+                       continue;
+
                aconnector = to_amdgpu_dm_connector(connector);
                if (aconnector->dc_link->type != dc_connection_mst_branch ||
                    aconnector->mst_root)
@@ -5926,6 +5930,9 @@ get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
                &aconnector->base.probed_modes :
                &aconnector->base.modes;
 
+       if (aconnector->base.connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
+               return NULL;
+
        if (aconnector->freesync_vid_base.clock != 0)
                return &aconnector->freesync_vid_base;
 
@@ -8767,10 +8774,10 @@ static void amdgpu_dm_commit_audio(struct drm_device *dev,
                if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
                        continue;
 
+notify:
                if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
                        continue;
 
-notify:
                aconnector = to_amdgpu_dm_connector(connector);
 
                mutex_lock(&adev->dm.audio_lock);