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

drm/amd/display: rename transform to dpp for dcn

Signed-off-by: default avatarYue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: default avatarEric Bernstein <Eric.Bernstein@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 39a4e660
...@@ -488,6 +488,7 @@ static void split_stream_across_pipes( ...@@ -488,6 +488,7 @@ static void split_stream_across_pipes(
secondary_pipe->plane_res.hubp = pool->hubps[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.hubp = pool->hubps[secondary_pipe->pipe_idx];
secondary_pipe->plane_res.ipp = pool->ipps[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.ipp = pool->ipps[secondary_pipe->pipe_idx];
secondary_pipe->plane_res.xfm = pool->transforms[secondary_pipe->pipe_idx]; secondary_pipe->plane_res.xfm = pool->transforms[secondary_pipe->pipe_idx];
secondary_pipe->plane_res.dpp = pool->dpps[secondary_pipe->pipe_idx];
if (primary_pipe->bottom_pipe) { if (primary_pipe->bottom_pipe) {
ASSERT(primary_pipe->bottom_pipe != secondary_pipe); ASSERT(primary_pipe->bottom_pipe != secondary_pipe);
secondary_pipe->bottom_pipe = primary_pipe->bottom_pipe; secondary_pipe->bottom_pipe = primary_pipe->bottom_pipe;
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "bios_parser_interface.h" #include "bios_parser_interface.h"
#include "include/irq_service_interface.h" #include "include/irq_service_interface.h"
#include "transform.h" #include "transform.h"
#include "dpp.h"
#include "timing_generator.h" #include "timing_generator.h"
#include "virtual/virtual_link_encoder.h" #include "virtual/virtual_link_encoder.h"
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "opp.h" #include "opp.h"
#include "timing_generator.h" #include "timing_generator.h"
#include "transform.h" #include "transform.h"
#include "dpp.h"
#include "core_types.h" #include "core_types.h"
#include "set_mode_types.h" #include "set_mode_types.h"
#include "virtual/virtual_stream_encoder.h" #include "virtual/virtual_stream_encoder.h"
...@@ -853,8 +854,13 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx) ...@@ -853,8 +854,13 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable; pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable;
/* Taps calculations */ /* Taps calculations */
res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps( if (pipe_ctx->plane_res.xfm != NULL)
pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality); res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps(
pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
if (pipe_ctx->plane_res.dpp != NULL)
res = pipe_ctx->plane_res.dpp->funcs->dpp_get_optimal_number_of_taps(
pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
if (!res) { if (!res) {
/* Try 24 bpp linebuffer */ /* Try 24 bpp linebuffer */
...@@ -862,6 +868,9 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx) ...@@ -862,6 +868,9 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps( res = pipe_ctx->plane_res.xfm->funcs->transform_get_optimal_number_of_taps(
pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality); pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
res = pipe_ctx->plane_res.dpp->funcs->dpp_get_optimal_number_of_taps(
pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
} }
if (res) if (res)
...@@ -1026,7 +1035,7 @@ static int acquire_first_split_pipe( ...@@ -1026,7 +1035,7 @@ static int acquire_first_split_pipe(
pipe_ctx->stream_res.tg = pool->timing_generators[i]; pipe_ctx->stream_res.tg = pool->timing_generators[i];
pipe_ctx->plane_res.hubp = pool->hubps[i]; pipe_ctx->plane_res.hubp = pool->hubps[i];
pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i];
pipe_ctx->plane_res.xfm = pool->transforms[i]; pipe_ctx->plane_res.dpp = pool->dpps[i];
pipe_ctx->stream_res.opp = pool->opps[i]; pipe_ctx->stream_res.opp = pool->opps[i];
pipe_ctx->pipe_idx = i; pipe_ctx->pipe_idx = i;
...@@ -1359,6 +1368,7 @@ static int acquire_first_free_pipe( ...@@ -1359,6 +1368,7 @@ static int acquire_first_free_pipe(
pipe_ctx->plane_res.hubp = pool->hubps[i]; pipe_ctx->plane_res.hubp = pool->hubps[i];
pipe_ctx->plane_res.ipp = pool->ipps[i]; pipe_ctx->plane_res.ipp = pool->ipps[i];
pipe_ctx->plane_res.xfm = pool->transforms[i]; pipe_ctx->plane_res.xfm = pool->transforms[i];
pipe_ctx->plane_res.dpp = pool->dpps[i];
pipe_ctx->stream_res.opp = pool->opps[i]; pipe_ctx->stream_res.opp = pool->opps[i];
pipe_ctx->pipe_idx = i; pipe_ctx->pipe_idx = i;
......
...@@ -200,7 +200,7 @@ bool dc_stream_set_cursor_attributes( ...@@ -200,7 +200,7 @@ bool dc_stream_set_cursor_attributes(
for (i = 0; i < MAX_PIPES; i++) { for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
if (pipe_ctx->stream != stream || !pipe_ctx->plane_res.xfm) if (pipe_ctx->stream != stream || (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp))
continue; continue;
if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state) if (pipe_ctx->top_pipe && pipe_ctx->plane_state != pipe_ctx->top_pipe->plane_state)
continue; continue;
...@@ -221,9 +221,15 @@ bool dc_stream_set_cursor_attributes( ...@@ -221,9 +221,15 @@ bool dc_stream_set_cursor_attributes(
pipe_ctx->plane_res.mi, attributes); pipe_ctx->plane_res.mi, attributes);
if (pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes != NULL) if (pipe_ctx->plane_res.xfm != NULL &&
pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes != NULL)
pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes( pipe_ctx->plane_res.xfm->funcs->set_cursor_attributes(
pipe_ctx->plane_res.xfm, attributes); pipe_ctx->plane_res.xfm, attributes);
if (pipe_ctx->plane_res.dpp != NULL &&
pipe_ctx->plane_res.dpp->funcs->set_cursor_attributes != NULL)
pipe_ctx->plane_res.dpp->funcs->set_cursor_attributes(
pipe_ctx->plane_res.dpp, attributes);
} }
stream->cursor_attributes = *attributes; stream->cursor_attributes = *attributes;
...@@ -258,6 +264,7 @@ bool dc_stream_set_cursor_position( ...@@ -258,6 +264,7 @@ bool dc_stream_set_cursor_position(
struct mem_input *mi = pipe_ctx->plane_res.mi; struct mem_input *mi = pipe_ctx->plane_res.mi;
struct hubp *hubp = pipe_ctx->plane_res.hubp; struct hubp *hubp = pipe_ctx->plane_res.hubp;
struct transform *xfm = pipe_ctx->plane_res.xfm; struct transform *xfm = pipe_ctx->plane_res.xfm;
struct dpp *dpp = pipe_ctx->plane_res.dpp;
struct dc_cursor_position pos_cpy = *position; struct dc_cursor_position pos_cpy = *position;
struct dc_cursor_mi_param param = { struct dc_cursor_mi_param param = {
.pixel_clk_khz = stream->timing.pix_clk_khz, .pixel_clk_khz = stream->timing.pix_clk_khz,
...@@ -270,7 +277,7 @@ bool dc_stream_set_cursor_position( ...@@ -270,7 +277,7 @@ bool dc_stream_set_cursor_position(
if (pipe_ctx->stream != stream || if (pipe_ctx->stream != stream ||
(!pipe_ctx->plane_res.mi && !pipe_ctx->plane_res.hubp) || (!pipe_ctx->plane_res.mi && !pipe_ctx->plane_res.hubp) ||
!pipe_ctx->plane_state || !pipe_ctx->plane_state ||
!pipe_ctx->plane_res.xfm) (!pipe_ctx->plane_res.xfm && !pipe_ctx->plane_res.dpp))
continue; continue;
if (pipe_ctx->plane_state->address.type if (pipe_ctx->plane_state->address.type
...@@ -293,6 +300,9 @@ bool dc_stream_set_cursor_position( ...@@ -293,6 +300,9 @@ bool dc_stream_set_cursor_position(
if (xfm != NULL && xfm->funcs->set_cursor_position != NULL) if (xfm != NULL && xfm->funcs->set_cursor_position != NULL)
xfm->funcs->set_cursor_position(xfm, &pos_cpy, &param, hubp->curs_attr.width); xfm->funcs->set_cursor_position(xfm, &pos_cpy, &param, hubp->curs_attr.width);
if (dpp != NULL && dpp->funcs->set_cursor_position != NULL)
dpp->funcs->set_cursor_position(dpp, &pos_cpy, &param, hubp->curs_attr.width);
} }
return true; return true;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
/* DC core (private) */ /* DC core (private) */
#include "core_types.h" #include "core_types.h"
#include "transform.h" #include "transform.h"
#include "dpp.h"
/******************************************************************************* /*******************************************************************************
* Private functions * Private functions
......
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
#define BLACK_OFFSET_CBCR 0x8000 #define BLACK_OFFSET_CBCR 0x8000
#define REG(reg)\ #define REG(reg)\
xfm->tf_regs->reg dpp->tf_regs->reg
#define CTX \ #define CTX \
xfm->base.ctx dpp->base.ctx
#undef FN #undef FN
#define FN(reg_name, field_name) \ #define FN(reg_name, field_name) \
xfm->tf_shift->field_name, xfm->tf_mask->field_name dpp->tf_shift->field_name, dpp->tf_mask->field_name
enum pixel_format_description { enum pixel_format_description {
PIXEL_FORMAT_FIXED = 0, PIXEL_FORMAT_FIXED = 0,
...@@ -99,7 +99,7 @@ enum gamut_remap_select { ...@@ -99,7 +99,7 @@ enum gamut_remap_select {
}; };
/* Program gamut remap in bypass mode */ /* Program gamut remap in bypass mode */
void dpp_set_gamut_remap_bypass(struct dcn10_dpp *xfm) void dpp_set_gamut_remap_bypass(struct dcn10_dpp *dpp)
{ {
REG_SET(CM_GAMUT_REMAP_CONTROL, 0, REG_SET(CM_GAMUT_REMAP_CONTROL, 0,
CM_GAMUT_REMAP_MODE, 0); CM_GAMUT_REMAP_MODE, 0);
...@@ -110,7 +110,7 @@ void dpp_set_gamut_remap_bypass(struct dcn10_dpp *xfm) ...@@ -110,7 +110,7 @@ void dpp_set_gamut_remap_bypass(struct dcn10_dpp *xfm)
bool dpp_get_optimal_number_of_taps( bool dpp_get_optimal_number_of_taps(
struct transform *xfm, struct dpp *dpp,
struct scaler_data *scl_data, struct scaler_data *scl_data,
const struct scaling_taps *in_taps) const struct scaling_taps *in_taps)
{ {
...@@ -154,7 +154,7 @@ bool dpp_get_optimal_number_of_taps( ...@@ -154,7 +154,7 @@ bool dpp_get_optimal_number_of_taps(
else else
scl_data->taps.h_taps_c = in_taps->h_taps_c; scl_data->taps.h_taps_c = in_taps->h_taps_c;
if (!xfm->ctx->dc->debug.always_scale) { if (!dpp->ctx->dc->debug.always_scale) {
if (IDENTITY_RATIO(scl_data->ratios.horz)) if (IDENTITY_RATIO(scl_data->ratios.horz))
scl_data->taps.h_taps = 1; scl_data->taps.h_taps = 1;
if (IDENTITY_RATIO(scl_data->ratios.vert)) if (IDENTITY_RATIO(scl_data->ratios.vert))
...@@ -169,14 +169,14 @@ bool dpp_get_optimal_number_of_taps( ...@@ -169,14 +169,14 @@ bool dpp_get_optimal_number_of_taps(
return true; return true;
} }
void dpp_reset(struct transform *xfm_base) void dpp_reset(struct dpp *dpp_base)
{ {
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
xfm->filter_h_c = NULL; dpp->filter_h_c = NULL;
xfm->filter_v_c = NULL; dpp->filter_v_c = NULL;
xfm->filter_h = NULL; dpp->filter_h = NULL;
xfm->filter_v = NULL; dpp->filter_v = NULL;
/* set boundary mode to 0 */ /* set boundary mode to 0 */
REG_SET(DSCL_CONTROL, 0, SCL_BOUNDARY_MODE, 0); REG_SET(DSCL_CONTROL, 0, SCL_BOUNDARY_MODE, 0);
...@@ -184,28 +184,28 @@ void dpp_reset(struct transform *xfm_base) ...@@ -184,28 +184,28 @@ void dpp_reset(struct transform *xfm_base)
static void dcn10_dpp_cm_set_regamma_pwl( static void dpp1_cm_set_regamma_pwl(
struct transform *xfm_base, const struct pwl_params *params) struct dpp *dpp_base, const struct pwl_params *params)
{ {
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
dcn10_dpp_cm_power_on_regamma_lut(xfm_base, true); dpp1_cm_power_on_regamma_lut(dpp_base, true);
dcn10_dpp_cm_configure_regamma_lut(xfm_base, xfm->is_write_to_ram_a_safe); dpp1_cm_configure_regamma_lut(dpp_base, dpp->is_write_to_ram_a_safe);
if (xfm->is_write_to_ram_a_safe) if (dpp->is_write_to_ram_a_safe)
dcn10_dpp_cm_program_regamma_luta_settings(xfm_base, params); dpp1_cm_program_regamma_luta_settings(dpp_base, params);
else else
dcn10_dpp_cm_program_regamma_lutb_settings(xfm_base, params); dpp1_cm_program_regamma_lutb_settings(dpp_base, params);
dcn10_dpp_cm_program_regamma_lut( dpp1_cm_program_regamma_lut(
xfm_base, params->rgb_resulted, params->hw_points_num); dpp_base, params->rgb_resulted, params->hw_points_num);
} }
static void dcn10_dpp_cm_set_regamma_mode( static void dpp1_cm_set_regamma_mode(
struct transform *xfm_base, struct dpp *dpp_base,
enum opp_regamma mode) enum opp_regamma mode)
{ {
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
uint32_t re_mode = 0; uint32_t re_mode = 0;
uint32_t obuf_bypass = 0; /* need for pipe split */ uint32_t obuf_bypass = 0; /* need for pipe split */
uint32_t obuf_hupscale = 0; uint32_t obuf_hupscale = 0;
...@@ -221,8 +221,8 @@ static void dcn10_dpp_cm_set_regamma_mode( ...@@ -221,8 +221,8 @@ static void dcn10_dpp_cm_set_regamma_mode(
re_mode = 2; re_mode = 2;
break; break;
case OPP_REGAMMA_USER: case OPP_REGAMMA_USER:
re_mode = xfm->is_write_to_ram_a_safe ? 3 : 4; re_mode = dpp->is_write_to_ram_a_safe ? 3 : 4;
xfm->is_write_to_ram_a_safe = !xfm->is_write_to_ram_a_safe; dpp->is_write_to_ram_a_safe = !dpp->is_write_to_ram_a_safe;
break; break;
default: default:
break; break;
...@@ -234,7 +234,7 @@ static void dcn10_dpp_cm_set_regamma_mode( ...@@ -234,7 +234,7 @@ static void dcn10_dpp_cm_set_regamma_mode(
OBUF_H_2X_UPSCALE_EN, obuf_hupscale); OBUF_H_2X_UPSCALE_EN, obuf_hupscale);
} }
static void ippn10_setup_format_flags(enum surface_pixel_format input_format,\ static void dpp1_setup_format_flags(enum surface_pixel_format input_format,\
enum pixel_format_description *fmt) enum pixel_format_description *fmt)
{ {
...@@ -247,11 +247,11 @@ static void ippn10_setup_format_flags(enum surface_pixel_format input_format,\ ...@@ -247,11 +247,11 @@ static void ippn10_setup_format_flags(enum surface_pixel_format input_format,\
*fmt = PIXEL_FORMAT_FIXED; *fmt = PIXEL_FORMAT_FIXED;
} }
static void ippn10_set_degamma_format_float( static void dpp1_set_degamma_format_float(
struct transform *xfm_base, struct dpp *dpp_base,
bool is_float) bool is_float)
{ {
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
if (is_float) { if (is_float) {
REG_UPDATE(CM_IGAM_CONTROL, CM_IGAM_INPUT_FORMAT, 3); REG_UPDATE(CM_IGAM_CONTROL, CM_IGAM_INPUT_FORMAT, 3);
...@@ -262,8 +262,8 @@ static void ippn10_set_degamma_format_float( ...@@ -262,8 +262,8 @@ static void ippn10_set_degamma_format_float(
} }
} }
void ippn10_cnv_setup ( void dpp1_cnv_setup (
struct transform *xfm_base, struct dpp *dpp_base,
enum surface_pixel_format input_format, enum surface_pixel_format input_format,
enum expansion_mode mode) enum expansion_mode mode)
{ {
...@@ -273,10 +273,10 @@ void ippn10_cnv_setup ( ...@@ -273,10 +273,10 @@ void ippn10_cnv_setup (
enum dc_color_space color_space; enum dc_color_space color_space;
enum dcn10_input_csc_select select; enum dcn10_input_csc_select select;
bool is_float; bool is_float;
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
bool force_disable_cursor = false; bool force_disable_cursor = false;
ippn10_setup_format_flags(input_format, &fmt); dpp1_setup_format_flags(input_format, &fmt);
alpha_en = 1; alpha_en = 1;
pixel_format = 0; pixel_format = 0;
color_space = COLOR_SPACE_SRGB; color_space = COLOR_SPACE_SRGB;
...@@ -304,7 +304,7 @@ void ippn10_cnv_setup ( ...@@ -304,7 +304,7 @@ void ippn10_cnv_setup (
break; break;
} }
ippn10_set_degamma_format_float(xfm_base, is_float); dpp1_set_degamma_format_float(dpp_base, is_float);
switch (input_format) { switch (input_format) {
case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555: case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555:
...@@ -362,7 +362,7 @@ void ippn10_cnv_setup ( ...@@ -362,7 +362,7 @@ void ippn10_cnv_setup (
CNVC_SURFACE_PIXEL_FORMAT, pixel_format); CNVC_SURFACE_PIXEL_FORMAT, pixel_format);
REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en); REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en);
ippn10_program_input_csc(xfm_base, color_space, select); dpp1_program_input_csc(dpp_base, color_space, select);
if (force_disable_cursor) { if (force_disable_cursor) {
REG_UPDATE(CURSOR_CONTROL, REG_UPDATE(CURSOR_CONTROL,
...@@ -373,10 +373,10 @@ void ippn10_cnv_setup ( ...@@ -373,10 +373,10 @@ void ippn10_cnv_setup (
} }
void dcn10_set_cursor_attributes( void dcn10_set_cursor_attributes(
struct transform *xfm_base, struct dpp *dpp_base,
const struct dc_cursor_attributes *attr) const struct dc_cursor_attributes *attr)
{ {
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
enum dc_cursor_color_format color_format = attr->color_format; enum dc_cursor_color_format color_format = attr->color_format;
REG_UPDATE_2(CURSOR0_CONTROL, REG_UPDATE_2(CURSOR0_CONTROL,
...@@ -401,12 +401,12 @@ void dcn10_set_cursor_attributes( ...@@ -401,12 +401,12 @@ void dcn10_set_cursor_attributes(
void dcn10_set_cursor_position( void dcn10_set_cursor_position(
struct transform *xfm_base, struct dpp *dpp_base,
const struct dc_cursor_position *pos, const struct dc_cursor_position *pos,
const struct dc_cursor_mi_param *param, const struct dc_cursor_mi_param *param,
uint32_t width) uint32_t width)
{ {
struct dcn10_dpp *xfm = TO_DCN10_DPP(xfm_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
int src_x_offset = pos->x - pos->x_hotspot - param->viewport_x_start; int src_x_offset = pos->x - pos->x_hotspot - param->viewport_x_start;
uint32_t cur_en = pos->enable ? 1 : 0; uint32_t cur_en = pos->enable ? 1 : 0;
...@@ -421,25 +421,25 @@ void dcn10_set_cursor_position( ...@@ -421,25 +421,25 @@ void dcn10_set_cursor_position(
} }
static const struct transform_funcs dcn10_dpp_funcs = { static const struct dpp_funcs dcn10_dpp_funcs = {
.transform_reset = dpp_reset, .dpp_reset = dpp_reset,
.transform_set_scaler = dcn10_dpp_dscl_set_scaler_manual_scale, .dpp_set_scaler = dpp1_dscl_set_scaler_manual_scale,
.transform_get_optimal_number_of_taps = dpp_get_optimal_number_of_taps, .dpp_get_optimal_number_of_taps = dpp_get_optimal_number_of_taps,
.transform_set_gamut_remap = dcn10_dpp_cm_set_gamut_remap, .dpp_set_gamut_remap = dpp1_cm_set_gamut_remap,
.opp_set_csc_adjustment = dcn10_dpp_cm_set_output_csc_adjustment, .opp_set_csc_adjustment = dpp1_cm_set_output_csc_adjustment,
.opp_set_csc_default = dcn10_dpp_cm_set_output_csc_default, .opp_set_csc_default = dpp1_cm_set_output_csc_default,
.opp_power_on_regamma_lut = dcn10_dpp_cm_power_on_regamma_lut, .opp_power_on_regamma_lut = dpp1_cm_power_on_regamma_lut,
.opp_program_regamma_lut = dcn10_dpp_cm_program_regamma_lut, .opp_program_regamma_lut = dpp1_cm_program_regamma_lut,
.opp_configure_regamma_lut = dcn10_dpp_cm_configure_regamma_lut, .opp_configure_regamma_lut = dpp1_cm_configure_regamma_lut,
.opp_program_regamma_lutb_settings = dcn10_dpp_cm_program_regamma_lutb_settings, .opp_program_regamma_lutb_settings = dpp1_cm_program_regamma_lutb_settings,
.opp_program_regamma_luta_settings = dcn10_dpp_cm_program_regamma_luta_settings, .opp_program_regamma_luta_settings = dpp1_cm_program_regamma_luta_settings,
.opp_program_regamma_pwl = dcn10_dpp_cm_set_regamma_pwl, .opp_program_regamma_pwl = dpp1_cm_set_regamma_pwl,
.opp_set_regamma_mode = dcn10_dpp_cm_set_regamma_mode, .opp_set_regamma_mode = dpp1_cm_set_regamma_mode,
.ipp_set_degamma = ippn10_set_degamma, .ipp_set_degamma = dpp1_set_degamma,
.ipp_program_input_lut = ippn10_program_input_lut, .ipp_program_input_lut = dpp1_program_input_lut,
.ipp_program_degamma_pwl = ippn10_set_degamma_pwl, .ipp_program_degamma_pwl = dpp1_set_degamma_pwl,
.ipp_setup = ippn10_cnv_setup, .ipp_setup = dpp1_cnv_setup,
.ipp_full_bypass = ippn10_full_bypass, .ipp_full_bypass = dpp1_full_bypass,
.set_cursor_attributes = dcn10_set_cursor_attributes, .set_cursor_attributes = dcn10_set_cursor_attributes,
.set_cursor_position = dcn10_set_cursor_position, .set_cursor_position = dcn10_set_cursor_position,
}; };
...@@ -453,29 +453,29 @@ static struct dpp_caps dcn10_dpp_cap = { ...@@ -453,29 +453,29 @@ static struct dpp_caps dcn10_dpp_cap = {
/* Constructor, Destructor */ /* Constructor, Destructor */
/*****************************************/ /*****************************************/
void dcn10_dpp_construct( void dpp1_construct(
struct dcn10_dpp *xfm, struct dcn10_dpp *dpp,
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst,
const struct dcn_dpp_registers *tf_regs, const struct dcn_dpp_registers *tf_regs,
const struct dcn_dpp_shift *tf_shift, const struct dcn_dpp_shift *tf_shift,
const struct dcn_dpp_mask *tf_mask) const struct dcn_dpp_mask *tf_mask)
{ {
xfm->base.ctx = ctx; dpp->base.ctx = ctx;
xfm->base.inst = inst; dpp->base.inst = inst;
xfm->base.funcs = &dcn10_dpp_funcs; dpp->base.funcs = &dcn10_dpp_funcs;
xfm->base.caps = &dcn10_dpp_cap; dpp->base.caps = &dcn10_dpp_cap;
xfm->tf_regs = tf_regs; dpp->tf_regs = tf_regs;
xfm->tf_shift = tf_shift; dpp->tf_shift = tf_shift;
xfm->tf_mask = tf_mask; dpp->tf_mask = tf_mask;
xfm->lb_pixel_depth_supported = dpp->lb_pixel_depth_supported =
LB_PIXEL_DEPTH_18BPP | LB_PIXEL_DEPTH_18BPP |
LB_PIXEL_DEPTH_24BPP | LB_PIXEL_DEPTH_24BPP |
LB_PIXEL_DEPTH_30BPP; LB_PIXEL_DEPTH_30BPP;
xfm->lb_bits_per_entry = LB_BITS_PER_ENTRY; dpp->lb_bits_per_entry = LB_BITS_PER_ENTRY;
xfm->lb_memory_size = LB_TOTAL_NUMBER_OF_ENTRIES; /*0x1404*/ dpp->lb_memory_size = LB_TOTAL_NUMBER_OF_ENTRIES; /*0x1404*/
} }
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
#ifndef __DAL_DPP_DCN10_H__ #ifndef __DAL_DPP_DCN10_H__
#define __DAL_DPP_DCN10_H__ #define __DAL_DPP_DCN10_H__
#include "transform.h" #include "dpp.h"
#define TO_DCN10_DPP(transform)\ #define TO_DCN10_DPP(dpp)\
container_of(transform, struct dcn10_dpp, base) container_of(dpp, struct dcn10_dpp, base)
/* TODO: Use correct number of taps. Using polaris values for now */ /* TODO: Use correct number of taps. Using polaris values for now */
#define LB_TOTAL_NUMBER_OF_ENTRIES 5124 #define LB_TOTAL_NUMBER_OF_ENTRIES 5124
...@@ -1252,7 +1252,7 @@ struct dcn_dpp_registers { ...@@ -1252,7 +1252,7 @@ struct dcn_dpp_registers {
}; };
struct dcn10_dpp { struct dcn10_dpp {
struct transform base; struct dpp base;
const struct dcn_dpp_registers *tf_regs; const struct dcn_dpp_registers *tf_regs;
const struct dcn_dpp_shift *tf_shift; const struct dcn_dpp_shift *tf_shift;
...@@ -1285,99 +1285,99 @@ void dscl1_calc_lb_num_partitions( ...@@ -1285,99 +1285,99 @@ void dscl1_calc_lb_num_partitions(
int *num_part_y, int *num_part_y,
int *num_part_c); int *num_part_c);
void ippn10_degamma_ram_select( void dpp1_degamma_ram_select(
struct transform *xfm_base, struct dpp *dpp_base,
bool use_ram_a); bool use_ram_a);
void ippn10_program_degamma_luta_settings( void dpp1_program_degamma_luta_settings(
struct transform *xfm_base, struct dpp *dpp_base,
const struct pwl_params *params); const struct pwl_params *params);
void ippn10_program_degamma_lutb_settings( void dpp1_program_degamma_lutb_settings(
struct transform *xfm_base, struct dpp *dpp_base,
const struct pwl_params *params); const struct pwl_params *params);
void ippn10_program_degamma_lut( void dpp1_program_degamma_lut(
struct transform *xfm_base, struct dpp *dpp_base,
const struct pwl_result_data *rgb, const struct pwl_result_data *rgb,
uint32_t num, uint32_t num,
bool is_ram_a); bool is_ram_a);
void ippn10_power_on_degamma_lut( void dpp1_power_on_degamma_lut(
struct transform *xfm_base, struct dpp *dpp_base,
bool power_on); bool power_on);
void ippn10_program_input_csc( void dpp1_program_input_csc(
struct transform *xfm_base, struct dpp *dpp_base,
enum dc_color_space color_space, enum dc_color_space color_space,
enum dcn10_input_csc_select select); enum dcn10_input_csc_select select);
void ippn10_program_input_lut( void dpp1_program_input_lut(
struct transform *xfm_base, struct dpp *dpp_base,
const struct dc_gamma *gamma); const struct dc_gamma *gamma);
void ippn10_full_bypass(struct transform *xfm_base); void dpp1_full_bypass(struct dpp *dpp_base);
void ippn10_set_degamma( void dpp1_set_degamma(
struct transform *xfm_base, struct dpp *dpp_base,
enum ipp_degamma_mode mode); enum ipp_degamma_mode mode);
void ippn10_set_degamma_pwl(struct transform *xfm_base, void dpp1_set_degamma_pwl(struct dpp *dpp_base,
const struct pwl_params *params); const struct pwl_params *params);
bool dpp_get_optimal_number_of_taps( bool dpp_get_optimal_number_of_taps(
struct transform *xfm, struct dpp *dpp,
struct scaler_data *scl_data, struct scaler_data *scl_data,
const struct scaling_taps *in_taps); const struct scaling_taps *in_taps);
void dpp_reset(struct transform *xfm_base); void dpp_reset(struct dpp *dpp_base);
void dcn10_dpp_cm_program_regamma_lut( void dpp1_cm_program_regamma_lut(
struct transform *xfm_base, struct dpp *dpp_base,
const struct pwl_result_data *rgb, const struct pwl_result_data *rgb,
uint32_t num); uint32_t num);
void dcn10_dpp_cm_power_on_regamma_lut( void dpp1_cm_power_on_regamma_lut(
struct transform *xfm_base, struct dpp *dpp_base,
bool power_on); bool power_on);
void dcn10_dpp_cm_configure_regamma_lut( void dpp1_cm_configure_regamma_lut(
struct transform *xfm_base, struct dpp *dpp_base,
bool is_ram_a); bool is_ram_a);
/*program re gamma RAM A*/ /*program re gamma RAM A*/
void dcn10_dpp_cm_program_regamma_luta_settings( void dpp1_cm_program_regamma_luta_settings(
struct transform *xfm_base, struct dpp *dpp_base,
const struct pwl_params *params); const struct pwl_params *params);
/*program re gamma RAM B*/ /*program re gamma RAM B*/
void dcn10_dpp_cm_program_regamma_lutb_settings( void dpp1_cm_program_regamma_lutb_settings(
struct transform *xfm_base, struct dpp *dpp_base,
const struct pwl_params *params); const struct pwl_params *params);
void dcn10_dpp_cm_set_output_csc_adjustment( void dpp1_cm_set_output_csc_adjustment(
struct transform *xfm_base, struct dpp *dpp_base,
const struct out_csc_color_matrix *tbl_entry); const struct out_csc_color_matrix *tbl_entry);
void dcn10_dpp_cm_set_output_csc_default( void dpp1_cm_set_output_csc_default(
struct transform *xfm_base, struct dpp *dpp_base,
const struct default_adjustment *default_adjust); const struct default_adjustment *default_adjust);
void dcn10_dpp_cm_set_gamut_remap( void dpp1_cm_set_gamut_remap(
struct transform *xfm, struct dpp *dpp,
const struct xfm_grph_csc_adjustment *adjust); const struct dpp_grph_csc_adjustment *adjust);
void dcn10_dpp_dscl_set_scaler_manual_scale( void dpp1_dscl_set_scaler_manual_scale(
struct transform *xfm_base, struct dpp *dpp_base,
const struct scaler_data *scl_data); const struct scaler_data *scl_data);
void ippn10_cnv_setup ( void dpp1_cnv_setup (
struct transform *xfm_base, struct dpp *dpp_base,
enum surface_pixel_format input_format, enum surface_pixel_format input_format,
enum expansion_mode mode); enum expansion_mode mode);
void ippn10_full_bypass(struct transform *xfm_base); void dpp1_full_bypass(struct dpp *dpp_base);
void dcn10_dpp_construct(struct dcn10_dpp *xfm110, void dpp1_construct(struct dcn10_dpp *dpp1,
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst, uint32_t inst,
const struct dcn_dpp_registers *tf_regs, const struct dcn_dpp_registers *tf_regs,
......
...@@ -895,10 +895,10 @@ static void dcn10_init_hw(struct dc *dc) ...@@ -895,10 +895,10 @@ static void dcn10_init_hw(struct dc *dc)
} }
for (i = 0; i < dc->res_pool->pipe_count; i++) { for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct transform *xfm = dc->res_pool->transforms[i]; struct dpp *dpp = dc->res_pool->dpps[i];
struct timing_generator *tg = dc->res_pool->timing_generators[i]; struct timing_generator *tg = dc->res_pool->timing_generators[i];
xfm->funcs->transform_reset(xfm); dpp->funcs->dpp_reset(dpp);
dc->res_pool->mpc->funcs->remove( dc->res_pool->mpc->funcs->remove(
dc->res_pool->mpc, &(dc->res_pool->opps[i]->mpc_tree), dc->res_pool->mpc, &(dc->res_pool->opps[i]->mpc_tree),
dc->res_pool->opps[i]->inst, i); dc->res_pool->opps[i]->inst, i);
...@@ -1146,14 +1146,14 @@ static void plane_atomic_disable(struct dc *dc, ...@@ -1146,14 +1146,14 @@ static void plane_atomic_disable(struct dc *dc,
static void plane_atomic_power_down(struct dc *dc, int fe_idx) static void plane_atomic_power_down(struct dc *dc, int fe_idx)
{ {
struct dce_hwseq *hws = dc->hwseq; struct dce_hwseq *hws = dc->hwseq;
struct transform *xfm = dc->res_pool->transforms[fe_idx]; struct dpp *dpp = dc->res_pool->dpps[fe_idx];
if (REG(DC_IP_REQUEST_CNTL)) { if (REG(DC_IP_REQUEST_CNTL)) {
REG_SET(DC_IP_REQUEST_CNTL, 0, REG_SET(DC_IP_REQUEST_CNTL, 0,
IP_REQUEST_EN, 1); IP_REQUEST_EN, 1);
dpp_pg_control(hws, fe_idx, false); dpp_pg_control(hws, fe_idx, false);
hubp_pg_control(hws, fe_idx, false); hubp_pg_control(hws, fe_idx, false);
xfm->funcs->transform_reset(xfm); dpp->funcs->dpp_reset(dpp);
REG_SET(DC_IP_REQUEST_CNTL, 0, REG_SET(DC_IP_REQUEST_CNTL, 0,
IP_REQUEST_EN, 0); IP_REQUEST_EN, 0);
dm_logger_write(dc->ctx->logger, LOG_DEBUG, dm_logger_write(dc->ctx->logger, LOG_DEBUG,
...@@ -1203,7 +1203,7 @@ static void reset_front_end( ...@@ -1203,7 +1203,7 @@ static void reset_front_end(
static void dcn10_power_down_fe(struct dc *dc, int fe_idx) static void dcn10_power_down_fe(struct dc *dc, int fe_idx)
{ {
struct dce_hwseq *hws = dc->hwseq; struct dce_hwseq *hws = dc->hwseq;
struct transform *xfm = dc->res_pool->transforms[fe_idx]; struct dpp *dpp = dc->res_pool->dpps[fe_idx];
reset_front_end(dc, fe_idx); reset_front_end(dc, fe_idx);
...@@ -1211,7 +1211,7 @@ static void dcn10_power_down_fe(struct dc *dc, int fe_idx) ...@@ -1211,7 +1211,7 @@ static void dcn10_power_down_fe(struct dc *dc, int fe_idx)
IP_REQUEST_EN, 1); IP_REQUEST_EN, 1);
dpp_pg_control(hws, fe_idx, false); dpp_pg_control(hws, fe_idx, false);
hubp_pg_control(hws, fe_idx, false); hubp_pg_control(hws, fe_idx, false);
xfm->funcs->transform_reset(xfm); dpp->funcs->dpp_reset(dpp);
REG_SET(DC_IP_REQUEST_CNTL, 0, REG_SET(DC_IP_REQUEST_CNTL, 0,
IP_REQUEST_EN, 0); IP_REQUEST_EN, 0);
dm_logger_write(dc->ctx->logger, LOG_DEBUG, dm_logger_write(dc->ctx->logger, LOG_DEBUG,
...@@ -1365,34 +1365,34 @@ static void dcn10_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_c ...@@ -1365,34 +1365,34 @@ static void dcn10_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_c
static bool dcn10_set_input_transfer_func( static bool dcn10_set_input_transfer_func(
struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state) struct pipe_ctx *pipe_ctx, const struct dc_plane_state *plane_state)
{ {
struct transform *xfm_base = pipe_ctx->plane_res.xfm; struct dpp *dpp_base = pipe_ctx->plane_res.dpp;
const struct dc_transfer_func *tf = NULL; const struct dc_transfer_func *tf = NULL;
bool result = true; bool result = true;
if (xfm_base == NULL) if (dpp_base == NULL)
return false; return false;
if (plane_state->in_transfer_func) if (plane_state->in_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))
xfm_base->funcs->ipp_program_input_lut(xfm_base, dpp_base->funcs->ipp_program_input_lut(dpp_base,
plane_state->gamma_correction); plane_state->gamma_correction);
if (tf == NULL) if (tf == NULL)
xfm_base->funcs->ipp_set_degamma(xfm_base, IPP_DEGAMMA_MODE_BYPASS); dpp_base->funcs->ipp_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:
xfm_base->funcs->ipp_set_degamma(xfm_base, dpp_base->funcs->ipp_set_degamma(dpp_base,
IPP_DEGAMMA_MODE_HW_sRGB); IPP_DEGAMMA_MODE_HW_sRGB);
break; break;
case TRANSFER_FUNCTION_BT709: case TRANSFER_FUNCTION_BT709:
xfm_base->funcs->ipp_set_degamma(xfm_base, dpp_base->funcs->ipp_set_degamma(dpp_base,
IPP_DEGAMMA_MODE_HW_xvYCC); IPP_DEGAMMA_MODE_HW_xvYCC);
break; break;
case TRANSFER_FUNCTION_LINEAR: case TRANSFER_FUNCTION_LINEAR:
xfm_base->funcs->ipp_set_degamma(xfm_base, dpp_base->funcs->ipp_set_degamma(dpp_base,
IPP_DEGAMMA_MODE_BYPASS); IPP_DEGAMMA_MODE_BYPASS);
break; break;
case TRANSFER_FUNCTION_PQ: case TRANSFER_FUNCTION_PQ:
...@@ -1403,7 +1403,7 @@ static bool dcn10_set_input_transfer_func( ...@@ -1403,7 +1403,7 @@ static bool dcn10_set_input_transfer_func(
break; break;
} }
} else if (tf->type == TF_TYPE_BYPASS) { } else if (tf->type == TF_TYPE_BYPASS) {
xfm_base->funcs->ipp_set_degamma(xfm_base, IPP_DEGAMMA_MODE_BYPASS); dpp_base->funcs->ipp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_BYPASS);
} else { } else {
/*TF_TYPE_DISTRIBUTED_POINTS*/ /*TF_TYPE_DISTRIBUTED_POINTS*/
result = false; result = false;
...@@ -1730,25 +1730,25 @@ static bool dcn10_set_output_transfer_func( ...@@ -1730,25 +1730,25 @@ static bool dcn10_set_output_transfer_func(
struct pipe_ctx *pipe_ctx, 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 dpp *dpp = pipe_ctx->plane_res.dpp;
if (xfm == NULL) if (dpp == NULL)
return false; return false;
xfm->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 == stream->out_transfer_func->tf ==
TRANSFER_FUNCTION_SRGB) { TRANSFER_FUNCTION_SRGB) {
xfm->funcs->opp_set_regamma_mode(xfm, OPP_REGAMMA_SRGB); dpp->funcs->opp_set_regamma_mode(dpp, OPP_REGAMMA_SRGB);
} else if (dcn10_translate_regamma_to_hw_format( } else if (dcn10_translate_regamma_to_hw_format(
stream->out_transfer_func, &xfm->regamma_params)) { stream->out_transfer_func, &dpp->regamma_params)) {
xfm->funcs->opp_program_regamma_pwl(xfm, &xfm->regamma_params); dpp->funcs->opp_program_regamma_pwl(dpp, &dpp->regamma_params);
xfm->funcs->opp_set_regamma_mode(xfm, OPP_REGAMMA_USER); dpp->funcs->opp_set_regamma_mode(dpp, OPP_REGAMMA_USER);
} else { } else {
xfm->funcs->opp_set_regamma_mode(xfm, OPP_REGAMMA_BYPASS); dpp->funcs->opp_set_regamma_mode(dpp, OPP_REGAMMA_BYPASS);
} }
return true; return true;
...@@ -2033,7 +2033,7 @@ static void dcn10_power_on_fe( ...@@ -2033,7 +2033,7 @@ static void dcn10_power_on_fe(
static void program_gamut_remap(struct pipe_ctx *pipe_ctx) static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
{ {
struct xfm_grph_csc_adjustment adjust; struct dpp_grph_csc_adjustment adjust;
memset(&adjust, 0, sizeof(adjust)); memset(&adjust, 0, sizeof(adjust));
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
...@@ -2069,7 +2069,7 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx) ...@@ -2069,7 +2069,7 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
gamut_remap_matrix.matrix[10]; gamut_remap_matrix.matrix[10];
} }
pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust); pipe_ctx->plane_res.dpp->funcs->dpp_set_gamut_remap(pipe_ctx->plane_res.dpp, &adjust);
} }
...@@ -2091,7 +2091,7 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx, ...@@ -2091,7 +2091,7 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx,
tbl_entry.color_space = color_space; tbl_entry.color_space = color_space;
//tbl_entry.regval = matrix; //tbl_entry.regval = matrix;
pipe_ctx->plane_res.xfm->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.xfm, &tbl_entry); pipe_ctx->plane_res.dpp->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.dpp, &tbl_entry);
} }
} }
static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx) static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx)
...@@ -2275,7 +2275,7 @@ static void update_dchubp_dpp( ...@@ -2275,7 +2275,7 @@ static void update_dchubp_dpp(
{ {
struct dce_hwseq *hws = dc->hwseq; struct dce_hwseq *hws = dc->hwseq;
struct hubp *hubp = pipe_ctx->plane_res.hubp; struct hubp *hubp = pipe_ctx->plane_res.hubp;
struct transform *xfm = pipe_ctx->plane_res.xfm; struct dpp *dpp = pipe_ctx->plane_res.dpp;
struct dc_plane_state *plane_state = pipe_ctx->plane_state; struct dc_plane_state *plane_state = pipe_ctx->plane_state;
union plane_size size = plane_state->plane_size; union plane_size size = plane_state->plane_size;
struct mpcc_cfg mpcc_cfg = {0}; struct mpcc_cfg mpcc_cfg = {0};
...@@ -2317,7 +2317,7 @@ static void update_dchubp_dpp( ...@@ -2317,7 +2317,7 @@ static void update_dchubp_dpp(
hws hws
); );
xfm->funcs->ipp_setup(xfm, dpp->funcs->ipp_setup(dpp,
plane_state->format, plane_state->format,
EXPANSION_MODE_ZERO); EXPANSION_MODE_ZERO);
...@@ -2346,8 +2346,9 @@ static void update_dchubp_dpp( ...@@ -2346,8 +2346,9 @@ static void update_dchubp_dpp(
pipe_ctx->plane_res.scl_data.lb_params.alpha_en = per_pixel_alpha; pipe_ctx->plane_res.scl_data.lb_params.alpha_en = per_pixel_alpha;
pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP; pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
/* scaler configuration */ /* scaler configuration */
pipe_ctx->plane_res.xfm->funcs->transform_set_scaler( pipe_ctx->plane_res.dpp->funcs->dpp_set_scaler(
pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data); pipe_ctx->plane_res.dpp, &pipe_ctx->plane_res.scl_data);
hubp->funcs->mem_program_viewport(hubp, hubp->funcs->mem_program_viewport(hubp,
&pipe_ctx->plane_res.scl_data.viewport, &pipe_ctx->plane_res.scl_data.viewport_c); &pipe_ctx->plane_res.scl_data.viewport, &pipe_ctx->plane_res.scl_data.viewport_c);
......
...@@ -446,13 +446,13 @@ static const struct dc_debug debug_defaults_diags = { ...@@ -446,13 +446,13 @@ static const struct dc_debug debug_defaults_diags = {
.disable_pplib_wm_range = true .disable_pplib_wm_range = true
}; };
static void dcn10_dpp_destroy(struct transform **xfm) static void dcn10_dpp_destroy(struct dpp **dpp)
{ {
kfree(TO_DCN10_DPP(*xfm)); kfree(TO_DCN10_DPP(*dpp));
*xfm = NULL; *dpp = NULL;
} }
static struct transform *dcn10_dpp_create( static struct dpp *dcn10_dpp_create(
struct dc_context *ctx, struct dc_context *ctx,
uint32_t inst) uint32_t inst)
{ {
...@@ -462,8 +462,8 @@ static struct transform *dcn10_dpp_create( ...@@ -462,8 +462,8 @@ static struct transform *dcn10_dpp_create(
if (!dpp) if (!dpp)
return NULL; return NULL;
dcn10_dpp_construct(dpp, ctx, inst, dpp1_construct(dpp, ctx, inst,
&tf_regs[inst], &tf_shift, &tf_mask); &tf_regs[inst], &tf_shift, &tf_mask);
return &dpp->base; return &dpp->base;
} }
...@@ -702,8 +702,8 @@ static void destruct(struct dcn10_resource_pool *pool) ...@@ -702,8 +702,8 @@ static void destruct(struct dcn10_resource_pool *pool)
if (pool->base.opps[i] != NULL) if (pool->base.opps[i] != NULL)
pool->base.opps[i]->funcs->opp_destroy(&pool->base.opps[i]); pool->base.opps[i]->funcs->opp_destroy(&pool->base.opps[i]);
if (pool->base.transforms[i] != NULL) if (pool->base.dpps[i] != NULL)
dcn10_dpp_destroy(&pool->base.transforms[i]); dcn10_dpp_destroy(&pool->base.dpps[i]);
if (pool->base.ipps[i] != NULL) if (pool->base.ipps[i] != NULL)
pool->base.ipps[i]->funcs->ipp_destroy(&pool->base.ipps[i]); pool->base.ipps[i]->funcs->ipp_destroy(&pool->base.ipps[i]);
...@@ -924,7 +924,7 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer( ...@@ -924,7 +924,7 @@ static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer(
idle_pipe->plane_res.hubp = pool->hubps[idle_pipe->pipe_idx]; idle_pipe->plane_res.hubp = pool->hubps[idle_pipe->pipe_idx];
idle_pipe->plane_res.ipp = pool->ipps[idle_pipe->pipe_idx]; idle_pipe->plane_res.ipp = pool->ipps[idle_pipe->pipe_idx];
idle_pipe->plane_res.xfm = pool->transforms[idle_pipe->pipe_idx]; idle_pipe->plane_res.dpp = pool->dpps[idle_pipe->pipe_idx];
return idle_pipe; return idle_pipe;
} }
...@@ -1377,8 +1377,8 @@ static bool construct( ...@@ -1377,8 +1377,8 @@ static bool construct(
goto ipp_create_fail; goto ipp_create_fail;
} }
pool->base.transforms[j] = dcn10_dpp_create(ctx, i); pool->base.dpps[j] = dcn10_dpp_create(ctx, i);
if (pool->base.transforms[j] == NULL) { if (pool->base.dpps[j] == NULL) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
dm_error( dm_error(
"DC: failed to create dpp!\n"); "DC: failed to create dpp!\n");
......
...@@ -84,6 +84,7 @@ void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable); ...@@ -84,6 +84,7 @@ void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable);
/********** DAL Core*********************/ /********** DAL Core*********************/
#include "display_clock.h" #include "display_clock.h"
#include "transform.h" #include "transform.h"
#include "dpp.h"
struct resource_pool; struct resource_pool;
struct dc_state; struct dc_state;
...@@ -133,6 +134,7 @@ struct resource_pool { ...@@ -133,6 +134,7 @@ struct resource_pool {
struct hubp *hubps[MAX_PIPES]; struct hubp *hubps[MAX_PIPES];
struct input_pixel_processor *ipps[MAX_PIPES]; struct input_pixel_processor *ipps[MAX_PIPES];
struct transform *transforms[MAX_PIPES]; struct transform *transforms[MAX_PIPES];
struct dpp *dpps[MAX_PIPES];
struct output_pixel_processor *opps[MAX_PIPES]; struct output_pixel_processor *opps[MAX_PIPES];
struct timing_generator *timing_generators[MAX_PIPES]; struct timing_generator *timing_generators[MAX_PIPES];
struct stream_encoder *stream_enc[MAX_PIPES * 2]; struct stream_encoder *stream_enc[MAX_PIPES * 2];
...@@ -184,6 +186,7 @@ struct plane_resource { ...@@ -184,6 +186,7 @@ struct plane_resource {
struct mem_input *mi; struct mem_input *mi;
struct input_pixel_processor *ipp; struct input_pixel_processor *ipp;
struct transform *xfm; struct transform *xfm;
struct dpp *dpp;
}; };
struct pipe_ctx { struct pipe_ctx {
......
/*
* Copyright 2012-15 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DAL_DPP_H__
#define __DAL_DPP_H__
#include "transform.h"
struct dpp {
const struct dpp_funcs *funcs;
struct dc_context *ctx;
int inst;
struct dpp_caps *caps;
struct pwl_params regamma_params;
};
struct dpp_grph_csc_adjustment {
struct fixed31_32 temperature_matrix[CSC_TEMPERATURE_MATRIX_SIZE];
enum graphics_gamut_adjust_type gamut_adjust_type;
};
struct dpp_funcs {
void (*dpp_reset)(struct dpp *dpp);
void (*dpp_set_scaler)(struct dpp *dpp,
const struct scaler_data *scl_data);
void (*dpp_set_pixel_storage_depth)(
struct dpp *dpp,
enum lb_pixel_depth depth,
const struct bit_depth_reduction_params *bit_depth_params);
bool (*dpp_get_optimal_number_of_taps)(
struct dpp *dpp,
struct scaler_data *scl_data,
const struct scaling_taps *in_taps);
void (*dpp_set_gamut_remap)(
struct dpp *dpp,
const struct dpp_grph_csc_adjustment *adjust);
void (*opp_set_csc_default)(
struct dpp *dpp,
const struct default_adjustment *default_adjust);
void (*opp_set_csc_adjustment)(
struct dpp *dpp,
const struct out_csc_color_matrix *tbl_entry);
void (*opp_power_on_regamma_lut)(
struct dpp *dpp,
bool power_on);
void (*opp_program_regamma_lut)(
struct dpp *dpp,
const struct pwl_result_data *rgb,
uint32_t num);
void (*opp_configure_regamma_lut)(
struct dpp *dpp,
bool is_ram_a);
void (*opp_program_regamma_lutb_settings)(
struct dpp *dpp,
const struct pwl_params *params);
void (*opp_program_regamma_luta_settings)(
struct dpp *dpp,
const struct pwl_params *params);
void (*opp_program_regamma_pwl)(
struct dpp *dpp, const struct pwl_params *params);
void (*opp_set_regamma_mode)(
struct dpp *dpp_base,
enum opp_regamma mode);
void (*ipp_set_degamma)(
struct dpp *dpp_base,
enum ipp_degamma_mode mode);
void (*ipp_program_input_lut)(
struct dpp *dpp_base,
const struct dc_gamma *gamma);
void (*ipp_program_degamma_pwl)(struct dpp *dpp_base,
const struct pwl_params *params);
void (*ipp_setup)(
struct dpp *dpp_base,
enum surface_pixel_format input_format,
enum expansion_mode mode);
void (*ipp_full_bypass)(struct dpp *dpp_base);
void (*set_cursor_attributes)(
struct dpp *dpp_base,
const struct dc_cursor_attributes *attr);
void (*set_cursor_position)(
struct dpp *dpp_base,
const struct dc_cursor_position *pos,
const struct dc_cursor_mi_param *param,
uint32_t width
);
};
#endif
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