<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, 29 Mar 2017 at 13:04 Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 29/03/17 09:27 AM, <a href="mailto:raof@ubuntu.com" class="gmail_msg" target="_blank">raof@ubuntu.com</a> wrote:<br class="gmail_msg">
> From: Christopher James Halse Rogers <<a href="mailto:christopher.halse.rogers@canonical.com" class="gmail_msg" target="_blank">christopher.halse.rogers@canonical.com</a>><br class="gmail_msg">
><br class="gmail_msg">
> Any use of the framebuffer will migrate it to VRAM, which is not sensible for<br class="gmail_msg">
> an imported dma-buf.<br class="gmail_msg">
><br class="gmail_msg">
> Signed-off-by: Christopher James Halse Rogers <<a href="mailto:christopher.halse.rogers@canonical.com" class="gmail_msg" target="_blank">christopher.halse.rogers@canonical.com</a>><br class="gmail_msg">
> CC: <a href="mailto:amd-gfx@lists.freedesktop.org" class="gmail_msg" target="_blank">amd-gfx@lists.freedesktop.org</a><br class="gmail_msg">
> ---<br class="gmail_msg">
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 ++++++<br class="gmail_msg">
> 1 file changed, 6 insertions(+)<br class="gmail_msg">
><br class="gmail_msg">
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br class="gmail_msg">
> index 39fc388f222a..e7c3cc5b7d62 100644<br class="gmail_msg">
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br class="gmail_msg">
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br class="gmail_msg">
> @@ -612,6 +612,12 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,<br class="gmail_msg">
> return ERR_PTR(-ENOENT);<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> + /* Handle is imported dma-buf, so cannot be migrated to VRAM for scanout */<br class="gmail_msg">
<br class="gmail_msg">
Newer APUs support scanout from GTT, though they still impose some<br class="gmail_msg">
restrictions which will probably not be satisfied in general by BOs<br class="gmail_msg">
imported from other drivers. So this is probably okay for now.<br class="gmail_msg"></blockquote><div><br></div><div>As far as I can tell amdgpu unconditionally migrates to VRAM when trying to scanout at the moment. When that changes, so can this check :).<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> + if (obj->import_attach) {<br class="gmail_msg">
> + dev_err(&dev->pdev->dev, "Cannot create framebuffer from imported dma_buf\n");<br class="gmail_msg">
<br class="gmail_msg">
This should probably be something like DRM_DEBUG, so userspace can't<br class="gmail_msg">
spam dmesg by default. Same for patch 5.<br class="gmail_msg">
<br class="gmail_msg"></blockquote>Ta. v2 incoming.<br></div></div>