diff options
author | Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> | 2020-03-31 16:45:31 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-04-22 18:11:47 -0400 |
commit | d652509e7a244761755403a2ae3fb6c96183226e (patch) | |
tree | 811a5c021bc0d1f166111b51f4b472b8bbbd8642 /drivers/gpu/drm/amd/display/modules | |
parent | d1ebfdd8d0fc30ff65b85a4bf3fa9e5e35006466 (diff) |
drm/amd/display: Check ramp != NULL before applying lut1d for degamma
[Why]
A NULL ramp is a valid configuration for passing into
mod_color_calculate_degamma_params but we'll hit a NULL pointer if we do
so.
We need this in order to get the right transfer function to do degamma
on NV12 formats where we aren't supplied with a custom user degamma.
[How]
Add the NULL check.
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Zhan Liu <Zhan.Liu@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c index cac09d500fda..d47253cdcc4e 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c +++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c @@ -1902,7 +1902,7 @@ bool mod_color_calculate_degamma_params(struct dc_transfer_func *input_tf, - if (ramp->type == GAMMA_CUSTOM) + if (ramp && ramp->type == GAMMA_CUSTOM) apply_lut_1d(ramp, MAX_HW_POINTS, tf_pts); ret = true; |