diff options
| author | Alex Hung <[email protected]> | 2024-06-11 16:43:12 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-06-27 21:10:38 +0000 |
| commit | c53bb80f49a7cea933ccb4b7a458e6983820e9a5 (patch) | |
| tree | 8b8ae6d3973f28c7f0d7235f893b19c0e8ebdd0d /drivers/gpu/drm/amd/display | |
| parent | drm/amd/display: Use periodic detection for ipx/headless (diff) | |
| download | kernel-c53bb80f49a7cea933ccb4b7a458e6983820e9a5.tar.gz kernel-c53bb80f49a7cea933ccb4b7a458e6983820e9a5.zip | |
drm/amd/display: Ensure curve to hw translation succeed
[WHAT & HOW]
Check cm3_helper_translate_curve_to_hw_format runs successfully so the
regamma_params is valid and can be used.
Also revmoed two result assignments.
This fixes 2 CHECKED_RETURN UNUSED_VALUE issues reported by Coverity.
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/display')
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c index bcacfd893cf7..eaeeade31ed7 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c @@ -228,8 +228,11 @@ bool dcn30_set_blend_lut( if (plane_state->blend_tf.type == TF_TYPE_HWPWL) blend_lut = &plane_state->blend_tf.pwl; else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) { - cm3_helper_translate_curve_to_hw_format( + result = cm3_helper_translate_curve_to_hw_format( &plane_state->blend_tf, &dpp_base->regamma_params, false); + if (!result) + return result; + blend_lut = &dpp_base->regamma_params; } result = dpp_base->funcs->dpp_program_blnd_lut(dpp_base, blend_lut); diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c index fe62478fbcde..05d8f81daa06 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c @@ -483,11 +483,14 @@ bool dcn32_set_mcm_luts( if (plane_state->blend_tf.type == TF_TYPE_HWPWL) lut_params = &plane_state->blend_tf.pwl; else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) { - cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf, + result = cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf, &dpp_base->regamma_params, false); + if (!result) + return result; + lut_params = &dpp_base->regamma_params; } - result = mpc->funcs->program_1dlut(mpc, lut_params, mpcc_id); + mpc->funcs->program_1dlut(mpc, lut_params, mpcc_id); lut_params = NULL; // Shaper @@ -501,7 +504,7 @@ bool dcn32_set_mcm_luts( lut_params = &dpp_base->shaper_params; } - result = mpc->funcs->program_shaper(mpc, lut_params, mpcc_id); + mpc->funcs->program_shaper(mpc, lut_params, mpcc_id); // 3D if (plane_state->lut3d_func.state.bits.initialized == 1) |
