aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0284-drm-amdgpu-don-t-allocate-zero-sized-kernel-BOs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0284-drm-amdgpu-don-t-allocate-zero-sized-kernel-BOs.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0284-drm-amdgpu-don-t-allocate-zero-sized-kernel-BOs.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0284-drm-amdgpu-don-t-allocate-zero-sized-kernel-BOs.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0284-drm-amdgpu-don-t-allocate-zero-sized-kernel-BOs.patch
new file mode 100644
index 00000000..71adc19e
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0284-drm-amdgpu-don-t-allocate-zero-sized-kernel-BOs.patch
@@ -0,0 +1,35 @@
+From 7b937b59485080a47bc9c3906bfeff2d63c3dd48 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Fri, 14 Sep 2018 21:03:37 +0200
+Subject: [PATCH 0284/2940] drm/amdgpu: don't allocate zero sized kernel BOs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Just free the BO if the size should be zero.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+index 7d01aa8d5b6d..12690ba4d1ea 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+@@ -274,6 +274,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
+ bool free = false;
+ int r;
+
++ if (!size) {
++ amdgpu_bo_unref(bo_ptr);
++ return 0;
++ }
++
+ memset(&bp, 0, sizeof(bp));
+ bp.size = size;
+ bp.byte_align = align;
+--
+2.17.1
+