【问题标题】:Qt Embedded exchanged colors bits: Red and BlueQt Embedded 交换颜色位:红色和蓝色
【发布时间】:2012-08-03 15:37:00
【问题描述】:

我在帧缓冲区 (/dev/fb0) 上具有 16 位颜色深度的 ARM 显示设备上使用 QtEmbedded (4.8.0)。在这种情况下,我们正在交换颜色位 RED 和 BLUE。

我们正在使用以下编译标志:

./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -prefix /home/rchaves/Toolchain -release -opensource -shared -fast -depths 16 -largefile -no-exceptions -no-accessibility -stl -no-sql-mysql -no-sql-psql -no-sql-oci -no-sql-odbc -no-sql-tds -no-sql-db2 -no-sql-sqlite -no-sql-sqlite2 -no-sql-ibase -no-qt3support -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon-backend -no-svg -no-webkit -no-javascript-jit -no-script -no-scripttools -no-declarative -no-declarative-debug -qt-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-nis -no-cups -iconv -no-pch -no-dbus -qt-freetype -no-opengl -qt-gfx-linuxfb -qt-kbd-linuxinput -qt-mouse-tslib -nomake demos -nomake examples

以及执行应用程序的以下参数:

QWS_DISPLAY=LinuxFb:/dev/fb0:depth=16 ./app -qws

这里有应用程序帧缓冲区(示例)日志:

The framebuffer device was opened successfully.

Fixed screen info:
    id:          DISP3 BG
    smem_start:  0x93800000
    smem_len:    7864320
    type:        0
    type_aux:    0
    visual:      2
    xpanstep:    1
    ypanstep:    1
    ywrapstep:   0
    line_length: 2048
    mmio_start:  0x0
    mmio_len:    0
    accel:       0

The framebuffer device was mapped to memory successfully.

Successfully switched to graphics mode.

Variable screen info:
    xres:           1024
    yres:           768
    xres_virtual:   1024
    yres_virtual:   3840
    yoffset:        0
    xoffset:        0
    bits_per_pixel: 16
    grayscale: 0
    red:    offset:  0, length:  5, msb_right:  0
    green:  offset:  5, length:  6, msb_right:  0
    blue:   offset: 11, length:  5, msb_right:  0
    transp: offset:  0, length:  0, msb_right:  0
    nonstd:       0
    activate:     64
    height:       -1
    width:        -1
    accel_flags:  0x0
    pixclock:     15385
    left_margin:  157
    right_margin: 157
    upper_margin: 16
    lower_margin: 15
    hsync_len:    5
    vsync_len:    1
    sync:         0
    vmode:        0

Frame Buffer Performance test...
    Average:   43020 usecs
    Bandwidth: 174.338 MByte/Sec
    Max. FPS:  23.245 fps

Will draw 3 rectangles on the screen,
they should be colored red, green and blue (in that order).
Done.

【问题讨论】:

    标签: qtembedded


    【解决方案1】:

    迟到总比没有好。我在使用 Qt5.5.1 和 linuxfb 插件的 SAM5 处理器上遇到了这个确切的问题。重新配置或重新编译 Qt5 框架并不能解决问题。

    显然LinuxFB插件不支持BGR格式。有一个open bug 跟踪此问题。检查../src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp 中的determineFormat 函数,您会发现无论提供何种帧缓冲区信息,ImageFormat 都被硬编码为**RGB。

    要解决此问题,应用错误所附的patch 可能会帮助您解决此问题。

    我说“可能”是因为我的帧缓冲区驱动程序错误地报告它是 RBG 格式。所以要注意这一点。如果是这种情况,只需硬编码swapRgb 标志,直到修复帧缓冲驱动程序。

    【讨论】:

      【解决方案2】:

      更新:尝试在./configure 中设置-depths generic 并使用-display linuxfb:genericcolors 运行。这是根据this thread 讨论的问题。

      旧答案:听起来你的显示器的字节序被交换了。

      根据documentation,您可以尝试将littleendian 选项传递给显示字符串。另一种选择是查阅 linux fb 文档关于执行字节序交换。

      【讨论】:

      • 嗨 Yann,我们已经尝试在 framebuffer 参数上使用 littleendian 选项,但没有结果。
      • @AndréAndrade:该死 :(。您是否验证过此问题是 Qt 应用程序所独有的,而不仅仅是 LCD 接线错误的结果?如果您使用,控制台是否具有相同的颜色反转?显示非白色文本?
      • 当我使用提供的显示 Qt 库时,它运行良好,但是当我使用自己的 Qt 编译时,我遇到了问题。显示器的颜色还可以,问题出在我的应用程序 + 我的 Qt 编译上。
      • @AndréAndrade:试试我更新的建议。我没有带交换 LCD 的电路板,所以我可以轻松测试 :)
      • 我们今天早上已经尝试过您的更新建议,但没有成功。我在我的问题更新中发布了一些帧缓冲区调试。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-19
      • 2013-02-05
      • 2014-08-26
      • 1970-01-01
      • 1970-01-01
      • 2011-10-28
      • 1970-01-01
      相关资源
      最近更新 更多