aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/drm
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/drm')
-rw-r--r--include/uapi/drm/drm.h1
-rw-r--r--include/uapi/drm/drm_fourcc.h78
-rw-r--r--include/uapi/drm/drm_mode.h9
-rw-r--r--include/uapi/drm/i915_drm.h5
-rw-r--r--include/uapi/drm/nouveau_drm.h1
-rw-r--r--include/uapi/drm/radeon_drm.h4
-rw-r--r--include/uapi/drm/tegra_drm.h3
7 files changed, 99 insertions, 2 deletions
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 01b2d6d0e355..ff6ef62d084b 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -630,6 +630,7 @@ struct drm_gem_open {
630 */ 630 */
631#define DRM_CAP_CURSOR_WIDTH 0x8 631#define DRM_CAP_CURSOR_WIDTH 0x8
632#define DRM_CAP_CURSOR_HEIGHT 0x9 632#define DRM_CAP_CURSOR_HEIGHT 0x9
633#define DRM_CAP_ADDFB2_MODIFIERS 0x10
633 634
634/** DRM_IOCTL_GET_CAP ioctl argument type */ 635/** DRM_IOCTL_GET_CAP ioctl argument type */
635struct drm_get_cap { 636struct drm_get_cap {
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 */
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index ca788e01dab2..dbeba949462a 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -336,6 +336,7 @@ struct drm_mode_fb_cmd {
336}; 336};
337 337
338#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ 338#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
339#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
339 340
340struct drm_mode_fb_cmd2 { 341struct drm_mode_fb_cmd2 {
341 __u32 fb_id; 342 __u32 fb_id;
@@ -356,10 +357,18 @@ struct drm_mode_fb_cmd2 {
356 * So it would consist of Y as offsets[0] and UV as 357 * So it would consist of Y as offsets[0] and UV as
357 * offsets[1]. Note that offsets[0] will generally 358 * offsets[1]. Note that offsets[0] will generally
358 * be 0 (but this is not required). 359 * be 0 (but this is not required).
360 *
361 * To accommodate tiled, compressed, etc formats, a per-plane
362 * modifier can be specified. The default value of zero
363 * indicates "native" format as specified by the fourcc.
364 * Vendor specific modifier token. This allows, for example,
365 * different tiling/swizzling pattern on different planes.
366 * See discussion above of DRM_FORMAT_MOD_xxx.
359 */ 367 */
360 __u32 handles[4]; 368 __u32 handles[4];
361 __u32 pitches[4]; /* pitch for each plane */ 369 __u32 pitches[4]; /* pitch for each plane */
362 __u32 offsets[4]; /* offset of each plane */ 370 __u32 offsets[4]; /* offset of each plane */
371 __u64 modifier[4]; /* ie, tiling, compressed (per plane) */
363}; 372};
364 373
365#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 374#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 6eed16b92a24..551b6737f5df 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -270,7 +270,7 @@ typedef struct _drm_i915_sarea {
270#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) 270#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
271#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) 271#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
272#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) 272#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
273#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) 273#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
274#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) 274#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
275#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) 275#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
276#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) 276#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
@@ -347,6 +347,9 @@ typedef struct drm_i915_irq_wait {
347#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 347#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
348#define I915_PARAM_MMAP_VERSION 30 348#define I915_PARAM_MMAP_VERSION 30
349#define I915_PARAM_HAS_BSD2 31 349#define I915_PARAM_HAS_BSD2 31
350#define I915_PARAM_REVISION 32
351#define I915_PARAM_SUBSLICE_TOTAL 33
352#define I915_PARAM_EU_TOTAL 34
350 353
351typedef struct drm_i915_getparam { 354typedef struct drm_i915_getparam {
352 int param; 355 int param;
diff --git a/include/uapi/drm/nouveau_drm.h b/include/uapi/drm/nouveau_drm.h
index 0d7608dc1a34..5507eead5863 100644
--- a/include/uapi/drm/nouveau_drm.h
+++ b/include/uapi/drm/nouveau_drm.h
@@ -39,6 +39,7 @@
39#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) 39#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
40#define NOUVEAU_GEM_DOMAIN_GART (1 << 2) 40#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
41#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) 41#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
42#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
42 43
43#define NOUVEAU_GEM_TILE_COMP 0x00030000 /* nv50-only */ 44#define NOUVEAU_GEM_TILE_COMP 0x00030000 /* nv50-only */
44#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00 45#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 50d0fb41a3bf..871e73f99a4d 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -1034,6 +1034,10 @@ struct drm_radeon_cs {
1034#define RADEON_INFO_VRAM_USAGE 0x1e 1034#define RADEON_INFO_VRAM_USAGE 0x1e
1035#define RADEON_INFO_GTT_USAGE 0x1f 1035#define RADEON_INFO_GTT_USAGE 0x1f
1036#define RADEON_INFO_ACTIVE_CU_COUNT 0x20 1036#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
1037#define RADEON_INFO_CURRENT_GPU_TEMP 0x21
1038#define RADEON_INFO_CURRENT_GPU_SCLK 0x22
1039#define RADEON_INFO_CURRENT_GPU_MCLK 0x23
1040#define RADEON_INFO_READ_REG 0x24
1037 1041
1038struct drm_radeon_info { 1042struct drm_radeon_info {
1039 uint32_t request; 1043 uint32_t request;
diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index c15d781ecc0f..5391780c2b05 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -36,7 +36,8 @@ struct drm_tegra_gem_create {
36 36
37struct drm_tegra_gem_mmap { 37struct drm_tegra_gem_mmap {
38 __u32 handle; 38 __u32 handle;
39 __u32 offset; 39 __u32 pad;
40 __u64 offset;
40}; 41};
41 42
42struct drm_tegra_syncpt_read { 43struct drm_tegra_syncpt_read {