drm/amd/display: re gamma programming
authorVitaly Prosyak <vitaly.prosyak@amd.com>
Tue, 13 Dec 2016 20:23:16 +0000 (14:23 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:05:02 +0000 (17:05 -0400)
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>
drivers/gpu/drm/amd/display/dc/core/dc.c

index 75b6e404d01667306b436a07bbad0a56f3581bc6..9a35e3bb8283ab5fcb4181e2b6b5cd12df602473 100644 (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);