my dear diary… (some not-so-old memories)

•November 8, 2009 • Leave a Comment

Portland, OR

I was so proud for the forth time be part of the X crew, this time in Portland. Really amazing the city. I had the opportunity to play tourist and visit some nice places.

My X conferences

BTW, I just collect the photos of all four X conferences that I’ve attended. It’s not much photos but there’s some funny things :)

X on embedded

The cool thing of the work that I’m doing at Nokia is that I can publish and discuss mostly all X fun with the open source communities. “Mostly” because, for the last device – the N-shiny-and-awesome-900 – for instance, the video driver is closed (provided by Imagination), so we cannot comment much regarding such driver stack :( C’est la vie.

So we’ve been using Xorg for our small devices (FWIW the development of kdrive based servers is dead! Period). Therefore, myself and Oliver brought to XDC some discussions that we had about X server for tiny systems. Xorg DDX is still too fat. There’s a lot of code that we can cut off and that was the whole idea of our talk, more concerned about Xorg’s memory footprint.

Life is beautiful

6 months living in Helsinki: hosted 4 visits of friends, 5 new European countries visited and an average of 2 pints per day :) Lot of fun and no time at all for opensource pet projects. Even so, I’m enjoying! Besides, I bought an skate board and I’m speaking the first Finnish words already. I’m happy also that I’m (finally) finding time again to appreciate a good music (but didn’t get a guitar yet for me here). Let’s see what will be my next musical project… Nähdään!

multiseat with multiple X servers (or “the right way”)

•July 24, 2009 • 9 Comments

So last week I posted on lkml an old patch that we were carrying for a long time in the Linux community. It basically brings the multiple (old) video cards functionally again on Linux and X server (and this time doing on the right and beauty way). For the people that was following multiseat implementations, this is a HUGE step: we will finally be able to discard the old and ugly hack (a mix of Xorg, several Xephyr servers + evdev) and and go to a clean way, starting multiple X servers in parallel. Cool! Well, not that much, because it might take some time to be in your beloved distribution :)

It’s too early and I don’t know if it’s recommended to say this, but if you want to give a try basically you have to get all X components, this X server patches, my libpciaccess and Dave’s kernel patchset. Again: it’s a very unstable work!

If you’re concerned with the technical explanations then you can follow the nice memo that Dave wrote about this.

Nokia, FI…

•June 12, 2009 • 5 Comments

… here I’am :)

personal news

•May 17, 2009 • 2 Comments

Being quick about my last months: finished my Master course, moving to Helsinki tomorrow (!), got my first real job. Yessh, three great steps in my crazy life and I’m very happy with it! Hope to stay closer with the desktop communities again ;)

Cursor’s update inside kernel only

•January 14, 2009 • 3 Comments

One thing that I learned with open communities is when you send a proposal idea and no one replies. This seems to be odd at first but it _isn’t_. If you did something strange or wrong then at least someone will reply. OTOH if you did something that can be promiser _and_ no one objects, then great! 99% that you did something interesting :)

Given that I’ll not work towards this cursor’s shortcut idea soon, I’m posting a mail that I recently sent to dri list and didn’t see much excitement there. So the bits are preserved here for future references.

Under KMS, we can build a feature to update the cursor directly to screen without the continuous intervention of the userspace application (X server, wayland, etc). It’s a fastpath for DRM based cursors obtained by short-circuit the kernel input layer and DRM module. This would solve all cursor’s latency issues that we have in our current model.

This series of patches implement such feature using Xorg as the application. Through an ioctl, Xorg tells which devices are responsible for cursors’ updates and the kernel evdev driver will spit the events to DRM. DRM will take care about the event informations and also screen limits, and then will draw the cursor on screen. Very intuitive.

Right now a thing that is annoying me is how others cursors, sw rendered, could be implemented. I want to avoid two different sets of the same code in different contexts. IMHO conceptually all these cursor update things must be in-kernel. Painting a cursor image seems to be quite hard as we have to save/restore areas under the cursor. I remember that anholt had an idea concerning this, but I do not remember details.

Well, the patches are far from ready to go upstream, but it deploys a system working on this way. So, for now, this mail has two goals:
- to people comment on and see in what kind of world we can move.
- get a feedback how we can proceed in the case of sw cursors.

Please, comment on. The patches can be found here.

multiseat – documentation and references

•January 9, 2009 • Leave a Comment

Trying to put some order with all the multiseat documentation found on Web, today I updated the following:

Multiseat’s article, in X.Org Foundation wiki:
http://wiki.x.org/wiki/Development/Documentation/Multiseat

Multiseat’s history, in Wikipedia:
http://en.wikipedia.org/wiki/Multiseat#History

So if you are trying to setup or help in development, probably the foundation’s wiki has the most up to date and centralized references. Also, please, if you have more helpful information, don’t be afraid to update the wikis. Our future grandsons will be thankful  :)

multiseat – roadmap

•September 23, 2008 • 5 Comments

This week our laboratory at university released the MDM utility to ease the process of installation and configuration of a multiseat box. The idea is that the end-user should not use some boring and hard howtos anymore to deploy it. Just installing a distro package must be enough now. Try it, use it, report the bugs and send the patches! :)

But I would like to call attention here because we’re still relying on the ugly Xephyr solution to build the multiseat on a simple PC machine (there are people selling this solution. Sigh). A lot of cool stuffs arriving in the linux graphics stack are lacking with this solution. So lets try trace the roadmap here that we can follow in the short/medium-term to build a good one solution:

- Vga Arbiter
We should as fast as we can forget the Xephyr hack. Definitely several instances of Xorg – one for each user session – is what we want. If someone wants to use several graphics cards to deploy a multiseat, then (s)he would probably face the problem of the vga legacy address. The vga arbitration is the solution.

Jesse seems that will work towards this in 2.6.28. There’s also a “minor” problem here that the X server still not posting secondary cards (after pci-rework).

- xrandr 1.3
To deploy a multiseat with one video card/multi-crtc, the randr extension is enough to cover the hotplug of output devices. For a multi-card configuration, xrandr must be GPU aware. So we must done some work here as well to do the automagically configuration of output devices.

- input hotplug
So far MDM is not using the last input features of X to plug or re-plug a device in the machine. It is using its own ugly method to poll for devices. Some work here is needed.

- ConsoleKit integration
Device ownership (e.g. audio, pen drive, cameras, usb toys, output and input devices) when multiple users are in the same machine could be a mess. Moreover, the security problems implied by this could be harmful. ConsoleKit seems to solve this all. It is able to keep track of all the users currently logged in.

Honestly I never took a closer look at ConsoleKit. I’m not sure if it’s prepared enough to support multiseat. So we need to take care of this as well eventually putting some hook inside MDM to work with it.

- DRI + modesetting
Support DRI in multiple X servers in parallel is not ready yet. Some redesign must be done to achieve this.

- tools for auto configuration
After all this work, some easy tools and very user-friendly would be awesome to setup on-the-fly the multiseat in the desktop environments.

Parallel events (panic) with X

•August 18, 2008 • Leave a Comment

Unfortunately that model which I described some weeks ago to put the input event delivery of the X server in a separate thread wouldn’t be an advantage. I precipitated myself thinking that it could be feasible. Sorry :(

I started to implement all this but it showed a very boring task to grab all the globals variables which both threads touch and to lock it. So I decided to stop going in this way. It’s hard to program thinking in parallel. It’s even harder to debug a program with severals flows. More, the tools don’t help you (if you have lucky, gdb will work).

But the main reason I can argue to stop with this model is that the “main” event flow of execution (i.e. basically all the functions in {Swapped,}ProcVector) and the input delivery flow (ProcessInputEvents()) are very very tied. Both deal a lot with clients and we’d need to lock several globals, thus spending a lot of time in the management of the threads. It’s easy to see this acting: just put a breakpoint in TryClientEvents(). Every single request to deliver a given event to a given client involves this function. And both input and main event flow will call TryClientEvents(). So you will see a zillion of times this function being called. The contention of the eventual processing and main threads would be even greater if the client choose to receive MotionNotify event.

So yeah, it’s far from be clear how to put processing of input events inside another thread.

== Next ==

In the next days I’ll be traveling to CESol, Fortaleza here in Brazil. I was invited to talk about my work in X land. Latin America has a lot of promising countries concerning FOSS development however for some reason no one actively participate and contribute for the X development (why?). I’ll try to motivate people there somehow :)

In the next week I’ll put the generation thread in a shape good enough to eventually push this to upstream. Also I’ll try to write a good sumary of all my work given that GSoC is in the end.

Priorities and scheduling hints for X server threads

•August 7, 2008 • 3 Comments

Input events routed through another thread/process can have bad effects on latency because we can’t guarantee that it will get scheduled at the right moment. Although this is hard to see happening with the current X server threaded implementation, we must design something to avoid it. One way to improve the responsiveness is to give a high priority to the input thread and also adjust the CPU scheduling. (Note that this will not avoid problems related with page faults which usually happen in the X input flow.)

Linux uses 1:1 thread model and the scheduler handles every thread as a process. For now I don’t care about others systems. Both input generation and processing threads was designed to sleep after a relatively short CPU run. So we can give a priority to processes that are trusted to not hog the CPU. And given they are special time-critical applications I have no doubt in what policy to use: I set both input threads to use the real-time FIFO policy and to get the maximum priority (sched_get_priority_max()).

I’m sure that someone will complain telling that this would decrease a bit the main thread when used together with both input threads. In GUI we’re talking about better user experience. Latency variability must be avoided whenever possible in interactive situations. What the user see is what matters. For non-interactive processes (server scheduling workloads) the situation is totally different.

Xorg’s philosophy is to be portable so we have to take care when setting this kind of parameters. It is a complex issue and different systems do it in wildly different ways. I was using my Linux box (2.6.24) to design it all.

keep it going…

•August 7, 2008 • 1 Comment

Given that GSoC ‘08 is getting close to the end, strategy number 2 showed more feasible to proceed my work. Strategy #3 would be a lot of fun but would imply a hell massive codification as well (also a little out of our scope). Unfortunately no-no for now.