diff options
Diffstat (limited to 'include/drm/i915_drm.h')
-rw-r--r-- | include/drm/i915_drm.h | 132 |
1 files changed, 129 insertions, 3 deletions
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 7e0cb1da92e6..b64a8d7cdf6d 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -27,11 +27,11 @@ | |||
27 | #ifndef _I915_DRM_H_ | 27 | #ifndef _I915_DRM_H_ |
28 | #define _I915_DRM_H_ | 28 | #define _I915_DRM_H_ |
29 | 29 | ||
30 | #include "drm.h" | ||
31 | |||
30 | /* Please note that modifications to all structs defined here are | 32 | /* Please note that modifications to all structs defined here are |
31 | * subject to backwards-compatibility constraints. | 33 | * subject to backwards-compatibility constraints. |
32 | */ | 34 | */ |
33 | #include <linux/types.h> | ||
34 | #include "drm.h" | ||
35 | 35 | ||
36 | /* Each region is a minimum of 16k, and there are at most 255 of them. | 36 | /* Each region is a minimum of 16k, and there are at most 255 of them. |
37 | */ | 37 | */ |
@@ -186,6 +186,9 @@ typedef struct _drm_i915_sarea { | |||
186 | #define DRM_I915_GEM_MMAP_GTT 0x24 | 186 | #define DRM_I915_GEM_MMAP_GTT 0x24 |
187 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 | 187 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 |
188 | #define DRM_I915_GEM_MADVISE 0x26 | 188 | #define DRM_I915_GEM_MADVISE 0x26 |
189 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 | ||
190 | #define DRM_I915_OVERLAY_ATTRS 0x28 | ||
191 | #define DRM_I915_GEM_EXECBUFFER2 0x29 | ||
189 | 192 | ||
190 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 193 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
191 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 194 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -205,6 +208,7 @@ typedef struct _drm_i915_sarea { | |||
205 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) | 208 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) |
206 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) | 209 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) |
207 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) | 210 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) |
211 | #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) | ||
208 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) | 212 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) |
209 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) | 213 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) |
210 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) | 214 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) |
@@ -221,8 +225,10 @@ typedef struct _drm_i915_sarea { | |||
221 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) | 225 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) |
222 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) | 226 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) |
223 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) | 227 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) |
224 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_intel_get_pipe_from_crtc_id) | 228 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) |
225 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) | 229 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) |
230 | #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_IOCTL_I915_OVERLAY_ATTRS, struct drm_intel_overlay_put_image) | ||
231 | #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) | ||
226 | 232 | ||
227 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 233 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
228 | * on the security mechanisms provided by hardware. | 234 | * on the security mechanisms provided by hardware. |
@@ -266,6 +272,9 @@ typedef struct drm_i915_irq_wait { | |||
266 | #define I915_PARAM_CHIPSET_ID 4 | 272 | #define I915_PARAM_CHIPSET_ID 4 |
267 | #define I915_PARAM_HAS_GEM 5 | 273 | #define I915_PARAM_HAS_GEM 5 |
268 | #define I915_PARAM_NUM_FENCES_AVAIL 6 | 274 | #define I915_PARAM_NUM_FENCES_AVAIL 6 |
275 | #define I915_PARAM_HAS_OVERLAY 7 | ||
276 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | ||
277 | #define I915_PARAM_HAS_EXECBUF2 9 | ||
269 | 278 | ||
270 | typedef struct drm_i915_getparam { | 279 | typedef struct drm_i915_getparam { |
271 | int param; | 280 | int param; |
@@ -561,6 +570,57 @@ struct drm_i915_gem_execbuffer { | |||
561 | __u64 cliprects_ptr; | 570 | __u64 cliprects_ptr; |
562 | }; | 571 | }; |
563 | 572 | ||
573 | struct drm_i915_gem_exec_object2 { | ||
574 | /** | ||
575 | * User's handle for a buffer to be bound into the GTT for this | ||
576 | * operation. | ||
577 | */ | ||
578 | __u32 handle; | ||
579 | |||
580 | /** Number of relocations to be performed on this buffer */ | ||
581 | __u32 relocation_count; | ||
582 | /** | ||
583 | * Pointer to array of struct drm_i915_gem_relocation_entry containing | ||
584 | * the relocations to be performed in this buffer. | ||
585 | */ | ||
586 | __u64 relocs_ptr; | ||
587 | |||
588 | /** Required alignment in graphics aperture */ | ||
589 | __u64 alignment; | ||
590 | |||
591 | /** | ||
592 | * Returned value of the updated offset of the object, for future | ||
593 | * presumed_offset writes. | ||
594 | */ | ||
595 | __u64 offset; | ||
596 | |||
597 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) | ||
598 | __u64 flags; | ||
599 | __u64 rsvd1; | ||
600 | __u64 rsvd2; | ||
601 | }; | ||
602 | |||
603 | struct drm_i915_gem_execbuffer2 { | ||
604 | /** | ||
605 | * List of gem_exec_object2 structs | ||
606 | */ | ||
607 | __u64 buffers_ptr; | ||
608 | __u32 buffer_count; | ||
609 | |||
610 | /** Offset in the batchbuffer to start execution from. */ | ||
611 | __u32 batch_start_offset; | ||
612 | /** Bytes used in batchbuffer from batch_start_offset */ | ||
613 | __u32 batch_len; | ||
614 | __u32 DR1; | ||
615 | __u32 DR4; | ||
616 | __u32 num_cliprects; | ||
617 | /** This is a struct drm_clip_rect *cliprects */ | ||
618 | __u64 cliprects_ptr; | ||
619 | __u64 flags; /* currently unused */ | ||
620 | __u64 rsvd1; | ||
621 | __u64 rsvd2; | ||
622 | }; | ||
623 | |||
564 | struct drm_i915_gem_pin { | 624 | struct drm_i915_gem_pin { |
565 | /** Handle of the buffer to be pinned. */ | 625 | /** Handle of the buffer to be pinned. */ |
566 | __u32 handle; | 626 | __u32 handle; |
@@ -686,4 +746,70 @@ struct drm_i915_gem_madvise { | |||
686 | __u32 retained; | 746 | __u32 retained; |
687 | }; | 747 | }; |
688 | 748 | ||
749 | /* flags */ | ||
750 | #define I915_OVERLAY_TYPE_MASK 0xff | ||
751 | #define I915_OVERLAY_YUV_PLANAR 0x01 | ||
752 | #define I915_OVERLAY_YUV_PACKED 0x02 | ||
753 | #define I915_OVERLAY_RGB 0x03 | ||
754 | |||
755 | #define I915_OVERLAY_DEPTH_MASK 0xff00 | ||
756 | #define I915_OVERLAY_RGB24 0x1000 | ||
757 | #define I915_OVERLAY_RGB16 0x2000 | ||
758 | #define I915_OVERLAY_RGB15 0x3000 | ||
759 | #define I915_OVERLAY_YUV422 0x0100 | ||
760 | #define I915_OVERLAY_YUV411 0x0200 | ||
761 | #define I915_OVERLAY_YUV420 0x0300 | ||
762 | #define I915_OVERLAY_YUV410 0x0400 | ||
763 | |||
764 | #define I915_OVERLAY_SWAP_MASK 0xff0000 | ||
765 | #define I915_OVERLAY_NO_SWAP 0x000000 | ||
766 | #define I915_OVERLAY_UV_SWAP 0x010000 | ||
767 | #define I915_OVERLAY_Y_SWAP 0x020000 | ||
768 | #define I915_OVERLAY_Y_AND_UV_SWAP 0x030000 | ||
769 | |||
770 | #define I915_OVERLAY_FLAGS_MASK 0xff000000 | ||
771 | #define I915_OVERLAY_ENABLE 0x01000000 | ||
772 | |||
773 | struct drm_intel_overlay_put_image { | ||
774 | /* various flags and src format description */ | ||
775 | __u32 flags; | ||
776 | /* source picture description */ | ||
777 | __u32 bo_handle; | ||
778 | /* stride values and offsets are in bytes, buffer relative */ | ||
779 | __u16 stride_Y; /* stride for packed formats */ | ||
780 | __u16 stride_UV; | ||
781 | __u32 offset_Y; /* offset for packet formats */ | ||
782 | __u32 offset_U; | ||
783 | __u32 offset_V; | ||
784 | /* in pixels */ | ||
785 | __u16 src_width; | ||
786 | __u16 src_height; | ||
787 | /* to compensate the scaling factors for partially covered surfaces */ | ||
788 | __u16 src_scan_width; | ||
789 | __u16 src_scan_height; | ||
790 | /* output crtc description */ | ||
791 | __u32 crtc_id; | ||
792 | __u16 dst_x; | ||
793 | __u16 dst_y; | ||
794 | __u16 dst_width; | ||
795 | __u16 dst_height; | ||
796 | }; | ||
797 | |||
798 | /* flags */ | ||
799 | #define I915_OVERLAY_UPDATE_ATTRS (1<<0) | ||
800 | #define I915_OVERLAY_UPDATE_GAMMA (1<<1) | ||
801 | struct drm_intel_overlay_attrs { | ||
802 | __u32 flags; | ||
803 | __u32 color_key; | ||
804 | __s32 brightness; | ||
805 | __u32 contrast; | ||
806 | __u32 saturation; | ||
807 | __u32 gamma0; | ||
808 | __u32 gamma1; | ||
809 | __u32 gamma2; | ||
810 | __u32 gamma3; | ||
811 | __u32 gamma4; | ||
812 | __u32 gamma5; | ||
813 | }; | ||
814 | |||
689 | #endif /* _I915_DRM_H_ */ | 815 | #endif /* _I915_DRM_H_ */ |