summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-08-09 15:30:36 -0700
committerIan Romanick <idr@us.ibm.com>2007-08-09 15:30:36 -0700
commitaea6b4dea9708f66f5fc2068fe84407682570aca (patch)
treed2a4e20c903edc89ddb8e49847be309f6451a224 /shared-core
parent25cb876f8513d02d4d189371eaa8b7b9a88e860d (diff)
Unify alloc and free ioctls.
The DRM_XGI_PCIE_ALLOC and DRM_XGI_FB_ALLOC ioctls (and the matching free ioctls) are unified to DRM_XGI_ALLOC. The desired memory region is selected by xgi_mem_alloc::location. The region is magically encoded in xgi_mem_alloc::index, which is used to release the memory. Bump to version 0.11.0. This update requires a new DDX.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/xgi_drm.h46
1 files changed, 29 insertions, 17 deletions
diff --git a/shared-core/xgi_drm.h b/shared-core/xgi_drm.h
index adce7066..c980a35a 100644
--- a/shared-core/xgi_drm.h
+++ b/shared-core/xgi_drm.h
@@ -60,10 +60,20 @@ enum xgi_mem_location {
};
struct xgi_mem_alloc {
+ /**
+ * Memory region to be used for allocation.
+ *
+ * Must be one of XGI_MEMLOC_NON_LOCAL or XGI_MEMLOC_LOCAL.
+ */
unsigned int location;
+
+ /**
+ * Number of bytes request.
+ *
+ * On successful allocation, set to the actual number of bytes
+ * allocated.
+ */
unsigned int size;
- unsigned int is_front;
- unsigned int owner;
/**
* Address of the memory from the graphics hardware's point of view.
@@ -74,6 +84,13 @@ struct xgi_mem_alloc {
* Offset of the allocation in the mapping.
*/
__u32 offset;
+
+ /**
+ * Magic handle used to release memory.
+ *
+ * See also DRM_XGI_FREE ioctl.
+ */
+ unsigned long index;
};
enum xgi_batch_type {
@@ -102,24 +119,19 @@ struct xgi_state_info {
*/
#define DRM_XGI_BOOTSTRAP 0
-#define DRM_XGI_FB_ALLOC 1
-#define DRM_XGI_FB_FREE 2
-#define DRM_XGI_PCIE_ALLOC 3
-#define DRM_XGI_PCIE_FREE 4
-#define DRM_XGI_SUBMIT_CMDLIST 5
-#define DRM_XGI_GE_RESET 6
-#define DRM_XGI_DUMP_REGISTER 7
-#define DRM_XGI_DEBUG_INFO 8
-#define DRM_XGI_TEST_RWINKERNEL 9
-#define DRM_XGI_STATE_CHANGE 10
+#define DRM_XGI_ALLOC 1
+#define DRM_XGI_FREE 2
+#define DRM_XGI_SUBMIT_CMDLIST 3
+#define DRM_XGI_GE_RESET 4
+#define DRM_XGI_DUMP_REGISTER 5
+#define DRM_XGI_DEBUG_INFO 6
+#define DRM_XGI_TEST_RWINKERNEL 7
+#define DRM_XGI_STATE_CHANGE 8
#define XGI_IOCTL_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_BOOTSTRAP, struct xgi_bootstrap)
-#define XGI_IOCTL_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_FB_ALLOC, struct xgi_mem_alloc)
-#define XGI_IOCTL_FB_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_XGI_FB_FREE, __u32)
-
-#define XGI_IOCTL_PCIE_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_PCIE_ALLOC, struct xgi_mem_alloc)
-#define XGI_IOCTL_PCIE_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_XGI_PCIE_FREE, __u32)
+#define XGI_IOCTL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_XGI_ALLOC, struct xgi_mem_alloc)
+#define XGI_IOCTL_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_XGI_FREE, __u32)
#define XGI_IOCTL_GE_RESET DRM_IO(DRM_COMMAND_BASE + DRM_XGI_GE_RESET)
#define XGI_IOCTL_DUMP_REGISTER DRM_IO(DRM_COMMAND_BASE + DRM_XGI_DUMP_REGISTER)