Commit f46661dd authored by Amy Zhang's avatar Amy Zhang Committed by Alex Deucher

drm/amd/display: Move output transfer function to stream updates

Signed-off-by: default avatarAmy Zhang <Amy.Zhang@amd.com>
Reviewed-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6838161c
...@@ -201,11 +201,10 @@ static bool stream_get_crtc_position(struct dc *dc, ...@@ -201,11 +201,10 @@ static bool stream_get_crtc_position(struct dc *dc,
return ret; return ret;
} }
static bool set_gamut_remap(struct dc *dc, static bool set_gamut_remap(struct dc *dc, const struct dc_stream *stream)
const struct dc_stream **stream, int num_streams)
{ {
struct core_dc *core_dc = DC_TO_CORE(dc); struct core_dc *core_dc = DC_TO_CORE(dc);
struct core_stream *core_stream = DC_STREAM_TO_CORE(stream[0]); struct core_stream *core_stream = DC_STREAM_TO_CORE(stream);
int i = 0; int i = 0;
bool ret = false; bool ret = false;
struct pipe_ctx *pipes; struct pipe_ctx *pipes;
...@@ -1182,7 +1181,6 @@ static enum surface_update_type det_surface_update( ...@@ -1182,7 +1181,6 @@ static enum surface_update_type det_surface_update(
overall_type = type; overall_type = type;
if (u->in_transfer_func || if (u->in_transfer_func ||
u->out_transfer_func ||
u->hdr_static_metadata) { u->hdr_static_metadata) {
if (overall_type < UPDATE_TYPE_MED) if (overall_type < UPDATE_TYPE_MED)
overall_type = UPDATE_TYPE_MED; overall_type = UPDATE_TYPE_MED;
...@@ -1279,8 +1277,28 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1279,8 +1277,28 @@ void dc_update_surfaces_and_stream(struct dc *dc,
/* update current stream with the new updates */ /* update current stream with the new updates */
if (stream_update) { if (stream_update) {
stream->public.src = stream_update->src; if ((stream_update->src.height != 0) &&
stream->public.dst = stream_update->dst; (stream_update->src.width != 0))
stream->public.src = stream_update->src;
if ((stream_update->dst.height != 0) &&
(stream_update->dst.width != 0))
stream->public.dst = stream_update->dst;
if (stream_update->out_transfer_func &&
stream_update->out_transfer_func !=
dc_stream->out_transfer_func) {
if (stream_update->out_transfer_func->type !=
TF_TYPE_UNKNOWN) {
if (dc_stream->out_transfer_func != NULL)
dc_transfer_func_release
(dc_stream->out_transfer_func);
dc_transfer_func_retain(stream_update->
out_transfer_func);
stream->public.out_transfer_func =
stream_update->out_transfer_func;
}
}
} }
/* save update parameters into surface */ /* save update parameters into surface */
...@@ -1361,13 +1379,6 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1361,13 +1379,6 @@ void dc_update_surfaces_and_stream(struct dc *dc,
srf_updates[i].in_transfer_func; srf_updates[i].in_transfer_func;
} }
if (srf_updates[i].out_transfer_func &&
srf_updates[i].out_transfer_func != dc_stream->out_transfer_func) {
if (dc_stream->out_transfer_func != NULL)
dc_transfer_func_release(dc_stream->out_transfer_func);
dc_transfer_func_retain(srf_updates[i].out_transfer_func);
stream->public.out_transfer_func = srf_updates[i].out_transfer_func;
}
if (srf_updates[i].hdr_static_metadata) if (srf_updates[i].hdr_static_metadata)
surface->public.hdr_static_ctx = surface->public.hdr_static_ctx =
*(srf_updates[i].hdr_static_metadata); *(srf_updates[i].hdr_static_metadata);
...@@ -1436,11 +1447,12 @@ void dc_update_surfaces_and_stream(struct dc *dc, ...@@ -1436,11 +1447,12 @@ void dc_update_surfaces_and_stream(struct dc *dc,
pipe_ctx, pipe_ctx->surface); pipe_ctx, pipe_ctx->surface);
if (is_new_pipe_surface || if (is_new_pipe_surface ||
srf_updates[i].out_transfer_func) (stream_update != NULL &&
stream_update->out_transfer_func !=
NULL)) {
core_dc->hwss.set_output_transfer_func( core_dc->hwss.set_output_transfer_func(
pipe_ctx, pipe_ctx, pipe_ctx->stream);
pipe_ctx->surface, }
pipe_ctx->stream);
if (srf_updates[i].hdr_static_metadata) { if (srf_updates[i].hdr_static_metadata) {
resource_build_info_frame(pipe_ctx); resource_build_info_frame(pipe_ctx);
......
...@@ -122,7 +122,7 @@ struct dc_stream_funcs { ...@@ -122,7 +122,7 @@ struct dc_stream_funcs {
const struct rect *dst); const struct rect *dst);
bool (*set_gamut_remap)(struct dc *dc, bool (*set_gamut_remap)(struct dc *dc,
const struct dc_stream **stream, int num_streams); const struct dc_stream *stream);
void (*set_static_screen_events)(struct dc *dc, void (*set_static_screen_events)(struct dc *dc,
const struct dc_stream **stream, const struct dc_stream **stream,
...@@ -265,7 +265,8 @@ struct dc_hdr_static_metadata { ...@@ -265,7 +265,8 @@ struct dc_hdr_static_metadata {
enum dc_transfer_func_type { enum dc_transfer_func_type {
TF_TYPE_PREDEFINED, TF_TYPE_PREDEFINED,
TF_TYPE_DISTRIBUTED_POINTS, TF_TYPE_DISTRIBUTED_POINTS,
TF_TYPE_BYPASS TF_TYPE_BYPASS,
TF_TYPE_UNKNOWN
}; };
struct dc_transfer_func_distributed_points { struct dc_transfer_func_distributed_points {
...@@ -349,11 +350,8 @@ struct dc_surface_update { ...@@ -349,11 +350,8 @@ struct dc_surface_update {
*/ */
/* gamma TO BE REMOVED */ /* gamma TO BE REMOVED */
struct dc_gamma *gamma; struct dc_gamma *gamma;
struct dc_hdr_static_metadata *hdr_static_metadata;
struct dc_transfer_func *in_transfer_func; struct dc_transfer_func *in_transfer_func;
struct dc_transfer_func *out_transfer_func; struct dc_hdr_static_metadata *hdr_static_metadata;
}; };
/* /*
* This structure is filled in by dc_surface_get_status and contains * This structure is filled in by dc_surface_get_status and contains
...@@ -473,11 +471,9 @@ struct dc_stream { ...@@ -473,11 +471,9 @@ struct dc_stream {
}; };
struct dc_stream_update { struct dc_stream_update {
struct rect src; struct rect src;
struct rect dst; struct rect dst;
struct dc_transfer_func *out_transfer_func;
}; };
......
...@@ -631,7 +631,6 @@ static bool dce110_translate_regamma_to_hw_format(const struct dc_transfer_func ...@@ -631,7 +631,6 @@ static bool dce110_translate_regamma_to_hw_format(const struct dc_transfer_func
static bool dce110_set_output_transfer_func( static bool dce110_set_output_transfer_func(
struct pipe_ctx *pipe_ctx, struct pipe_ctx *pipe_ctx,
const struct core_surface *surface, /* Surface - To be removed */
const struct core_stream *stream) const struct core_stream *stream)
{ {
struct output_pixel_processor *opp = pipe_ctx->opp; struct output_pixel_processor *opp = pipe_ctx->opp;
......
...@@ -1301,11 +1301,13 @@ static bool dcn10_translate_regamma_to_hw_format(const struct dc_transfer_func ...@@ -1301,11 +1301,13 @@ static bool dcn10_translate_regamma_to_hw_format(const struct dc_transfer_func
static bool dcn10_set_output_transfer_func( static bool dcn10_set_output_transfer_func(
struct pipe_ctx *pipe_ctx, struct pipe_ctx *pipe_ctx,
const struct core_surface *surface,
const struct core_stream *stream) const struct core_stream *stream)
{ {
struct output_pixel_processor *opp = pipe_ctx->opp; struct output_pixel_processor *opp = pipe_ctx->opp;
if (opp == NULL)
return false;
opp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM; opp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
if (stream->public.out_transfer_func && if (stream->public.out_transfer_func &&
......
...@@ -80,7 +80,6 @@ struct hw_sequencer_funcs { ...@@ -80,7 +80,6 @@ struct hw_sequencer_funcs {
bool (*set_output_transfer_func)( bool (*set_output_transfer_func)(
struct pipe_ctx *pipe_ctx, struct pipe_ctx *pipe_ctx,
const struct core_surface *surface,
const struct core_stream *stream); const struct core_stream *stream);
void (*power_down)(struct core_dc *dc); void (*power_down)(struct core_dc *dc);
......
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