This source file includes following definitions.
- komeda_get_format_name
1
2
3
4
5
6
7
8 #ifndef _KOMEDA_FORMAT_CAPS_H_
9 #define _KOMEDA_FORMAT_CAPS_H_
10
11 #include <linux/types.h>
12 #include <uapi/drm/drm_fourcc.h>
13 #include <drm/drm_fourcc.h>
14
15 #define AFBC(x) DRM_FORMAT_MOD_ARM_AFBC(x)
16
17
18 #define AFBC_16x16(x) AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 | (x))
19 #define AFBC_32x8(x) AFBC(AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 | (x))
20
21
22 #define _YTR AFBC_FORMAT_MOD_YTR
23 #define _SPLIT AFBC_FORMAT_MOD_SPLIT
24 #define _SPARSE AFBC_FORMAT_MOD_SPARSE
25 #define _CBR AFBC_FORMAT_MOD_CBR
26 #define _TILED AFBC_FORMAT_MOD_TILED
27 #define _SC AFBC_FORMAT_MOD_SC
28
29
30 #define KOMEDA_FMT_RICH_LAYER BIT(0)
31 #define KOMEDA_FMT_SIMPLE_LAYER BIT(1)
32 #define KOMEDA_FMT_WB_LAYER BIT(2)
33
34 #define AFBC_TH_LAYOUT_ALIGNMENT 8
35 #define AFBC_HEADER_SIZE 16
36 #define AFBC_SUPERBLK_ALIGNMENT 128
37 #define AFBC_SUPERBLK_PIXELS 256
38 #define AFBC_BODY_START_ALIGNMENT 1024
39 #define AFBC_TH_BODY_START_ALIGNMENT 4096
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 struct komeda_format_caps {
59 u32 hw_id;
60 u32 fourcc;
61 u32 supported_layer_types;
62 u32 supported_rots;
63 u32 supported_afbc_layouts;
64 u64 supported_afbc_features;
65 };
66
67
68
69
70
71
72
73
74
75
76 struct komeda_format_caps_table {
77 u32 n_formats;
78 const struct komeda_format_caps *format_caps;
79 bool (*format_mod_supported)(const struct komeda_format_caps *caps,
80 u32 layer_type, u64 modifier, u32 rot);
81 };
82
83 extern u64 komeda_supported_modifiers[];
84
85 static inline const char *komeda_get_format_name(u32 fourcc, u64 modifier)
86 {
87 struct drm_format_name_buf buf;
88 static char name[64];
89
90 snprintf(name, sizeof(name), "%s with modifier: 0x%llx.",
91 drm_get_format_name(fourcc, &buf), modifier);
92
93 return name;
94 }
95
96 const struct komeda_format_caps *
97 komeda_get_format_caps(struct komeda_format_caps_table *table,
98 u32 fourcc, u64 modifier);
99
100 u32 komeda_get_afbc_format_bpp(const struct drm_format_info *info,
101 u64 modifier);
102
103 u32 *komeda_get_layer_fourcc_list(struct komeda_format_caps_table *table,
104 u32 layer_type, u32 *n_fmts);
105
106 void komeda_put_fourcc_list(u32 *fourcc_list);
107
108 bool komeda_format_mod_supported(struct komeda_format_caps_table *table,
109 u32 layer_type, u32 fourcc, u64 modifier,
110 u32 rot);
111
112 #endif