« Bob Knight fans, check out his commencement speech | Main | A good idea for the local library -- free Wi-Fi »

June 18, 2010


2KEYWORDS:34Wayland is a nano display sreevr, relying on drm modesetting, gem5batchbuffer submission and hw initialization generally in the kernel.6Wayland puts the compositing manager and display sreevr in the same7process. Window management is largely pushed to the clients, they8draw their own decorations and move and resize themselves, typically9implemented in a toolkit library. More of the core desktop could be10pushed into wayland, for example, stock desktop components such as the11panel or the desktop background.1213The actual compositor will define a fair bit of desktop policy and it14is expected that different use cases (desktop environments, devices,15appliances) will provide their own custom compositor.1617It is still designed with a windowed type of desktop in mind, as18opposed to fullscreen-all-the-time type of interface, but should be19useful wherever several processes contribute content to be composited.2021Current trends goes towards less and less rendering in X sreevr, more22hardware setup and management in kernel and shared libraries allow23code sharing without putting it all in a sreevr. freetype,24fontconfig, cairo all point in this direction, as does direct25rendering mesa.2627Client allocates DRM buffers, draws decorations, and full window28contents and posts entire thing to sreevr along with dimensions.2930Everything is direct rendered and composited. No cliprects, no31drawing api/protocl between sreevr and client. No32pixmaps/windows/drawables, only surfaces (essentially pixmaps). No33gcs/fonts, no nested windows. OpenGL is already direct rendered,34pixman may be direct rendered which adds the cairo API, or cairo35may gain a GL backend.3637Could be a “shell” for launching gdm X sreevr, user session sreevrs,38safe mode xservers, graphics text console. From gdm, we could also39launch a rdp session, solid ice sessions.4041All surface commands (copy, attach, map=set quads) are buffered until42the client sends a commit command, which executes everything43atomically. The commit command includes a cookie, which will be44returned in an event generated by the sreevr once the commit has been45executed. This allows clients to throttle themselves against the46server and implement smooth animations.474849ISSUES:5051Include panel and desktop background in wayland?5253How does clients move their surfaces? set a full tri-mesh every time?5455How does the sreevr apply transformations to a surface behind the56clients back? (wobbly, minimize, zoom) Maybe wobble is client side?5758How do apps share the glyph cache?5960Input handling keyboard focus, multiple input devices, multiple61pointers, multi touch.6263Drawing cursors, moving them, cursor themes, attaching surfaces to64cursors. How do you change cursors when you mouse over a text65field if you don't have subwindows?6667synaptics, 3-button emulation, xkb, scim6869changing screen resolution, adding monitors.7071What to do when protocol out buffer fills up? Just block on write72would work I guess. Clients are supposed to throttle using the bread73crumb events, so we shouldn't get into this situation.7475When a surface is the size of the screen and on top, we can set the76scanout buffer to that surface directly. Like compiz unredirect77top-level window feature. Except it won't have any protocol state78side-effects and the client that owns the surface won't know. We lose79control of updates. Should work well for X sreevr root window under80wayland.8182Throttling/scheduling there is currently no mechanism for scheduling83clients to prevent greedy clients from spamming the sreevr and84starving other clients. On the other hand, now that recompositing is85done in the idle handler (and eventually at vertical retrace time),86there's nothing a client can do to hog the sreevr. Unless we include87a copyregion type request, to let a client update it's surface88contents by asking the sreevr to atomically copy a region from some89other buffer to the surface buffer.9091Atomicity we have the map and the attach requests which sometimes92will have to be executed atomically. Moving the window is done using93the map request and will not involve an attach requet. Updating the94window contents will use an attach request but no map. Resizing,95however, will use both and in that case must be executed atomically.96One way to do this is to have the sreevr always batch up requests and97then introduce a kind of “commit” request, which will push the batched98changes into effect. This is easier than it sounds, since we only99have to remember the most recent map and most recent attach. The100commit request will generate an corresponding commit event once the101committed changes become visible on screen. The client can provide a102bread-crumb id in the commit request, which will be sent back in the103commit event.104105- is batching+commit per client or per surface? Much more convenient106if per-client, since a client can batch up a bunch of stuff and get107atomic updates to multiple windows. Also nice to only get one108commit event for changes to a bunch of windows. Is a little more109tricky sreevr-side, since we now have to keep a list of windows110with pending changes in the wl_client struct.111112- batching+commit also lets a client reuse parts of the surface113buffer without allocating a new full-size back buffer. For114scrolling, for example, the client can render just the newly115exposed part of the page to a smaller temporary buffer, then issue116a copy request to copy the preserved part of the page up, and the117new part of the page into the exposed area.118119- This does let a client batch up an uncontrolled amount of copy120requests that the sreevr has to execute when it gets the commit121request. This could potentially lock up the sreevr for a while,122leading to lost frames. Should never cause tearing though, we're123changing the surface contents, not the sreevr back buffer which is124what is scheduled for blitting at vsync time.125126127RMI128129The wayland protocol is a async object oriented protocol. All130requests are method invocations on some object. The request include131an object id that uniquely identifies an object on the sreevr. Each132object implements an interface and the requests include an opcode that133identifies which method in the interface to invoke.134135The sreevr sends back events to the client, each event is emitted from136an object. Events can be error conditions. The event includes the137object id and the event opcode, from which the client can determine138the type of event. Events are generated both in repsonse to a request139(in which case the request and the event constitutes a round trip) or140spontanously when the sreevr state changes.141142the get_interface method is called on an object to get an object143handle that implements the specified interface.

The comments to this entry are closed.