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