drm: Branch 'master'

[email protected] (Christian K??nig) Thu, 22 Mar 2018 08:59:40 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 amdgpu/amdgpu_bo.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b81d44d587d1706d5c7568e539340632a748782b
Author: Satyajit <[email protected]>
Date:   Mon Feb 26 18:07:03 2018 +0530

    libdrm: amdgpu: Adding DRM_RDWR flag in amdgpu_bo_export
    
    Currently while exporting prime handle to fd read write access is
    not granted. mmap fails because of this. mmap was not supported on
    prime initially.
    Here is link to related discussion
    https://lists.freedesktop.org/archives/dri-devel/2017-February/131840.html
    
    Adding the DRM_RDWR flag in amdgpu_bo_export to support mmap.
    
    Signed-off-by: Satyajit <[email protected]>
    Acked-by: Christian König <[email protected]>

diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index cb255cb0..9e37b149 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -246,8 +246,9 @@ int amdgpu_bo_export(amdgpu_bo_handle bo,
 
 	case amdgpu_bo_handle_type_dma_buf_fd:
 		amdgpu_add_handle_to_table(bo);
-		return drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC,
-				       (int*)shared_handle);
+		return drmPrimeHandleToFD(bo->dev->fd, bo->handle,
+					  DRM_CLOEXEC | DRM_RDWR,
+					  (int*)shared_handle);
 	}
 	return -EINVAL;
 }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
_______________________________________________
Dri-patches mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-patches