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 #ifndef __DISPLAY_MODE_LIB_H__
26 #define __DISPLAY_MODE_LIB_H__
27
28
29 #include "dml_common_defs.h"
30 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
31 #include "display_mode_vba.h"
32 #endif
33
34 enum dml_project {
35 DML_PROJECT_UNDEFINED,
36 DML_PROJECT_RAVEN1,
37 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
38 DML_PROJECT_NAVI10,
39 DML_PROJECT_NAVI10v2,
40 #endif
41 #ifdef CONFIG_DRM_AMD_DC_DCN2_1
42 DML_PROJECT_DCN21,
43 #endif
44 };
45
46 struct display_mode_lib;
47
48 struct dml_funcs {
49 void (*rq_dlg_get_dlg_reg)(
50 struct display_mode_lib *mode_lib,
51 display_dlg_regs_st *dlg_regs,
52 display_ttu_regs_st *ttu_regs,
53 display_e2e_pipe_params_st *e2e_pipe_param,
54 const unsigned int num_pipes,
55 const unsigned int pipe_idx,
56 const bool cstate_en,
57 const bool pstate_en,
58 const bool vm_en,
59 const bool ignore_viewport_pos,
60 const bool immediate_flip_support);
61 void (*rq_dlg_get_rq_reg)(
62 struct display_mode_lib *mode_lib,
63 display_rq_regs_st *rq_regs,
64 const display_pipe_params_st pipe_param);
65 void (*recalculate)(struct display_mode_lib *mode_lib);
66 void (*validate)(struct display_mode_lib *mode_lib);
67 };
68
69 struct display_mode_lib {
70 struct _vcs_dpi_ip_params_st ip;
71 struct _vcs_dpi_soc_bounding_box_st soc;
72 enum dml_project project;
73 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
74 struct vba_vars_st vba;
75 #endif
76 struct dal_logger *logger;
77 struct dml_funcs funcs;
78 };
79
80 void dml_init_instance(struct display_mode_lib *lib,
81 const struct _vcs_dpi_soc_bounding_box_st *soc_bb,
82 const struct _vcs_dpi_ip_params_st *ip_params,
83 enum dml_project project);
84
85 const char *dml_get_status_message(enum dm_validation_status status);
86
87 #endif