...And the patch.
Thomas Hellström wrote:
Dave Airlie wrote:
I'll try it out as soon as there is time.
I've just tested glxgears and a few mesa tests on it and it seems to
be working fine....
We should probably think about pulling this over into the DRM sooner
rather than later, there are also some changes to the DDX
i830_driver.c compat code to deal with...
Yup. I've attached a patch (against the cleanup branch) with things I
think may be needed.
1) 64-bit reordering. 64-bit scalars, structs and unions should
probably be 64-bit aligned in parent structs. I had to insert padding
in two cases, but this probably needs to be double-checked.
2) A "magic" member in the init ioctl. Checking this allows for
verbose and friendly failure of code that uses the old interface.
3) Init major / minor versioning of the memory manager interface in
case we need changes in the future.
4) expand_pads are 64-bit following Jesse Barnes recommendations.
5) The info_req carries a fence class for validation for a particular
command submission mechanism.
6) The info_rep arg carries tile_strides and tile_info.
The argument tile_strides is ((actual_tile_stride) << 16) |
(desired_tile_stride))
The argument tile_info is driver-specific. (Could be tile width,
x-major, y-major etc.)
Finally, should we perhaps allow for 64-bit buffer object flags / mask
at this point?
I haven't done any user-space or kernel coding for this yet.
Just want to know what you think.
/Thomas
>From 2b7d5bff5a6aeca08ccf1931828eeca74935bad5 Mon Sep 17 00:00:00 2001
From: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Wed, 9 May 2007 09:56:06 +0200
Subject: [PATCH] New members and 64-bit reordering.
Signed-off-by: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
---
shared-core/drm.h | 46 +++++++++++++++++++++++++++++-----------------
1 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/shared-core/drm.h b/shared-core/drm.h
index ae308be..5cb2545 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -671,12 +671,13 @@ #define DRM_FENCE_MASK_DRIVER
#define DRM_FENCE_TYPE_EXE 0x00000001
typedef struct drm_fence_arg {
- unsigned handle;
- int class;
- unsigned type;
- unsigned flags;
- unsigned signaled;
- unsigned expand_pad[4]; /*Future expansion */
+ unsigned int handle;
+ unsigned int class;
+ unsigned int type;
+ unsigned int flags;
+ unsigned int signaled;
+ unsigned int pad_64;
+ drm_u64_t expand_pad[3]; /*Future expansion */
} drm_fence_arg_t;
/* Buffer permissions, referring to how the GPU uses the buffers.
@@ -774,6 +775,10 @@ #define DRM_BO_HINT_DONT_FENCE 0x000000
#define DRM_BO_HINT_WAIT_LAZY 0x00000008
#define DRM_BO_HINT_ALLOW_UNFENCED_MAP 0x00000010
+#define DRM_BO_INIT_MAGIC 0xfe769812
+#define DRM_BO_INIT_MAJOR 0
+#define DRM_BO_INIT_MINOR 1
+
typedef enum {
drm_bo_type_dc,
@@ -786,25 +791,26 @@ struct drm_bo_info_req {
unsigned int handle;
unsigned int mask;
unsigned int hint;
+ unsigned int fence_class;
};
struct drm_bo_create_req {
unsigned int mask;
unsigned int hint;
- unsigned page_alignment;
- drm_u64_t size;
+ unsigned int page_alignment;
drm_bo_type_t type;
+ drm_u64_t size;
drm_u64_t buffer_start;
};
struct drm_bo_op_req {
- struct drm_bo_info_req bo_req;
- unsigned int arg_handle;
enum {
drm_bo_validate,
drm_bo_fence,
drm_bo_ref_fence,
} op;
+ unsigned int arg_handle;
+ struct drm_bo_info_req bo_req;
};
/*
@@ -816,20 +822,22 @@ #define DRM_BO_REP_BUSY 0x00000001
struct drm_bo_info_rep {
unsigned int handle;
unsigned int flags;
- drm_u64_t size;
- drm_u64_t offset;
- drm_u64_t arg_handle;
unsigned int mask;
- drm_u64_t buffer_start;
unsigned int fence_flags;
unsigned int rep_flags;
unsigned int page_alignment;
- unsigned int expand_pad[4]; /*Future expansion */
+ unsigned int tile_strides;
+ unsigned int tile_info;
+ drm_u64_t size;
+ drm_u64_t offset;
+ drm_u64_t arg_handle;
+ drm_u64_t buffer_start;
+ drm_u64_t expand_pad[4]; /*Future expansion */
};
struct drm_bo_arg_rep {
- int ret;
struct drm_bo_info_rep bo_info;
+ int ret;
};
struct drm_bo_create_arg {
@@ -859,6 +867,7 @@ struct drm_bo_map_wait_idle_arg {
struct drm_bo_op_arg {
int handled;
+ unsigned int pad_64;
drm_u64_t next;
union {
struct drm_bo_op_req req;
@@ -882,9 +891,12 @@ typedef struct drm_mm_type_arg {
} drm_mm_type_arg_t;
typedef struct drm_mm_init_arg {
+ unsigned int magic;
+ unsigned int major;
+ unsigned int minor;
+ unsigned int mem_type;
drm_u64_t p_offset;
drm_u64_t p_size;
- unsigned int mem_type;
} drm_mm_init_arg_t;
/**
--
1.4.1
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel