blob: 6757f601fcd54c7e30c06f6cbfc5550c059ac300 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
From e3976d1e541b68fb73584a289acfa9e0f6d4f7d7 Mon Sep 17 00:00:00 2001
From: Christian Koenig <christian.koenig@amd.com>
Date: Wed, 2 Dec 2015 15:48:11 +0100
Subject: [PATCH 0822/4131] drm/amdgpu: disallow foreign BOs in the display
path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Pinning them in other devices VRAM would obviously not work.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 6744e0c..06a1b82 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -181,6 +181,12 @@ int amdgpu_crtc_page_flip_target(struct drm_crtc *crtc,
obj = new_amdgpu_fb->obj;
new_abo = gem_to_amdgpu_bo(obj);
+ if (new_rbo->adev != adev) {
+ DRM_ERROR("Foreign BOs not allowed in the display engine\n");
+ r = -EINVAL;
+ goto cleanup;
+ }
+
/* pin the new buffer */
r = amdgpu_bo_reserve(new_abo, false);
if (unlikely(r != 0)) {
--
2.7.4
|