drm/amd/display: Reset gamma to NULL after release

Signed-off-by: Anthony Koo <anthony.koo@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Anthony Koo 2016-12-20 18:48:11 -05:00 committed by Alex Deucher
parent fafba6de3a
commit 3c25e920f0

View File

@ -1748,8 +1748,10 @@ bool mod_color_remove_sink(struct mod_color *mod_color,
for (i = 0; i < core_color->num_sinks; i++) {
if (core_color->caps[i].sink == sink) {
if (core_color->state[i].gamma)
if (core_color->state[i].gamma) {
dc_gamma_release(core_color->state[i].gamma);
core_color->state[i].gamma = NULL;
}
/* To remove this sink, shift everything after down */
for (j = i; j < core_color->num_sinks - 1; j++) {