All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Christopher James Halse Rogers <chris@cooperteam.net>,
	Christopher James Halse Rogers
	<christopher.halse.rogers@canonical.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: raof@ubuntu.com, dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm: Add DRM_CAP_PRIME_SCANOUT.
Date: Mon, 17 Apr 2017 15:41:10 +0900	[thread overview]
Message-ID: <bc31c434-4c74-d266-f0e0-b959de5c94f6@daenzer.net> (raw)
In-Reply-To: <DA1DCCA1-565C-4C06-AAD5-CAAB62FF4115@cooperteam.net>

On 17/04/17 02:05 PM, Christopher James Halse Rogers wrote:
> On 10 April 2017 6:51:21 pm AEST, "Michel Dänzer" <michel@daenzer.net> wrote:
>> On 06/04/17 04:47 PM, Christopher James Halse Rogers wrote:
>>> On Wed, 5 Apr 2017 at 20:14 Lucas Stach <l.stach@pengutronix.de
>>> <mailto:l.stach@pengutronix.de>> wrote:
>>>
>>>> Drivers with separate VRAM and GTT are already doing a lot of migration
>>>> behind the userspaces back. The only issue with dma-buf migration to
>>>> VRAM is that you probably don't want to migrate the pages, but duplicate
>>>> them in VRAM, doubling memory consumption with possible OOM. But then
>>>> you could alloc the memory on addfb where you are able to return proper
>>>> errors.
>>>
>>> Hm. So, on a first inspection, this looks like something I could
>>> actually cook up.
>>>
>>> Looking at amdgpu it seems like the thing to do would be to associate a
>>> shadow-bo in VRAM for the imported dma-buf in the addfb call, then
>>> pin-and-copy-to the shadow bo in the places where the bo is currently
>>> pinned.
>>>
>>> Is this approach likely to be acceptable?
>>
>> It would break e.g. with DRI2 flips, because they replace the screen
>> pixmap buffer with the buffer we're flipping to. If the app stops
>> flipping while such a shadow BO is being scanned out, later draws to
>> the screen pixmap won't become visible.
> 
> This shadow BO would only ever be used for imported dma-bufs. This
> would change the behaviour from “addfb fails” to “you get a shadow
> BO”. (And, pre-patch, from “addfb succeeds but you never see any new
> rendering”).
> 
> I don't think any DRI2 implementation hits this, because of it did it
> would already be broken.

You're right, I got it backwards. I guess this could work.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-04-17  6:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04  8:13 [PATCH] Tell userspace if scanning out of an imported PRIME buffer is safe raof
2017-04-04  8:13 ` [PATCH 1/2] drm: Add DRM_CAP_PRIME_SCANOUT raof
2017-04-04  8:31   ` Daniel Vetter
2017-04-04 10:11     ` Daniel Stone
2017-04-04 10:27     ` Christopher James Halse Rogers
2017-04-04 10:43       ` Lucas Stach
2017-04-04 11:53         ` Daniel Vetter
2017-04-05  0:20           ` Christopher James Halse Rogers
2017-04-05  6:27             ` Daniel Vetter
2017-04-05  6:52               ` Christopher James Halse Rogers
2017-04-05  8:15             ` Lucas Stach
2017-04-05  9:59               ` Daniel Vetter
2017-04-05 10:14                 ` Lucas Stach
2017-04-05 11:13                   ` Christopher James Halse Rogers
2017-04-05 11:21                     ` Christian König
2017-04-10  8:52                       ` Michel Dänzer
2017-04-10  9:03                         ` Christian König
2017-04-10 14:10                           ` Alex Deucher
2017-04-06  7:47                   ` Christopher James Halse Rogers
2017-04-10  8:51                     ` Michel Dänzer
2017-04-17  5:05                       ` Christopher James Halse Rogers
2017-04-17  6:41                         ` Michel Dänzer [this message]
2017-04-04 10:43       ` Daniel Stone
2017-04-04 11:15         ` Christian König
2017-04-04 11:32           ` Daniel Stone
2017-04-04 11:43             ` Christian König
2017-04-04  8:13 ` [PATCH 2/2] drm/i915: support DRIVER_PRIME_SCANOUT raof

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=bc31c434-4c74-d266-f0e0-b959de5c94f6@daenzer.net \
    --to=michel@daenzer.net \
    --cc=chris@cooperteam.net \
    --cc=christopher.halse.rogers@canonical.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=l.stach@pengutronix.de \
    --cc=raof@ubuntu.com \
    /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.