[Xcb] XPutImage and context switches / roundtrips?

Peter Harris peter.harris at hummingbird.com
Wed Sep 10 14:01:34 PDT 2008


Clemens Eisserer wrote:
> Is there anything that can be done against this?
> Maybe increasing the buffer to something like 32kB, I guess this size
> would be perfect for my use-case - but I have read somewhere that the
> size is fixed to 4kb and can not be chaged at run-time, not even at
> compile-time (which would be useless for me anyway).

It's the size of the OS's socket buffer that matters, not the size of
XCB's internal buffer, really.

man setsockopt (look for SO_SNDBUF) might help. See also
xcb_get_file_descriptor.

My Linux 2.6.26 box defaults to a reasonably large size. Maybe your OS
is different.

> Could the BigRequest extension used for this?

No, but take a look at MIT-SHM. Of course, MIT-SHM would be a lot more
efficient if you could put all your tiles into one large image first.
Just remember that you have to keep your old code path as a fallback
just in case you can't use MIT-SHM (remote display, for example).

Also, don't copy that abysmal Red Hat Notifier which keeps doing a
PutImage on the same tiles over and over again. Pixmaps exist for a reason.

Peter Harris
-- 
     Hummingbird Connectivity - A Division of Open Text
Peter Harris                    http://connectivity.hummingbird.com
Research and Development        Phone: +1 905 762 6001
peter.harris at hummingbird.com    Toll Free: 1 877 359 4866


More information about the Xcb mailing list