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,6 +578,7 @@ static int __set_input_tf(struct dc_transfer_func *func, ...@@ -578,6 +578,7 @@ static int __set_input_tf(struct dc_transfer_func *func,
struct dc_gamma *gamma = NULL; struct dc_gamma *gamma = NULL;
bool res; bool res;
if (lut_size) {
gamma = dc_create_gamma(); gamma = dc_create_gamma();
if (!gamma) if (!gamma)
return -ENOMEM; return -ENOMEM;
...@@ -586,8 +587,11 @@ static int __set_input_tf(struct dc_transfer_func *func, ...@@ -586,8 +587,11 @@ static int __set_input_tf(struct dc_transfer_func *func,
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);
if (gamma)
dc_gamma_release(&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