2 * Copyright 2012-15 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef __DAL_HUBP_H__
27 #define __DAL_HUBP_H__
29 #include "mem_input.h"
31 #define OPP_ID_INVALID 0xf
35 CURSOR_PITCH_64_PIXELS = 0,
36 CURSOR_PITCH_128_PIXELS,
37 CURSOR_PITCH_256_PIXELS
40 enum cursor_lines_per_chunk {
41 #if defined(CONFIG_DRM_AMD_DC_DCN2_0)
42 CURSOR_LINE_PER_CHUNK_1 = 0, /* new for DCN2 */
44 CURSOR_LINE_PER_CHUNK_2 = 1,
45 CURSOR_LINE_PER_CHUNK_4,
46 CURSOR_LINE_PER_CHUNK_8,
47 CURSOR_LINE_PER_CHUNK_16
51 const struct hubp_funcs *funcs;
52 struct dc_context *ctx;
53 struct dc_plane_address request_address;
59 struct dc_cursor_attributes curs_attr;
66 struct _vcs_dpi_display_dlg_regs_st *dlg_regs,
67 struct _vcs_dpi_display_ttu_regs_st *ttu_regs,
68 struct _vcs_dpi_display_rq_regs_st *rq_regs,
69 struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest);
71 void (*hubp_setup_interdependent)(
73 struct _vcs_dpi_display_dlg_regs_st *dlg_regs,
74 struct _vcs_dpi_display_ttu_regs_st *ttu_regs);
76 void (*dcc_control)(struct hubp *hubp, bool enable,
77 bool independent_64b_blks);
78 void (*mem_program_viewport)(
80 const struct rect *viewport,
81 const struct rect *viewport_c);
83 bool (*hubp_program_surface_flip_and_addr)(
85 const struct dc_plane_address *address,
88 void (*hubp_program_pte_vm)(
90 enum surface_pixel_format format,
91 union dc_tiling_info *tiling_info,
92 enum dc_rotation_angle rotation);
94 void (*hubp_set_vm_system_aperture_settings)(
96 struct vm_system_aperture_param *apt);
98 void (*hubp_set_vm_context0_settings)(
100 const struct vm_context0_param *vm0);
102 void (*hubp_program_surface_config)(
104 enum surface_pixel_format format,
105 union dc_tiling_info *tiling_info,
106 struct plane_size *plane_size,
107 enum dc_rotation_angle rotation,
108 struct dc_plane_dcc_param *dcc,
109 bool horizontal_mirror,
110 unsigned int compa_level);
112 bool (*hubp_is_flip_pending)(struct hubp *hubp);
114 void (*hubp_update_dchub)(struct hubp *hubp,
115 struct dchub_init_data *dh_data);
117 void (*set_blank)(struct hubp *hubp, bool blank);
118 void (*set_hubp_blank_en)(struct hubp *hubp, bool blank);
120 void (*set_cursor_attributes)(
122 const struct dc_cursor_attributes *attr);
124 void (*set_cursor_position)(
126 const struct dc_cursor_position *pos,
127 const struct dc_cursor_mi_param *param);
129 void (*hubp_disconnect)(struct hubp *hubp);
131 void (*hubp_clk_cntl)(struct hubp *hubp, bool enable);
132 void (*hubp_vtg_sel)(struct hubp *hubp, uint32_t otg_inst);
133 void (*hubp_read_state)(struct hubp *hubp);
134 void (*hubp_clear_underflow)(struct hubp *hubp);
135 void (*hubp_disable_control)(struct hubp *hubp, bool disable_hubp);
136 unsigned int (*hubp_get_underflow_status)(struct hubp *hubp);
137 void (*hubp_init)(struct hubp *hubp);
139 #if defined(CONFIG_DRM_AMD_DC_DCN2_0)
140 void (*dmdata_set_attributes)(
142 const struct dc_dmdata_attributes *attr);
146 uint32_t dmdata_sw_size,
147 const uint32_t *dmdata_sw_data);
148 bool (*dmdata_status_done)(struct hubp *hubp);
149 void (*hubp_enable_tripleBuffer)(
153 bool (*hubp_is_triplebuffer_enabled)(
156 void (*hubp_set_flip_control_surface_gsl)(