Hello all,

I have a question about mode selection; more specifically about the bit 
depth of the surface. 

Looking in systems/fbdev/fbdev.c in primarySetRegion, I see that 
DirectFB iterates over the available modes and compares the requested 
width and height, but not the bit depth.  Also, I see that a "priority" 
is checked, but I can't find anywhere where this priority is actually 
set.

I ran into this while investigating the bug reported at http://
www.directfb.org/mantis/view.php?id=32, and looking at the resulting 
rgb codes it looks to me like there is some intermediate RGB565 
conversion going on.  I put some debugging printfs in primarySetRegion 
(notably printing out highest->bpp), and it seems to pick a [EMAIL PROTECTED] 
bit screen, which I thought would explain the results seen on a Via 
CLE266.

However, when I try the test app included with the bug report on my 
laptop (Radeon M9), the resulting rgb values _are_ correct - and even 
there, DirectFB seems to pick a 16 bit screen.

Also, adding printfs in dfb_fbdev_set_mode, printing out 
var.bits_per_pixel and mode->bpp, I see a lot of mode->bpp - 16 (12 
times), then one var.bits_per_pixel = 16, then the (*) DirectFB/Code/
WM: Default 0.2 (Convergence GmbH) line, then one more 
var.bits_per_pixel = 16, then 5 times var.bits_per_pixel  = 32, then I 
see my primarySetRegion printf (saying a [EMAIL PROTECTED] mode is selected), 
then finally one more var.bits_per_pixel = 32.

Since the code attached to the bug report reads data back from the 
frame buffer as 32 bit RGB values, apparently the buffer _is_ set to a 
32 bit mode.

Looking at /etc/fb.modes, I notice that there are no 32 bit modes 
listed.  So I guess I have the following questions:

- Am I supposed to be able to select 32 bit frame buffer modes at all?
- Is SetVideoMode supposed to fall back to a lower bit depth when the 
requested one is not available?
- Is it possible that the unichrome driver somehow uses 16bit palette 
lookups when doing a LUT8 blit to a 32bit surface?

Thanks for any hints,
Sander Stoks


_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to