aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_fourcc.h31
-rw-r--r--include/drm/drm_mode.h50
2 files changed, 81 insertions, 0 deletions
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
index 7586c46f..3ad838d3 100644
--- a/include/drm/drm_fourcc.h
+++ b/include/drm/drm_fourcc.h
@@ -185,6 +185,8 @@ extern "C" {
185#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 185#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07
186/* add more to the end as needed */ 186/* add more to the end as needed */
187 187
188#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
189
188#define fourcc_mod_code(vendor, val) \ 190#define fourcc_mod_code(vendor, val) \
189 ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL)) 191 ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL))
190 192
@@ -197,6 +199,15 @@ extern "C" {
197 */ 199 */
198 200
199/* 201/*
202 * Invalid Modifier
203 *
204 * This modifier can be used as a sentinel to terminate the format modifiers
205 * list, or to initialize a variable with an invalid modifier. It might also be
206 * used to report an error back to userspace for certain APIs.
207 */
208#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
209
210/*
200 * Linear Layout 211 * Linear Layout
201 * 212 *
202 * Just plain linear layout. Note that this is different from no specifying any 213 * Just plain linear layout. Note that this is different from no specifying any
@@ -253,6 +264,26 @@ extern "C" {
253#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3) 264#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3)
254 265
255/* 266/*
267 * Intel color control surface (CCS) for render compression
268 *
269 * The framebuffer format must be one of the 8:8:8:8 RGB formats.
270 * The main surface will be plane index 0 and must be Y/Yf-tiled,
271 * the CCS will be plane index 1.
272 *
273 * Each CCS tile matches a 1024x512 pixel area of the main surface.
274 * To match certain aspects of the 3D hardware the CCS is
275 * considered to be made up of normal 128Bx32 Y tiles, Thus
276 * the CCS pitch must be specified in multiples of 128 bytes.
277 *
278 * In reality the CCS tile appears to be a 64Bx64 Y tile, composed
279 * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks.
280 * But that fact is not relevant unless the memory is accessed
281 * directly.
282 */
283#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4)
284#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5)
285
286/*
256 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks 287 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
257 * 288 *
258 * Macroblocks are laid in a Z-shape, and each pixel data is following the 289 * Macroblocks are laid in a Z-shape, and each pixel data is following the
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 70571af6..08077978 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -657,6 +657,56 @@ struct drm_mode_atomic {
657 __u64 user_data; 657 __u64 user_data;
658}; 658};
659 659
660struct drm_format_modifier_blob {
661#define FORMAT_BLOB_CURRENT 1
662 /* Version of this blob format */
663 __u32 version;
664
665 /* Flags */
666 __u32 flags;
667
668 /* Number of fourcc formats supported */
669 __u32 count_formats;
670
671 /* Where in this blob the formats exist (in bytes) */
672 __u32 formats_offset;
673
674 /* Number of drm_format_modifiers */
675 __u32 count_modifiers;
676
677 /* Where in this blob the modifiers exist (in bytes) */
678 __u32 modifiers_offset;
679
680 /* u32 formats[] */
681 /* struct drm_format_modifier modifiers[] */
682};
683
684struct drm_format_modifier {
685 /* Bitmask of formats in get_plane format list this info applies to. The
686 * offset allows a sliding window of which 64 formats (bits).
687 *
688 * Some examples:
689 * In today's world with < 65 formats, and formats 0, and 2 are
690 * supported
691 * 0x0000000000000005
692 * ^-offset = 0, formats = 5
693 *
694 * If the number formats grew to 128, and formats 98-102 are
695 * supported with the modifier:
696 *
697 * 0x0000003c00000000 0000000000000000
698 * ^
699 * |__offset = 64, formats = 0x3c00000000
700 *
701 */
702 __u64 formats;
703 __u32 offset;
704 __u32 pad;
705
706 /* The modifier that applies to the >get_plane format list bitmask. */
707 __u64 modifier;
708};
709
660/** 710/**
661 * Create a new 'blob' data property, copying length bytes from data pointer, 711 * Create a new 'blob' data property, copying length bytes from data pointer,
662 * and returning new blob ID. 712 * and returning new blob ID.