drm/amd/display: Add null checks for 8K60 lightup
authorMuhammad Ahmed <ahmed.ahmed@amd.com>
Tue, 31 Oct 2023 20:03:21 +0000 (16:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Nov 2023 05:49:58 +0000 (00:49 -0500)
[WHY & HOW]
Add some null checks to fix an issue where 8k60
tiled display fails to light up.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Muhammad Ahmed <ahmed.ahmed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 7b9bf5cb45299974757bd16d608e41d444ef3b0f..d8f434738212383505d17b5fbc9c1883cb1eaa6b 100644 (file)
@@ -3178,7 +3178,7 @@ static bool update_planes_and_stream_state(struct dc *dc,
                        struct pipe_ctx *otg_master = resource_get_otg_master_for_stream(&context->res_ctx,
                                        context->streams[i]);
 
-                       if (otg_master->stream->test_pattern.type != DP_TEST_PATTERN_VIDEO_MODE)
+                       if (otg_master && otg_master->stream->test_pattern.type != DP_TEST_PATTERN_VIDEO_MODE)
                                resource_build_test_pattern_params(&context->res_ctx, otg_master);
                }
        }
index 1d48278cba96c587be346e32c4ce46bfe6aaf85e..a1f1d100399275aba741c7dcd852c30fbcac27cf 100644 (file)
@@ -5190,6 +5190,9 @@ bool dc_resource_acquire_secondary_pipe_for_mpc_odm_legacy(
        sec_next = sec_pipe->next_odm_pipe;
        sec_prev = sec_pipe->prev_odm_pipe;
 
+       if (pri_pipe == NULL)
+               return false;
+
        *sec_pipe = *pri_pipe;
 
        sec_pipe->top_pipe = sec_top;