[Mesa-dev] [PATCH] egl/wayland: Set __DRI_IMAGE_USE_SCANOUT for shared buffers

Michel Dänzer michel at daenzer.net
Thu Jan 28 19:44:47 PST 2016


On 28.01.2016 20:20, Daniel Stone wrote:
> On 28 January 2016 at 03:21, Michel Dänzer <michel at daenzer.net> wrote:
>> On 27.01.2016 23:54, Daniel Stone wrote:
>>> On 27 January 2016 at 14:16, Axel Davy <axel.davy at ens.fr> wrote:
>>>> On 27/01/2016 13:43, Daniel Stone wrote:
>>>>> If the compositor wants to scan out directly, it will import via
>>>>> GBM, which is in a position to reject the import if the buffer is
>>>>> not suitable for scanout. So there's something missing here,
>>>>> either in the GBM implementation to set magic flags when
>>>>> importing, or failure to communicate tiling mode correctly, or
>>>>> whatever.
>>>>>
>>>>> So for now, I would NAK this
>>
>> And you can NAK this because... ? :)
> 
> Well, why not just skip review and bang whatever you feel like into
> egl/wayland then.

That's not what I wrote or meant, and doesn't answer my question.


>>>> The other thing you mention, ie failing to import non-scanout
>>>> buffers when scanout is requested is, I believe, unrelated to this
>>>> patch, and would require a bit more work. In particular this is
>>>> handled by a function validateUsage, which doesn't seem to be fully
>>>> implemented on gallium. I suggest to file a bug on bugzillla.
>>>
>>> Well, I could, but if this fix goes in, I assume nothing will ever
>>> happen for Gallium drivers, so not sure there's much point, aside
>>> from having a URL to point to the next time this comes up.
>>
>> intel_validate_usage doesn't handle scanout either, but AFAIR at least
>> older generations of Intel GPUs don't support all tiling modes for
>> scanout either. So I don't see how that could work in the scheme you
>> describe other than by luck.
>>
>> Assuming there was any validateUsage hook which would properly catch
>> buffers which can't be scanned out, can you point us to other code which
>> would allow the Wayland compositor to make sure clients allocate buffers
>> which can be scanned out?
> 
> The code doesn't exist now, but essentially gbm_bo_import would be
> able to track a wl_buffer back to the source, and send a wl_drm event
> back to Mesa (remember that this is private protocol, so can be
> changed at will) informing it that it should allocate with more
> optimal flags. Not a great deal of work.

It still sounds like significant work (particularly for somebody like me
who isn't very familiar with Wayland details yet). It should be done by
somebody who cares about the difference you're describing. I think it's
unreasonable to expect myself or Axel to do it, especially since you
said on IRC:

 08:35 #dri-devel: < daniels> mannerov: it makes the flag totally
                   meaningless - s/SCANOUT/NOT_A_FBO/ and i'll ack it

Which makes little sense to me — even if the SCANOUT flags aren't used
optimally yet, their meaning is quite clear.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list