1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#include "dm_services.h"
27#include "dce_calcs.h"
28#include "reg_helper.h"
29#include "basics/conversion.h"
30#include "dcn31_hubp.h"
31
32#define REG(reg)\
33 hubp2->hubp_regs->reg
34
35#define CTX \
36 hubp2->base.ctx
37
38#undef FN
39#define FN(reg_name, field_name) \
40 hubp2->hubp_shift->field_name, hubp2->hubp_mask->field_name
41
42void hubp31_set_unbounded_requesting(struct hubp *hubp, bool enable)
43{
44 struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp);
45
46 REG_UPDATE(DCHUBP_CNTL, HUBP_UNBOUNDED_REQ_MODE, enable);
47 REG_UPDATE(CURSOR_CONTROL, CURSOR_REQ_MODE, enable);
48}
49
50void hubp31_soft_reset(struct hubp *hubp, bool reset)
51{
52 struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp);
53
54 REG_UPDATE(DCHUBP_CNTL, HUBP_SOFT_RESET, reset);
55}
56
57static struct hubp_funcs dcn31_hubp_funcs = {
58 .hubp_enable_tripleBuffer = hubp2_enable_triplebuffer,
59 .hubp_is_triplebuffer_enabled = hubp2_is_triplebuffer_enabled,
60 .hubp_program_surface_flip_and_addr = hubp3_program_surface_flip_and_addr,
61 .hubp_program_surface_config = hubp3_program_surface_config,
62 .hubp_is_flip_pending = hubp2_is_flip_pending,
63 .hubp_setup = hubp3_setup,
64 .hubp_setup_interdependent = hubp2_setup_interdependent,
65 .hubp_set_vm_system_aperture_settings = hubp3_set_vm_system_aperture_settings,
66 .set_blank = hubp2_set_blank,
67 .dcc_control = hubp3_dcc_control,
68 .mem_program_viewport = min_set_viewport,
69 .set_cursor_attributes = hubp2_cursor_set_attributes,
70 .set_cursor_position = hubp2_cursor_set_position,
71 .hubp_clk_cntl = hubp2_clk_cntl,
72 .hubp_vtg_sel = hubp2_vtg_sel,
73 .dmdata_set_attributes = hubp3_dmdata_set_attributes,
74 .dmdata_load = hubp2_dmdata_load,
75 .dmdata_status_done = hubp2_dmdata_status_done,
76 .hubp_read_state = hubp3_read_state,
77 .hubp_clear_underflow = hubp2_clear_underflow,
78 .hubp_set_flip_control_surface_gsl = hubp2_set_flip_control_surface_gsl,
79 .hubp_init = hubp3_init,
80 .set_unbounded_requesting = hubp31_set_unbounded_requesting,
81 .hubp_soft_reset = hubp31_soft_reset,
82 .hubp_in_blank = hubp1_in_blank,
83};
84
85bool hubp31_construct(
86 struct dcn20_hubp *hubp2,
87 struct dc_context *ctx,
88 uint32_t inst,
89 const struct dcn_hubp2_registers *hubp_regs,
90 const struct dcn_hubp2_shift *hubp_shift,
91 const struct dcn_hubp2_mask *hubp_mask)
92{
93 hubp2->base.funcs = &dcn31_hubp_funcs;
94 hubp2->base.ctx = ctx;
95 hubp2->hubp_regs = hubp_regs;
96 hubp2->hubp_shift = hubp_shift;
97 hubp2->hubp_mask = hubp_mask;
98 hubp2->base.inst = inst;
99 hubp2->base.opp_id = OPP_ID_INVALID;
100 hubp2->base.mpcc_id = 0xf;
101
102 return true;
103}
104