diff options
author | Dave Airlie <airlied@redhat.com> | 2009-11-17 19:09:55 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-11-17 19:09:55 -0500 |
commit | 46557bef3f3834ac33031c7be27d39d90d507442 (patch) | |
tree | 5cfc4a9e1263fe0a15e516ca9695ee2f9b8899e4 /include/drm | |
parent | 4efc50d697ed8d9a91f0005d922907a7b6c9290d (diff) | |
parent | d91d8a3f88059d93e34ac70d059153ec69a9ffc7 (diff) |
Merge branch 'drm-core-next' of ../linux-2.6 into drm-next
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm.h | 1 | ||||
-rw-r--r-- | include/drm/drmP.h | 36 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 16 | ||||
-rw-r--r-- | include/drm/drm_memory.h | 2 | ||||
-rw-r--r-- | include/drm/drm_mode.h | 33 | ||||
-rw-r--r-- | include/drm/drm_pciids.h | 1 | ||||
-rw-r--r-- | include/drm/i915_drm.h | 19 |
7 files changed, 73 insertions, 35 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h index fa6d9155873d..3919a4f792ae 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
@@ -687,6 +687,7 @@ struct drm_gem_open { | |||
687 | #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) | 687 | #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) |
688 | #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) | 688 | #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) |
689 | #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) | 689 | #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) |
690 | #define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) | ||
690 | 691 | ||
691 | /** | 692 | /** |
692 | * Device specific ioctls should only be in their respective headers | 693 | * Device specific ioctls should only be in their respective headers |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index fe52254df60c..1b72a526ba64 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -245,16 +245,6 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
245 | 245 | ||
246 | #endif | 246 | #endif |
247 | 247 | ||
248 | #define DRM_PROC_LIMIT (PAGE_SIZE-80) | ||
249 | |||
250 | #define DRM_PROC_PRINT(fmt, arg...) \ | ||
251 | len += sprintf(&buf[len], fmt , ##arg); \ | ||
252 | if (len > DRM_PROC_LIMIT) { *eof = 1; return len - offset; } | ||
253 | |||
254 | #define DRM_PROC_PRINT_RET(ret, fmt, arg...) \ | ||
255 | len += sprintf(&buf[len], fmt , ##arg); \ | ||
256 | if (len > DRM_PROC_LIMIT) { ret; *eof = 1; return len - offset; } | ||
257 | |||
258 | /*@}*/ | 248 | /*@}*/ |
259 | 249 | ||
260 | /***********************************************************************/ | 250 | /***********************************************************************/ |
@@ -265,19 +255,8 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
265 | 255 | ||
266 | #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1)) | 256 | #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1)) |
267 | #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) | 257 | #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) |
268 | #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist) | ||
269 | 258 | ||
270 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) | 259 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) |
271 | /** | ||
272 | * Get the private SAREA mapping. | ||
273 | * | ||
274 | * \param _dev DRM device. | ||
275 | * \param _ctx context number. | ||
276 | * \param _map output mapping. | ||
277 | */ | ||
278 | #define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \ | ||
279 | (_map) = (_dev)->context_sareas[_ctx]; \ | ||
280 | } while(0) | ||
281 | 260 | ||
282 | /** | 261 | /** |
283 | * Test that the hardware lock is held by the caller, returning otherwise. | 262 | * Test that the hardware lock is held by the caller, returning otherwise. |
@@ -297,18 +276,6 @@ do { \ | |||
297 | } while (0) | 276 | } while (0) |
298 | 277 | ||
299 | /** | 278 | /** |
300 | * Copy and IOCTL return string to user space | ||
301 | */ | ||
302 | #define DRM_COPY( name, value ) \ | ||
303 | len = strlen( value ); \ | ||
304 | if ( len > name##_len ) len = name##_len; \ | ||
305 | name##_len = strlen( value ); \ | ||
306 | if ( len && name ) { \ | ||
307 | if ( copy_to_user( name, value, len ) ) \ | ||
308 | return -EFAULT; \ | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * Ioctl function type. | 279 | * Ioctl function type. |
313 | * | 280 | * |
314 | * \param inode device inode. | 281 | * \param inode device inode. |
@@ -822,6 +789,9 @@ struct drm_driver { | |||
822 | int (*gem_init_object) (struct drm_gem_object *obj); | 789 | int (*gem_init_object) (struct drm_gem_object *obj); |
823 | void (*gem_free_object) (struct drm_gem_object *obj); | 790 | void (*gem_free_object) (struct drm_gem_object *obj); |
824 | 791 | ||
792 | /* vga arb irq handler */ | ||
793 | void (*vgaarb_irq)(struct drm_device *dev, bool state); | ||
794 | |||
825 | /* Driver private ops for this object */ | 795 | /* Driver private ops for this object */ |
826 | struct vm_operations_struct *gem_vm_ops; | 796 | struct vm_operations_struct *gem_vm_ops; |
827 | 797 | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index b69347b8904f..4cc8a32dc4cf 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -290,6 +290,7 @@ struct drm_property { | |||
290 | struct drm_crtc; | 290 | struct drm_crtc; |
291 | struct drm_connector; | 291 | struct drm_connector; |
292 | struct drm_encoder; | 292 | struct drm_encoder; |
293 | struct drm_pending_vblank_event; | ||
293 | 294 | ||
294 | /** | 295 | /** |
295 | * drm_crtc_funcs - control CRTCs for a given device | 296 | * drm_crtc_funcs - control CRTCs for a given device |
@@ -333,6 +334,19 @@ struct drm_crtc_funcs { | |||
333 | void (*destroy)(struct drm_crtc *crtc); | 334 | void (*destroy)(struct drm_crtc *crtc); |
334 | 335 | ||
335 | int (*set_config)(struct drm_mode_set *set); | 336 | int (*set_config)(struct drm_mode_set *set); |
337 | |||
338 | /* | ||
339 | * Flip to the given framebuffer. This implements the page | ||
340 | * flip ioctl descibed in drm_mode.h, specifically, the | ||
341 | * implementation must return immediately and block all | ||
342 | * rendering to the current fb until the flip has completed. | ||
343 | * If userspace set the event flag in the ioctl, the event | ||
344 | * argument will point to an event to send back when the flip | ||
345 | * completes, otherwise it will be NULL. | ||
346 | */ | ||
347 | int (*page_flip)(struct drm_crtc *crtc, | ||
348 | struct drm_framebuffer *fb, | ||
349 | struct drm_pending_vblank_event *event); | ||
336 | }; | 350 | }; |
337 | 351 | ||
338 | /** | 352 | /** |
@@ -756,6 +770,8 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, | |||
756 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, | 770 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, |
757 | void *data, struct drm_file *file_priv); | 771 | void *data, struct drm_file *file_priv); |
758 | extern bool drm_detect_hdmi_monitor(struct edid *edid); | 772 | extern bool drm_detect_hdmi_monitor(struct edid *edid); |
773 | extern int drm_mode_page_flip_ioctl(struct drm_device *dev, | ||
774 | void *data, struct drm_file *file_priv); | ||
759 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, | 775 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, |
760 | int hdisplay, int vdisplay, int vrefresh, | 776 | int hdisplay, int vdisplay, int vrefresh, |
761 | bool reduced, bool interlaced, bool margins); | 777 | bool reduced, bool interlaced, bool margins); |
diff --git a/include/drm/drm_memory.h b/include/drm/drm_memory.h index 63e425b5ea82..15af9b32ae42 100644 --- a/include/drm/drm_memory.h +++ b/include/drm/drm_memory.h | |||
@@ -44,8 +44,6 @@ | |||
44 | 44 | ||
45 | #if __OS_HAS_AGP | 45 | #if __OS_HAS_AGP |
46 | 46 | ||
47 | #include <linux/vmalloc.h> | ||
48 | |||
49 | #ifdef HAVE_PAGE_AGP | 47 | #ifdef HAVE_PAGE_AGP |
50 | #include <asm/agp.h> | 48 | #include <asm/agp.h> |
51 | #else | 49 | #else |
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 1f908416aedb..68ddc6175ae7 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -268,4 +268,37 @@ struct drm_mode_crtc_lut { | |||
268 | __u64 blue; | 268 | __u64 blue; |
269 | }; | 269 | }; |
270 | 270 | ||
271 | #define DRM_MODE_PAGE_FLIP_EVENT 0x01 | ||
272 | #define DRM_MODE_PAGE_FLIP_FLAGS DRM_MODE_PAGE_FLIP_EVENT | ||
273 | |||
274 | /* | ||
275 | * Request a page flip on the specified crtc. | ||
276 | * | ||
277 | * This ioctl will ask KMS to schedule a page flip for the specified | ||
278 | * crtc. Once any pending rendering targeting the specified fb (as of | ||
279 | * ioctl time) has completed, the crtc will be reprogrammed to display | ||
280 | * that fb after the next vertical refresh. The ioctl returns | ||
281 | * immediately, but subsequent rendering to the current fb will block | ||
282 | * in the execbuffer ioctl until the page flip happens. If a page | ||
283 | * flip is already pending as the ioctl is called, EBUSY will be | ||
284 | * returned. | ||
285 | * | ||
286 | * The ioctl supports one flag, DRM_MODE_PAGE_FLIP_EVENT, which will | ||
287 | * request that drm sends back a vblank event (see drm.h: struct | ||
288 | * drm_event_vblank) when the page flip is done. The user_data field | ||
289 | * passed in with this ioctl will be returned as the user_data field | ||
290 | * in the vblank event struct. | ||
291 | * | ||
292 | * The reserved field must be zero until we figure out something | ||
293 | * clever to use it for. | ||
294 | */ | ||
295 | |||
296 | struct drm_mode_crtc_page_flip { | ||
297 | __u32 crtc_id; | ||
298 | __u32 fb_id; | ||
299 | __u32 flags; | ||
300 | __u32 reserved; | ||
301 | __u64 user_data; | ||
302 | }; | ||
303 | |||
271 | #endif | 304 | #endif |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 923361b220f2..e6f3b120f51a 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -552,6 +552,7 @@ | |||
552 | {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 552 | {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
553 | {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 553 | {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
554 | {0x8086, 0x2e32, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 554 | {0x8086, 0x2e32, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
555 | {0x8086, 0x2e42, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | ||
555 | {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 556 | {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
556 | {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 557 | {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
557 | {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 558 | {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 8e1e92583fbc..7e0cb1da92e6 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -185,6 +185,7 @@ typedef struct _drm_i915_sarea { | |||
185 | #define DRM_I915_GEM_GET_APERTURE 0x23 | 185 | #define DRM_I915_GEM_GET_APERTURE 0x23 |
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 | 189 | ||
189 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 190 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
190 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 191 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -221,6 +222,7 @@ typedef struct _drm_i915_sarea { | |||
221 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_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) |
222 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) | 223 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) |
223 | #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) | 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) |
225 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) | ||
224 | 226 | ||
225 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 227 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
226 | * on the security mechanisms provided by hardware. | 228 | * on the security mechanisms provided by hardware. |
@@ -667,4 +669,21 @@ struct drm_i915_get_pipe_from_crtc_id { | |||
667 | __u32 pipe; | 669 | __u32 pipe; |
668 | }; | 670 | }; |
669 | 671 | ||
672 | #define I915_MADV_WILLNEED 0 | ||
673 | #define I915_MADV_DONTNEED 1 | ||
674 | #define __I915_MADV_PURGED 2 /* internal state */ | ||
675 | |||
676 | struct drm_i915_gem_madvise { | ||
677 | /** Handle of the buffer to change the backing store advice */ | ||
678 | __u32 handle; | ||
679 | |||
680 | /* Advice: either the buffer will be needed again in the near future, | ||
681 | * or wont be and could be discarded under memory pressure. | ||
682 | */ | ||
683 | __u32 madv; | ||
684 | |||
685 | /** Whether the backing store still exists. */ | ||
686 | __u32 retained; | ||
687 | }; | ||
688 | |||
670 | #endif /* _I915_DRM_H_ */ | 689 | #endif /* _I915_DRM_H_ */ |