OpenGL in USB Display Devices under wayland

Casey Dahlin cdahlin at redhat.com
Fri Jun 22 11:35:05 PDT 2012


On Fri, Jun 22, 2012 at 02:08:16PM -0400, rektide wrote:
> How about this question: might Weston be adaptable to serve this use case? What would be the
> major changes to Weston to do this? What other subsystems would have to change?
> 

Right now wayland doesn't have a protocol to export much notion of what associates a card and a
given output. Each DRM-capable device should expose a source of DRM buffers,
and whichever source you use determines which card does the work during
drawing. That's more or less in place in theory, though I don't think weston yet does
multiple devices.

When scanout happens, the client just says where they want their buffer mapped
in compositor coordinate space. What card ends up scanning it out depends on
what output is position to render that part of the coordinate space. You can
get access to those coordinates, and you can pick a particular output and
render fullscreen, but the assumption is kind of that any buffer could end up
on any card. DRM buffers are card specific, so a compositor would naturally
need to be prepared to shift all or part of a buffer to another card.

So the only mechanism that is missing afaik is a way for a compositor to
"recommend" a particular card for a particular output or for general use. That
might have to go into mesa (mesa carries a bit of wayland protocol code,
specifically the stuff around exposing buffer sources).

As for the implementation in weston itself, it's just some coordination of
buffer-to-buffer copying, and some intelligence about making card choices.

I guess a slightly interesting bit is if you want the composition itself to
happen on another card, which means the actual scanout buffer is allocated on
the "wrong" card and then copied once after the windows are blitted on.
Depending on how much shiny your window manager is performing that may or may
not be worth doing, but it isn't hard to imagine how.

--CJD


More information about the wayland-devel mailing list