aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm.h4
-rw-r--r--include/drm/drmP.h12
-rw-r--r--include/drm/drm_crtc.h7
-rw-r--r--include/drm/drm_mode.h29
4 files changed, 52 insertions, 0 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h
index e5f70617dec5..8598cc94e169 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -701,6 +701,10 @@ struct drm_gem_open {
701#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) 701#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
702#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) 702#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
703 703
704#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
705#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
706#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
707
704/** 708/**
705 * Device specific ioctls should only be in their respective headers 709 * Device specific ioctls should only be in their respective headers
706 * The device specific ioctl range is from 0x40 to 0x99. 710 * The device specific ioctl range is from 0x40 to 0x99.
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index fe29aadb129d..3cbe7a02d2aa 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -880,6 +880,17 @@ struct drm_driver {
880 /* vga arb irq handler */ 880 /* vga arb irq handler */
881 void (*vgaarb_irq)(struct drm_device *dev, bool state); 881 void (*vgaarb_irq)(struct drm_device *dev, bool state);
882 882
883 /* dumb alloc support */
884 int (*dumb_create)(struct drm_file *file_priv,
885 struct drm_device *dev,
886 struct drm_mode_create_dumb *args);
887 int (*dumb_map_offset)(struct drm_file *file_priv,
888 struct drm_device *dev, uint32_t handle,
889 uint64_t *offset);
890 int (*dumb_destroy)(struct drm_file *file_priv,
891 struct drm_device *dev,
892 uint32_t handle);
893
883 /* Driver private ops for this object */ 894 /* Driver private ops for this object */
884 struct vm_operations_struct *gem_vm_ops; 895 struct vm_operations_struct *gem_vm_ops;
885 896
@@ -1544,6 +1555,7 @@ drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
1544int drm_gem_handle_create(struct drm_file *file_priv, 1555int drm_gem_handle_create(struct drm_file *file_priv,
1545 struct drm_gem_object *obj, 1556 struct drm_gem_object *obj,
1546 u32 *handlep); 1557 u32 *handlep);
1558int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
1547 1559
1548static inline void 1560static inline void
1549drm_gem_object_handle_reference(struct drm_gem_object *obj) 1561drm_gem_object_handle_reference(struct drm_gem_object *obj)
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 801be59f4f15..080a6e33470e 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -798,4 +798,11 @@ extern int drm_add_modes_noedid(struct drm_connector *connector,
798extern bool drm_edid_is_valid(struct edid *edid); 798extern bool drm_edid_is_valid(struct edid *edid);
799struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, 799struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
800 int hsize, int vsize, int fresh); 800 int hsize, int vsize, int fresh);
801
802extern int drm_mode_create_dumb_ioctl(struct drm_device *dev,
803 void *data, struct drm_file *file_priv);
804extern int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
805 void *data, struct drm_file *file_priv);
806extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
807 void *data, struct drm_file *file_priv);
801#endif /* __DRM_CRTC_H__ */ 808#endif /* __DRM_CRTC_H__ */
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 0fc7397c8f1f..ae6b7a3dbec7 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -344,4 +344,33 @@ struct drm_mode_crtc_page_flip {
344 __u64 user_data; 344 __u64 user_data;
345}; 345};
346 346
347/* create a dumb scanout buffer */
348struct drm_mode_create_dumb {
349 uint32_t height;
350 uint32_t width;
351 uint32_t bpp;
352 uint32_t flags;
353 /* handle, pitch, size will be returned */
354 uint32_t handle;
355 uint32_t pitch;
356 uint64_t size;
357};
358
359/* set up for mmap of a dumb scanout buffer */
360struct drm_mode_map_dumb {
361 /** Handle for the object being mapped. */
362 __u32 handle;
363 __u32 pad;
364 /**
365 * Fake offset to use for subsequent mmap call
366 *
367 * This is a fixed-size type for 32/64 compatibility.
368 */
369 __u64 offset;
370};
371
372struct drm_mode_destroy_dumb {
373 uint32_t handle;
374};
375
347#endif 376#endif