From e3976d1e541b68fb73584a289acfa9e0f6d4f7d7 Mon Sep 17 00:00:00 2001 From: Christian Koenig 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 --- 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