mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-24 14:50:11 +01:00
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:
parent
8074b2e83d
commit
e9648e9107
2 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue