summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/core
diff options
context:
space:
mode:
authorAnthony Koo <Anthony.Koo@amd.com>2016-12-15 12:09:46 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:05:32 -0400
commit90e508ba253c9e43711a7bf16230cdb13d0b1440 (patch)
tree0c599e21fc0e65790c60636362364f2efc26231f /drivers/gpu/drm/amd/display/dc/core
parent9cdc4e7ce4cae74bbe64a0e0ed15655dfa50a8a1 (diff)
downloadop-kernel-dev-90e508ba253c9e43711a7bf16230cdb13d0b1440.zip
op-kernel-dev-90e508ba253c9e43711a7bf16230cdb13d0b1440.tar.gz
drm/amd/display: Refactor output transfer function to stream
Refactor part 3 - Moving output transfer function from surface to stream Split HWSS to program degamma and regamma separately. Degamma should be dependent on input transfer function. And Regamma should depend on the desired output transfer function. 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>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c23
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c3
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_surface.c6
3 files changed, 19 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index f20701a..df1bae8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1394,6 +1394,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
for (j = 0; j < context->res_ctx.pool->pipe_count; j++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
+ struct core_stream *stream = pipe_ctx->stream;
if (pipe_ctx->surface != surface)
continue;
@@ -1472,15 +1473,14 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
if (updates[i].out_transfer_func &&
updates[i].out_transfer_func !=
- surface->public.out_transfer_func) {
- if (surface->public.out_transfer_func != NULL)
+ stream->public.out_transfer_func) {
+ if (stream->public.out_transfer_func != NULL)
dc_transfer_func_release(
- surface->public.
+ stream->public.
out_transfer_func);
-
dc_transfer_func_retain(
updates[i].out_transfer_func);
- surface->public.out_transfer_func =
+ stream->public.out_transfer_func =
updates[i].out_transfer_func;
}
}
@@ -1517,11 +1517,18 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
}
if (is_new_pipe_surface[j] ||
+ updates[i].in_transfer_func)
+ core_dc->hwss.set_input_transfer_func(
+ pipe_ctx, pipe_ctx->surface);
+
+ if (is_new_pipe_surface[j] ||
updates[i].gamma ||
- updates[i].in_transfer_func ||
updates[i].out_transfer_func)
- core_dc->hwss.set_gamma_correction(
- pipe_ctx, pipe_ctx->surface);
+ core_dc->hwss.set_output_transfer_func(
+ pipe_ctx,
+ pipe_ctx->surface,
+ pipe_ctx->stream);
+
}
if (apply_ctx) {
core_dc->hwss.apply_ctx_for_surface(core_dc, surface, context);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 8d6aa60..237436e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -89,6 +89,9 @@ 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)
+ dc_transfer_func_release(
+ stream->public.out_transfer_func);
}
void dc_stream_retain(const struct dc_stream *dc_stream)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
index 8d26684..3ec1f36 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -76,9 +76,6 @@ static void destruct(struct surface *surface)
if (surface->protected.public.in_transfer_func != NULL)
dc_transfer_func_release(
surface->protected.public.in_transfer_func);
- if (surface->protected.public.out_transfer_func != NULL)
- dc_transfer_func_release(
- surface->protected.public.out_transfer_func);
}
/*******************************************************************************
@@ -223,9 +220,8 @@ void dc_transfer_func_release(const struct dc_transfer_func *dc_tf)
dm_free(tf);
}
-struct dc_transfer_func *dc_create_transfer_func(const struct dc *dc)
+struct dc_transfer_func *dc_create_transfer_func()
{
- struct core_dc *core_dc = DC_TO_CORE(dc);
struct transfer_func *tf = dm_alloc(sizeof(*tf));
if (tf == NULL)
OpenPOWER on IntegriCloud