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]

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]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值