Commit 8d26795a authored by Joshua Ashton's avatar Joshua Ashton Committed by Alex Deucher

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: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarJoshua Ashton <joshua@froggi.es>
Signed-off-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 486c95af
...@@ -578,17 +578,21 @@ static int __set_input_tf(struct dc_transfer_func *func, ...@@ -578,17 +578,21 @@ static int __set_input_tf(struct dc_transfer_func *func,
struct dc_gamma *gamma = NULL; struct dc_gamma *gamma = NULL;
bool res; bool res;
gamma = dc_create_gamma(); if (lut_size) {
if (!gamma) gamma = dc_create_gamma();
return -ENOMEM; if (!gamma)
return -ENOMEM;
gamma->type = GAMMA_CUSTOM; gamma->type = GAMMA_CUSTOM;
gamma->num_entries = lut_size; 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); res = mod_color_calculate_degamma_params(NULL, func, gamma, gamma != NULL);
dc_gamma_release(&gamma);
if (gamma)
dc_gamma_release(&gamma);
return res ? 0 : -ENOMEM; return res ? 0 : -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment