Hi,

On 03.12.2014 15:16, Kalle Jokiniemi wrote:
The pixel format from dfb_pixelformat_for_depth() might be not supported
by the framebuffer device. Use primarily the pixel format from user's
configuration and only fall back to dfb_pixelformat_for_depth() if no
user setting is available.

Haven't sent patches before, but here's some background what I was fixing this for.. So I was trying directfb on my phone, and was getting this kind of errors when running dfbinfo or dfbshow:

(*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)
(!) DirectFB/FBDev: No supported modes found in /etc/fb.modes and current mode not supported! (!) DirectFB/FBDev: Current mode's pixelformat: rgba 8/24, 8/16, 8/8, 8/0 (32bit)
(!) DirectFB/Core/layers: Failed to initialize layer 0!

As a kernel dev, I first turned around the kernel to see where it was failing, and the problem was with bad pixel format. My phone needs ARGB. Eventually it turned out that this bit of fbdev code is always running RGB32 from the pixel depth, regardless of any settings I tried to put in place.

The patch fixes the problem so that I can make it work with my own directfbrc.

- Kalle

---
  systems/fbdev/fbdev.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/systems/fbdev/fbdev.c b/systems/fbdev/fbdev.c
index aee785b..921c4ad 100644
--- a/systems/fbdev/fbdev.c
+++ b/systems/fbdev/fbdev.c
@@ -1979,12 +1979,18 @@ dfb_fbdev_test_mode_simple( const VideoMode *mode )
  {
       DFBResult                ret;
       struct fb_var_screeninfo var;
+     DFBSurfacePixelFormat    pixelformat;

       D_DEBUG_AT( FBDev_Mode, "%s( mode: %p )\n", __FUNCTION__, mode );

       D_ASSERT( mode != NULL );

-     ret = dfb_fbdev_mode_to_var( mode, dfb_pixelformat_for_depth(mode->bpp), 
mode->xres, mode->yres,
+     if (dfb_config->mode.format)
+          pixelformat = dfb_config->mode.format;
+     else
+          pixelformat = dfb_pixelformat_for_depth(mode->bpp);
+
+     ret = dfb_fbdev_mode_to_var( mode, pixelformat, mode->xres, mode->yres,
                                    0, 0, DLBM_FRONTONLY, &var );
       if (ret)
            return ret;

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to