All of lore.kernel.org
 help / color / mirror / Atom feed
From: raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Christopher James Halse Rogers
	<christopher.halse.rogers-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH v2] drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)
Date: Wed, 29 Mar 2017 15:02:11 +1100	[thread overview]
Message-ID: <20170329040211.18844-1-raof@ubuntu.com> (raw)
In-Reply-To: <20170329002720.11445-4-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>

From: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>

Any use of the framebuffer will migrate it to VRAM, which is not sensible for
an imported dma-buf.

v2: Use DRM_DEBUG_KMS to prevent userspace accidentally spamming dmesg.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
CC: amd-gfx@lists.freedesktop.org
---
 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 39fc388f222a..2f2e9b5c8a6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -612,6 +612,12 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,
 		return ERR_PTR(-ENOENT);
 	}
 
+	/* Handle is imported dma-buf, so cannot be migrated to VRAM for scanout */
+	if (obj->import_attach) {
+		DRM_DEBUG_KMS("Cannot create framebuffer from imported dma_buf\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	amdgpu_fb = kzalloc(sizeof(*amdgpu_fb), GFP_KERNEL);
 	if (amdgpu_fb == NULL) {
 		drm_gem_object_unreference_unlocked(obj);
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-03-29  4:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  0:27 [PATCH] Fixes for interaction of imported dma-bufs and scanout raof
2017-03-29  0:27 ` [PATCH 1/6] drm/nouveau: Fail fb creation from imported dma-bufs raof
2017-03-29  8:47   ` Maarten Lankhorst
2017-03-29  0:27 ` [PATCH 2/6] drm/nouveau: Pin bos from imported dma-bufs to GTT raof
2017-03-29  8:45   ` Maarten Lankhorst
2017-04-03  5:56   ` [PATCH 2/6 v2] drm/nouveau: Pin bos from imported dma-bufs to GTT. (v2) raof
     [not found] ` <20170329002720.11445-1-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-03-29  0:27   ` [PATCH 3/6] drm/amdgpu: Fail fb creation from imported dma-bufs raof-GeWIH/nMZzLQT0dZR+AlfA
     [not found]     ` <20170329002720.11445-4-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-03-29  2:03       ` Michel Dänzer
     [not found]         ` <4a950f45-3ad5-2d63-c434-0474e8cfda37-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-29  3:41           ` Christopher James Halse Rogers
2017-03-29  4:02       ` raof-GeWIH/nMZzLQT0dZR+AlfA [this message]
     [not found]         ` <20170329040211.18844-1-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-03-29  6:07           ` [PATCH v2] drm/amdgpu: Fail fb creation from imported dma-bufs. (v2) Michel Dänzer
     [not found]             ` <2b175dd8-abeb-b3e7-d783-355607a48fda-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-29 21:51               ` Alex Deucher
2017-03-29  0:27   ` [PATCH 4/6] drm/amd/amdgpu: Pin bos from imported dma-bufs to GTT raof-GeWIH/nMZzLQT0dZR+AlfA
2017-03-29  1:57     ` Michel Dänzer
2017-03-29  7:14     ` Christian König
2017-03-29  9:07       ` Michel Dänzer
2017-03-29  9:11         ` Christian König
     [not found]     ` <20170329002720.11445-5-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-04-03  3:31       ` [PATCH 4/6 (v2)] drm/amdgpu: Refuse to pin or change acceptable domains of prime BOs to VRAM. (v2) raof-GeWIH/nMZzLQT0dZR+AlfA
2017-03-29  0:27   ` [PATCH 5/6] drm/radeon: Fail fb creation from imported dma-bufs raof-GeWIH/nMZzLQT0dZR+AlfA
     [not found]     ` <20170329002720.11445-6-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-03-29  4:00       ` [PATCH v2] " raof-GeWIH/nMZzLQT0dZR+AlfA
     [not found]         ` <20170329040054.18587-1-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-03-29  7:18           ` Christian König
2017-03-29  0:27 ` [PATCH 6/6] drm/radeon: Pin bos from imported dma-bufs to GTT raof
     [not found]   ` <20170329002720.11445-7-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-04-03  3:35     ` [PATCH 6/7] drm/radeon: Maintain prime import/export refcount for BOs raof-GeWIH/nMZzLQT0dZR+AlfA
     [not found]       ` <20170403033523.22639-1-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-04-03  3:35         ` [PATCH 7/7 v2] drm/radeon: Refuse to migrate a prime BO to VRAM. (v2) raof-GeWIH/nMZzLQT0dZR+AlfA
     [not found]           ` <20170403033523.22639-2-raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
2017-04-03  8:24             ` Christian König
2017-04-03 15:51               ` Alex Deucher
2017-04-03 16:00                 ` Christian König
     [not found]                   ` <c9417139-b930-040b-c186-e99b8ecc3474-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-04  8:03                     ` Christopher James Halse Rogers
     [not found]               ` <4fe38f82-c9d5-c212-fa05-08c2b4684c4e-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-04 15:08                 ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170329040211.18844-1-raof@ubuntu.com \
    --to=raof-gewih/nmzzlqt0dzr+alfa@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christopher.halse.rogers-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.