[PATCH] unstable/linux-dmabuf: Add 'direct_display' flag

Scott Anderson scott at anderso.nz
Thu Nov 14 22:44:27 UTC 2019


On 15/11/19 4:04 am, Drew DeVault wrote:
> On Fri Nov 15, 2019 at 12:39 AM, Scott Anderson wrote:
>>> A hint is merely a hint. The compositor can abide or not by that.
>>> This flag will explicitly close the client connection if the buffer
>>> can't be scanned out when this flag is passed.
>>
>> This flag doesn't sound like a hint to me, but a hard requirement. From
>> the discussion I saw on the MR [1], if we don't abide, we risk being killed.
> 
> I agree: that's not a hint, it's a demand.
> 
> I think that there would be value in being able to suggest that a
> particluar buffer be scanned out for performance reasons. But, as a
> suggestion, and not a demand, and definitely not for secrecy reasons.
> wlroots-based compositors would reserve the right to read your buffers
> whenever we want. If I want to read your buffer for a frame to take a
> screenshot, it's not going to be the end of the world for performance
> and I don't want to end up segfaulting because of it.
 >
>> But without the excuse for performance, that also raises another issue
>> for me about content-protection living in a "wp" protocol. The
>> governance thing hasn't officially been applied yet, and I wouldn't even
>> be the official spokesperson for wlroots, but I would personally NACK
>> that. Content-protection is a niche use case not generally useful to
>> Wayland implementations. I think a "ext" "wl_buffer factory for
>> protected dmabufs" would be a better place for this. It means you could
>> advertise a correct list of formats+modifiers too.
> 
> As an official spokesperson for wlroots:
> 
> If this protocol change were for the purpose of _suggesting_ scan-out,
> I'd be on board with it. But this is not that - if it were, we would
> dispense with any ideas around enforcing it with memory protections.
> Then we could get an improvement for performance without a regression
> for usability.
> 
> Rather, this just seems to be a DRM-enabling change, and the official
> policy of wlroots will always be to NACK those for the wp and xdg
> namespaces.

I don't think a hint for "please scan me out" has any value. A Wayland 
compositor that is capable of scanning out will try to scan out 
everybody as often as they can anyway, making the hint meaningless. A 
Wayland compositor that is not capable of scanning out is also going to 
ignore the hint, also making it meaningless.

The only situation I could possibly think of where this could make a 
difference is if you have two surfaces, and the compositor's policy 
would normally be to scan out the focused surface, but chooses to scan 
out e.g. a video player surface with this flag instead. That only works 
if the video player is not occluded.

But that's also cheapened by the fact that this flag sounds like "free 
performance", and everybody would just set it.


More information about the wayland-devel mailing list