Ian Romanick wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jon Smirl wrote:
I'm trying to work out a syntax for the sysfs attribute that will
control the config. My first idea is to use a alpha/red/blue/green
syntax. When red is set and blue/green are missing index mode is set.
When green is set and red/blue are missing gray scale is set.

Are there chips that can scanout from buffers not packed at a power of two?
How should I work different color spaces (YCbCr) into this?

4bpp Index = /4
4bpp greyscale = //4
8bpp Index = /8
8bpp RGB 332 = /3/3/2
8bpp greyscale = //8
16bpp aRGB 1555 = 1/5/5/5
16bpp RGB 565 = /5/6/5
16bpp aRGB 4444 = 4/4/4/4
16bpp aIndex 88 = 8/8
24bpp RGB 888 = /8/8/8
24bpp aRGB 6666 = 6/6/6/6
32bpp aRGB 8888 = 8/8/8/8
32bpp aRGB 2:10:10:10 = 2/10/10/10

What would be wrong with using a letter, a colon, and a number to
describe the field?  So, instead of 2/10/10/10 you'd have
A:2/R:10/G:10/B:10.  Or A:8/I:8 for aIndex 88.  I'm not familiar with
how sysfs attributes work, so this may be pure nonsense.

I agree that something like the above is acceptable, exept that we need
an extra field for offset and another if indexed color or not. So something 
like:

A:2/0/R:10/2/G:10/12/B:10/22//I

is ARGB2888. The I means it's indexed (directcolor), differentiating it from
truecolor.

A:8/0/R:8/0/G:8/0/B:8/0//I

is ARGB8 indexed, because offset's are all equal to 0 and len's are all
equal to 8.  The 'I' here is probably redundant, but it can be used to
differentiate it from static pseudocolor.

From here, you can get the color depth which usually translates to bpp:

if (offset's = 0 && red.len == green.len && green.len == blue.len)
        if (transp.offset == 0) //ARGB8 bpp8
depth = green.len ; else //A8_RGB8 bpp16
                depth = green.len + transp.len
else
        depth = red.len + green.len + blue.len + transp.len

If depth returns 15 (RGB555), the driver can easily round that up to bpp16.

Tony


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to