Tuesday, October 03, 2006

Optimizing VNC for localhost

I've got some free time now and have been thinking recently about revisiting QEMU GUI support. Previously, I had a set of patches that implemented a shared memory transport for QEMU's graphic interface. The first change I wanted to make to my old patches, was to use a TCP transport instead of QEMU's char device interface. I quickly realized though that there would be a lot of shared code between this new transport and the VNC transport. At this point, I started thinking about what it would take to add a shared memory transport to VNC. Conceptionally, all this would require is a new encoding type that can send back a shared memory ID. The client would have to send a little more than just a SetPixelFormat though since the bytes-per-line is also needed. What this would allow though, is for the server to allocate a shared memory segment, hand that info over to the client, and the client could then hand that over to the X server. This would have fantastic performance on the localhost case. Reusing the VNC protocol means a much simpler client. I sent off a note to the VNC folks asking to reserve a pseudo-encoding range. Once I get a response, I should be able to hack something up fairly soon.