diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-08-12 18:22:34 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-08-12 18:22:34 -0700 |
commit | e9648e9107e90c3ef38a9c9ebb95bac1297d0df5 (patch) | |
tree | 5fd12fb7db6fac8ab07658b4123e2cc4fd850502 | |
parent | 8074b2e83d18bbf85d1c3284f561d849c829dd4b (diff) |
Export a generic dri_bo handle for use by clients
We'll need something like this (either a handle field or a dri_bo_get_handle
function) for kernel mode setting to get at the handles.
-rw-r--r-- | libdrm/dri_bufmgr.h | 4 | ||||
-rw-r--r-- | libdrm/intel/intel_bufmgr_gem.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libdrm/dri_bufmgr.h b/libdrm/dri_bufmgr.h index a5ae6c0f..7a7dd6e9 100644 --- a/libdrm/dri_bufmgr.h +++ b/libdrm/dri_bufmgr.h @@ -58,6 +58,10 @@ struct _dri_bo { void *virtual; /** Buffer manager context associated with this buffer object */ dri_bufmgr *bufmgr; + /** + * MM-specific handle for accessing object + */ + int handle; }; /** diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index 22f8695d..02b1b252 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -311,6 +311,7 @@ dri_gem_bo_alloc(dri_bufmgr *bufmgr, const char *name, ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CREATE, &create); bo_gem->gem_handle = create.handle; + bo_gem->bo.handle = bo_gem->gem_handle; if (ret != 0) { free(bo_gem); return NULL; |