QT 24bpp support
来源:互联网 发布:无间道细节知乎 编辑:程序博客网 时间:2024/04/27 17:20
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]- 1Preparation
- 2Adapt the code
- 2.1Linux Kernel source code
- 2.2Qt source code
- 3Update the Linux Kernel and the NFS file system
- 4Interesting 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]
- QT 24bpp support
- 24BPP转16BPP
- 16BPP与24BPP的相互转换
- 4.3寸24BPP屏驱动笔记
- JSON Support in Qt
- Qt multi screen Support
- wince的24bpp(24位)颜色深度实现
- High-DPI Support in QT
- High-DPI Support in QT
- Qt浅译:JSON Support in Qt
- 2440 wince的24bpp(24位)颜色深度实现
- OpenCV学习——图像装载函数的模拟加载24BPP的BMP文件
- 32BPP窗口模式下24位位图的像素操作(1)
- 32BPP窗口模式下24位位图的像素操作(2)
- 6410 QT2 24bpp 解决只有3/4屏幕的 BUG
- 在UBOOT TINY210V2 S70里实现24BPP的显示CONSOLE 有图有真像
- 嵌入式裸机开发学习:2440驱动LCD的24bpp模式相关设置
- 像素深度BPP
- 12个有效的提高编程技能的方法
- 虚函数在对象中的内存布局
- 文件对话框CFileDialog
- JAVA简单聊天程序
- uva-10878 - Decode the tape
- QT 24bpp support
- JAVA的JMF下载和安装
- Android-防止EditText自动获得焦点
- 存取权限
- 自写的队列的一些基本处理
- 突破封锁——MAC地址欺骗
- AlertDialog自定义样式
- 我对中文化编程的设想,请大家放飞思维
- 基于泛型DAO的设计模式