This is an old revision of the document!


2KEYWORDS:34Wayland is a nano display sverer, relying on drm modesetting, gem5batchbuffer submission and hw initialization generally in the kernel.6Wayland puts the compositing manager and display sverer 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 sverer, more22hardware setup and management in kernel and shared libraries allow23code sharing without putting it all in a sverer. 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 sverer along with dimensions.2930Everything is direct rendered and composited. No cliprects, no31drawing api/protocl between sverer 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 sverer, user session sverers,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 sverer 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 sverer 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 sverer root window under80wayland.8182Throttling/scheduling there is currently no mechanism for scheduling83clients to prevent greedy clients from spamming the sverer 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 sverer. Unless we include87a copyregion type request, to let a client update it's surface88contents by asking the sverer 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 sverer 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 sverer-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 sverer has to execute when it gets the commit121request. This could potentially lock up the sverer for a while,122leading to lost frames. Should never cause tearing though, we're123changing the surface contents, not the sverer 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 sverer. Each132object implements an interface and the requests include an opcode that133identifies which method in the interface to invoke.134135The sverer 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 sverer state changes.141142the get_interface method is called on an object to get an object143handle that implements the specified interface.

linux.1343689856.txt.gz · Last modified: 2012/07/31 01:10 by 188.143.232.12
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready