mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
drm/amd/display: handle empty LUTs in __set_input_tf
Unlike degamma, blend gamma doesn't support hardcoded curve (predefined/ROM), but we can use AMD color module to fill blend gamma parameters when we have non-linear plane gamma TF without plane gamma LUT. The regular degamma path doesn't hit this. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Joshua Ashton <joshua@froggi.es> Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
486c95af5d
commit
8d26795ae6
|
|
@ -578,17 +578,21 @@ static int __set_input_tf(struct dc_transfer_func *func,
|
|||
struct dc_gamma *gamma = NULL;
|
||||
bool res;
|
||||
|
||||
gamma = dc_create_gamma();
|
||||
if (!gamma)
|
||||
return -ENOMEM;
|
||||
if (lut_size) {
|
||||
gamma = dc_create_gamma();
|
||||
if (!gamma)
|
||||
return -ENOMEM;
|
||||
|
||||
gamma->type = GAMMA_CUSTOM;
|
||||
gamma->num_entries = lut_size;
|
||||
gamma->type = GAMMA_CUSTOM;
|
||||
gamma->num_entries = lut_size;
|
||||
|
||||
__drm_lut_to_dc_gamma(lut, gamma, false);
|
||||
__drm_lut_to_dc_gamma(lut, gamma, false);
|
||||
}
|
||||
|
||||
res = mod_color_calculate_degamma_params(NULL, func, gamma, true);
|
||||
dc_gamma_release(&gamma);
|
||||
res = mod_color_calculate_degamma_params(NULL, func, gamma, gamma != NULL);
|
||||
|
||||
if (gamma)
|
||||
dc_gamma_release(&gamma);
|
||||
|
||||
return res ? 0 : -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user