Commit 80bd2096 authored by Yongqiang Sun's avatar Yongqiang Sun Committed by Alex Deucher

drm/amd/display: reset transfer_func to NULL on release

Signed-off-by: default avatarYongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0f4e66cd
......@@ -89,9 +89,11 @@ static bool construct(struct core_stream *stream,
static void destruct(struct core_stream *stream)
{
dc_sink_release(&stream->sink->public);
if (stream->public.out_transfer_func != NULL)
if (stream->public.out_transfer_func != NULL) {
dc_transfer_func_release(
stream->public.out_transfer_func);
stream->public.out_transfer_func = NULL;
}
}
void dc_stream_retain(const struct dc_stream *dc_stream)
......
......@@ -71,11 +71,15 @@ static bool construct(struct dc_context *ctx, struct surface *surface)
static void destruct(struct surface *surface)
{
if (surface->protected.public.gamma_correction != NULL)
if (surface->protected.public.gamma_correction != NULL) {
dc_gamma_release(surface->protected.public.gamma_correction);
if (surface->protected.public.in_transfer_func != NULL)
surface->protected.public.gamma_correction = NULL;
}
if (surface->protected.public.in_transfer_func != NULL) {
dc_transfer_func_release(
surface->protected.public.in_transfer_func);
surface->protected.public.in_transfer_func = NULL;
}
}
/*******************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment