Thread (13 messages) 13 messages, 6 authors, 2005-08-07

Re: Choosing the correct framebuffer configuration

flat view

From: Jon Smirl <hidden>
Date: 2005-08-07 15:33:54

On 8/7/05, Geert Uytterhoeven [off-list ref] wrote:
On Fri, 5 Aug 2005, Jon Smirl wrote:
quoted
The chips actually allow nine configs (maybe more when I get a look at
the R300 doc). It is ambiguous to set these configs based on BPP since
there are multiple configs for various BPP. These configs should
instead be set with the transp/red/blue/green fields.

4bpp Index = /4
8bpp Index = /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
32bpp aRGB 8888 = 8/8/8/8
32bpp aRGB 2:10:10:10 = 2/10/10/10

What is the best way to fix this?
Just follow the FBIOPUT_VSCREENINFO rules:
  - If a value doesn't fit, round it up.
  - If rounding is impossible, return an error.

So if a user asks for e.g. bpp 16, transp.length = 1,
{red,green,blue}.length = 0, you can give him 1555 if your hardware supports
it. Or 4444 if your hardware doesn't support anything in between 1000 and 4444
(w.r.t. rounding). But you must not give him 565, since this implies you
rounded down transp.length.
quoted
The interesting hidden config is 30b color.
Piece of cake!

    bpp = 32
    transp.length = 2, {red,green,blue}.length = 10
The problem is that the radeonfb driver sees bpp = 32 and then sets
rgbt = 8/8/8/8. It stomps rgbt without looking at it.

Is this a general problem? Do a lot of drivers look at bpp and then
overwrite rgbt? If so I can look at putting better fixup code in base
fbdev and then remove the code that converts from bpp to rgbt in the
various drivers.

The basic problem is what happens if bpp and rgbt are set in
conflicting ways. For example bpp = 16 and rgbt = 8/8/8/8. Which one
should win? I think the config should always be controlled by rgbt and
bpp is read only and computed from rgbt. But fixing everything to work
that way may break some apps. radeonfb is definitely not working in
this manner.

Best fix would be for the core fbdev to zero out bpp before handing it
to check_par. That would force the chip drivers to compute it from
rgbt. Some of the chip drivers will probably need their code adjusted.
This may also break some apps since they are not setting rgbt.

So I guess the fallback position is leave this driver dependent. So
for the radeonfb case if you set bpp it will work like it always has.
I'll then fix radeonfb to look at rgbt if bpp = 0. rgbt with bpp=0
will then be able to select the other configs.

It would also be nice to build a string with the list of legal configs
into each driver. For radeon the string would contain: /4, /8,
1/5/5/5, /5/6/5, 4/4/4/4, 8/8, /8/8/8, 8/8/8/8, 2/10/10/10. This would
let me display the list of legal configs in sysfs.

-- 
Jon Smirl
jonsmirl@gmail.com


-------------------------------------------------------
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help