]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: apply edge-case DISPCLK WDIVIDER changes to master OTG pipes only
authorSamson Tam <samson.tam@amd.com>
Mon, 18 Sep 2023 22:43:13 +0000 (18:43 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 4 Oct 2023 22:41:25 +0000 (18:41 -0400)
[Why]
The edge-case DISPCLK WDIVIDER changes call stream_enc functions.
But with MPC pipes, downstream pipes have null stream_enc and will
 cause crash.

[How]
Only call stream_enc functions for pipes that are OTG master.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Samson Tam <samson.tam@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/clk_mgr/dcn20/dcn20_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c

index c435f7632e8e8b76b868a26fec65d40f938ee6b6..5ee87965a07818a67916326ff277a1626aba6e04 100644 (file)
@@ -157,7 +157,7 @@ void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct
                        int32_t N;
                        int32_t j;
 
-                       if (!pipe_ctx->stream)
+                       if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
                                continue;
                        /* Virtual encoders don't have this function */
                        if (!stream_enc->funcs->get_fifo_cal_average_level)
@@ -188,7 +188,7 @@ void dcn20_update_clocks_update_dentist(struct clk_mgr_internal *clk_mgr, struct
                        int32_t N;
                        int32_t j;
 
-                       if (!pipe_ctx->stream)
+                       if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
                                continue;
                        /* Virtual encoders don't have this function */
                        if (!stream_enc->funcs->get_fifo_cal_average_level)
index 37ffa0050e602e933ed18012728cbaae8426cc16..a496930b1f9c03598fbe8a9aa82a538ddcd4552e 100644 (file)
@@ -363,7 +363,7 @@ static void dcn32_update_clocks_update_dentist(
                        int32_t N;
                        int32_t j;
 
-                       if (!pipe_ctx->stream)
+                       if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
                                continue;
                        /* Virtual encoders don't have this function */
                        if (!stream_enc->funcs->get_fifo_cal_average_level)
@@ -409,7 +409,7 @@ static void dcn32_update_clocks_update_dentist(
                        int32_t N;
                        int32_t j;
 
-                       if (!pipe_ctx->stream)
+                       if (!resource_is_pipe_type(pipe_ctx, OTG_MASTER))
                                continue;
                        /* Virtual encoders don't have this function */
                        if (!stream_enc->funcs->get_fifo_cal_average_level)