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.
This commit is contained in:
Jesse Barnes 2008-08-12 18:22:34 -07:00
parent 8074b2e83d
commit e9648e9107
2 changed files with 5 additions and 0 deletions

View file

@ -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;
};
/**

View file

@ -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;