aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/i915_drm.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2009-09-15 16:57:34 -0400
committerEric Anholt <eric@anholt.net>2009-11-05 17:47:08 -0500
commit02e792fbaadb75dec8e476a05b610e49908fc6a4 (patch)
tree3c813fbf64431827b0e56291c647e60443a52277 /include/drm/i915_drm.h
parentf0f8a9cecea322b215600d96cf0c1eb08343a4e9 (diff)
drm/i915: implement drmmode overlay support v4
This implements intel overlay support for kms via a device-specific ioctl. Thomas Hellstrom brought up the idea of a general ioctl (on dri-devel). We've reached the conclusion that such an infrastructure only makes sense when multiple kms overlay implementations exists, which atm don't (and it doesn't look like this is gonna change). Open issues: - Runs in sync with the gpu, i.e. unnecessary waiting. I've decided to wait on this because the hw tends to hang when changing something in this area. I left some dummy functions as infrastructure. - polyphase filtering uses a static table. - uses uninterruptible sleeps. Unfortunately the alternatives may unnecessarily wedged the hw if/when we timeout too early (and userspace only overloaded the batch buffers with stuff worth a few secs of gpu time). Changes since v1: - fix off-by-one misconception on my side. This fixes fullscreen playback. Changes since v2: - add underrun detection as spec'ed for i965. - flush caches properly, fixing visual corruptions. Changes since v4: - fix up cache flushing of overlay memory regs. - killed require_pipe_a logic - it hangs the chip. Tested-By: diego.abelenda@gmail.com (on a 865G) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> [anholt: Resolved against the MADVISE ioctl going in before this one] Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'include/drm/i915_drm.h')
-rw-r--r--include/drm/i915_drm.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 7e0cb1da92e6..c900499f2f63 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -186,6 +186,8 @@ 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
189 191
190#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 192#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) 193#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -223,6 +225,8 @@ typedef struct _drm_i915_sarea {
223#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) 225#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) 226#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)
225#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) 227#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
228#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_IOCTL_I915_OVERLAY_ATTRS, struct drm_intel_overlay_put_image)
229#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
226 230
227/* Allow drivers to submit batchbuffers directly to hardware, relying 231/* Allow drivers to submit batchbuffers directly to hardware, relying
228 * on the security mechanisms provided by hardware. 232 * on the security mechanisms provided by hardware.
@@ -266,6 +270,7 @@ typedef struct drm_i915_irq_wait {
266#define I915_PARAM_CHIPSET_ID 4 270#define I915_PARAM_CHIPSET_ID 4
267#define I915_PARAM_HAS_GEM 5 271#define I915_PARAM_HAS_GEM 5
268#define I915_PARAM_NUM_FENCES_AVAIL 6 272#define I915_PARAM_NUM_FENCES_AVAIL 6
273#define I915_PARAM_HAS_OVERLAY 7
269 274
270typedef struct drm_i915_getparam { 275typedef struct drm_i915_getparam {
271 int param; 276 int param;
@@ -686,4 +691,70 @@ struct drm_i915_gem_madvise {
686 __u32 retained; 691 __u32 retained;
687}; 692};
688 693
694/* flags */
695#define I915_OVERLAY_TYPE_MASK 0xff
696#define I915_OVERLAY_YUV_PLANAR 0x01
697#define I915_OVERLAY_YUV_PACKED 0x02
698#define I915_OVERLAY_RGB 0x03
699
700#define I915_OVERLAY_DEPTH_MASK 0xff00
701#define I915_OVERLAY_RGB24 0x1000
702#define I915_OVERLAY_RGB16 0x2000
703#define I915_OVERLAY_RGB15 0x3000
704#define I915_OVERLAY_YUV422 0x0100
705#define I915_OVERLAY_YUV411 0x0200
706#define I915_OVERLAY_YUV420 0x0300
707#define I915_OVERLAY_YUV410 0x0400
708
709#define I915_OVERLAY_SWAP_MASK 0xff0000
710#define I915_OVERLAY_NO_SWAP 0x000000
711#define I915_OVERLAY_UV_SWAP 0x010000
712#define I915_OVERLAY_Y_SWAP 0x020000
713#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
714
715#define I915_OVERLAY_FLAGS_MASK 0xff000000
716#define I915_OVERLAY_ENABLE 0x01000000
717
718struct drm_intel_overlay_put_image {
719 /* various flags and src format description */
720 __u32 flags;
721 /* source picture description */
722 __u32 bo_handle;
723 /* stride values and offsets are in bytes, buffer relative */
724 __u16 stride_Y; /* stride for packed formats */
725 __u16 stride_UV;
726 __u32 offset_Y; /* offset for packet formats */
727 __u32 offset_U;
728 __u32 offset_V;
729 /* in pixels */
730 __u16 src_width;
731 __u16 src_height;
732 /* to compensate the scaling factors for partially covered surfaces */
733 __u16 src_scan_width;
734 __u16 src_scan_height;
735 /* output crtc description */
736 __u32 crtc_id;
737 __u16 dst_x;
738 __u16 dst_y;
739 __u16 dst_width;
740 __u16 dst_height;
741};
742
743/* flags */
744#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
745#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
746struct drm_intel_overlay_attrs {
747 __u32 flags;
748 __u32 color_key;
749 __s32 brightness;
750 __u32 contrast;
751 __u32 saturation;
752 __u32 gamma0;
753 __u32 gamma1;
754 __u32 gamma2;
755 __u32 gamma3;
756 __u32 gamma4;
757 __u32 gamma5;
758};
759
689#endif /* _I915_DRM_H_ */ 760#endif /* _I915_DRM_H_ */