aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/drm/drm_fourcc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/drm/drm_fourcc.h')
-rw-r--r--include/uapi/drm/drm_fourcc.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index a284f11a8ef5..07735822a28f 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -129,4 +129,82 @@
129#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ 129#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */
130#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ 130#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */
131 131
132
133/*
134 * Format Modifiers:
135 *
136 * Format modifiers describe, typically, a re-ordering or modification
137 * of the data in a plane of an FB. This can be used to express tiled/
138 * swizzled formats, or compression, or a combination of the two.
139 *
140 * The upper 8 bits of the format modifier are a vendor-id as assigned
141 * below. The lower 56 bits are assigned as vendor sees fit.
142 */
143
144/* Vendor Ids: */
145#define DRM_FORMAT_MOD_NONE 0
146#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01
147#define DRM_FORMAT_MOD_VENDOR_AMD 0x02
148#define DRM_FORMAT_MOD_VENDOR_NV 0x03
149#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04
150#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05
151/* add more to the end as needed */
152
153#define fourcc_mod_code(vendor, val) \
154 ((((u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL))
155
156/*
157 * Format Modifier tokens:
158 *
159 * When adding a new token please document the layout with a code comment,
160 * similar to the fourcc codes above. drm_fourcc.h is considered the
161 * authoritative source for all of these.
162 */
163
164/* Intel framebuffer modifiers */
165
166/*
167 * Intel X-tiling layout
168 *
169 * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
170 * in row-major layout. Within the tile bytes are laid out row-major, with
171 * a platform-dependent stride. On top of that the memory can apply
172 * platform-depending swizzling of some higher address bits into bit6.
173 *
174 * This format is highly platforms specific and not useful for cross-driver
175 * sharing. It exists since on a given platform it does uniquely identify the
176 * layout in a simple way for i915-specific userspace.
177 */
178#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1)
179
180/*
181 * Intel Y-tiling layout
182 *
183 * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb)
184 * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes)
185 * chunks column-major, with a platform-dependent height. On top of that the
186 * memory can apply platform-depending swizzling of some higher address bits
187 * into bit6.
188 *
189 * This format is highly platforms specific and not useful for cross-driver
190 * sharing. It exists since on a given platform it does uniquely identify the
191 * layout in a simple way for i915-specific userspace.
192 */
193#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2)
194
195/*
196 * Intel Yf-tiling layout
197 *
198 * This is a tiled layout using 4Kb tiles in row-major layout.
199 * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which
200 * are arranged in four groups (two wide, two high) with column-major layout.
201 * Each group therefore consits out of four 256 byte units, which are also laid
202 * out as 2x2 column-major.
203 * 256 byte units are made out of four 64 byte blocks of pixels, producing
204 * either a square block or a 2:1 unit.
205 * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width
206 * in pixel depends on the pixel depth.
207 */
208#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
209
132#endif /* DRM_FOURCC_H */ 210#endif /* DRM_FOURCC_H */