]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Check return of shaper curve to HW format
authorAlex Hung <alex.hung@amd.com>
Fri, 6 Feb 2026 05:54:27 +0000 (22:54 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Feb 2026 17:16:11 +0000 (12:16 -0500)
[Why & How]
Check return of cm3_helper_translate_curve_to_hw_format.

This is reported as a CHECKED_RETURN error by Coverity.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Ray Wu <ray.wu@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/hwss/dcn32/dcn32_hwseq.c

index 2767d3a97812ee5b5d5f11eb201af1533b3710a3..a0aaa727e9fa333d9d424fef2ea50b4d382d6fd7 100644 (file)
@@ -486,7 +486,7 @@ bool dcn32_set_mcm_luts(
        struct dpp *dpp_base = pipe_ctx->plane_res.dpp;
        int mpcc_id = pipe_ctx->plane_res.hubp->inst;
        struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;
-       bool result = true;
+       bool rval, result;
        const struct pwl_params *lut_params = NULL;
 
        // 1D LUT
@@ -509,10 +509,10 @@ bool dcn32_set_mcm_luts(
                lut_params = &plane_state->in_shaper_func.pwl;
        else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) {
                // TODO: dpp_base replace
-               cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+               rval = cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
                                                        &plane_state->in_shaper_func,
                                                        &dpp_base->shaper_params, true);
-               lut_params = &dpp_base->shaper_params;
+               lut_params = rval ? &dpp_base->shaper_params : NULL;
        }
 
        mpc->funcs->program_shaper(mpc, lut_params, mpcc_id);