|
@@ -29,18 +29,18 @@
|
|
|
#include "basics/conversion.h"
|
|
|
|
|
|
#define REG(reg)\
|
|
|
- mi->mi_regs->reg
|
|
|
+ hubp1->mi_regs->reg
|
|
|
|
|
|
#define CTX \
|
|
|
- mi->base.ctx
|
|
|
+ hubp1->base.ctx
|
|
|
|
|
|
#undef FN
|
|
|
#define FN(reg_name, field_name) \
|
|
|
- mi->mi_shift->field_name, mi->mi_mask->field_name
|
|
|
+ hubp1->mi_shift->field_name, hubp1->mi_mask->field_name
|
|
|
|
|
|
-void hubp1_set_blank(struct mem_input *mem_input, bool blank)
|
|
|
+void hubp1_set_blank(struct hubp *hubp, bool blank)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
uint32_t blank_en = blank ? 1 : 0;
|
|
|
|
|
|
REG_UPDATE_2(DCHUBP_CNTL,
|
|
@@ -51,24 +51,24 @@ void hubp1_set_blank(struct mem_input *mem_input, bool blank)
|
|
|
REG_WAIT(DCHUBP_CNTL,
|
|
|
HUBP_NO_OUTSTANDING_REQ, 1,
|
|
|
1, 200);
|
|
|
- mem_input->mpcc_id = 0xf;
|
|
|
- mem_input->opp_id = 0xf;
|
|
|
+ hubp->mpcc_id = 0xf;
|
|
|
+ hubp->opp_id = 0xf;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void hubp1_set_hubp_blank_en(struct mem_input *mem_input, bool blank)
|
|
|
+static void hubp1_set_hubp_blank_en(struct hubp *hubp, bool blank)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
uint32_t blank_en = blank ? 1 : 0;
|
|
|
|
|
|
REG_UPDATE(DCHUBP_CNTL, HUBP_BLANK_EN, blank_en);
|
|
|
}
|
|
|
|
|
|
-static void hubp1_vready_workaround(struct mem_input *mem_input,
|
|
|
+static void hubp1_vready_workaround(struct hubp *hubp,
|
|
|
struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest)
|
|
|
{
|
|
|
uint32_t value = 0;
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
/* set HBUBREQ_DEBUG_DB[12] = 1 */
|
|
|
value = REG_READ(HUBPREQ_DEBUG_DB);
|
|
@@ -88,7 +88,7 @@ static void hubp1_vready_workaround(struct mem_input *mem_input,
|
|
|
}
|
|
|
|
|
|
void hubp1_program_tiling(
|
|
|
- struct dcn10_mem_input *mi,
|
|
|
+ struct dcn10_hubp *hubp1,
|
|
|
const union dc_tiling_info *info,
|
|
|
const enum surface_pixel_format pixel_format)
|
|
|
{
|
|
@@ -108,7 +108,7 @@ void hubp1_program_tiling(
|
|
|
}
|
|
|
|
|
|
void hubp1_program_size_and_rotation(
|
|
|
- struct dcn10_mem_input *mi,
|
|
|
+ struct dcn10_hubp *hubp1,
|
|
|
enum dc_rotation_angle rotation,
|
|
|
enum surface_pixel_format format,
|
|
|
const union plane_size *plane_size,
|
|
@@ -170,7 +170,7 @@ void hubp1_program_size_and_rotation(
|
|
|
}
|
|
|
|
|
|
void hubp1_program_pixel_format(
|
|
|
- struct dcn10_mem_input *mi,
|
|
|
+ struct dcn10_hubp *hubp1,
|
|
|
enum surface_pixel_format format)
|
|
|
{
|
|
|
uint32_t red_bar = 3;
|
|
@@ -246,11 +246,11 @@ void hubp1_program_pixel_format(
|
|
|
}
|
|
|
|
|
|
bool hubp1_program_surface_flip_and_addr(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
const struct dc_plane_address *address,
|
|
|
bool flip_immediate)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
/* program flip type */
|
|
|
REG_SET(DCSURF_FLIP_CONTROL, 0,
|
|
@@ -387,20 +387,20 @@ bool hubp1_program_surface_flip_and_addr(
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- mem_input->request_address = *address;
|
|
|
+ hubp->request_address = *address;
|
|
|
|
|
|
if (flip_immediate)
|
|
|
- mem_input->current_address = *address;
|
|
|
+ hubp->current_address = *address;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void hubp1_dcc_control(struct mem_input *mem_input, bool enable,
|
|
|
+void hubp1_dcc_control(struct hubp *hubp, bool enable,
|
|
|
bool independent_64b_blks)
|
|
|
{
|
|
|
uint32_t dcc_en = enable ? 1 : 0;
|
|
|
uint32_t dcc_ind_64b_blk = independent_64b_blks ? 1 : 0;
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
REG_UPDATE_2(DCSURF_SURFACE_CONTROL,
|
|
|
PRIMARY_SURFACE_DCC_EN, dcc_en,
|
|
@@ -408,7 +408,7 @@ void hubp1_dcc_control(struct mem_input *mem_input, bool enable,
|
|
|
}
|
|
|
|
|
|
void hubp1_program_surface_config(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
enum surface_pixel_format format,
|
|
|
union dc_tiling_info *tiling_info,
|
|
|
union plane_size *plane_size,
|
|
@@ -416,20 +416,20 @@ void hubp1_program_surface_config(
|
|
|
struct dc_plane_dcc_param *dcc,
|
|
|
bool horizontal_mirror)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
- hubp1_dcc_control(mem_input, dcc->enable, dcc->grph.independent_64b_blks);
|
|
|
- hubp1_program_tiling(mi, tiling_info, format);
|
|
|
+ hubp1_dcc_control(hubp, dcc->enable, dcc->grph.independent_64b_blks);
|
|
|
+ hubp1_program_tiling(hubp1, tiling_info, format);
|
|
|
hubp1_program_size_and_rotation(
|
|
|
- mi, rotation, format, plane_size, dcc, horizontal_mirror);
|
|
|
- hubp1_program_pixel_format(mi, format);
|
|
|
+ hubp1, rotation, format, plane_size, dcc, horizontal_mirror);
|
|
|
+ hubp1_program_pixel_format(hubp1, format);
|
|
|
}
|
|
|
|
|
|
void hubp1_program_requestor(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
struct _vcs_dpi_display_rq_regs_st *rq_regs)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
REG_UPDATE(HUBPRET_CONTROL,
|
|
|
DET_BUF_PLANE1_BASE_ADDRESS, rq_regs->plane1_base_address);
|
|
@@ -460,11 +460,11 @@ void hubp1_program_requestor(
|
|
|
|
|
|
|
|
|
void hubp1_program_deadline(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
struct _vcs_dpi_display_dlg_regs_st *dlg_attr,
|
|
|
struct _vcs_dpi_display_ttu_regs_st *ttu_attr)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
/* DLG - Per hubp */
|
|
|
REG_SET_2(BLANK_OFFSET_0, 0,
|
|
@@ -581,7 +581,7 @@ void hubp1_program_deadline(
|
|
|
}
|
|
|
|
|
|
static void hubp1_setup(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
struct _vcs_dpi_display_dlg_regs_st *dlg_attr,
|
|
|
struct _vcs_dpi_display_ttu_regs_st *ttu_attr,
|
|
|
struct _vcs_dpi_display_rq_regs_st *rq_regs,
|
|
@@ -590,27 +590,15 @@ static void hubp1_setup(
|
|
|
/* otg is locked when this func is called. Register are double buffered.
|
|
|
* disable the requestors is not needed
|
|
|
*/
|
|
|
- hubp1_program_requestor(mem_input, rq_regs);
|
|
|
- hubp1_program_deadline(mem_input, dlg_attr, ttu_attr);
|
|
|
- hubp1_vready_workaround(mem_input, pipe_dest);
|
|
|
+ hubp1_program_requestor(hubp, rq_regs);
|
|
|
+ hubp1_program_deadline(hubp, dlg_attr, ttu_attr);
|
|
|
+ hubp1_vready_workaround(hubp, pipe_dest);
|
|
|
}
|
|
|
|
|
|
-void hubp1_program_display_marks(
|
|
|
- struct mem_input *mem_input,
|
|
|
- struct dce_watermarks nbp,
|
|
|
- struct dce_watermarks stutter,
|
|
|
- struct dce_watermarks urgent,
|
|
|
- uint32_t total_dest_line_time_ns)
|
|
|
-{
|
|
|
- /* only for dce
|
|
|
- * dcn use only program_watermarks
|
|
|
- */
|
|
|
-}
|
|
|
-
|
|
|
-bool hubp1_is_flip_pending(struct mem_input *mem_input)
|
|
|
+bool hubp1_is_flip_pending(struct hubp *hubp)
|
|
|
{
|
|
|
uint32_t flip_pending = 0;
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
struct dc_plane_address earliest_inuse_address;
|
|
|
|
|
|
REG_GET(DCSURF_FLIP_CONTROL,
|
|
@@ -625,20 +613,20 @@ bool hubp1_is_flip_pending(struct mem_input *mem_input)
|
|
|
if (flip_pending)
|
|
|
return true;
|
|
|
|
|
|
- if (earliest_inuse_address.grph.addr.quad_part != mem_input->request_address.grph.addr.quad_part)
|
|
|
+ if (earliest_inuse_address.grph.addr.quad_part != hubp->request_address.grph.addr.quad_part)
|
|
|
return true;
|
|
|
|
|
|
- mem_input->current_address = mem_input->request_address;
|
|
|
+ hubp->current_address = hubp->request_address;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
uint32_t aperture_default_system = 1;
|
|
|
uint32_t context0_default_system; /* = 0;*/
|
|
|
|
|
|
-static void hubp1_set_vm_system_aperture_settings(struct mem_input *mem_input,
|
|
|
+static void hubp1_set_vm_system_aperture_settings(struct hubp *hubp,
|
|
|
struct vm_system_aperture_param *apt)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
PHYSICAL_ADDRESS_LOC mc_vm_apt_default;
|
|
|
PHYSICAL_ADDRESS_LOC mc_vm_apt_low;
|
|
|
PHYSICAL_ADDRESS_LOC mc_vm_apt_high;
|
|
@@ -664,10 +652,10 @@ static void hubp1_set_vm_system_aperture_settings(struct mem_input *mem_input,
|
|
|
MC_VM_SYSTEM_APERTURE_HIGH_ADDR_LSB, mc_vm_apt_high.low_part);
|
|
|
}
|
|
|
|
|
|
-static void hubp1_set_vm_context0_settings(struct mem_input *mem_input,
|
|
|
+static void hubp1_set_vm_context0_settings(struct hubp *hubp,
|
|
|
const struct vm_context0_param *vm0)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
/* pte base */
|
|
|
REG_SET(DCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_MSB, 0,
|
|
|
VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_MSB, vm0->pte_base.high_part);
|
|
@@ -700,11 +688,11 @@ static void hubp1_set_vm_context0_settings(struct mem_input *mem_input,
|
|
|
}
|
|
|
|
|
|
void min_set_viewport(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
const struct rect *viewport,
|
|
|
const struct rect *viewport_c)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
|
|
|
REG_SET_2(DCSURF_PRI_VIEWPORT_DIMENSION, 0,
|
|
|
PRI_VIEWPORT_WIDTH, viewport->width,
|
|
@@ -733,7 +721,7 @@ void min_set_viewport(
|
|
|
PRI_VIEWPORT_Y_START_C, viewport_c->y);
|
|
|
}
|
|
|
|
|
|
-void dcn10_mem_input_read_state(struct dcn10_mem_input *mi,
|
|
|
+void hubp1_read_state(struct dcn10_hubp *hubp1,
|
|
|
struct dcn_hubp_state *s)
|
|
|
{
|
|
|
REG_GET(DCSURF_SURFACE_CONFIG,
|
|
@@ -783,7 +771,7 @@ enum cursor_lines_per_chunk {
|
|
|
};
|
|
|
|
|
|
static bool ippn10_cursor_program_control(
|
|
|
- struct dcn10_mem_input *mi,
|
|
|
+ struct dcn10_hubp *hubp1,
|
|
|
bool pixel_data_invert,
|
|
|
enum dc_cursor_color_format color_format)
|
|
|
{
|
|
@@ -849,15 +837,15 @@ static enum cursor_lines_per_chunk ippn10_get_lines_per_chunk(
|
|
|
}
|
|
|
|
|
|
void hubp1_cursor_set_attributes(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
const struct dc_cursor_attributes *attr)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
enum cursor_pitch hw_pitch = ippn10_get_cursor_pitch(attr->pitch);
|
|
|
enum cursor_lines_per_chunk lpc = ippn10_get_lines_per_chunk(
|
|
|
attr->width, attr->color_format);
|
|
|
|
|
|
- mem_input->curs_attr = *attr;
|
|
|
+ hubp->curs_attr = *attr;
|
|
|
|
|
|
REG_UPDATE(CURSOR_SURFACE_ADDRESS_HIGH,
|
|
|
CURSOR_SURFACE_ADDRESS_HIGH, attr->address.high_part);
|
|
@@ -871,17 +859,17 @@ void hubp1_cursor_set_attributes(
|
|
|
CURSOR_MODE, attr->color_format,
|
|
|
CURSOR_PITCH, hw_pitch,
|
|
|
CURSOR_LINES_PER_CHUNK, lpc);
|
|
|
- ippn10_cursor_program_control(mi,
|
|
|
+ ippn10_cursor_program_control(hubp1,
|
|
|
attr->attribute_flags.bits.INVERT_PIXEL_DATA,
|
|
|
attr->color_format);
|
|
|
}
|
|
|
|
|
|
void hubp1_cursor_set_position(
|
|
|
- struct mem_input *mem_input,
|
|
|
+ struct hubp *hubp,
|
|
|
const struct dc_cursor_position *pos,
|
|
|
const struct dc_cursor_mi_param *param)
|
|
|
{
|
|
|
- struct dcn10_mem_input *mi = TO_DCN10_MEM_INPUT(mem_input);
|
|
|
+ struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp);
|
|
|
int src_x_offset = pos->x - pos->x_hotspot - param->viewport_x_start;
|
|
|
uint32_t cur_en = pos->enable ? 1 : 0;
|
|
|
uint32_t dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
|
|
@@ -893,7 +881,7 @@ void hubp1_cursor_set_position(
|
|
|
* TODO: Look at combining cursor_set_position() and
|
|
|
* cursor_set_attributes() into cursor_update()
|
|
|
*/
|
|
|
- if (mem_input->curs_attr.address.quad_part == 0)
|
|
|
+ if (hubp->curs_attr.address.quad_part == 0)
|
|
|
return;
|
|
|
|
|
|
dst_x_offset *= param->ref_clk_khz;
|
|
@@ -909,11 +897,11 @@ void hubp1_cursor_set_position(
|
|
|
if (src_x_offset >= (int)param->viewport_width)
|
|
|
cur_en = 0; /* not visible beyond right edge*/
|
|
|
|
|
|
- if (src_x_offset + (int)mem_input->curs_attr.width < 0)
|
|
|
+ if (src_x_offset + (int)hubp->curs_attr.width < 0)
|
|
|
cur_en = 0; /* not visible beyond left edge*/
|
|
|
|
|
|
if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)
|
|
|
- hubp1_cursor_set_attributes(mem_input, &mem_input->curs_attr);
|
|
|
+ hubp1_cursor_set_attributes(hubp, &hubp->curs_attr);
|
|
|
REG_UPDATE(CURSOR_CONTROL,
|
|
|
CURSOR_ENABLE, cur_en);
|
|
|
|
|
@@ -930,16 +918,15 @@ void hubp1_cursor_set_position(
|
|
|
/* TODO Handle surface pixel formats other than 4:4:4 */
|
|
|
}
|
|
|
|
|
|
-static struct mem_input_funcs dcn10_mem_input_funcs = {
|
|
|
- .mem_input_program_display_marks = hubp1_program_display_marks,
|
|
|
- .mem_input_program_surface_flip_and_addr =
|
|
|
+static struct hubp_funcs dcn10_hubp_funcs = {
|
|
|
+ .hubp_program_surface_flip_and_addr =
|
|
|
hubp1_program_surface_flip_and_addr,
|
|
|
- .mem_input_program_surface_config =
|
|
|
+ .hubp_program_surface_config =
|
|
|
hubp1_program_surface_config,
|
|
|
- .mem_input_is_flip_pending = hubp1_is_flip_pending,
|
|
|
- .mem_input_setup = hubp1_setup,
|
|
|
- .mem_input_set_vm_system_aperture_settings = hubp1_set_vm_system_aperture_settings,
|
|
|
- .mem_input_set_vm_context0_settings = hubp1_set_vm_context0_settings,
|
|
|
+ .hubp_is_flip_pending = hubp1_is_flip_pending,
|
|
|
+ .hubp_setup = hubp1_setup,
|
|
|
+ .hubp_set_vm_system_aperture_settings = hubp1_set_vm_system_aperture_settings,
|
|
|
+ .hubp_set_vm_context0_settings = hubp1_set_vm_context0_settings,
|
|
|
.set_blank = hubp1_set_blank,
|
|
|
.dcc_control = hubp1_dcc_control,
|
|
|
.mem_program_viewport = min_set_viewport,
|
|
@@ -952,22 +939,22 @@ static struct mem_input_funcs dcn10_mem_input_funcs = {
|
|
|
/* Constructor, Destructor */
|
|
|
/*****************************************/
|
|
|
|
|
|
-void dcn10_mem_input_construct(
|
|
|
- struct dcn10_mem_input *mi,
|
|
|
+void dcn10_hubp_construct(
|
|
|
+ struct dcn10_hubp *hubp1,
|
|
|
struct dc_context *ctx,
|
|
|
uint32_t inst,
|
|
|
const struct dcn_mi_registers *mi_regs,
|
|
|
const struct dcn_mi_shift *mi_shift,
|
|
|
const struct dcn_mi_mask *mi_mask)
|
|
|
{
|
|
|
- mi->base.funcs = &dcn10_mem_input_funcs;
|
|
|
- mi->base.ctx = ctx;
|
|
|
- mi->mi_regs = mi_regs;
|
|
|
- mi->mi_shift = mi_shift;
|
|
|
- mi->mi_mask = mi_mask;
|
|
|
- mi->base.inst = inst;
|
|
|
- mi->base.opp_id = 0xf;
|
|
|
- mi->base.mpcc_id = 0xf;
|
|
|
+ hubp1->base.funcs = &dcn10_hubp_funcs;
|
|
|
+ hubp1->base.ctx = ctx;
|
|
|
+ hubp1->mi_regs = mi_regs;
|
|
|
+ hubp1->mi_shift = mi_shift;
|
|
|
+ hubp1->mi_mask = mi_mask;
|
|
|
+ hubp1->base.inst = inst;
|
|
|
+ hubp1->base.opp_id = 0xf;
|
|
|
+ hubp1->base.mpcc_id = 0xf;
|
|
|
}
|
|
|
|
|
|
|