All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Christopher James Halse Rogers <chris@cooperteam.net>
Cc: dri-devel@lists.freedesktop.org, raof@ubuntu.com,
	Christopher James Halse Rogers
	<christopher.halse.rogers@canonical.com>
Subject: Re: [PATCH 1/2] drm: Add DRM_CAP_PRIME_SCANOUT.
Date: Tue, 04 Apr 2017 12:43:00 +0200	[thread overview]
Message-ID: <1491302580.2367.24.camel@pengutronix.de> (raw)
In-Reply-To: <88638B51-0742-4BE9-9137-AEAB72E0B971@cooperteam.net>

Am Dienstag, den 04.04.2017, 20:27 +1000 schrieb Christopher James Halse
Rogers:
> On 4 April 2017 6:31:12 pm AEST, Daniel Vetter <daniel@ffwll.ch> wrote:
> >On Tue, Apr 04, 2017 at 06:13:20PM +1000, raof@ubuntu.com wrote:
> >> From: Christopher James Halse Rogers <raof@ubuntu.com>
> >> 
> >> Until recently, on (at least) nouveau, radeon, and amdgpu attempting
> >to scanout of an
> >> imported dma-buf would silently result in the dma-buf sharing being
> >broken.
> >> 
> >> While the hardware is capable of scanning out of imported dma-bufs
> >(at least in some circumstances),
> >> these drivers do not currently implement it, so attempts to scan out
> >of such buffers will never succeed.
> >> 
> >> Add a userspace-visible drm capability and associated driver_feature
> >so that userspace can discover
> >> when scanning out of an imported dma-buf can work.
> >> 
> >> Signed-off-by: Christopher James Halse Rogers
> ><christopher.halse.rogers@canonical.com>
> >
> >This seems like an awful specific special case. Why can't you do the
> >entire dance upfront, i.e. import buffer, addfb2? None of that has any
> >visible effect, and it will also allow you to check runtime constraints
> >which can't be covered with this here.
> >-Daniel
> 
> No, because addfb2 doesn't (or, rather, didn't) actually check any
> runtime constraints.
> 
> The problem only appeared when the buffer is actually *used* in a
> modeset - otherwise I could do a (reasonably) cheap
> import/addfb/render on exporter/read out on importer dance to detect
> it.
> 
> To be clear - this is trying to solve the problem “how can I tell if
> it's safe to addfb/pageflip rather than do a GL copy to a GPU-local
> buffer and flip from that?”.
> 
> If I could guarantee that I'd only ever run on 4.13-or-later kernels
> (I think that's when the previous patches will land?), then this would
> indeed be mostly unnecessary. It would save me a bunch of addfb calls
> that would predictably fail, but they're cheap.

I don't think we ever had caps for "things are working now, as they are
supposed to". i915 wasn't properly synchronizing on foreign fences for a
long time, yet we didn't gain a cap for "cross device sync works now".

If your distro use-case relies on those things working it's probably
best to just backport the relevant fixes.

Regards,
Lucas

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-04-04 10:43 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 [this message]
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
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=1491302580.2367.24.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=chris@cooperteam.net \
    --cc=christopher.halse.rogers@canonical.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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.