Browse Source

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>
Vitaly Prosyak 8 years ago
parent
commit
1e3d346f4f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/gpu/drm/amd/display/dc/core/dc.c

+ 2 - 1
drivers/gpu/drm/amd/display/dc/core/dc.c

@@ -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);