diff options
author | Dave Airlie <airlied@redhat.com> | 2009-12-07 23:03:47 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-07 23:03:47 -0500 |
commit | 3ff99164f67aae78a2bd2313f65ad55bddb1ffea (patch) | |
tree | d6bba03616d1be6ab9e6d9e92641a6f4047e1e15 /include/drm | |
parent | 1bd049fa895f9c6743f38b52ce14775f5a31ea63 (diff) | |
parent | f2b115e69d46344ae7afcaad5823496d2a0d8650 (diff) |
Merge remote branch 'anholt/drm-intel-next' into drm-linus
This merges the upstream Intel tree and fixes up numerous conflicts
due to patches merged into Linus tree later in -rc cycle.
Conflicts:
drivers/char/agp/intel-agp.c
drivers/gpu/drm/drm_dp_i2c_helper.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_suspend.c
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm.h | 1 | ||||
-rw-r--r-- | include/drm/drmP.h | 16 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 3 | ||||
-rw-r--r-- | include/drm/drm_os_linux.h | 2 | ||||
-rw-r--r-- | include/drm/i915_drm.h | 74 |
5 files changed, 92 insertions, 4 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h index 43a35b092f04..e3f46e0cb7dc 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
@@ -728,6 +728,7 @@ struct drm_event { | |||
728 | }; | 728 | }; |
729 | 729 | ||
730 | #define DRM_EVENT_VBLANK 0x01 | 730 | #define DRM_EVENT_VBLANK 0x01 |
731 | #define DRM_EVENT_FLIP_COMPLETE 0x02 | ||
731 | 732 | ||
732 | struct drm_event_vblank { | 733 | struct drm_event_vblank { |
733 | struct drm_event base; | 734 | struct drm_event base; |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index db56a6add5de..19ef8ebdc662 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1300,6 +1300,7 @@ extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | |||
1300 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | 1300 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); |
1301 | extern int drm_vblank_get(struct drm_device *dev, int crtc); | 1301 | extern int drm_vblank_get(struct drm_device *dev, int crtc); |
1302 | extern void drm_vblank_put(struct drm_device *dev, int crtc); | 1302 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
1303 | extern void drm_vblank_off(struct drm_device *dev, int crtc); | ||
1303 | extern void drm_vblank_cleanup(struct drm_device *dev); | 1304 | extern void drm_vblank_cleanup(struct drm_device *dev); |
1304 | /* Modesetting support */ | 1305 | /* Modesetting support */ |
1305 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1306 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
@@ -1524,14 +1525,27 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
1524 | 1525 | ||
1525 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | 1526 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) |
1526 | { | 1527 | { |
1528 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
1529 | return NULL; | ||
1530 | |||
1527 | if (size * nmemb <= PAGE_SIZE) | 1531 | if (size * nmemb <= PAGE_SIZE) |
1528 | return kcalloc(nmemb, size, GFP_KERNEL); | 1532 | return kcalloc(nmemb, size, GFP_KERNEL); |
1529 | 1533 | ||
1534 | return __vmalloc(size * nmemb, | ||
1535 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | ||
1536 | } | ||
1537 | |||
1538 | /* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */ | ||
1539 | static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) | ||
1540 | { | ||
1530 | if (size != 0 && nmemb > ULONG_MAX / size) | 1541 | if (size != 0 && nmemb > ULONG_MAX / size) |
1531 | return NULL; | 1542 | return NULL; |
1532 | 1543 | ||
1544 | if (size * nmemb <= PAGE_SIZE) | ||
1545 | return kmalloc(nmemb * size, GFP_KERNEL); | ||
1546 | |||
1533 | return __vmalloc(size * nmemb, | 1547 | return __vmalloc(size * nmemb, |
1534 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | 1548 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL); |
1535 | } | 1549 | } |
1536 | 1550 | ||
1537 | static __inline void drm_free_large(void *ptr) | 1551 | static __inline void drm_free_large(void *ptr) |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 219f075d2733..fdf43abc36db 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -743,7 +743,8 @@ extern void drm_mode_connector_detach_encoder(struct drm_connector *connector, | |||
743 | struct drm_encoder *encoder); | 743 | struct drm_encoder *encoder); |
744 | extern bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, | 744 | extern bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, |
745 | int gamma_size); | 745 | int gamma_size); |
746 | extern void *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type); | 746 | extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, |
747 | uint32_t id, uint32_t type); | ||
747 | /* IOCTLs */ | 748 | /* IOCTLs */ |
748 | extern int drm_mode_getresources(struct drm_device *dev, | 749 | extern int drm_mode_getresources(struct drm_device *dev, |
749 | void *data, struct drm_file *file_priv); | 750 | void *data, struct drm_file *file_priv); |
diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h index 26641e95e0a4..393369147a2d 100644 --- a/include/drm/drm_os_linux.h +++ b/include/drm/drm_os_linux.h | |||
@@ -123,5 +123,5 @@ do { \ | |||
123 | remove_wait_queue(&(queue), &entry); \ | 123 | remove_wait_queue(&(queue), &entry); \ |
124 | } while (0) | 124 | } while (0) |
125 | 125 | ||
126 | #define DRM_WAKEUP( queue ) wake_up_interruptible( queue ) | 126 | #define DRM_WAKEUP( queue ) wake_up( queue ) |
127 | #define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue ) | 127 | #define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue ) |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index a04c3ab1d726..ec3f5e80a5df 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) |
@@ -221,8 +223,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) | 223 | #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) | 224 | #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) | 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_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) | 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,8 @@ 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 | ||
274 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | ||
269 | 275 | ||
270 | typedef struct drm_i915_getparam { | 276 | typedef struct drm_i915_getparam { |
271 | int param; | 277 | int param; |
@@ -686,4 +692,70 @@ struct drm_i915_gem_madvise { | |||
686 | __u32 retained; | 692 | __u32 retained; |
687 | }; | 693 | }; |
688 | 694 | ||
695 | /* flags */ | ||
696 | #define I915_OVERLAY_TYPE_MASK 0xff | ||
697 | #define I915_OVERLAY_YUV_PLANAR 0x01 | ||
698 | #define I915_OVERLAY_YUV_PACKED 0x02 | ||
699 | #define I915_OVERLAY_RGB 0x03 | ||
700 | |||
701 | #define I915_OVERLAY_DEPTH_MASK 0xff00 | ||
702 | #define I915_OVERLAY_RGB24 0x1000 | ||
703 | #define I915_OVERLAY_RGB16 0x2000 | ||
704 | #define I915_OVERLAY_RGB15 0x3000 | ||
705 | #define I915_OVERLAY_YUV422 0x0100 | ||
706 | #define I915_OVERLAY_YUV411 0x0200 | ||
707 | #define I915_OVERLAY_YUV420 0x0300 | ||
708 | #define I915_OVERLAY_YUV410 0x0400 | ||
709 | |||
710 | #define I915_OVERLAY_SWAP_MASK 0xff0000 | ||
711 | #define I915_OVERLAY_NO_SWAP 0x000000 | ||
712 | #define I915_OVERLAY_UV_SWAP 0x010000 | ||
713 | #define I915_OVERLAY_Y_SWAP 0x020000 | ||
714 | #define I915_OVERLAY_Y_AND_UV_SWAP 0x030000 | ||
715 | |||
716 | #define I915_OVERLAY_FLAGS_MASK 0xff000000 | ||
717 | #define I915_OVERLAY_ENABLE 0x01000000 | ||
718 | |||
719 | struct drm_intel_overlay_put_image { | ||
720 | /* various flags and src format description */ | ||
721 | __u32 flags; | ||
722 | /* source picture description */ | ||
723 | __u32 bo_handle; | ||
724 | /* stride values and offsets are in bytes, buffer relative */ | ||
725 | __u16 stride_Y; /* stride for packed formats */ | ||
726 | __u16 stride_UV; | ||
727 | __u32 offset_Y; /* offset for packet formats */ | ||
728 | __u32 offset_U; | ||
729 | __u32 offset_V; | ||
730 | /* in pixels */ | ||
731 | __u16 src_width; | ||
732 | __u16 src_height; | ||
733 | /* to compensate the scaling factors for partially covered surfaces */ | ||
734 | __u16 src_scan_width; | ||
735 | __u16 src_scan_height; | ||
736 | /* output crtc description */ | ||
737 | __u32 crtc_id; | ||
738 | __u16 dst_x; | ||
739 | __u16 dst_y; | ||
740 | __u16 dst_width; | ||
741 | __u16 dst_height; | ||
742 | }; | ||
743 | |||
744 | /* flags */ | ||
745 | #define I915_OVERLAY_UPDATE_ATTRS (1<<0) | ||
746 | #define I915_OVERLAY_UPDATE_GAMMA (1<<1) | ||
747 | struct drm_intel_overlay_attrs { | ||
748 | __u32 flags; | ||
749 | __u32 color_key; | ||
750 | __s32 brightness; | ||
751 | __u32 contrast; | ||
752 | __u32 saturation; | ||
753 | __u32 gamma0; | ||
754 | __u32 gamma1; | ||
755 | __u32 gamma2; | ||
756 | __u32 gamma3; | ||
757 | __u32 gamma4; | ||
758 | __u32 gamma5; | ||
759 | }; | ||
760 | |||
689 | #endif /* _I915_DRM_H_ */ | 761 | #endif /* _I915_DRM_H_ */ |