News for hackers. Stuff that matters.
Re:GTK: Introducing Graphics Offload by AshamedCaptain on Saturday November 18, 2023 @09:34AM (#38320053)
> XShm uses a buffer created in CPU memory allocated by the client that the X server then has to copy to the screen.

This is completely wrong. The _entire point_ of XShm, as the name implies, is to have _shared memory_ between the client and the X server. And the server controls the card's framebuffer (at least, in traditional X). There's absolutely no copy and that was the entire point of the extension.

(if compositing is enabled, and therefore the GPU is in between, the server eventually has to call texture_from_surface; at that point, whether there is a copy or not depends on the GPU's driver).

You could literally read the PREVIOUS contents of your card's framebuffer by doing XShmGetImage on the root window.

> No, for video, the GPU is used in the middle so you can do post-processing without copying everything into main memory and stalling the whole pipeline.

You can do many types of card-accelerated zero-copy post-processing using XV: colorspace conversion, scaling, etc., which, again, was the point of the extension. At the time, scaling the video in software or even just doing a memory copy per frame would have completely tanked frame rate. How do you think I used Xine to watch DVDs on Pentium II-level hardware? Obviously you cannot put the video in faces of rotating 3D cube, but this is precisely what I call "fancy animations".

There are no comments on this comment yet.