mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 12:15:08 +07:00
drm/amd/display: Move output transfer function to stream updates
Signed-off-by: Amy Zhang <Amy.Zhang@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
6838161c72
commit
f46661dd42
@ -201,11 +201,10 @@ static bool stream_get_crtc_position(struct dc *dc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool set_gamut_remap(struct dc *dc,
|
||||
const struct dc_stream **stream, int num_streams)
|
||||
static bool set_gamut_remap(struct dc *dc, const struct dc_stream *stream)
|
||||
{
|
||||
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;
|
||||
bool ret = false;
|
||||
struct pipe_ctx *pipes;
|
||||
@ -1182,7 +1181,6 @@ static enum surface_update_type det_surface_update(
|
||||
overall_type = type;
|
||||
|
||||
if (u->in_transfer_func ||
|
||||
u->out_transfer_func ||
|
||||
u->hdr_static_metadata) {
|
||||
if (overall_type < UPDATE_TYPE_MED)
|
||||
overall_type = UPDATE_TYPE_MED;
|
||||
@ -1279,8 +1277,28 @@ void dc_update_surfaces_and_stream(struct dc *dc,
|
||||
|
||||
/* update current stream with the new updates */
|
||||
if (stream_update) {
|
||||
stream->public.src = stream_update->src;
|
||||
stream->public.dst = stream_update->dst;
|
||||
if ((stream_update->src.height != 0) &&
|
||||
(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 */
|
||||
@ -1361,13 +1379,6 @@ void dc_update_surfaces_and_stream(struct dc *dc,
|
||||
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)
|
||||
surface->public.hdr_static_ctx =
|
||||
*(srf_updates[i].hdr_static_metadata);
|
||||
@ -1436,11 +1447,12 @@ void dc_update_surfaces_and_stream(struct dc *dc,
|
||||
pipe_ctx, pipe_ctx->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(
|
||||
pipe_ctx,
|
||||
pipe_ctx->surface,
|
||||
pipe_ctx->stream);
|
||||
pipe_ctx, pipe_ctx->stream);
|
||||
}
|
||||
|
||||
if (srf_updates[i].hdr_static_metadata) {
|
||||
resource_build_info_frame(pipe_ctx);
|
||||
|
@ -122,7 +122,7 @@ struct dc_stream_funcs {
|
||||
const struct rect *dst);
|
||||
|
||||
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,
|
||||
const struct dc_stream **stream,
|
||||
@ -265,7 +265,8 @@ struct dc_hdr_static_metadata {
|
||||
enum dc_transfer_func_type {
|
||||
TF_TYPE_PREDEFINED,
|
||||
TF_TYPE_DISTRIBUTED_POINTS,
|
||||
TF_TYPE_BYPASS
|
||||
TF_TYPE_BYPASS,
|
||||
TF_TYPE_UNKNOWN
|
||||
};
|
||||
|
||||
struct dc_transfer_func_distributed_points {
|
||||
@ -349,11 +350,8 @@ struct dc_surface_update {
|
||||
*/
|
||||
/* gamma TO BE REMOVED */
|
||||
struct dc_gamma *gamma;
|
||||
struct dc_hdr_static_metadata *hdr_static_metadata;
|
||||
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
|
||||
@ -473,11 +471,9 @@ struct dc_stream {
|
||||
};
|
||||
|
||||
struct dc_stream_update {
|
||||
|
||||
struct rect src;
|
||||
|
||||
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
|
||||
|
||||
static bool dce110_set_output_transfer_func(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
const struct core_surface *surface, /* Surface - To be removed */
|
||||
const struct core_stream *stream)
|
||||
{
|
||||
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
|
||||
|
||||
static bool dcn10_set_output_transfer_func(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
const struct core_surface *surface,
|
||||
const struct core_stream *stream)
|
||||
{
|
||||
struct output_pixel_processor *opp = pipe_ctx->opp;
|
||||
|
||||
if (opp == NULL)
|
||||
return false;
|
||||
|
||||
opp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
|
||||
|
||||
if (stream->public.out_transfer_func &&
|
||||
|
@ -80,7 +80,6 @@ struct hw_sequencer_funcs {
|
||||
|
||||
bool (*set_output_transfer_func)(
|
||||
struct pipe_ctx *pipe_ctx,
|
||||
const struct core_surface *surface,
|
||||
const struct core_stream *stream);
|
||||
|
||||
void (*power_down)(struct core_dc *dc);
|
||||
|
Loading…
Reference in New Issue
Block a user