QT 24bpp support

The reason for this page is that the S3C6410 processor is programmed NOT to work with 32bpp (no ALPHA layer). Although the kernel setting for 24 bpp (bits per pixel) uses 32 bits: ARGB where Alpha is not used. The difference with QT is that for QT 24 bpp setting only uses 24 bpp, this makes a difference with the kernel 32 bpp. This miscommunication between the kernel and QT result in a screen that is only filled for 3/4 and seems kind of black and white.

REMARK: The 4.3" LCD doesn't support 24 bpp, so there won't be any change in display quality. Please inform if the LCD module you use is ready to show 24 bpp.

Contents

[hide]
  • 1 Preparation
  • 2 Adapt the code
    • 2.1 Linux Kernel source code
    • 2.2 Qt source code
  • 3 Update the Linux Kernel and the NFS file system
  • 4 Interesting Pages

Preparation

First of all we need to make clean the buildroot folder because we need to adapt the source code. Remember that if you make clean, the configuration we already made earlier inside buildroot will remain! Only the build code will be removed. If you want to start all over again you can use the command make distclean to remove everything and start with a fresh buildroot system (see earlier tutorials on this wiki)

$ cd ~/buildroot-2011.05
$ make clean

This can take a while and after that we can alter the menuconfig of buildroot and the kernel to use the 24 bpp setting:

$ make menuconfig
Package Selection for the target --->
    Graphic libraries and applications (graphic/text) --->
        [*] Qt --->
              [*] Gui Module
                    Pixel Depths --->
                         [*] 16 bpp
                         [*] 24 bpp
                         [*] 32 bpp

Save the configuration and exit.

$ make linux26-menuconfig
Device drivers --->
      Graphics Support --->
         <*>   Support for frame buffer devices --->
               <*> S3C Framebuffer support
                    Advanced options for S3C Framebuffer
                        Select BPP(bits per pixel) (24 BPP) --->

Adapt the code

Now we need to adapt a little bit of code to the Linux kernel and to the Qt source code.

Linux Kernel source code

Now everything is set up we need to make a few changes to the kernel and to the QT source code.

$ gedit ~/buildroot-2011.05/output/build/linux-custom/drivers/video/fbmem.c 

And look for line 1005, for the function do_fb_ioctl Add the following three lines at the beginning of this function:

if (info-> var.bits_per_pixel == 24) {
info-> var.bits_per_pixel = 32;
}

So that it looks like this:

static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
			unsigned long arg)
{
if (info-> var.bits_per_pixel == 24) {
info-> var.bits_per_pixel = 32;
}
struct fb_ops *fb;
struct fb_var_screeninfo var;
struct fb_fix_screeninfo fix;
struct fb_con2fbmap con2fb;
struct fb_cmap_user cmap;
...

Save the file and exit.

Qt source code

And now we need to make an adaptation to the Qt:

Open the qt-everywhere-opensource-src-4.7.3.tar.gz file inside ~/buildroot-2011.05/dl directory.

After it is opened in the archive manager, look for the following file:

qt-everywhere-opensource-src-4.7.3/src/gui/embedded/qscreenlinuxfb_qws.cpp

and open this file by double clicking on it and look for line 280 QLinuxFbScreen::connect and a little further in that function you will see the following if function:

  if (d == 24) {
       d = vinfo.red.length + vinfo.green.length + vinfo.blue.length;
       if (d <= 0)
           d = 24; // reset if color component lengths are not reported
    } else if (d == 16) {
        d = vinfo.red.length + vinfo.green.length + vinfo.blue.length;
        if (d <= 0)
            d = 16;
    }

Change this into:

    if (d == 24) {
        d = 32;
    } else if (d == 16) {
        d = vinfo.red.length + vinfo.green.length + vinfo.blue.length;
        if (d <= 0)
            d = 16;
    }

Save the file. It can take some time before the computer has reimplemented the file into the archive, so just be patient for a while.

Now everything is ready to build! Inside the main buildroot directory, press:

$ make

And wait


Update the Linux Kernel and the NFS file system

  • The last step is to update the kernel inside the NAND flash of the board (using dnw). Click here
  • Update the NFS file system with the new one, using the altered Qt. Click here

Interesting Pages

[1]

Retrieved from " http://www.arm9board.net/wiki/index.php?title=QT_24bpp_support"

你可能感兴趣的:(QT 24bpp support)