<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7201445798030158398</id><updated>2013-05-22T17:46:54.366+03:00</updated><category term='bluetooth'/><category term='android'/><category term='N9'/><category term='graphics'/><category term='wayland'/><category term='network'/><category term='input'/><category term='ID3'/><category term='games'/><category term='music'/><category term='screensaver'/><category term='GL'/><category term='demo'/><category term='X'/><title type='text'>Pekka Paalanen</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ppaalanen.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-6808203972050049354</id><published>2013-02-03T22:59:00.000+02:00</published><updated>2013-02-03T22:59:26.762+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='input'/><title type='text'>Broken connection to DiNovo bluetooth device: a solution</title><content type='html'>I have a Logitech DiNovo Mini (combined keyboard &amp;amp; touchpad), which at first worked just fine on my Gentoo laptop, Asus G50V, using the laptop's built-in bluetooth adapter, &lt;a href="http://www.bluez.org/"&gt;Bluez&lt;/a&gt; major version 4 (4.101-r5 today), and &lt;a href="http://en.gentoo-wiki.com/wiki/Bluetooth_mouse"&gt;manual&lt;/a&gt; &lt;a href="http://wiki.gentoo.org/wiki/Bluetooth"&gt;connection&lt;/a&gt;. Then I tried to connect the DiNovo to other devices, both without and with the USB-bluetooth-dongle that came with the DiNovo. Then I wanted it back to my laptop. There was a time when it worked only if I temporarily removed the battery from DiNovo. In the end, after several weeks if not months, it did not work anymore, at all. Blindly poking around, I now found how to fix it.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The DiNovo showed a green light, saying it got a connection, but on the laptop, all I could see was the device appearing and very soon disappearing in udev (confirmed with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;udevadm monitor&lt;/span&gt;). I tried to pair it again, many times, and while the pairing seemed to succeed, the device just did not work. I also installed &lt;a href="http://packages.gentoo.org/package/net-wireless/blueman"&gt;blueman&lt;/a&gt;, which indicated the same: when I touched the DiNovo, it connected, and was immediately disconnected. In the system log I got:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;bluetoothd[280]: Refusing input device connect: Operation already in progress (114)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;bluetoothd[280]: Refusing connection from ##:##:##:##:##:##: setup in progress&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(bluetoothd:280): GLib-WARNING **: Invalid file descriptor.&lt;/span&gt;&lt;/blockquote&gt;Ok, so is it trying to connect twice for some odd reason? Where is the state kept? Could I manually fix it?&lt;br /&gt;&lt;br /&gt;Apparently, I could. In the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/var/lib/bluetooth/*/&lt;/span&gt; directory I saw several files that seemed to be about the bluetooth settings on my Gentoo. Not knowing anything about how Bluez works, I looked at the files there, to see if I could spot something suspicious. Luckily they were all plain-enough text files, so I did spot something.&lt;br /&gt;&lt;br /&gt;The file &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/var/lib/bluetooth/*/spd&lt;/span&gt; had two lines with my DiNovo's device address on it. The first line was a long one, the second line short. Not knowing what I'm doing, I stopped the bluetooth service, removed the short line, and restarted the bluetooth service. Like magic, the DiNovo started working again, connecting automatically. No errors in the system log anymore, either.&lt;br /&gt;&lt;br /&gt;I have not used the DiNovo much after the repair yet, remains to be seen if I broke anything, but so far so good. Apparently when I was playing around with the DiNovo, somehow that file got a second entry for the same device, and caused malfunction. Is it my fault or a bug, I do not know. Googling did not give any helpful hints on solving this, so I am recording this note here, hoping it helps someone.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;-- A note, barely readable, scratched with a broken SD-card on the wall of a passageway in the huge, monster crawling dungeon they call the Intternets.&lt;/span&gt;&lt;/i&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2013/02/broken-connection-to-dinovo-bluetooth.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/6808203972050049354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/6808203972050049354'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2013/02/broken-connection-to-dinovo-bluetooth.html' title='Broken connection to DiNovo bluetooth device: a solution'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-5311755610887418223</id><published>2012-11-21T15:58:00.000+02:00</published><updated>2012-11-21T15:58:37.139+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='GL'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>On supporting Wayland GL clients and proprietary embedded platforms</title><content type='html'>How would one start implementing support for graphics hardware accelerated &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; clients on an embedded platform that only has proprietary drivers?&lt;br /&gt;&lt;br /&gt;This is a question I have answered more than once recently. Presumably you already have some ways to implement a Wayland compositor, some APIs you can use to composite and get images on screen. You may have &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_shm&lt;/span&gt; based clients already working, and now you want hardware rendered clients to work. Where to start? &lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;First I will explain &lt;a href="http://wayland.freedesktop.org/architecture.html"&gt;the architecture&lt;/a&gt; a bit. There are basically three things related to Wayland graphics:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the client side support for graphics hardware acceleration&lt;/li&gt;&lt;li&gt;the compositor's support for hardware accelerated clients&lt;/li&gt;&lt;li&gt;the compositor's own rendering or compositing, and output to screen&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Usually the graphics hardware accelerated applications (clients) use EGL for the window system glue, and GL ES (2) for rendering.&amp;nbsp; The client side is the EGL Wayland platform, plus &lt;a href="http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-egl.h"&gt;wayland-egl API&lt;/a&gt;. The EGL Wayland platform means, that you can pass Wayland types as EGL native types, for instance a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;struct wl_display *&lt;/span&gt; as the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLNativeDisplayType&lt;/span&gt; parameter of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;eglGetDisplay()&lt;/span&gt; function.&lt;br /&gt;&lt;br /&gt;The compositor's support for hardware accelerated clients is the server side of Wayland-enabled libEGL. Normally it consists of the &lt;a href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/WL_bind_wayland_display.spec"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGL_WL_bind_wayland_display&lt;/span&gt; extension&lt;/a&gt;. For a compositor programmer, this extension allows you to create an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLImageKHR&lt;/span&gt; object from a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;struct wl_buffer *&lt;/span&gt;, and then bind that as a GL texture, so you can composite it.&lt;br /&gt;&lt;br /&gt;The compositor's own rendering mechanisms are largely irrelevant to the client support. The only requirement is, that the compositor can effectively use the kinds of buffers the clients send to it. If you turn a wl_buffer object via &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLImageKHR&lt;/span&gt; into a GL texture, you would better be compositing with a GL API, naturally. Apart from that, it does not matter what APIs the compositor uses for compositing and displaying.&lt;br /&gt;&lt;br /&gt;Now, what do we actually need for supporting hardware accelerated clients?&lt;br /&gt;&lt;br /&gt;First, forget about using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_shm&lt;/span&gt; buffers, they are not suitable for hardware accelerated clients. Buffers that GPUs render into are often badly suited for CPU usage, or not directly accessible by the CPU at all. Due to GPU requirements, you likely cannot make a GPU to render into an shm buffer, either. Therefore to get the pixel data into an shm buffer you would need to do a copy, like &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;glReadPixels()&lt;/span&gt;. Then you send the shm buffer to the server, and the server needs to copy the pixels again to make them accessible to the GPU for compositing, e.g. by calling &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;glTexImage2D()&lt;/span&gt;. That is two copies between CPU and GPU domains, and that is &lt;i&gt;slow&lt;/i&gt;. I would say unusably slow. It is far better to not move the pixels into CPU domain at all, and avoid all copying.&lt;br /&gt;&lt;br /&gt;Therefore, the most important thing is graphics buffer sharing or passing. Buffer sharing works by creating a handle for a buffer, and passing that handle to another process which then uses the handle to make the GPU access again the same buffer. On your graphics platform, find out:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Do such handles exist at all?&lt;/li&gt;&lt;li&gt;How do you create a buffer and a handle?&lt;/li&gt;&lt;li&gt;How do you direct GL ES rendering into that buffer?&lt;/li&gt;&lt;li&gt;What is the handle? Does it contain integers, open file descriptors, or opaque pointers? Integers and file descriptors are not a problem, but you cannot pass (host virtual) pointers from one process to another.&lt;/li&gt;&lt;li&gt;How do you create something usable, like an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLImageKHR&lt;/span&gt; or a GL texture, from the handle?&lt;/li&gt;&lt;/ul&gt;It would be good to test that the buffer passing actually works, too.&lt;br /&gt;&lt;br /&gt;Once you know what the handle is, and whether clients can allocate their own buffers (preferred), or must the compositor hand out buffers to clients for some obscure security reasons, you can think about how to use the Wayland protocol to pass buffers around. You must invent a new Wayland protocol extension. The extension should allow a client to create a wl_buffer object from the handle. All the standard Wayland interfaces deal with wl_buffer objects, and the server will detect the type of each wl_buffer object when used by a client. Examples of the protocol extension are &lt;a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/egl/wayland/wayland-drm/wayland-drm.xml"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt;&lt;/a&gt; of Mesa, and my experimental &lt;a href="http://cgit.collabora.com/git/android/platform/frameworks/base.git/tree/opengl/libs/EGL/wayland-protocol/wayland-android.xml?h=pq-egl-wip2"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;android_wlegl&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I recommend you do the first implementation of the protocol extension completely ad hoc. Hack the server to work with your buffer types, and write a custom client that directly uses the protocol without any fancy API like wayland-egl. Once you confirm it works, you can design the real implementation, whether it should be in a wrapper library around the proprietary libEGL or something else.&lt;br /&gt;&lt;br /&gt;EGL is the standard interface to implement accelerated Wayland client support and it conveniently hides the details from both servers and clients, but it is not the only way. If you control both server and client code, you can use any other API, or create your own. That is a big if, though.&lt;br /&gt;&lt;br /&gt;The key point is buffer sharing, copying will kill your system performance. After you know how to share graphics buffers, your work has only begun. Good luck!&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/11/on-supporting-wayland-gl-clients-and.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/5311755610887418223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/5311755610887418223'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/11/on-supporting-wayland-gl-clients-and.html' title='On supporting Wayland GL clients and proprietary embedded platforms'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-6056974509395181730</id><published>2012-09-24T13:46:00.000+03:00</published><updated>2012-09-24T13:46:25.626+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='demo'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland on Android: upgrade to 4.0.4 and new build integration</title><content type='html'>We at &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt; have been working on a new Android build system integration with &lt;a href="http://en.wikipedia.org/wiki/GNU_build_system"&gt;autotools&lt;/a&gt; projects, still based on &lt;a href="http://derekforeman.blogspot.com.br/2012/04/androgenizer-porting-libtoolized.html"&gt;Androgenizer&lt;/a&gt; (&lt;a href="http://cgit.collabora.com/git/android/androgenizer.git"&gt;git&lt;/a&gt;). Now we have our own &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;repo&lt;/span&gt; &lt;a href="http://cgit.collabora.com/git/android/manifest.git/"&gt;manifest repository&lt;/a&gt;, and a tool called &lt;a href="http://blogs.kde.org/2012/09/21/explaining-anagrm-and-our-android-efforts"&gt;anagrman&lt;/a&gt; for managing optional feature packages (aggregates). &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; on Android is one feature package, and the first to become available. We also upgraded to Ice Cream Sandwhich 4.0.4_r2.1. Instead of a snapshot release, this particular announcement is about live branches.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Weston (&lt;a href="http://cgit.collabora.com/git/android/platform/external/collabora/weston.git/"&gt;git&lt;/a&gt;) was upgraded to &lt;a href="http://cgit.freedesktop.org/wayland/weston/commit/?id=d7f282b84e1729f4692488a8af7e696e4d6b69d7"&gt;upstream&lt;/a&gt; as of Sept. 18th, 2012, though there are no user visible changes on Android. This brings the 0.95 protocol, and the new &lt;a href="http://lists.freedesktop.org/archives/wayland-devel/2012-August/004692.html"&gt;evdev input rework&lt;/a&gt; from upstream, which went through some changes since &lt;a href="http://ppaalanen.blogspot.fi/2012/07/wayland-on-android-snapshot-release.html"&gt;the 4.0.1_r1.2-b Wayland on Android release&lt;/a&gt;. Weston now has its GLESv2 renderer separated in code, and &lt;a href="http://lists.freedesktop.org/archives/wayland-devel/2012-August/005149.html"&gt;shaders are faster and simpler&lt;/a&gt; (I have not done any shader benchmarks myself).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://cgit.freedesktop.org/xorg/lib/libxkbcommon"&gt;Libxkbcommon&lt;/a&gt; lost its final dependencies to kbproto and xproto, and our Android build files are upstream. Thanks to Daniel Stone, we can use libxkbcommon straight from upstream.&lt;br /&gt;&lt;br /&gt;The new Android build system integration requires you to manually download only &lt;a href="http://cgit.collabora.com/git/android/anagrman.git/"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;anagrman&lt;/span&gt;&lt;/a&gt; in addition to Android &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;repo&lt;/span&gt;. There is no &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;make wayland-aggregate-configure&lt;/span&gt; step anymore, all generated Android makefiles are created during the full build. Also &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;androgenizer&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wayland-scanner&lt;/span&gt; are built automatically as needed. All this is possible using the makefile update feature of GNU Make. If there is a rule that can update a makefile, GNU Make will update the makefile as needed. If any makefiles were updated, Make will then start from scratch, reading in all makefiles again, before continuing to the actual build phase. This causes Make to reload all Android makefiles 2-3 times during the first build. It should also solve any dependency issues of the explicit configure step, like when one project's &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;configure&lt;/span&gt; depends on another project's fully built library. A big thank you to &lt;a href="http://blogs.kde.org/users/heliocastro"&gt;Helio Chissini de Castro&lt;/a&gt; for doing most of the build system work.&lt;br /&gt;&lt;br /&gt;This work is available in two ways:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The source code you can build yourself, see &lt;a href="http://cgit.collabora.com/git/android/aggregates.git/tree/README"&gt;README&lt;/a&gt;. Use the module &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wayland&lt;/span&gt; where &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;anagrman&lt;/span&gt; is invoked.&lt;/li&gt;&lt;li&gt;A snapshot image you can flash into a Samsung Galaxy Nexus: &lt;a href="http://people.collabora.com/%7Epq/releases/wayland-on-android-20120924.zip"&gt;wayland-on-android-20120924.zip&lt;/a&gt; (105 MB) (sha1: &lt;a href="http://people.collabora.com/%7Epq/releases/wayland-on-android-20120924.zip.sha1"&gt;b75cb4e325bc7a2960464128ae7f569c21741471&lt;/a&gt;). You can flash it with the command: &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ fastboot update wayland-on-android-20120924.zip&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;The ready-made image is configured to launch Weston at boot instead of SurfaceFlinger (the setting is in &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;device/samsung/maguro/system.prop&lt;/span&gt; in the source tree). The source code, however, does not start Weston nor SurfaceFlinger automatically. You have to use the commands &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# adb root&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# adb shell&lt;/span&gt; to log into the phone, and run one of:&lt;br /&gt;&lt;ul&gt;&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# setprop service.compositor surfaceflinger&lt;/li&gt;&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# setprop service.compositor weston&lt;/li&gt;&lt;/ul&gt;You can also run Weston by just &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# weston &amp;amp;&lt;/span&gt; and start other demo clients manually. Weston will automatically start &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;simple-touch&lt;/span&gt; finger drawing demo, and the power button will cause Weston to power off the phone. The available demo apps are: &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;simple-touch&lt;/span&gt;, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;simple-shm&lt;/span&gt;, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;flower&lt;/span&gt;, and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;clickdot&lt;/span&gt;. Any GL based demos are not included, since the EGL Wayland platform for clients is still unimplemented.&lt;br /&gt;&lt;br /&gt;Even though this is a live release, i.e. not tagged to a specific revision, I do not expect much changes in the near future. We are now researching other ways to enable Wayland on Android and other embedded-like devices.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/09/wayland-on-android-upgrade-to-404-and.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/6056974509395181730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/6056974509395181730'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/09/wayland-on-android-upgrade-to-404-and.html' title='Wayland on Android: upgrade to 4.0.4 and new build integration'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-6636544472821708651</id><published>2012-07-13T15:40:00.000+03:00</published><updated>2012-07-13T16:23:51.900+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='input'/><category scheme='http://www.blogger.com/atom/ns#' term='demo'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland on Android snapshot release: input</title><content type='html'>It is time to announce the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;android-4.0.1_r1.2-b&lt;/span&gt; snapshot release of the &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; on Android project at &lt;a href="http://www.collabora.com/services/android/"&gt;Collabora&lt;/a&gt;! We give you: &lt;b&gt;input support&lt;/b&gt; in Weston and &lt;b&gt;a finger-painting demo&lt;/b&gt;!&lt;br /&gt;&lt;br /&gt;Collabora will have people at &lt;a href="http://guadec.org/"&gt;GUADEC&lt;/a&gt; demoing this on real devices, though not me personally.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.youtube.com/watch?v=YnrYxEMXF6g" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="225" src="http://2.bp.blogspot.com/-IiRK5RJrljM/UAAIsLxTvvI/AAAAAAAAAEg/LkhXIM7p_lw/s400/android-4.0.1_r1.2-b.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;a href="http://www.youtube.com/watch?v=YnrYxEMXF6g"&gt;Click to see the video!&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;This release provides ports of the following projects (git repositories, really) to Android 4.0.1 on Samsung Galaxy Nexus:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/wayland.git/log/?h=android-4.0.1_r1.2-b"&gt;wayland&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/wayland-demos.git/log/?h=android-4.0.1_r1.2-b"&gt;weston&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/pixman.git/log/?h=android-4.0.1_r1.2-b"&gt;pixman&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/mtdev.git/log/?h=android-4.0.1_r1.2-b"&gt;mtdev&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/cairo.git/log/?h=android-4.0.1_r1.2-b"&gt;cairo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/libxkbcommon.git/log/?h=android-4.0.1_r1.2-b"&gt;libxkbcommon&lt;/a&gt;, and its dependencies &lt;a href="http://cgit.collabora.com/git/user/pq/xproto.git/log/?h=android-4.0.1_r1.2-b"&gt;xproto&lt;/a&gt;, &lt;a href="http://cgit.freedesktop.org/xorg/proto/kbproto/log/"&gt;kbproto&lt;/a&gt;, and &lt;a href="http://cgit.collabora.com/git/user/pq/xkb-config.git/log/?h=android-4.0.1_r1.2-b"&gt;xkeyboard-config&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/android/platform/external/collabora/libffi.git/log/?h=android-4.0.1_r1.2-b"&gt;libffi&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/cursors.git/log/?h=android-4.0.1_r1.2-b"&gt;mouse cursors&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;It also includes some changes to Android internals, and &lt;a href="http://cgit.collabora.com/git/user/pq/wayland_aggregate.git/log/?h=android-4.0.1_r1.2-b"&gt;the aggregate&lt;/a&gt; for building it all.&lt;br /&gt;&lt;br /&gt;This is just a snapshot release of a work in progress, and you cannot do much with it. Everything an end user would have known about Android is still gone.&lt;br /&gt;&lt;br /&gt;In Weston, the three device buttons are working, and the touchscreen is working. Unfortunately, the only application really supporting touch devices is &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;simple-touch&lt;/span&gt;, but I turned that into a demo that is automatically launched. If you install this release into a Galaxy Nexus device, it will boot into Weston and you can play with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;simple-touch&lt;/span&gt;. The power button is hooked up in Weston to power off the device immediately, so a computer is not necessary to show and exit the demo.&lt;br /&gt;&lt;br /&gt;The main advancement compared to my previous posts is that the touchscreen is fully working now. Also, this time I am providing a proper release:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;an image you can flash into your device, if you have the right tools: &lt;a href="http://people.collabora.com/%7Epq/releases/android-4.0.1_r1.2-b.tar.gz"&gt;android-4.0.1_r1.2-b.tar.gz&lt;/a&gt; (106 MB) (sha1: &lt;a href="http://people.collabora.com/%7Epq/releases/android-4.0.1_r1.2-b.tar.gz.sha1"&gt;1bd52cef8b53574452b4e2feac76c5191e815884&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;instructions for building a full Android OS with Weston: &lt;a href="http://cgit.collabora.com/git/user/pq/wayland_aggregate.git/tree/README?h=android-4.0.1_r1.2-b"&gt;README&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;You can get the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;fastboot&lt;/span&gt; tool needed for flashing the images from the &lt;a href="http://developer.android.com/sdk/index.html"&gt;Android SDK&lt;/a&gt;, I think. I have never used the SDK myself, I have always gone with &lt;a href="http://source.android.com/source/index.html"&gt;the full AOSP tree&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Please, if you try this on your device, let me know how it went. If you find problems that I can fix, I might push the fixes to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;android-4.0.1_r1.2-b&lt;/span&gt; release branches, and update the &lt;a href="http://cgit.collabora.com/git/user/pq/wayland_aggregate.git/tree/ChangeLog?h=android-4.0.1_r1.2-b"&gt;ChangeLog&lt;/a&gt; for this release, but I will not provide new images. Before August I probably won't react, though.&lt;br /&gt;&lt;br /&gt;If you look at the histories of the git branches mentioned towards the top, you will find many ugly hacky commits. All commits marked as HACK will be replaced by the proper changes during the course of this project. We are planning to send almost all changes to respective upstream projects, too. The input enablement patch series in Weston needs a rewrite, before it gets upstream.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks to the whole Android team at &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt; for making this happen!</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/07/wayland-on-android-snapshot-release.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/6636544472821708651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/6636544472821708651'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/07/wayland-on-android-snapshot-release.html' title='Wayland on Android snapshot release: input'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-IiRK5RJrljM/UAAIsLxTvvI/AAAAAAAAAEg/LkhXIM7p_lw/s72-c/android-4.0.1_r1.2-b.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-1348768077643312949</id><published>2012-07-06T17:16:00.002+03:00</published><updated>2012-07-06T17:17:30.376+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='input'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Forwarding evdev devices to Android</title><content type='html'>I'm working on adding input support for Weston's Android backend, and to test a normal keyboard and a mouse, I needed a way to get those as evdev devices on Android. I don't have any Bluetooth devices here, so I started hacking up evdev forwarding from a laptop PC. I could not find much information on anyone doing this before.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;First I tried the various forwarding types of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;adb&lt;/span&gt; other than TCP. None of them seemed to work at all. Therefore I needed to use TCP, since that worked. Thanks to a co-worker at &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt;, I found out that busybox has a netcat tool I could use on Android. Laptop of course has the original netcat. &lt;a href="http://code.google.com/p/nethid/"&gt;Nethid&lt;/a&gt; is a quick &amp;amp; dirty program for creating a fake evdev device node using uinput, so I fixed that to work on Android.&lt;br /&gt;&lt;br /&gt;First on the host, set up TCP forwarding (port number just made up):&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ adb forward tcp:7776 tcp:7776&lt;/div&gt;&lt;/blockquote&gt;On the Android device, start uinput:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ busybox nc -l -p 7776 | uinput-pipe&lt;/div&gt;&lt;/blockquote&gt;Then on the host start feeding input events:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$ cat /dev/input/event10 | nc localhost 7776&lt;/div&gt;&lt;/blockquote&gt;And Weston now finds my forwarded evdev input device and receives input from it!&lt;br /&gt;&lt;br /&gt;But there are some minor problems with this. Something in this pipe spaghetti is caching data, so input events arrive in bursts, not as soon as possible. Also, something is eating over 99% of the REL_X events, so it is quite impossible to move the cursor horizontally. REL_Y events seem go through fine. Strange...&lt;br /&gt;&lt;br /&gt;Anyway, this fills its purpose: I was able to test that pointer devices work on my Weston android backend, and I also got mouse cursors to show up after some fixes. &lt;b&gt;The video below&lt;/b&gt; is the proof.&lt;br /&gt;&lt;iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/l7pFXD5BUCg?rel=0" width="560"&gt;&lt;/iframe&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/07/forwarding-evdev-devices-to-android.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/1348768077643312949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/1348768077643312949'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/07/forwarding-evdev-devices-to-android.html' title='Forwarding evdev devices to Android'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/l7pFXD5BUCg/default.jpg' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-4983321771830190251</id><published>2012-06-19T15:06:00.001+03:00</published><updated>2012-06-19T15:06:55.631+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland on Android: intermediate report</title><content type='html'>We at &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt; had an internal meeting, where I presented the Wayland on Android project and its current state. You can find the slides by clicking the picture below.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://people.collabora.com/%7Epq/wayland-on-android-sprint.pdf"&gt;&lt;img border="0" height="240" src="http://1.bp.blogspot.com/-dCEaVPXXLgk/T-BnNI2XmmI/AAAAAAAAAEU/bldrLXCdFYo/s320/wayland-on-android-title.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Note: epdfview may get the colors wrong, at least Evince shows it right.&lt;br /&gt;&lt;br /&gt;Some links related to the slides:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a href="http://derekforeman.blogspot.fi/2012/04/androgenizer-porting-libtoolized.html"&gt;Androgenizer&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.collabora.com/services/android/"&gt;Android at Collabora&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/06/wayland-on-android-intermediate-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/4983321771830190251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/4983321771830190251'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/06/wayland-on-android-intermediate-report.html' title='Wayland on Android: intermediate report'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-dCEaVPXXLgk/T-BnNI2XmmI/AAAAAAAAAEU/bldrLXCdFYo/s72-c/wayland-on-android-title.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-5963785960168789423</id><published>2012-05-24T10:40:00.000+03:00</published><updated>2012-05-24T10:40:02.176+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Weston on Android: desktop-shell</title><content type='html'>Last week I got weston-desktop-shell working on Android, along with some toytoolkit clients. This means I have &lt;a href="http://cairographics.org/"&gt;Cairo&lt;/a&gt; &lt;a href="http://derekforeman.blogspot.ca/2012/04/androgenizer-porting-libtoolized.html"&gt;androgenized&lt;/a&gt;, and it can even render text. I did have trouble with Cairo's configure script, so the build lacks all thread-safety. For the curious, all sources can be found via my &lt;a href="http://cgit.collabora.com/git/user/pq/wayland_aggregate.git/"&gt;wayland-aggregate&lt;/a&gt;. Right now I'm working on Android's libEGL, trying to add &lt;a href="http://wayland.freedesktop.org/architecture.html#heading_toc_j_2"&gt;Wayland support&lt;/a&gt;.&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-xmiKECjDO-o/T73jrf0X77I/AAAAAAAAAEI/nnMW8UhhhA4/s1600/photo-desktop-shell-GN.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-xmiKECjDO-o/T73jrf0X77I/AAAAAAAAAEI/nnMW8UhhhA4/s320/photo-desktop-shell-GN.jpg" width="170" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Galaxy Nexus sideways on a table, running Weston and desktop-shell.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/05/weston-on-android-desktop-shell.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/5963785960168789423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/5963785960168789423'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/05/weston-on-android-desktop-shell.html' title='Weston on Android: desktop-shell'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-xmiKECjDO-o/T73jrf0X77I/AAAAAAAAAEI/nnMW8UhhhA4/s72-c/photo-desktop-shell-GN.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-9215617195848499780</id><published>2012-05-11T10:16:00.000+03:00</published><updated>2012-05-11T10:16:02.685+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland anti-FUD</title><content type='html'>I was replying to an email, and got side-tracked into writing some Wayland anti-FUD. There are lots of myths about Wayland out there, so I thought to better make it into a blog post.&lt;br /&gt;&lt;br /&gt;This post is about the very small overhead of a Wayland (system) compositor, and why &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; over network will be much better than X-over-ssh.&lt;br /&gt;&lt;br /&gt;I predict that on desktops and other systems that may have accounts for more than one person, there will actually be &lt;i&gt;two&lt;/i&gt; Wayland compositors stacked. There is a system compositor at the bottom, handling fast user switching, replacing VT switching, etc., and then a session compositor that actually provides the desktop environment. This is not my idea, it has been written in the &lt;a href="http://wayland.freedesktop.org/faq.html"&gt;Wayland FAQ&lt;/a&gt; under "Is Wayland replacing the X server?" for a long time.&lt;br /&gt;&lt;br /&gt;My point is: &lt;b&gt;Wayland compositors will not make 3D games suck &lt;/b&gt;because of compositing. While explaining why, I also continue to explaining why &lt;b&gt;network transparency will not suck&lt;/b&gt; either. Now, do not mix up these things, I am &lt;b&gt;not&lt;/b&gt; claiming that remoting 3D games over network will magically become feasible.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;The overhead of adding a system compositor in the Wayland stack will be very small. A system compositor normally does not do any real work for compositing, it only takes the buffer handle from a client compositor, and flips it onto the screen. No rendering and no image copying involved in the system compositor.&lt;br /&gt;&lt;br /&gt;It is the same with a full-screen game vs. any Wayland compositor: the compositor will not do any real work. A game renders its image into a buffer, passes the buffer handle to the compositor, and the compositor tells the hardware to scan out the buffer. No extra copying, no extra rendering.&lt;br /&gt;&lt;br /&gt;The overhead that will appear with adding a system compositor, is relaying input events and buffer flips. The amount of data is small, and at least buffer flips will happen at most once per vertical refresh per monitor. There is also the idea of relaying input events only once per frame. This means that CPU process context switches will increase only by few per frame, when adding another compositor in the stack. Ideally the increase is 2 per frame: a switch to system compositor, system compositor handles input and output, and a switch back.&lt;br /&gt;&lt;br /&gt;The overhead can be this small, because the protocol has been designed to avoid round-trips. A round-trip means that one process is waiting for another to reply before it can continue. The protocol also favors batching: accumulate a bunch of data, and then send as a batch. Both of these principles minimize the number CPU process context switches.&lt;br /&gt;&lt;br /&gt;Because of these design principles, no Wayland developer is worried about the performance of a possible network transparency layer. Minimizing CPU context switches translates directly to minimizing the effect of network latency. Some believe, that even a simple Wayland network transport which practically just relays the Wayland protocol messages as is, and adds transferring of buffer data, will clearly outperform the traditional X-over-ssh.&lt;br /&gt;&lt;br /&gt;Now, if you still claim that X-over-ssh would be better, you a) underestimate the effect of latency, and b) forget that modern applications do not send small rendering commands through the X protocol like 10-20 years ago. Modern applications render their content client-side, and send &lt;i&gt;images&lt;/i&gt; to the X server. Wayland simply makes images the only way to send content to the server, allowing to drop the whole rendering machinery from the server and avoiding a huge amount of protocol.&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/05/wayland-anti-fud.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/9215617195848499780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/9215617195848499780'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/05/wayland-anti-fud.html' title='Wayland anti-FUD'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-4925532081569342873</id><published>2012-04-27T15:33:00.000+03:00</published><updated>2012-04-27T15:33:03.192+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>First light from Weston on Android</title><content type='html'>A couple of months ago, &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt; assigned me first to research and then make a proof of concept port of &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; on &lt;a href="http://www.collabora.com/services/android/"&gt;Android&lt;/a&gt;. I had never even seen an Android before. Yesterday, Weston on Android achieved first light!&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ZWp5uNJbqAA/T5pidtLQUsI/AAAAAAAAADQ/ZTmOixl-MHs/s1600/GN-simple-shm-2012-04-27-120210.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="180" src="http://4.bp.blogspot.com/-ZWp5uNJbqAA/T5pidtLQUsI/AAAAAAAAADQ/ZTmOixl-MHs/s320/GN-simple-shm-2012-04-27-120210.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Galaxy Nexus running Weston and simple-shm.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a name='more'&gt;&lt;/a&gt;That is a Samsung Galaxy Nexus smart phone, running a self-built image of &lt;a href="http://source.android.com/index.html"&gt;Android 4.0.1&lt;/a&gt;. Weston is driving the screen, where you see the &lt;a href="http://ppaalanen.blogspot.com/2012/04/improved-appearance-for-simplest.html"&gt;simple-shm&lt;/a&gt; Wayland client. There is no desktop nor wallpaper, because right now, simple-shm is the only ported client.&lt;br /&gt;&lt;br /&gt;How is that possible? Android has no &lt;a href="http://dri.freedesktop.org/wiki/"&gt;DRI&lt;/a&gt;, no &lt;a href="http://dri.freedesktop.org/wiki/DRM"&gt;DRM&lt;/a&gt;, no &lt;a href="http://en.wikipedia.org/wiki/Mode_setting"&gt;KMS&lt;/a&gt; (the DRM API), no &lt;a href="http://lists.freedesktop.org/archives/mesa-dev/2011-June/008726.html"&gt;GBM&lt;/a&gt;, no &lt;a href="http://www.mesa3d.org/"&gt;Mesa&lt;/a&gt;, and for this device the graphics drivers are proprietary and I do not have access to the closed driver source.&lt;br /&gt;&lt;br /&gt;Fortunately, Android's self-invented graphics stack has pretty similar requirements to Weston. All it took was to write a new Android specific backend for Weston, that interfaces to the Android APIs. Writing it took roughly three days.&lt;br /&gt;&lt;br /&gt;And the rest of the two months? I spent some time in studying Android's graphics stack, but the majority of the time sunk into porting the minimum required library dependencies, &lt;a href="http://cgit.freedesktop.org/wayland/wayland/"&gt;libwayland&lt;/a&gt;, Weston, and simple-shm to the Android platform and build environment. Simply getting the Android build system to build stuff properly took a huge effort, and then I got to write &lt;a href="http://lists.freedesktop.org/archives/wayland-devel/2012-April/003039.html"&gt;workarounds&lt;/a&gt; to &lt;a href="http://lists.freedesktop.org/archives/wayland-devel/2012-April/003114.html"&gt;features missing&lt;/a&gt; in Android's C library (Bionic). Features, that we have taken for granted on standard Linux operating systems for years. I also had to completely remove signal handling and timers from libwayland, because signalfd and timerfd interfaces do not exist in Bionic. Those need to be reinvented still.&lt;br /&gt;&lt;br /&gt;Android has gralloc and fb hardware abstraction layer (HAL) APIs. Hardware vendors are required to implement these APIs, and provide EGL and GL support libraries. These implementations are usually closed and proprietary. On top of these is the Android wrapper-libEGL, written in C++, open source. My first thought was to use the gralloc and fb HAL APIs directly, but turned out that the wrapper-libEGL does not support using them in the application side. Instead, I was forced to use some Android C++ API (there is no C API for this, as far as I can tell) to get access to the framebuffer in an EGL-compatible way. In the end, I had to write a lot less code than using the HALs directly.&lt;br /&gt;&lt;br /&gt;The Android backend for Weston so far only provides basic graphics output to the screen, and offers (presumably) accelerated GLES2 via EGL for the server. No input devices are hooked up yet, so you cannot interact with Weston. I do not know how to get pageflip completion events (if possible?), so that is hacked over.&lt;br /&gt;&lt;br /&gt;Simple-shm is the only client that runs for now. There is no support for EGL/GL in Wayland clients. Toytoolkit clients are waiting for Cairo and dependencies to be ported.&lt;br /&gt;&lt;br /&gt;The framebuffer can be used by one program at a time. Normally that program is SurfaceFlinger, the Android system compositor. To be able to run Weston, I have to kill SurfaceFlinger and make sure it stays down. Killing SurfaceFlinger also kills the whole Android UI infrastructure. You cannot even power off the phone by pressing or holding down the physical power button!&lt;br /&gt;&lt;br /&gt;A video about simple-shm running on Galaxy Nexus:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/loeW7SLkF8s/0.jpg"&gt;&lt;param name="movie" value="http://www.youtube.com/v/loeW7SLkF8s?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266"  src="http://www.youtube.com/v/loeW7SLkF8s?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;The sources with Android build integration and other hacks can be found here:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/wayland.git/log/?h=android"&gt;http://cgit.collabora.com/git/user/pq/wayland.git/log/?h=android&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/wayland-demos.git/log/?h=android"&gt;http://cgit.collabora.com/git/user/pq/wayland-demos.git/log/?h=android&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://cgit.collabora.com/git/user/pq/wayland_aggregate.git/"&gt;http://cgit.collabora.com/git/user/pq/wayland_aggregate.git/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;The wayland_aggregate is how I actually connect to the Android build system. Building is not trivial, and you cannot simply do a checkout and start compiling. You have to get the right Android tree for your device, add my local manifest (which still points to repositories on my hard drive, i.e., won't work for you), download and extract binary blobs, and whatnot. Be warned, I will rebase the above branches.&lt;br /&gt;&lt;br /&gt;This is the beginning of pushing a Wayland stack into Android. Next I need to clean up, send stuff upstream, add input support, find out about that pageflip, reinvent signal handling and timerfd, and then move on to the second major task: supporting Wayland GL clients. I hope it is possible to implement the Wayland platform in the wrapper-libEGL.&lt;br /&gt;&lt;br /&gt;This work is sponsored by Collabora, Ltd, and I also thank my fellow collaborans for guidance through the &lt;a href="http://abstrusegoose.com/432"&gt;vast jungles of Android&lt;/a&gt;.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/04/first-light-from-weston-on-android.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/4925532081569342873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/4925532081569342873'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/04/first-light-from-weston-on-android.html' title='First light from Weston on Android'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-ZWp5uNJbqAA/T5pidtLQUsI/AAAAAAAAADQ/ZTmOixl-MHs/s72-c/GN-simple-shm-2012-04-27-120210.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-3470322222453498362</id><published>2012-04-27T10:17:00.000+03:00</published><updated>2012-04-27T10:20:40.834+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Improved appearance for the simplest Wayland client</title><content type='html'>Of the &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; demo clients in the &lt;a href="http://cgit.freedesktop.org/wayland/weston/"&gt;Weston repository&lt;/a&gt;, &lt;a href="http://cgit.freedesktop.org/wayland/weston/tree/clients/simple-shm.c"&gt;simple-shm&lt;/a&gt; is the simplest. All the related code is in that one file, and it interfaces directly with &lt;a href="http://cgit.freedesktop.org/wayland/wayland/"&gt;libwayland&lt;/a&gt;. It does not use GL or EGL, so it can be ran on systems where the EGL stack does not support the Wayland platform nor extensions. However, what it renders, is surprising:&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-3oRbc_kbtlM/T5o6vPNidyI/AAAAAAAAACw/7HFwdk0gEXY/s1600/simple-shm.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/-3oRbc_kbtlM/T5o6vPNidyI/AAAAAAAAACw/7HFwdk0gEXY/s320/simple-shm.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The original simple-shm client on a Weston desktop.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;The square with apparently garbage texture is the original simple-shm. To any graphics developer, who does not know any better, that immediately looks like something is wrong with the image stride somewhere in the graphics stack. That really is what it was supposed to look like, not a bug.&lt;br /&gt;&lt;br /&gt;I decided to &lt;a href="http://lists.freedesktop.org/archives/wayland-devel/2012-April/003136.html"&gt;propose a different rendering&lt;/a&gt;, that would not look so much like a bug, and had some real diagnostic value.&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vdbu2zMPGT8/T5pEVGJZUzI/AAAAAAAAADE/zJFe0wT4o8k/s1600/simple-shm-new-2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/-vdbu2zMPGT8/T5pEVGJZUzI/AAAAAAAAADE/zJFe0wT4o8k/s320/simple-shm-new-2.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The proposed appearance of simple-shm, the way it is supposed to look like.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The new appearance has some vertical bars moving from left to right, some horizontal bars moving upwards, and some circles that shrink into the center. With these, you can actually see if there is a stride bug somewhere, or non-uniform scaling. There is one more diagnostic feature.&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-9-1xTdhonkE/T5pEUGK8QaI/AAAAAAAAAC8/Z3N_-QVC2OA/s1600/simple-shm-new-1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/-9-1xTdhonkE/T5pEUGK8QaI/AAAAAAAAAC8/Z3N_-QVC2OA/s320/simple-shm-new-1.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;This is how the proposed simple-shm looks like when the X-channel is mistaken as alpha.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Simple-shm uses XRGB buffers. If the compositor does not properly ignore the X-channel, and uses it as alpha, you will see a cross over the image. Depending on whether the compositor repaints what is below simple-shm or not, the cross will either saturate to white or show the background through. It is best to have a bright background picture to clearly see it.&lt;br /&gt;&lt;br /&gt;I do hope no-one gets hypnotized by the animation. ;-)</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/04/improved-appearance-for-simplest.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/3470322222453498362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/3470322222453498362'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/04/improved-appearance-for-simplest.html' title='Improved appearance for the simplest Wayland client'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-3oRbc_kbtlM/T5o6vPNidyI/AAAAAAAAACw/7HFwdk0gEXY/s72-c/simple-shm.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-2621575356775222222</id><published>2012-03-10T11:51:00.001+02:00</published><updated>2012-03-10T11:55:15.817+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='X'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='GL'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>What does EGL do in the Wayland stack</title><content type='html'>Recently I drew some diagrams of how an EGL library relates to the &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; stack. Here I am presenting the Mesa EGL version of them with the details explained.&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-yp99PzEORDI/T1no3lrZlCI/AAAAAAAAABI/RV7ODuT6qlw/s1600/EGL-Mesa-Wayland-arch.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="231" src="http://3.bp.blogspot.com/-yp99PzEORDI/T1no3lrZlCI/AAAAAAAAABI/RV7ODuT6qlw/s320/EGL-Mesa-Wayland-arch.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Mesa EGL with Wayland, and simplified X as comparison.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;X11 part&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The X11 part of the diagram is very much simplified. It completely ignores indirect rendering, DRI1, details of DRI2, and others. It only shows, that a direct rendering X11 EGL application uses the X11 protocol to create an X11 window, and the Mesa EGL X11 platform uses the DRI2 protocol in some way to communicate with the X server. Naturally the application also uses one of the OpenGL interfaces. The X server has hardware or platform specific drivers that are generally referred to as DDX. On the Linux DRI stack, these call into &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;libdrm&lt;/span&gt; and the various driver specific sub-libraries. In the end they use the kernel DRM services, like kernel mode setting (KMS). All this in the diagram is just for comparison with a Wayland stack.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Wayland server&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Wayland server in the diagram is Weston with the DRM backend. The server does its rendering using GL ES 2, which it initialises by calling EGL. Since the server runs on "bare KMS", it uses the EGL DRM platform, which could really be called as the GBM platform, since it relies on the Mesa GBM interface. Mesa GBM is an abstraction of the graphics driver specific buffer management APIs (for instance the various &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;libdrm_*&lt;/span&gt; libraries), implemented internally by calling into the Mesa GPU drivers.&lt;br /&gt;&lt;br /&gt;Mesa GBM provides graphics memory buffers to Weston. Weston then uses EGL calls to bind them into GL objects, and renders into them with GL ES 2. A rendered buffer is shown on an output (monitor) by queuing a page flip via the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;libdrm&lt;/span&gt; KMS API.&lt;br /&gt;&lt;br /&gt;If the EGL implementation offers the extension &lt;a href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/WL_bind_wayland_display.spec"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGL_WL_bind_wayland_display&lt;/span&gt;&lt;/a&gt;, Weston will use it to register its &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_display&lt;/span&gt; object (facing the clients) to EGL. In practice, the Mesa EGL then adds a new global Wayland object to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_display&lt;/span&gt;. That object (or interface) is called &lt;a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt;&lt;/a&gt;, and the server will automatically advertise that to all clients. Clients will use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt; for DRM authentication, getting the right DRM device node, and sharing graphics buffers with the server without copying pixels.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Wayland client&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A Wayland client, naturally, connects to a Wayland server, and gets the main Wayland protocol object &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_display&lt;/span&gt;. The client creates a window, which is a Wayland object of type &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_surface&lt;/span&gt;. All what follows is enabled by the Wayland platform support in Mesa EGL.&lt;br /&gt;&lt;br /&gt;The client passes the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_display&lt;/span&gt; object to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;eglGetDisplay()&lt;/span&gt; and receives an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLDisplay&lt;/span&gt; to be used with EGL calls. Then comes the trick that is denoted by the double-arrowed blue line from Wayland client to Mesa EGL in the diagram. The client calls the wayland-egl API (implemented in Mesa) function &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_egl_window_create()&lt;/span&gt; to get the native window handle. Normally you would just use the "real" native window object &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_surface&lt;/span&gt; (or an X11 &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt; if you were using X). The native window handle is used to create the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLSurface&lt;/span&gt; EGL handle. Wayland has this extra step and the wayland-egl API because a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_surface&lt;/span&gt; carries no information of its size. When the EGL library allocates buffers, it needs to know the size, and wayland-egl API is the only way to tell that.&lt;br /&gt;&lt;br /&gt;Once EGL Wayland platform knows the size, it can allocate a graphics buffer by calling the Mesa GPU driver. Then this graphics buffer needs to be mapped into a Wayland protocol object &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt;. A &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt; object is created by sending a request through the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt; interface carrying the name of the (DRM) graphics buffer. In the server side, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt; requests are handled in the Mesa EGL library, where the corresponding server side part of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt; object is created. In the diagram this is shown as the blue dotted arrow from EGL Wayland platform to itself. Now, whenever the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt; object is referenced in the Wayland protocol, the server knows exactly what it is.&lt;br /&gt;&lt;br /&gt;The client now has an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGLSurface&lt;/span&gt; ready, and renders into it by using one of the GL APIs or OpenVG offered by Mesa. Finally, the client calls &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;eglSwapBuffers()&lt;/span&gt; to show the result in its Wayland window.&lt;br /&gt;&lt;br /&gt;The buffer swap in Mesa EGL Wayland platform uses the Wayland core protocol and sends an attach request to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_surface&lt;/span&gt;, with the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt; as an argument. This is the blue dotted arrow from EGL Wayland platform to Wayland server.&lt;br /&gt;&lt;br /&gt;Weston itself processes the attach request. It knows the buffer is not a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;shm&lt;/span&gt; buffer, so it passes the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt; object to the Mesa EGL library in an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;eglCreateImageKHR()&lt;/span&gt; function call. In return Weston gets an EGLImage handle, which is then turned into a 2D texture, and used in drawing the surface (window). This operation is enabled by &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;EGL_WL_bind_wayland_display&lt;/span&gt; extension.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The important facts, that should be apparent in the diagram, are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;There are two different EGL platforms in play: one for the server, and one for the clients.&lt;/li&gt;&lt;li&gt;A Wayland server does not contain any graphics hardware or driver specific code, it is all in the generic libraries of DRM, EGL and GL (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;libdrm&lt;/span&gt; and Mesa).&lt;/li&gt;&lt;li&gt;Everything about &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt; is an implementation detail internal to the EGL library in use. &lt;/li&gt;&lt;/ul&gt;The system dependent part of Weston is the backend, which somehow must be able to drive the outputs. The new abstractions in Mesa (GBM API) make it completely hardware agnostic on standard Linux systems. Therefore every Wayland server implementation does not need its own set of graphics drivers, like X does.&lt;br /&gt;&lt;br /&gt;It is also worth to note, that 3D graphics on X uses very much the same drivers as Wayland. However, due to the Wayland requirements from the EGL framework (extensions, EGL Wayland platform), proprietary driver stacks need to specifically implement Wayland support, or they need to be wrapped into a meta-EGL-library, that glues Wayland support on top. Proprietary drivers also need to provide a way to use accelerated graphics without X, for a Wayland server to run without X beneath. Therefore the desktop proprietary drivers like Nvidia's have a long way to go, as currently &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;nvidia&lt;/span&gt; does not implement EGL at all, no support for Wayland, and no support for running without X, or even setting a video mode without X.&lt;br /&gt;&lt;br /&gt;Due to the way &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt; is totally encapsulated into Mesa EGL and how the interfaces are defined for the EGL Wayland platform and the EGL extension, another EGL implementor can choose their very own way of sharing graphics buffers instead of using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_drm&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;There are already plans to change to some of the architecture described in this article, so it is possible that details in the diagram become outdated fairly soon. This article also does not consider a purely software rendered Wayland stack, which certainly would lift all these requirements, but quite likely be too slow in practice for the desktop.&lt;br /&gt;&lt;br /&gt;See also: &lt;a href="http://wayland.freedesktop.org/architecture.html"&gt;the authoritative description of the Wayland architecture&lt;/a&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/03/what-does-egl-do-in-wayland-stack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2621575356775222222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2621575356775222222'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/03/what-does-egl-do-in-wayland-stack.html' title='What does EGL do in the Wayland stack'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-yp99PzEORDI/T1no3lrZlCI/AAAAAAAAABI/RV7ODuT6qlw/s72-c/EGL-Mesa-Wayland-arch.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-2743843567261960964</id><published>2012-02-02T14:57:00.000+02:00</published><updated>2012-02-02T14:57:03.201+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland R&amp;D at Collabora</title><content type='html'>While being contracted by &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt;, I started a Wayland R&amp;amp;D project in October 2011 with the primary goal of getting to know &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt;, and strengthening Wayland expertise in Collabora. During the four months I started the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_shell_surface&lt;/span&gt; protocol for desktops, added &lt;a href="http://ppaalanen.blogspot.com/2011/11/screen-locking-in-wayland.html"&gt;screen locking&lt;/a&gt;, &lt;a href="http://ppaalanen.blogspot.com/2011/11/wayland-screensaver.html"&gt;ported an X screensaver&lt;/a&gt; to Wayland &lt;a href="http://ppaalanen.blogspot.com/2011/12/wayland-screensaver-integration.html"&gt;with new protocol&lt;/a&gt;, and most recently implemented surface transformations in Weston (the reference compositor, originally the wayland-demos compositor). All this sponsored by Collabora.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The project started by getting wayland-demos running under X, and then looking into the bugs I hit. To rule out problems in hardware GL renderer, I also got the demos running with softpipe and llvmpipe. Trying to fix segmentation faults and other obvious problems was my stepping stone into the Wayland code base.&lt;br /&gt;&lt;br /&gt;My first real piece of work was screen locking. That included adding special protocol for it, having a way to have privileged Wayland clients, implementing locking in the shell plugin in the compositor, and writing an unlock dialog for the desktop-shell client. Those are the obvious parts. I also had to extend the shell plugin interface, find a way to hide surfaces so they do not render while the screen is locked, and of course bug hunting and patch set rebasing and rewriting, before screen locking landed upstream.&lt;br /&gt;&lt;br /&gt;Next was porting an X screensaver as a regular Wayland client. Once that worked, I extended the protocol by adding a screensaver interface, and made the shell plugin automatically start the screensaver application. Handling screensavers would have been a walk in the park, except I needed shell-specific data to be attached to all surfaces. I wrote a hacky solution, but in the end, Kristian Høgsberg wanted me to add a whole new interface into the shell protocol for this. It became the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_shell_surface&lt;/span&gt; interface, and all demo clients needed to adopt it. Yet that was not all. Since we are used to have per-monitor screensavers, I needed my screensaver to set different instances for each monitor. Hence I had to add output event callbacks in the toytoolkit.&lt;br /&gt;&lt;br /&gt;A cleanup phase came next, I took Valgrind and ran. I fixed a pile of memory leaks and wrote missing destructor functions all over, in compositor, clients and the toytoolkit, at the same time collecting a Valgrind suppressions list to ease Valgrinding in the future. This work included adding some ad hoc way of cleanly exiting demo clients.&lt;br /&gt;&lt;br /&gt;In January there were some discussions on maximised and full-screen surfaces, what they are and how they should be implemented. Surface scaling was raised as one point. Weston already had the zoom effect, and full-screen scaling would be another surface transformation, so I decided to write a transformation matrix stack for supporting any number of simultaneous transformations. It turned out to be a three week task.&lt;br /&gt;&lt;br /&gt;Implementing surface transformations required changes all over Weston. First, I needed a way to invert the transformation which is a 4-by-4 matrix. After searching in vain for a MIT-licenced C implementation I wrote one myself, based on LU-decomposition. I believe LU-decomposition is more efficient on a 4x4 matrix than &lt;a href="http://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution"&gt;the cofactor method&lt;/a&gt;. Along the inversion routines, I wrote a unit test application for testing the speed and precision of the inversion. Detecting and dealing with non-invertible transformations is also important.&lt;br /&gt;&lt;br /&gt;Going through the transformation stack every time you need to transform a point might be costly, so I added a cached total transform and its inverse. Implementing input redirection was a simple matter of applying the inverse total transform to pointer coordinates. Needing a way to test transformations, I added a Weston key binding for rotating surfaces, and modified an existing demo application to mark the clicked point. Adding functions for explicitly converting between display global coordinates and surface local coordinates (surface local are the only ones a client knows of) clarified some of the coordinate computations.&lt;br /&gt;&lt;br /&gt;Surface painting and damage region tracking needed fixes, too. Previously, a zoomed surface was repainted as a whole, and it forced a full display redraw, i.e. damaging the whole display. Transformed surface repaint needed to start honoring the repaint regions, so we could avoid excessive repainting. Damage and repaint regions are tracked as global coordinate axis aligned rectangles. Whenever a transformed surface is damaged (requires repainting), we need to compute the bounding box for the damage instead of simply using the global &lt;i&gt;x&lt;/i&gt;, &lt;i&gt;y&lt;/i&gt; of the top-left corner and the surface &lt;i&gt;width&lt;/i&gt;, &lt;i&gt;height&lt;/i&gt;. Then during surface painting, we take the list of damage rectangles, and render only those. Surface local coordinates (texture coordinates) are computed via the inverse transformation. This method may result in sampling outside of a surface's buffer (texture), so those samples need to be discarded in the fragment shader.&lt;br /&gt;&lt;br /&gt;Other things that needed fixing after the surface transformations were window move and resize. Before fixing, moving a surface would not follow the pointer but move in the surface local orientation. Resize needed the same orientation fix, and another fix in relative surface motion that a client can set in the surface's attach request.&lt;br /&gt;&lt;br /&gt;What you mostly see as the result of the surface transformations work is, that you can rotate any normal window, no application support needed. The pointer position on screen, over a window, accurately corresponds to what the application receives as the local pointer location. I did not realise it at the time, but this input redirection working flawlessly became an appreciated feature. Apparently it is hard or impossible to do in X, I would not know. In Wayland, and for me, it was just another relatively easy bug to be fixed. The window rotation feature was meant purely for debugging surface transformations.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-wVdYlTqQBdU/Typ_uvzYgrI/AAAAAAAAAA8/A9lo7A0dnAA/s1600/second-rotate-cropped.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-wVdYlTqQBdU/Typ_uvzYgrI/AAAAAAAAAA8/A9lo7A0dnAA/s320/second-rotate-cropped.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Two rotated windows and some flowers.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;There are still further issues to be fixed with surface transformations. Relative surfaces, like pop-up windows and menus, are not transformed and appear at a wrong location. Pointer cursors are not transformed; you would want the text bar cursor to be aligned with the text orientation. Continuously resizing a transformed window from its (locally) top-left corner makes the window drift away. We are probably still damaging larger regions than absolutely necessary for repaints. Repaint optimisation of opaque surfaces does not work with transformations.&lt;br /&gt;&lt;br /&gt;During all this work of four months there were also the usual bug hunts, enhancements and fixes all over. For example, decorationless EGL apps, which turned out to have been a bug in Cairo, and moving the configuration file parser into a helper library that is shared between clients and the compositor.&lt;br /&gt;&lt;br /&gt;Now, I am done with the Wayland R&amp;amp;D project and moving into another project at Collabora. In the new project I will continue working on Wayland, Weston, and the demos.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/02/wayland-r-at-collabora.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2743843567261960964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2743843567261960964'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/02/wayland-r-at-collabora.html' title='Wayland R&amp;D at Collabora'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-wVdYlTqQBdU/Typ_uvzYgrI/AAAAAAAAAA8/A9lo7A0dnAA/s72-c/second-rotate-cropped.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-3655981564009858135</id><published>2012-01-15T16:54:00.003+02:00</published><updated>2012-02-02T23:18:34.207+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='music'/><category scheme='http://www.blogger.com/atom/ns#' term='N9'/><category scheme='http://www.blogger.com/atom/ns#' term='ID3'/><title type='text'>Nokia N9 Music Player and Album Cover Art</title><content type='html'>I recently got a Nokia N9 phone. One of the first things I did was copy my music collection into it. Since the player shows also album cover images, if such are stored, I started adding them -- not by embedding them into ID3v2 tags but as separate files, to avoid useless copies of images.&lt;br /&gt;&lt;br /&gt;Usually it is as simple as putting a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;cover.jpg&lt;/span&gt; file into a directory, that contains a single album. Sometimes and in some cases, though, that does not work. I found out, that the N9's default music player is supposed to follow &lt;a href="https://live.gnome.org/MediaArtStorageSpec"&gt;Media Art Storage specification&lt;/a&gt;. That gave me hints.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;If a directory contains more than one album, you can name the cover image files according to the album, for example '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Back in Black.jpg&lt;/span&gt;' and '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Flick of the Switch.jpg&lt;/span&gt;', as long as the names correspond the ID3 tag album name (somehow?).&lt;br /&gt;&lt;br /&gt;My real problem case was a directory full of songs downloaded from &lt;a href="http://www.scenemusic.net/"&gt;Nectarine&lt;/a&gt;. I edited them all (&lt;a href="http://easytag.sourceforge.net/"&gt;EasyTAG&lt;/a&gt; is a wonderful tool) to make the ID3 album tag "Nectarine" because I wanted to have them all under the same "album", and there are over 50 songs in that single directory. Simply adding a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;cover.jpg&lt;/span&gt; or &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Nectarine.jpg&lt;/span&gt; did not work.&lt;br /&gt;&lt;br /&gt;There are two possible reasons that I found. First, the directory contains too many files, according to the Media Art Storage spec. Second, apparently the cover art is not taken into use, unless at least one song file, which would use that cover art, is touched (modification date updated).&lt;br /&gt;&lt;br /&gt;I created a new directory, moved one Nectarine song into it, and put &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Nectarine.jpg&lt;/span&gt; there, too. And it started to work, for all my Nectarine songs.&lt;br /&gt;&lt;br /&gt;There is software called Tracker in the N9, which maintains some sort of database of all media. Also album cover art gets used via Tracker. If you ssh into your phone, and move around your media files, Tracker update is not automatically triggered. &lt;strike&gt;You could use the command &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;tracker-control -r&lt;/span&gt; to force a full rebuild when you launch e.g. the music player the next time, but the rebuild will take a long time.&lt;/strike&gt; An easy way to force a faster rebuild is to plug the N9 into a computer via USB, and then unplug it.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2012/01/nokia-n9-music-player-and-album-cover.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/3655981564009858135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/3655981564009858135'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2012/01/nokia-n9-music-player-and-album-cover.html' title='Nokia N9 Music Player and Album Cover Art'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-2115067853727077993</id><published>2011-12-09T12:12:00.000+02:00</published><updated>2011-12-09T12:12:14.374+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><category scheme='http://www.blogger.com/atom/ns#' term='screensaver'/><title type='text'>Wayland screensaver integration</title><content type='html'>Continuing on the &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; screensaver track, I &lt;a href="http://lists.freedesktop.org/archives/wayland-devel/2011-December/001657.html"&gt;sent a branch for review&lt;/a&gt;. The screensaver interface is now fully implemented in both the demo compositor and the demo screensaver. Screenshots below...&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The compositor shell plugin of desktop-shell now implements the screensaver interface. This allows a client to register a surface as an idle animation for a given output (monitor). These surfaces remain hidden until the compositor's idle timer triggers, and the compositor fades to black. If there are any screensaver surfaces, the compositor will fade them in, showing the idle animation. The compositor can also be configured to automatically start a screensaver client.&lt;br /&gt;&lt;br /&gt;While an idle animation is running, if the shell implements screen locking, the unlock dialog will appear on the first input event, for instance when moving the mouse. The idle animation continues as the background for the unlock screen.&lt;br /&gt;&lt;br /&gt;There is another idle timeout running with the idle animation. When that timeout triggers, the compositor fades to black and will seize updating the screen. This also causes properly written animating clients to stop rendering, and we can hit zero CPU usage, even when there is a screensaver active. The compositor will wake from this sleep as usual, and fade in either the desktop directly, or the unlock dialog with the animation in the background.&lt;br /&gt;&lt;br /&gt;On returning to the normal desktop, the compositor (the shell plugin, really) will kill the screensaver client if it started it in the first place.&lt;br /&gt;&lt;br /&gt;The demo implementation also supports multiple outputs, which is convenient to demonstrate on X. The three Wayland compositor windows are the outputs of a single demo compositor running.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-P5WbYF1GaQE/TuHc0xq3RUI/AAAAAAAAAAk/ZUOYu_PNH4M/s1600/scr1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="167" src="http://2.bp.blogspot.com/-P5WbYF1GaQE/TuHc0xq3RUI/AAAAAAAAAAk/ZUOYu_PNH4M/s320/scr1.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Normal desktop, spread over three outputs, with a few flower clients and a terminal.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-YSaIdXy99xw/TuHc1e5W5ZI/AAAAAAAAAAo/RkdOmJidLS0/s1600/scr2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="167" src="http://1.bp.blogspot.com/-YSaIdXy99xw/TuHc1e5W5ZI/AAAAAAAAAAo/RkdOmJidLS0/s320/scr2.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The idle animations running on each output with separate state. There is only one screensaver client running.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-cM5TKiTZmEM/TuHc2HStkKI/AAAAAAAAAAw/t7L6souL2Jo/s1600/scr3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="167" src="http://4.bp.blogspot.com/-cM5TKiTZmEM/TuHc2HStkKI/AAAAAAAAAAw/t7L6souL2Jo/s320/scr3.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Idle animation as the background for the unlock screen.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2011/12/wayland-screensaver-integration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2115067853727077993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2115067853727077993'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2011/12/wayland-screensaver-integration.html' title='Wayland screensaver integration'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-P5WbYF1GaQE/TuHc0xq3RUI/AAAAAAAAAAk/ZUOYu_PNH4M/s72-c/scr1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-2999501926517702223</id><published>2011-11-22T15:38:00.000+02:00</published><updated>2011-11-22T15:38:09.353+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><category scheme='http://www.blogger.com/atom/ns#' term='screensaver'/><title type='text'>A Wayland screensaver</title><content type='html'>Now that &lt;a href="http://ppaalanen.blogspot.com/2011/11/screen-locking-in-wayland.html"&gt;screen locking&lt;/a&gt; is done in &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; demos, it is time to go for the eye-candy: full-screen idle animations, also known as screensavers. The first step was to port an existing screensaver to Wayland. I chose glmatrix from &lt;a href="http://www.jwz.org/xscreensaver/"&gt;XScreenSaver&lt;/a&gt;, because it is cool, and it renders with OpenGL. This way I did not have to port Xlib based rendering to Cairo (yay!).&lt;br /&gt;&lt;br /&gt;Here is GLMatrix running as a regular, windowed application on Wayland, using the toytoolkit:&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--OtX7mKoJKY/TsujXAPUkmI/AAAAAAAAAAc/sCzAXu7mt2E/s1600/glmatrix-wayland.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/--OtX7mKoJKY/TsujXAPUkmI/AAAAAAAAAAc/sCzAXu7mt2E/s320/glmatrix-wayland.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;GLMatrix on the Wayland demo compositor.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;On Wayland, screensavers can be reduced to pure animation applications, while the compositor handles everything about locking. Next, we need a Wayland protocol extension to actually use this idle-animation in a screensaver'y way.&lt;br /&gt;&lt;br /&gt;GLMatrix is already in the Wayland demo repository as a client called &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wscreensaver&lt;/span&gt;, and it requires cairo-gl, just like &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;gears&lt;/span&gt; does.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/wayland-screensaver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2999501926517702223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2999501926517702223'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/wayland-screensaver.html' title='A Wayland screensaver'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/--OtX7mKoJKY/TsujXAPUkmI/AAAAAAAAAAc/sCzAXu7mt2E/s72-c/glmatrix-wayland.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-2752822959890227366</id><published>2011-11-21T17:09:00.000+02:00</published><updated>2011-11-21T17:09:55.030+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Screen locking in Wayland</title><content type='html'>This is continuation to my &lt;a href="http://ppaalanen.blogspot.com/2011/11/wayland-desktop-shell.html"&gt;Wayland desktop-shell&lt;/a&gt; post.&lt;br /&gt;&lt;br /&gt;My goal was to implement a simple screen locking feature, a similar idea to what &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;xlockmore&lt;/span&gt; does for X. In &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt; it is much simpler and more reliable to implement than in X, because the implementation will be in the display server (compositor). While the "lock" itself is in the compositor, also an unlock dialog is required. The unlock dialog usually asks the user to input his password, but I settled for "click the green ball". Screenshots below...&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;First a protocol (&lt;a href="http://cgit.freedesktop.org/wayland/wayland-demos/commit/?id=9ef3e012d61acf71aa495b09f0534857c7695b7e"&gt;commit&lt;/a&gt;) is needed to drive the compositor locking and unlocking, since the unlock dialog is exported to the desktop-shell client. When the compositor hits the idle timeout, it fades out to black, and then locks itself in shell plugin. The compositor is woken up by input events, and sends &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;prepare_lock_surface&lt;/span&gt; event to desktop-shell. The client replies with &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;set_lock_surface&lt;/span&gt; request, with the unlock dialog's surface as an argument. Only on getting the surface, the compositor fades in, to have a nice transition to the dialog. The dialog then runs like any other application on screen, and when the user has dismissed it, desktop-shell sends &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;unlock&lt;/span&gt; request to the compositor. On &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;unlock&lt;/span&gt;, compositor brings all windows (surfaces) back to the desktop.&lt;br /&gt;&lt;br /&gt;The shell plugin implements screen locking by stealing all the surfaces from the compositor's rendering list. Only the background surface and pointer cursor surfaces are left. This has the side-effect that none of the stolen (hidden) surfaces can be activated nor receive input. The compositor-side surface objects still continue living as usual. New surfaces can be created and they are automatically hidden. Output assignment of the hidden surfaces is set to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;NULL&lt;/span&gt;, which prevents sending any &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;frame&lt;/span&gt; events for them, effectively also stopping any animations that might have been running. On unlock, the surfaces are simply put back into the compositor's list, and assigned to outputs.&lt;br /&gt;&lt;br /&gt;After &lt;a href="http://cgit.freedesktop.org/wayland/wayland-demos/commit/?id=2ca8630aab29b1c4c61cd6a6e5c295ef8f2f7138"&gt;the last commit&lt;/a&gt; in the screen locking series, you can enjoy automatic screen locking in the Wayland demo compositor:&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-gdkSJDi-BQ8/TspnTC7ZgpI/AAAAAAAAAAQ/qVewy_shk-8/s1600/nonlocked.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/-gdkSJDi-BQ8/TspnTC7ZgpI/AAAAAAAAAAQ/qVewy_shk-8/s320/nonlocked.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Normal desktop.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-N67gKkSwblM/TspnS0uHT7I/AAAAAAAAAAM/TZdVLRNuX58/s1600/locked.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/-N67gKkSwblM/TspnS0uHT7I/AAAAAAAAAAM/TZdVLRNuX58/s320/locked.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Locked, with the unlock dialog.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note, that locking does not imply a fancy animated screensaver. The black screen is &lt;i&gt;the&lt;/i&gt; screensaver ;-)&lt;br /&gt;&lt;br /&gt;Thanks to Kristian Høgsberg for his reviews, comments and bug fixes.&lt;br /&gt;&lt;br /&gt;This feature is sponsored by &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt;, Ltd.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/screen-locking-in-wayland.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2752822959890227366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/2752822959890227366'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/screen-locking-in-wayland.html' title='Screen locking in Wayland'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-gdkSJDi-BQ8/TspnTC7ZgpI/AAAAAAAAAAQ/qVewy_shk-8/s72-c/nonlocked.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-7255290256767398256</id><published>2011-11-21T11:26:00.000+02:00</published><updated>2011-11-21T11:26:15.963+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='X'/><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland misconceptions: Window</title><content type='html'>There are many misconceptions about &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt;, and I want to try to correct one. Let's start with the statement: &lt;br /&gt;&lt;br /&gt;&lt;b&gt;There is no object in the Wayland protocol that corresponds to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt; in X.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Surprised? We need to take a step back to explain what that really means, and I will do it with the help of an example of a complex application: Firefox.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Take a Firefox instance, one window with several tabs open. The active tab contains a flash video running.&lt;br /&gt;&lt;br /&gt;Notice, what I called as a "window". It is the window from the end user's perspective, it is "the Firefox" on screen. If there was a text terminal window open, too, that would be another "window". Let's call "the Firefox" an &lt;i&gt;application window&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;In X (I imagine, but I do not know if this is really the case) the application window would be an instance of the Xlib data type &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;. This &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt; contains lots of child &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;s, for example: every button could be a separate &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;. Every scrollable text box could be a separate &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;, that is only partially visible. Every tab is probably a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;, too. The hierarchy, the relationships, and event masks are all sent to the X server, so the X server can dispatch input events to the right &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;s, and render all those &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;s on screen.&lt;br /&gt;&lt;br /&gt;Wayland is nothing like that.&lt;br /&gt;&lt;br /&gt;Notice how I said the X server renders stuff? A Wayland compositor does not render that stuff. Wayland is not a rendering API.&lt;br /&gt;&lt;br /&gt;In Wayland, the whole application window is a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_surface&lt;/span&gt;. Period. There are no child surfaces (except perhaps menus, but those are an exception, because they can extend beyond the application window). All rendering must happen client-side. The application will acquire a new &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_buffer&lt;/span&gt;, render &lt;b&gt;everything&lt;/b&gt; into it, including even the video image and window decorations, and then do a single &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;attach&lt;/span&gt; request to get the updated application window contents on screen, in one go, without flicker. Yes, that really must be done for every video frame playing (you can cache the non-changing graphics client side to avoid full redraws).&lt;br /&gt;&lt;br /&gt;The simple statement, that &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;wl_surface&lt;/span&gt; corresponds to a window, is roughly correct, when one means an &lt;i&gt;application window&lt;/i&gt;. There is nothing like an Xlib &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Window&lt;/span&gt;, except if you invent one in your toolkit, and then it will be specific to your toolkit, and never transmitted over the Wayland protocol.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/wayland-misconceptions-window.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/7255290256767398256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/7255290256767398256'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/wayland-misconceptions-window.html' title='Wayland misconceptions: Window'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-3222686665467325139</id><published>2011-11-18T17:05:00.001+02:00</published><updated>2011-11-18T17:11:55.310+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wayland'/><title type='text'>Wayland desktop-shell</title><content type='html'>When I started on &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt;, it already had a fade to black type of screensaver, which triggered after an idle timeout. Actually, one should talk about &lt;a href="http://cgit.freedesktop.org/wayland/wayland-demos/"&gt;wayland-demos&lt;/a&gt; and the demo compositor, as Wayland itself is just a protocol and a C-library implementing the protocol.&lt;br /&gt;&lt;br /&gt;My plan was to add a locking feature. People usually like to lock their desktop when they leave, to prevent unauthorized access. Locking a desktop means that all windows should be hidden and interaction with any windows should be disabled. In X, implementing a lock requires lots and lots of tricks, and even then, you are not absolutely guaranteed, that it really works. In Wayland on the other hand, where locking can be implemented in the display server&amp;nbsp; which also manages all windows and input, you can be sure the lock holds.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The Wayland demo compositor consists of the core, backend plugins, and a shell plugin. The backend plugins handle interfacing with the system: getting images out and input events in. There are three backends: x11 for X, drm for running on DRM/KMS without X, and wayland for running the compositor inside another wayland compositor. The shell plugin is where all the excitement happens with respect to locking.&lt;br /&gt;&lt;br /&gt;The shell plugin has a client counterpart, called desktop-shell. Between these two is a special interface, also called desktop-shell. The desktop-shell interface is an extension to the Wayland core protocol. Desktop-shell client is responsible for drawing the background and the panel.&lt;br /&gt;&lt;br /&gt;Not every client should be able to lock the screen at will, or unlock it. Therefore I made the desktop-shell interface "privileged", which means that only a known client can bind to it. The easiest way to have a known or authenticated client is to have the compositor execute the client directly, and set up a secure communication channel to it, allowing only this client to bind to the interface. Having the whole interface protected, it is easy to define an unlock request that cannot be abused.&lt;br /&gt;&lt;br /&gt;As a result, desktop-shell client is nowadays started automatically by the demo compositor. Also, desktop-shell cannot be started manually anymore because it would not be privileged for the compositor. (&lt;a href="http://cgit.freedesktop.org/wayland/wayland-demos/commit/?id=bbe605241d7bca14821c5f807e017e31ccce5aa8"&gt;commit&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Later, Kristian Høgsberg added a configuration file for the desktop-shell client. You can set the panel buttons and the background image (which must be JPEG) in it. The sample file is wayland-desktop-shell.ini and you must copy it to &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$HOME/.config/&lt;/span&gt; directory and edit for the background image to have a nice demo experience.&lt;br /&gt;&lt;br /&gt;The actual screen locking in Wayland demos will be explained in a future post.</content><link rel='replies' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/wayland-desktop-shell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/3222686665467325139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/3222686665467325139'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/wayland-desktop-shell.html' title='Wayland desktop-shell'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7201445798030158398.post-5313524607653683848</id><published>2011-11-18T16:02:00.001+02:00</published><updated>2011-11-18T16:07:19.324+02:00</updated><title type='text'>The past summer</title><content type='html'>In the past summer I joined &lt;a href="http://www.collabora.com/"&gt;Collabora&lt;/a&gt;. After settling in and getting familiar with the self-employed status, I worked on &lt;a href="http://wiki.compiz.org/"&gt;Compiz&lt;/a&gt; for a moment, fixing bugs and helping the GLES 2 port. Then, I turned my interest to &lt;a href="http://wayland.freedesktop.org/"&gt;Wayland&lt;/a&gt;, and decided to implement some sort of screen locking.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/5313524607653683848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7201445798030158398/posts/default/5313524607653683848'/><link rel='alternate' type='text/html' href='http://ppaalanen.blogspot.com/2011/11/past-summer.html' title='The past summer'/><author><name>pq</name><uri>http://www.blogger.com/profile/06263850515835057642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='http://2.bp.blogspot.com/-5_dPQMOjo0k/T37oqOCtG-I/AAAAAAAAAB8/6AEpdRVxrME/s220/cat-128px.png'/></author></entry></feed>