Commit a6114e85 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Fix some more color indentations

Signed-off-by: default avatarHarry Wentland <harry.wentland@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 efd52204
...@@ -2142,6 +2142,7 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, ...@@ -2142,6 +2142,7 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream,
const struct drm_connector *connector) const struct drm_connector *connector)
{ {
struct dc_crtc_timing *timing_out = &stream->timing; struct dc_crtc_timing *timing_out = &stream->timing;
struct dc_transfer_func *tf = dc_create_transfer_func();
memset(timing_out, 0, sizeof(struct dc_crtc_timing)); memset(timing_out, 0, sizeof(struct dc_crtc_timing));
...@@ -2185,13 +2186,9 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, ...@@ -2185,13 +2186,9 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream,
stream->output_color_space = get_output_color_space(timing_out); stream->output_color_space = get_output_color_space(timing_out);
{ tf->type = TF_TYPE_PREDEFINED;
struct dc_transfer_func *tf = dc_create_transfer_func(); tf->tf = TRANSFER_FUNCTION_SRGB;
stream->out_transfer_func = tf;
tf->type = TF_TYPE_PREDEFINED;
tf->tf = TRANSFER_FUNCTION_SRGB;
stream->out_transfer_func = tf;
}
} }
static void fill_audio_info(struct audio_info *audio_info, static void fill_audio_info(struct audio_info *audio_info,
......
...@@ -1376,10 +1376,9 @@ static void commit_planes_for_stream(struct dc *dc, ...@@ -1376,10 +1376,9 @@ static void commit_planes_for_stream(struct dc *dc,
continue; continue;
/* work around to program degamma regs for split pipe after set mode. */ /* work around to program degamma regs for split pipe after set mode. */
if (srf_updates[i].in_transfer_func || (pipe_ctx->top_pipe && if (srf_updates[i].in_transfer_func ||
pipe_ctx->top_pipe->plane_state == pipe_ctx->plane_state)) (pipe_ctx->top_pipe && pipe_ctx->top_pipe->plane_state == pipe_ctx->plane_state))
dc->hwss.set_input_transfer_func( dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
pipe_ctx, pipe_ctx->plane_state);
} }
} }
......
...@@ -257,9 +257,9 @@ static void build_prescale_params(struct ipp_prescale_params *prescale_params, ...@@ -257,9 +257,9 @@ static void build_prescale_params(struct ipp_prescale_params *prescale_params,
} }
} }
static bool dce110_set_input_transfer_func( static bool
struct pipe_ctx *pipe_ctx, dce110_set_input_transfer_func(struct pipe_ctx *pipe_ctx,
const struct dc_plane_state *plane_state) const struct dc_plane_state *plane_state)
{ {
struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
const struct dc_transfer_func *tf = NULL; const struct dc_transfer_func *tf = NULL;
...@@ -280,25 +280,19 @@ static bool dce110_set_input_transfer_func( ...@@ -280,25 +280,19 @@ static bool dce110_set_input_transfer_func(
if (tf == NULL) { if (tf == NULL) {
/* Default case if no input transfer function specified */ /* Default case if no input transfer function specified */
ipp->funcs->ipp_set_degamma(ipp, ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_HW_sRGB);
IPP_DEGAMMA_MODE_HW_sRGB);
} else if (tf->type == TF_TYPE_PREDEFINED) { } else if (tf->type == TF_TYPE_PREDEFINED) {
switch (tf->tf) { switch (tf->tf) {
case TRANSFER_FUNCTION_SRGB: case TRANSFER_FUNCTION_SRGB:
ipp->funcs->ipp_set_degamma(ipp, ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_HW_sRGB);
IPP_DEGAMMA_MODE_HW_sRGB);
break; break;
case TRANSFER_FUNCTION_BT709: case TRANSFER_FUNCTION_BT709:
ipp->funcs->ipp_set_degamma(ipp, ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_HW_xvYCC);
IPP_DEGAMMA_MODE_HW_xvYCC);
break; break;
case TRANSFER_FUNCTION_LINEAR: case TRANSFER_FUNCTION_LINEAR:
ipp->funcs->ipp_set_degamma(ipp, ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_BYPASS);
IPP_DEGAMMA_MODE_BYPASS);
break; break;
case TRANSFER_FUNCTION_PQ: case TRANSFER_FUNCTION_PQ:
result = false;
break;
default: default:
result = false; result = false;
break; break;
...@@ -640,9 +634,9 @@ static bool dce110_translate_regamma_to_hw_format(const struct dc_transfer_func ...@@ -640,9 +634,9 @@ static bool dce110_translate_regamma_to_hw_format(const struct dc_transfer_func
return true; return true;
} }
static bool dce110_set_output_transfer_func( static bool
struct pipe_ctx *pipe_ctx, dce110_set_output_transfer_func(struct pipe_ctx *pipe_ctx,
const struct dc_stream_state *stream) const struct dc_stream_state *stream)
{ {
struct transform *xfm = pipe_ctx->plane_res.xfm; struct transform *xfm = pipe_ctx->plane_res.xfm;
...@@ -2756,8 +2750,7 @@ static void dce110_program_front_end_for_pipe( ...@@ -2756,8 +2750,7 @@ static void dce110_program_front_end_for_pipe(
struct dc_plane_state *plane_state = pipe_ctx->plane_state; struct dc_plane_state *plane_state = pipe_ctx->plane_state;
struct xfm_grph_csc_adjustment adjust; struct xfm_grph_csc_adjustment adjust;
struct out_csc_color_matrix tbl_entry; struct out_csc_color_matrix tbl_entry;
struct pipe_ctx *cur_pipe_ctx = struct pipe_ctx *cur_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
&dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
unsigned int i; unsigned int i;
memset(&tbl_entry, 0, sizeof(tbl_entry)); memset(&tbl_entry, 0, sizeof(tbl_entry));
...@@ -2850,10 +2843,8 @@ static void dce110_program_front_end_for_pipe( ...@@ -2850,10 +2843,8 @@ static void dce110_program_front_end_for_pipe(
/* Moved programming gamma from dc to hwss */ /* Moved programming gamma from dc to hwss */
if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) { if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) {
dc->hwss.set_input_transfer_func( dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
pipe_ctx, pipe_ctx->plane_state); dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
dc->hwss.set_output_transfer_func(
pipe_ctx, pipe_ctx->stream);
} }
dm_logger_write(dc->ctx->logger, LOG_SURFACE, dm_logger_write(dc->ctx->logger, LOG_SURFACE,
......
...@@ -874,8 +874,8 @@ static void dcn10_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_c ...@@ -874,8 +874,8 @@ static void dcn10_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_c
pipe_ctx->plane_state->address.grph_stereo.left_addr = addr; pipe_ctx->plane_state->address.grph_stereo.left_addr = addr;
} }
static bool dcn10_set_input_transfer_func( static bool dcn10_set_input_transfer_func(struct pipe_ctx *pipe_ctx,
struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state) const struct dc_plane_state *plane_state)
{ {
struct dpp *dpp_base = pipe_ctx->plane_res.dpp; struct dpp *dpp_base = pipe_ctx->plane_res.dpp;
const struct dc_transfer_func *tf = NULL; const struct dc_transfer_func *tf = NULL;
...@@ -888,28 +888,22 @@ static bool dcn10_set_input_transfer_func( ...@@ -888,28 +888,22 @@ static bool dcn10_set_input_transfer_func(
tf = plane_state->in_transfer_func; tf = plane_state->in_transfer_func;
if (plane_state->gamma_correction && dce_use_lut(plane_state)) if (plane_state->gamma_correction && dce_use_lut(plane_state))
dpp_base->funcs->dpp_program_input_lut(dpp_base, dpp_base->funcs->dpp_program_input_lut(dpp_base, plane_state->gamma_correction);
plane_state->gamma_correction);
if (tf == NULL) if (tf == NULL)
dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_BYPASS); dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_BYPASS);
else if (tf->type == TF_TYPE_PREDEFINED) { else if (tf->type == TF_TYPE_PREDEFINED) {
switch (tf->tf) { switch (tf->tf) {
case TRANSFER_FUNCTION_SRGB: case TRANSFER_FUNCTION_SRGB:
dpp_base->funcs->dpp_set_degamma(dpp_base, dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_HW_sRGB);
IPP_DEGAMMA_MODE_HW_sRGB);
break; break;
case TRANSFER_FUNCTION_BT709: case TRANSFER_FUNCTION_BT709:
dpp_base->funcs->dpp_set_degamma(dpp_base, dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_HW_xvYCC);
IPP_DEGAMMA_MODE_HW_xvYCC);
break; break;
case TRANSFER_FUNCTION_LINEAR: case TRANSFER_FUNCTION_LINEAR:
dpp_base->funcs->dpp_set_degamma(dpp_base, dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_BYPASS);
IPP_DEGAMMA_MODE_BYPASS);
break; break;
case TRANSFER_FUNCTION_PQ: case TRANSFER_FUNCTION_PQ:
result = false;
break;
default: default:
result = false; result = false;
break; break;
...@@ -1238,9 +1232,9 @@ static bool dcn10_translate_regamma_to_hw_format(const struct dc_transfer_func ...@@ -1238,9 +1232,9 @@ static bool dcn10_translate_regamma_to_hw_format(const struct dc_transfer_func
return true; return true;
} }
static bool dcn10_set_output_transfer_func( static bool
struct pipe_ctx *pipe_ctx, dcn10_set_output_transfer_func(struct pipe_ctx *pipe_ctx,
const struct dc_stream_state *stream) const struct dc_stream_state *stream)
{ {
struct dpp *dpp = pipe_ctx->plane_res.dpp; struct dpp *dpp = pipe_ctx->plane_res.dpp;
...@@ -1250,17 +1244,13 @@ static bool dcn10_set_output_transfer_func( ...@@ -1250,17 +1244,13 @@ static bool dcn10_set_output_transfer_func(
dpp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM; dpp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
if (stream->out_transfer_func && if (stream->out_transfer_func &&
stream->out_transfer_func->type == stream->out_transfer_func->type == TF_TYPE_PREDEFINED &&
TF_TYPE_PREDEFINED && stream->out_transfer_func->tf == TRANSFER_FUNCTION_SRGB)
stream->out_transfer_func->tf ==
TRANSFER_FUNCTION_SRGB) {
dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_SRGB); dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_SRGB);
} else if (dcn10_translate_regamma_to_hw_format( else if (dcn10_translate_regamma_to_hw_format(stream->out_transfer_func, &dpp->regamma_params))
stream->out_transfer_func, &dpp->regamma_params)) { dpp->funcs->dpp_program_regamma_pwl(dpp, &dpp->regamma_params, OPP_REGAMMA_USER);
dpp->funcs->dpp_program_regamma_pwl(dpp, &dpp->regamma_params, OPP_REGAMMA_USER); else
} else {
dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_BYPASS); dpp->funcs->dpp_program_regamma_pwl(dpp, NULL, OPP_REGAMMA_BYPASS);
}
return true; return true;
} }
...@@ -2047,10 +2037,8 @@ static void program_all_pipe_in_tree( ...@@ -2047,10 +2037,8 @@ static void program_all_pipe_in_tree(
} }
if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) { if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) {
dc->hwss.set_input_transfer_func( dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
pipe_ctx, pipe_ctx->plane_state); dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
dc->hwss.set_output_transfer_func(
pipe_ctx, pipe_ctx->stream);
} }
} }
......
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