summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/drm.h22
-rw-r--r--shared-core/i915_dma.c4
-rw-r--r--shared-core/i915_drm.h20
-rw-r--r--shared-core/i915_drv.h20
4 files changed, 40 insertions, 26 deletions
diff --git a/shared-core/drm.h b/shared-core/drm.h
index caa3dbd1..d79fa5f8 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -961,7 +961,7 @@ struct drm_mm_info_arg {
};
-struct drm_mm_alloc_args {
+struct drm_gem_alloc_args {
/**
* Requested size for the object.
*
@@ -972,12 +972,12 @@ struct drm_mm_alloc_args {
uint32_t handle;
};
-struct drm_mm_unreference_args {
+struct drm_gem_unreference_args {
/** Handle of the object to be unreferenced. */
uint32_t handle;
};
-struct drm_mm_link_args {
+struct drm_gem_link_args {
/** Handle for the object being given a name. */
uint32_t handle;
/** Requested file name to export the object under. */
@@ -986,7 +986,7 @@ struct drm_mm_link_args {
mode_t mode;
};
-struct drm_mm_pread_args {
+struct drm_gem_pread_args {
/** Handle for the object being read. */
uint32_t handle;
/** Offset into the object to read from */
@@ -997,7 +997,7 @@ struct drm_mm_pread_args {
void *data;
};
-struct drm_mm_pwrite_args {
+struct drm_gem_pwrite_args {
/** Handle for the object being written to. */
uint32_t handle;
/** Offset into the object to write to */
@@ -1008,7 +1008,7 @@ struct drm_mm_pwrite_args {
void *data;
};
-struct drm_mm_mmap_args {
+struct drm_gem_mmap_args {
/** Handle for the object being mapped. */
uint32_t handle;
/** Offset in the object to map. */
@@ -1043,11 +1043,11 @@ struct drm_mm_mmap_args {
#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_GEM_ALLOC DRM_IOWR(0x09, struct drm_gem_alloc_args)
+#define DRM_IOCTL_GEM_UNREFERENCE DRM_IOW(0x0a, struct drm_gem_unreference_args)
+#define DRM_IOCTL_GEM_PREAD DRM_IOW(0x0b, struct drm_gem_pread_args)
+#define DRM_IOCTL_GEM_PWRITE DRM_IOW(0x0c, struct drm_gem_pwrite_args)
+#define DRM_IOCTL_GEM_MMAP DRM_IOWR(0x0d, struct drm_gem_mmap_args)
#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 6c6fd435..821b2a95 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -1124,8 +1124,8 @@ struct drm_ioctl_desc i915_ioctls[] = {
#ifdef I915_HAVE_BUFFER
DRM_IOCTL_DEF(DRM_I915_EXECBUFFER, i915_execbuffer, DRM_AUTH),
#endif
- DRM_IOCTL_DEF(DRM_I915_MM_INIT, intel_mm_init_ioctl, DRM_AUTH),
- DRM_IOCTL_DEF(DRM_I915_MM_EXECBUFFER, intel_mm_execbuffer, DRM_AUTH),
+ DRM_IOCTL_DEF(DRM_I915_GEM_INIT, i915_gem_init_ioctl, DRM_AUTH),
+ DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER, i915_gem_execbuffer, DRM_AUTH),
};
int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
diff --git a/shared-core/i915_drm.h b/shared-core/i915_drm.h
index 1a70010b..4c241fc5 100644
--- a/shared-core/i915_drm.h
+++ b/shared-core/i915_drm.h
@@ -176,8 +176,8 @@ typedef struct drm_i915_sarea {
#define DRM_I915_MMIO 0x10
#define DRM_I915_HWS_ADDR 0x11
#define DRM_I915_EXECBUFFER 0x12
-#define DRM_I915_MM_INIT 0x13
-#define DRM_I915_MM_EXECBUFFER 0x14
+#define DRM_I915_GEM_INIT 0x13
+#define DRM_I915_GEM_EXECBUFFER 0x14
#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -197,8 +197,8 @@ typedef struct drm_i915_sarea {
#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
#define DRM_IOCTL_I915_MMIO DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_MMIO, drm_i915_mmio)
#define DRM_IOCTL_I915_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_EXECBUFFER, struct drm_i915_execbuffer)
-#define DRM_IOCTL_I915_MM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_MM_INIT, struct drm_i915_mm_init)
-#define DRM_IOCTL_I915_MM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_MM_INIT, struct drm_i915_mm_execbuffer)
+#define DRM_IOCTL_I915_MM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
+#define DRM_IOCTL_I915_MM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_execbuffer)
/* Asynchronous page flipping:
*/
@@ -398,7 +398,7 @@ struct drm_i915_execbuffer {
struct drm_fence_arg fence_arg;
};
-struct drm_i915_mm_init {
+struct drm_i915_gem_init {
/**
* Beginning offset in the GTT to be managed by the DRM memory
* manager.
@@ -411,7 +411,7 @@ struct drm_i915_mm_init {
off_t gtt_end;
};
-struct drm_i915_relocation_entry {
+struct drm_i915_gem_relocation_entry {
/**
* Handle of the buffer being pointed to by this relocation entry.
*
@@ -441,7 +441,7 @@ struct drm_i915_relocation_entry {
uint32_t presumed_offset;
};
-struct drm_i915_mm_validate_entry {
+struct drm_i915_gem_validate_entry {
/**
* User's handle for a buffer to be bound into the GTT for this
* operation.
@@ -453,11 +453,11 @@ struct drm_i915_mm_validate_entry {
*/
uint32_t buffer_offset;
/** List of relocations to be performed on this buffer */
- struct drm_i915_relocation_entry *relocs;
+ struct drm_i915_gem_relocation_entry *relocs;
uint32_t relocation_count;
};
-struct drm_i915_mm_execbuffer {
+struct drm_i915_gem_execbuffer {
/**
* List of buffers to be validated wit their relocations to be
* performend on them.
@@ -466,7 +466,7 @@ struct drm_i915_mm_execbuffer {
* a buffer is performing refer to buffers that have already appeared
* in the validate list.
*/
- struct drm_i915_mm_validate_entry *buffers;
+ struct drm_i915_gem_validate_entry *buffers;
uint32_t buffer_count;
/** Offset in the batchbuffer to start execution from. */
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index 0c6ec588..7913f48b 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -254,6 +254,18 @@ enum intel_chip_family {
CHIP_I965 = 0x08,
};
+/** driver private structure attached to each drm_gem_object */
+struct drm_i915_gem_object {
+ /** Current offset of the object in GTT space, if any. */
+ uint32_t gtt_offset;
+
+ /** Boolean whether this object has a valid gtt offset. */
+ int gtt_bound;
+
+ /** How many users have pinned this object in GTT space */
+ int pin_count;
+};
+
extern struct drm_ioctl_desc i915_ioctls[];
extern int i915_max_ioctl;
@@ -333,11 +345,13 @@ void i915_flush_ttm(struct drm_ttm *ttm);
/* i915_execbuf.c */
int i915_execbuffer(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-/* i915_mm.c */
-int intel_mm_init_ioctl(struct drm_device *dev, void *data,
+/* i915_gem.c */
+int i915_gem_init_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-int intel_mm_execbuffer(struct drm_device *dev, void *data,
+int i915_gem_execbuffer(struct drm_device *dev, void *data,
struct drm_file *file_priv);
+int i915_gem_init_object(struct drm_device *dev, struct drm_gem_object *obj);
+void i915_gem_free_object(struct drm_device *dev, struct drm_gem_object *obj);
#endif