drm/amd/display: re gamma programming

Fix gamma update logic to avoid crash

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Vitaly Prosyak 2016-12-13 14:23:16 -06:00 committed by Alex Deucher
parent 30018e9fa2
commit 1e3d346f4f

View File

@ -1445,7 +1445,8 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
}
}
if (updates[i].gamma) {
if (updates[i].gamma && updates[i].gamma !=
surface->public.gamma_correction) {
if (surface->public.gamma_correction != NULL)
dc_gamma_release(surface->public.
gamma_correction);