]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Add condition for dp_set_dsc_config call
authorIlya Bakoulin <ilya.bakoulin@amd.com>
Tue, 9 Apr 2024 18:04:19 +0000 (14:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:47:10 +0000 (09:47 -0400)
Not every ASIC implements dp_set_dsc_config. Add condition to prevent
calls to unimplemented function.

Reviewed-by: Wenjing Liu <wenjing.liu@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Ilya Bakoulin <ilya.bakoulin@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/link/link_dpms.c

index d5b4549a87157f711d660a623b38d8b63c2fe2c0..16549068d836bbfb09802c356b3a7f23a793850f 100644 (file)
@@ -838,10 +838,11 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
                if (dc_is_dp_signal(stream->signal) && !dp_is_128b_132b_signal(pipe_ctx)) {
                        DC_LOG_DSC("Setting stream encoder DSC config for engine %d:", (int)pipe_ctx->stream_res.stream_enc->id);
                        dsc_optc_config_log(dsc, &dsc_optc_cfg);
-                       pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config(pipe_ctx->stream_res.stream_enc,
-                                                                       optc_dsc_mode,
-                                                                       dsc_optc_cfg.bytes_per_pixel,
-                                                                       dsc_optc_cfg.slice_width);
+                       if (pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config)
+                               pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config(pipe_ctx->stream_res.stream_enc,
+                                                                               optc_dsc_mode,
+                                                                               dsc_optc_cfg.bytes_per_pixel,
+                                                                               dsc_optc_cfg.slice_width);
 
                        /* PPS SDP is set elsewhere because it has to be done after DIG FE is connected to DIG BE */
                }
@@ -868,9 +869,10 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
                                                                                NULL,
                                                                                true);
                        else {
-                               pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config(
-                                               pipe_ctx->stream_res.stream_enc,
-                                               OPTC_DSC_DISABLED, 0, 0);
+                               if (pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config)
+                                       pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config(
+                                                       pipe_ctx->stream_res.stream_enc,
+                                                       OPTC_DSC_DISABLED, 0, 0);
                                pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet(
                                                        pipe_ctx->stream_res.stream_enc, false, NULL, true);
                        }