Commit c8d7bd8b authored by Yue Hin Lau's avatar Yue Hin Lau Committed by Alex Deucher

drm/amd/display: move RGAM programming from opp to dpp

Signed-off-by: default avatarYue Hin Lau <Yuehin.Lau@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 e63825be
......@@ -1054,25 +1054,25 @@ static bool dcn10_set_output_transfer_func(
struct pipe_ctx *pipe_ctx,
const struct core_stream *stream)
{
struct output_pixel_processor *opp = pipe_ctx->opp;
struct transform *xfm = pipe_ctx->xfm;
if (opp == NULL)
if (xfm == NULL)
return false;
opp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
xfm->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
if (stream->public.out_transfer_func &&
stream->public.out_transfer_func->type ==
TF_TYPE_PREDEFINED &&
stream->public.out_transfer_func->tf ==
TRANSFER_FUNCTION_SRGB) {
opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_SRGB);
xfm->funcs->opp_set_regamma_mode(xfm, OPP_REGAMMA_SRGB);
} else if (dcn10_translate_regamma_to_hw_format(
stream->public.out_transfer_func, &opp->regamma_params)) {
opp->funcs->opp_program_regamma_pwl(opp, &opp->regamma_params);
opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_USER);
stream->public.out_transfer_func, &xfm->regamma_params)) {
xfm->funcs->opp_program_regamma_pwl(xfm, &xfm->regamma_params);
xfm->funcs->opp_set_regamma_mode(xfm, OPP_REGAMMA_USER);
} else {
opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_BYPASS);
xfm->funcs->opp_set_regamma_mode(xfm, OPP_REGAMMA_BYPASS);
}
return true;
......
......@@ -113,4 +113,11 @@ struct out_csc_color_matrix {
uint16_t regval[12];
};
enum opp_regamma {
OPP_REGAMMA_BYPASS = 0,
OPP_REGAMMA_SRGB,
OPP_REGAMMA_3_6,
OPP_REGAMMA_USER
};
#endif /* __DAL_HW_SHARED_H__ */
......@@ -196,13 +196,6 @@ struct pwl_float_data {
struct fixed31_32 b;
};
enum opp_regamma {
OPP_REGAMMA_BYPASS = 0,
OPP_REGAMMA_SRGB,
OPP_REGAMMA_3_6,
OPP_REGAMMA_USER,
};
struct output_pixel_processor {
struct dc_context *ctx;
uint32_t inst;
......
......@@ -38,6 +38,7 @@ struct transform {
const struct transform_funcs *funcs;
struct dc_context *ctx;
int inst;
struct pwl_params regamma_params;
};
/* Colorimetry */
......@@ -190,6 +191,34 @@ struct transform_funcs {
void (*opp_set_csc_adjustment)(
struct transform *xfm,
const struct out_csc_color_matrix *tbl_entry);
void (*opp_power_on_regamma_lut)(
struct transform *xfm,
bool power_on);
void (*opp_program_regamma_lut)(
struct transform *xfm,
const struct pwl_result_data *rgb,
uint32_t num);
void (*opp_configure_regamma_lut)(
struct transform *xfm,
bool is_ram_a);
void (*opp_program_regamma_lutb_settings)(
struct transform *xfm,
const struct pwl_params *params);
void (*opp_program_regamma_luta_settings)(
struct transform *xfm,
const struct pwl_params *params);
bool (*opp_program_regamma_pwl)(
struct transform *xfm, const struct pwl_params *params);
void (*opp_set_regamma_mode)(
struct transform *xfm_base,
enum opp_regamma mode);
};
extern const uint16_t filter_2tap_16p[18];
......
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