diff options
author | Michel Dänzer <[email protected]> | 2019-06-28 18:35:56 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2019-07-03 09:19:07 +0000 |
commit | 11a3679e3aba3524cf987f1f808d92c25f16e080 (patch) | |
tree | 9a55d792a74018d6cbe2ef766e5d8da85802bb01 /src/gallium/winsys/radeon | |
parent | cb446dc0fa5c68f681108f4613560543aa4cf553 (diff) |
winsys/amdgpu: Make KMS handles valid for original DRM file descriptor
Getting a DMA-buf fd and converting that to a handle using our duplicate
of that file descriptor (getting at which requires passing a
radeon_winsys pointer to the buffer_get_handle hook) makes sure of this,
since duplicated file descriptors reference the same file description
and therefore the same GEM handle namespace.
This is necessary because libdrm_amdgpu may use a different DRM file
descriptor with a separate handle namespace internally, e.g. because it
always reuses any existing amdgpu_device_handle for the same device.
amdgpu_bo_export returns a handle which is valid for that internal
file descriptor.
Bugzilla: https://bugs.freedesktop.org/110903
Reviewed-by: Marek Olšák <[email protected]>
Tested-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index d1e2a8685ba..e9e0784e9ab 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -1285,7 +1285,8 @@ fail: return NULL; } -static bool radeon_winsys_bo_get_handle(struct pb_buffer *buffer, +static bool radeon_winsys_bo_get_handle(struct radeon_winsys *rws, + struct pb_buffer *buffer, unsigned stride, unsigned offset, unsigned slice_size, struct winsys_handle *whandle) |