Use gbm_bo_get_fd to get DMA_BUF fd

When GBM is used for buffer allocation, gbm_bo_get_fd should be
used to get the DMA_BUF fd.

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Jammy Zhou
2015-05-12 00:09:42 +08:00
committed by Michel Dänzer
parent b69c5b3cc2
commit 4840f918ab

View File

@@ -296,7 +296,11 @@ Bool amdgpu_share_pixmap_backing(struct amdgpu_buffer *bo, void **handle_p)
{
int handle;
amdgpu_bo_export(bo->bo.amdgpu, amdgpu_bo_handle_type_dma_buf_fd,
if (bo->flags & AMDGPU_BO_FLAGS_GBM)
handle = gbm_bo_get_fd(bo->bo.gbm);
else
amdgpu_bo_export(bo->bo.amdgpu,
amdgpu_bo_handle_type_dma_buf_fd,
(uint32_t *)&handle);
*handle_p = (void *)(long)handle;