LWN.net Logo

Python slithers into Wesnoth

Python slithers into Wesnoth

Posted Jan 15, 2009 23:51 UTC (Thu) by alankila (subscriber, #47141)
In reply to: Python slithers into Wesnoth by jengelh
Parent article: Python slithers into Wesnoth

The texture-from-pixmap extension should allow one to use RGBA (or more likely, ABGR) surface which is directly usable by the display hardware for displaying. It's still not as good as something like DirectX which gives memory straight from the graphics adapter for application to use. That being said, it is not such a big problem because texture fill is still insanely fast on any GPU, so it isn't a large problem to require the graphics card to blit it when the image is ready. In contrast, CPU-based data blitting is always terribly slow because of low system memory bandwidth, and can't be optimized in any meaningful way...

As I see it, the trouble with XSHM pixmaps is that they aren't actual pieces of display surface. Something still needs to blit it before it finally is on the screen surface, and for reason or other it always seems to be the main CPU, and not the GPU. I also strongly suspect the XSM pixmaps are physically stored in the system RAM, and not the graphics card RAM. One likely explanation for this is that reading from display RAM by the main CPU seems to be very slow. (You can make this mistake quite easily with DirectX surfaces -- reading from display is a lot like hitting denormal numbers on FPU: suddenly everything begins to crawl...)

So in the end, XSHM may save one copy from application's memory to X server's memory, perhaps, but there are many copies left, all which are dreadfully expensive.

Xvideo indeed is quite marvelous when it comes for displaying data. Unfortunately the U and V channels have lower bandwidth compared to Y, limiting chromatic accuracy. On the other hand, gamma correction is done by hardware, which can be awfully convenient, and you get tint and brightness/contrast correction controls for free while at it. On the whole, I do think that it may be the only reasonable way for displaying video data on X.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds