summaryrefslogtreecommitdiff
path: root/shared-core/drm.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-02 12:28:49 -0700
committerKeith Packard <keithp@keithp.com>2008-05-02 12:29:17 -0700
commit39e20bcd5f4bf9fedac80188fda2e9fcab2f0360 (patch)
tree7349a479090d3fd8917ec775610fc304834e1b4b /shared-core/drm.h
parent49e8e3372afcf5fab9ffef5691d87ad8bc19599a (diff)
Add name/open ioctls, separate handle and pointer ref counts.
Names are just another unique integer set (from another idr object). Names are removed when the user refernces (handles) are all destroyed -- this required that handles for objects be counted separately from internal kernel references (so that we can tell when the handles are all gone).
Diffstat (limited to 'shared-core/drm.h')
-rw-r--r--shared-core/drm.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/shared-core/drm.h b/shared-core/drm.h
index 90c23fa7..0e8da7b9 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -983,16 +983,6 @@ struct drm_gem_unreference {
uint32_t pad;
};
-struct drm_gem_link {
- /** Handle for the object being given a name. */
- uint32_t handle;
- uint32_t pad;
- /** Requested file name to export the object under. */
- uint64_t name_ptr; /* char *, but pointers are not 32/64 compatible */
- /** Requested file mode to export the object under. */
- mode_t mode;
-};
-
struct drm_gem_pread {
/** Handle for the object being read. */
uint32_t handle;
@@ -1033,6 +1023,25 @@ struct drm_gem_mmap {
uint64_t addr_ptr; /* void *, but pointers are not 32/64 compatible */
};
+struct drm_gem_name {
+ /** Handle for the object being named */
+ uint32_t handle;
+
+ /** Returned global name */
+ uint32_t name;
+};
+
+struct drm_gem_open {
+ /** Name of object being opened */
+ uint32_t name;
+
+ /** Returned handle for the object */
+ uint32_t handle;
+
+ /** Returned size of the object */
+ uint64_t size;
+};
+
/**
* \name Ioctls Definitions
*/
@@ -1058,6 +1067,8 @@ struct drm_gem_mmap {
#define DRM_IOCTL_GEM_PREAD DRM_IOW(0x0b, struct drm_gem_pread)
#define DRM_IOCTL_GEM_PWRITE DRM_IOW(0x0c, struct drm_gem_pwrite)
#define DRM_IOCTL_GEM_MMAP DRM_IOWR(0x0d, struct drm_gem_mmap)
+#define DRM_IOCTL_GEM_NAME DRM_IOWR(0x0e, struct drm_gem_name)
+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0f, struct drm_gem_open)
#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)