[Openicc] Xorg low level buffers - colour conversion

Tomas Carnecky tom at dbservice.com
Fri Mar 7 11:48:56 PST 2008


Kai-Uwe Behrmann wrote:
> Control:
> What kind of buffers can a Xorg composite manager cover? ... static screen 
> content, Xvideo, OpenGL?
> In other words, is the composite manager a key component to influence all 
> colour paths to the screen at once?

The only special case is XVideo: If the 'video texture' adaptor is used 
then everything goes through the compositing manager. If the 'video 
blitter' use used (the 'blue overlay'), then that can't be influenced by 
the compositing manager. The XV adaptor itself can have several 
attributes influencing colors and such, but these are very much video 
card/driver specific. The video texture adaptor is default in many of 
the newer video drivers, although I've heard that using it can cause 
video tearing.

> Modularity:
> Is it possibly to generalise GPU usage and run a shader programm over 
> data residing in RAM?

You can run a shader over whatever you want. Newer graphics cards are 
generalized to such extent that you can also solve _huge_ matrices with 
them (GPUs are essentially massive parallel floating point processors). 
If you want to have the shader running on the GPU, you first have to 
upload the data to the graphics card memory, then run the shader, and 
then copy the result back to RAM. That adds some delay, especially the 
reading back to system RAM, which is slow on the AGP bus (much faster on 
PCI-Express). The compositing manager does not need to read the data 
back into system RAM, so don't worry, it does not have such delay.

> Assuming that the shader programm is some thiny blob, would it be 
> wise to provide this small programm by a CMM and thus influence the 
> interpolation algorithm, e.g. make the shader generation plugable?
> 
> Is the GPU shader, generated by a CMM, useable on the early rendering end 
> in a application?
> 
> Can a shader programm be written to files and shared by applications?

A glsl shader looks like a normal C source code, so you can do whatever 
you want with it: save it in a text file, share it between applications 
etc. An application can load the shader source code (which OpenGL 
compiles into a GPU assembler and loads it into the GPU) and run it on 
whatever data it wants.

Whoever can use OpenGL can also use the shaders, be it an application or 
the compositing manager, or even the xserver (now that we have 
accelerated OpenGL in the xserver).

If the color conversion is just a matrix transformation, then that can 
be very easily done in a few lines of a shader program. However if it 
involves lookup tables and such additional data then the shader becomes 
a bit more complicated.

> Has the final call, to bring this shader programm in place and start the 
> colour conversion, realy influence on the result? Or is it more to see 
> like a switch to start the programm?

I don't understand this question.

tom


More information about the openicc mailing list