blob: be48ada1ecad699daf6572fd645e9b746555f943 [file] [log] [blame]
Kristian Høgsberg97f1ebe2008-09-30 09:46:10 -04001
2KEYWORDS:
3
4Wayland is a nano display server, relying on drm modesetting, gem
Kristian Høgsberg23fceb12008-10-13 22:51:56 -04005batchbuffer submission and hw initialization generally in the kernel.
6Wayland puts the compositing manager and display server in the same
7process. Window management is largely pushed to the clients, they
8draw their own decorations and move and resize themselves, typically
9implemented in a toolkit library. More of the core desktop could be
10pushed into wayland, for example, stock desktop components such as the
11panel or the desktop background.
12
13The actual compositor will define a fair bit of desktop policy and it
14is expected that different use cases (desktop environments, devices,
15appliances) will provide their own custom compositor.
Kristian Høgsberg97f1ebe2008-09-30 09:46:10 -040016
17It is still designed with a windowed type of desktop in mind, as
Kristian Høgsberg23fceb12008-10-13 22:51:56 -040018opposed to fullscreen-all-the-time type of interface, but should be
19useful wherever several processes contribute content to be composited.
Kristian Høgsberg97f1ebe2008-09-30 09:46:10 -040020
Kristian Høgsberg33bea962008-09-30 22:21:49 -040021Current trends goes towards less and less rendering in X server, more
22hardware setup and management in kernel and shared libraries allow
23code sharing without putting it all in a server. freetype,
24fontconfig, cairo all point in this direction, as does direct
25rendering mesa.
Kristian Høgsberg97f1ebe2008-09-30 09:46:10 -040026
27Client allocates DRM buffers, draws decorations, and full window
28contents and posts entire thing to server along with dimensions.
29
30Everything is direct rendered and composited. No cliprects, no
31drawing api/protocl between server and client. No
32pixmaps/windows/drawables, only surfaces (essentially pixmaps). No
33gcs/fonts, no nested windows. OpenGL is already direct rendered,
34pixman may be direct rendered which adds the cairo API, or cairo
35may gain a GL backend.
36
Kristian Høgsberg33bea962008-09-30 22:21:49 -040037Could be a "shell" for launching gdm X server, user session servers,
38safe mode xservers, graphics text console. From gdm, we could also
39launch a rdp session, solid ice sessions.
40
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040041All surface commands (copy, attach, map=set quads) are buffered until
42the client sends a commit command, which executes everything
Kristian Høgsberg23fceb12008-10-13 22:51:56 -040043atomically. The commit command includes a cookie, which will be
44returned in an event generated by the server once the commit has been
45executed. This allows clients to throttle themselves against the
46server and implement smooth animations.
Kristian Høgsberga67a71a2008-10-07 10:10:36 -040047
Kristian Høgsberg19a0ac22008-10-11 19:40:01 -040048Throttling/scheduling - there is currently no mechanism for scheduling
49clients to prevent greedy clients from spamming the server and
50starving other clients. On the other hand, now that recompositing is
51done in the idle handler (and eventually at vertical retrace time),
52there's nothing a client can do to hog the server. Unless we include
53a copyregion type request, to let a client update it's surface
54contents by asking the server to atomically copy a region from some
55other buffer to the surface buffer.
56
57Atomicity - we have the map and the attach requests which sometimes
58will have to be executed atomically. Moving the window is done using
59the map request and will not involve an attach requet. Updating the
60window contents will use an attach request but no map. Resizing,
61however, will use both and in that case must be executed atomically.
62One way to do this is to have the server always batch up requests and
63then introduce a kind of "commit" request, which will push the batched
64changes into effect. This is easier than it sounds, since we only
65have to remember the most recent map and most recent attach. The
66commit request will generate an corresponding commit event once the
67committed changes become visible on screen. The client can provide a
68bread-crumb id in the commit request, which will be sent back in the
69commit event.
70
71 - is batching+commit per client or per surface? Much more convenient
72 if per-client, since a client can batch up a bunch of stuff and get
73 atomic updates to multiple windows. Also nice to only get one
74 commit event for changes to a bunch of windows. Is a little more
75 tricky server-side, since we now have to keep a list of windows
76 with pending changes in the wl_client struct.
77
78 - batching+commit also lets a client reuse parts of the surface
79 buffer without allocating a new full-size back buffer. For
80 scrolling, for example, the client can render just the newly
81 exposed part of the page to a smaller temporary buffer, then issue
82 a copy request to copy the preserved part of the page up, and the
83 new part of the page into the exposed area.
84
Kristian Høgsberg23fceb12008-10-13 22:51:56 -040085 - This does let a client batch up an uncontrolled amount of copy
Kristian Høgsberg19a0ac22008-10-11 19:40:01 -040086 requests that the server has to execute when it gets the commit
87 request. This could potentially lock up the server for a while,
88 leading to lost frames. Should never cause tearing though, we're
89 changing the surface contents, not the server back buffer which is
90 what is scheduled for blitting at vsync time.