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 #ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
26 #ifndef __DAL_DSC_H__
27 #define __DAL_DSC_H__
28
29 #include "dc_dsc.h"
30 #include "dc_hw_types.h"
31 #include "dc_dp_types.h"
32
33
34 struct dsc_config {
35 uint32_t pic_width;
36 uint32_t pic_height;
37 enum dc_pixel_encoding pixel_encoding;
38 enum dc_color_depth color_depth;
39 struct dc_dsc_config dc_dsc_cfg;
40 };
41
42
43
44 struct dsc_optc_config {
45 uint32_t slice_width;
46 uint32_t bytes_per_pixel;
47 bool is_pixel_format_444;
48 };
49
50
51 struct dcn_dsc_state {
52 uint32_t dsc_clock_en;
53 uint32_t dsc_slice_width;
54 uint32_t dsc_bytes_per_pixel;
55 };
56
57
58
59
60
61 union dsc_enc_slice_caps {
62 struct {
63 uint8_t NUM_SLICES_1 : 1;
64 uint8_t NUM_SLICES_2 : 1;
65 uint8_t NUM_SLICES_3 : 1;
66 uint8_t NUM_SLICES_4 : 1;
67 uint8_t NUM_SLICES_8 : 1;
68 } bits;
69 uint8_t raw;
70 };
71
72 struct dsc_enc_caps {
73 uint8_t dsc_version;
74 union dsc_enc_slice_caps slice_caps;
75 int32_t lb_bit_depth;
76 bool is_block_pred_supported;
77 union dsc_color_formats color_formats;
78 union dsc_color_depth color_depth;
79 int32_t max_total_throughput_mps;
80 int32_t max_slice_width;
81 uint32_t bpp_increment_div;
82 };
83
84 struct display_stream_compressor {
85 const struct dsc_funcs *funcs;
86 struct dc_context *ctx;
87 int inst;
88 };
89
90 struct dsc_funcs {
91 void (*dsc_get_enc_caps)(struct dsc_enc_caps *dsc_enc_caps, int pixel_clock_100Hz);
92 void (*dsc_read_state)(struct display_stream_compressor *dsc, struct dcn_dsc_state *s);
93 bool (*dsc_validate_stream)(struct display_stream_compressor *dsc, const struct dsc_config *dsc_cfg);
94 void (*dsc_set_config)(struct display_stream_compressor *dsc, const struct dsc_config *dsc_cfg,
95 struct dsc_optc_config *dsc_optc_cfg);
96 bool (*dsc_get_packed_pps)(struct display_stream_compressor *dsc, const struct dsc_config *dsc_cfg,
97 uint8_t *dsc_packed_pps);
98 void (*dsc_enable)(struct display_stream_compressor *dsc, int opp_pipe);
99 void (*dsc_disable)(struct display_stream_compressor *dsc);
100 };
101
102 #endif
103 #endif