mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
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 <harry.wentland@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
9862ef7bae
commit
c53bb80f49
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user