diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2184-drm-amdgpu-set-f_mapping-on-exported-DMA-bufs.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2184-drm-amdgpu-set-f_mapping-on-exported-DMA-bufs.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2184-drm-amdgpu-set-f_mapping-on-exported-DMA-bufs.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2184-drm-amdgpu-set-f_mapping-on-exported-DMA-bufs.patch new file mode 100644 index 00000000..26a4aded --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2184-drm-amdgpu-set-f_mapping-on-exported-DMA-bufs.patch @@ -0,0 +1,41 @@ +From 272ada6974b3d94cca1325f7bc0ff0266054d6a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com> +Date: Mon, 13 Nov 2017 17:20:50 +0100 +Subject: [PATCH 2184/4131] drm/amdgpu: set f_mapping on exported DMA-bufs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Otherwise we can't correctly CPU map TTM buffers. + +Signed-off-by: Christian König <christian.koenig@amd.com> +Acked-by: Alex Deucher <alexander.deucher@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +index 581ba9d..26fe6ce 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +@@ -187,12 +187,16 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev, + int flags) + { + struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj); ++ struct dma_buf *buf; + + if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm) || + bo->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) + return ERR_PTR(-EPERM); + +- return drm_gem_prime_export(dev, gobj, flags); ++ buf = drm_gem_prime_export(dev, gobj, flags); ++ if (!IS_ERR(buf)) ++ buf->file->f_mapping = dev->anon_inode->i_mapping; ++ return buf; + } + + struct drm_gem_object * +-- +2.7.4 + |