From dabd056bf34b389585b618cf03a297877505f06b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 29 Apr 2008 13:30:44 -0700 Subject: Move mmfs ioctls into the DRM. Untested. --- shared-core/drm.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'shared-core/drm.h') diff --git a/shared-core/drm.h b/shared-core/drm.h index 5981dcb8..caa3dbd1 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -960,6 +960,69 @@ struct drm_mm_info_arg { uint64_t p_size; }; + +struct drm_mm_alloc_args { + /** + * Requested size for the object. + * + * The (page-aligned) allocated size for the object will be returned. + */ + uint32_t size; + /** Returned handle for the object. */ + uint32_t handle; +}; + +struct drm_mm_unreference_args { + /** Handle of the object to be unreferenced. */ + uint32_t handle; +}; + +struct drm_mm_link_args { + /** Handle for the object being given a name. */ + uint32_t handle; + /** Requested file name to export the object under. */ + char *name; + /** Requested file mode to export the object under. */ + mode_t mode; +}; + +struct drm_mm_pread_args { + /** Handle for the object being read. */ + uint32_t handle; + /** Offset into the object to read from */ + off_t offset; + /** Length of data to read */ + size_t size; + /** Pointer to write the data into. */ + void *data; +}; + +struct drm_mm_pwrite_args { + /** Handle for the object being written to. */ + uint32_t handle; + /** Offset into the object to write to */ + off_t offset; + /** Length of data to write */ + size_t size; + /** Pointer to read the data from. */ + void *data; +}; + +struct drm_mm_mmap_args { + /** Handle for the object being mapped. */ + uint32_t handle; + /** Offset in the object to map. */ + off_t offset; + /** + * Length of data to map. + * + * The value will be page-aligned. + */ + size_t size; + /** Returned pointer the data was mapped at */ + void *addr; +}; + /** * \name Ioctls Definitions */ @@ -980,6 +1043,11 @@ struct drm_mm_info_arg { #define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) #define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) #define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) +#define DRM_IOCTL_MM_ALLOC DRM_IOWR(0x09, struct drm_mm_alloc_args) +#define DRM_IOCTL_MM_UNREFERENCE DRM_IOW(0x0a, struct drm_mm_unreference_args) +#define DRM_IOCTL_MM_PREAD DRM_IOW(0x0b, struct drm_mm_pread_args) +#define DRM_IOCTL_MM_PWRITE DRM_IOW(0x0c, struct drm_mm_pwrite_args) +#define DRM_IOCTL_MM_MMAP DRM_IOWR(0x0d, struct drm_mm_mmap_args) #define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) #define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) -- cgit v1.2.3