summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2019-06-28 18:35:56 +0200
committerMichel Dänzer <[email protected]>2019-07-03 09:19:07 +0000
commit11a3679e3aba3524cf987f1f808d92c25f16e080 (patch)
tree9a55d792a74018d6cbe2ef766e5d8da85802bb01 /src/gallium/drivers/radeon
parentcb446dc0fa5c68f681108f4613560543aa4cf553 (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/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/radeon_winsys.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h
index c27627e8926..525c28182ed 100644
--- a/src/gallium/drivers/radeon/radeon_winsys.h
+++ b/src/gallium/drivers/radeon/radeon_winsys.h
@@ -411,12 +411,14 @@ struct radeon_winsys {
* Get a winsys handle from a winsys buffer. The internal structure
* of the handle is platform-specific and only a winsys should access it.
*
+ * \param ws The winsys instance for which the handle is to be valid
* \param buf A winsys buffer object to get the handle from.
* \param whandle A winsys handle pointer.
* \param stride A stride of the buffer in bytes, for texturing.
* \return true on success.
*/
- bool (*buffer_get_handle)(struct pb_buffer *buf,
+ bool (*buffer_get_handle)(struct radeon_winsys *ws,
+ struct pb_buffer *buf,
unsigned stride, unsigned offset,
unsigned slice_size,
struct winsys_handle *whandle);