display Transformed:Rot180 changes colors
-
We're running Qt 4.8.6 on an embedded Linux system, running on a TI am3352 ARM processor.
We're using a 24-bit color LCD.
When we run our application normally ("app -qws") everything appears correctly.
When we run through the transformed driver ("app -qws -display Transformed:Rot180") the red and blue colors are swapped (i.e., what was reddish is now blueish).
Any ideas on how to fix this?
Thanks,
Peter Steinberg -
Hi,
sorry replying kind of late and with vague answer, but anyway:
we had similar issues on a system with Vybrid vf610 processor and Timesys Factory Linux build - Qt 4.8.5. The colours were swapped in the same way for rotated display with 24 bits, so we switched to 16-bit (also for performance reasons, the difference is significant). But recently I have found this patch from Timesys, which seems to be addressing this issue for Vybrid framebuffer (didn't need to try in now, though). Maybe it could point you in the right direction.diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenl inuxfb_qws.cpp index 91f1207..d4453ed 100644 --- a/src/gui/embedded/qscreenlinuxfb_qws.cpp +++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp @@ -306,7 +306,6 @@ bool QLinuxFbScreen::connect(const QString &displaySpec) #endif QScreen::setFrameBufferLittleEndian(true); #endif - QString dev = QLatin1String("/dev/fb0"); foreach(QString d, args) { if (d.startsWith(QLatin1Char('/'))) { @@ -1312,10 +1311,17 @@ void QLinuxFbScreen::setPixelFormat(struct fb_var_screen info info) break; } case 24: { + /* + This is modified for Vybrid framebuffer (rgb and bgr swi tched) const fb_bitfield rgb888[4] = {{16, 8, 0}, {8, 8, 0}, {0, 8, 0}, {0, 0, 0}}; const fb_bitfield bgr888[4] = {{0, 8, 0}, {8, 8, 0}, {16, 8, 0}, {0, 0, 0}}; + */ + const fb_bitfield bgr888[4] = {{16, 8, 0}, {8, 8, 0}, + {0, 8, 0}, {0, 0, 0}}; + const fb_bitfield rgb888[4] = {{0, 8, 0}, {8, 8, 0}, + {16, 8, 0}, {0, 0, 0}}; if (memcmp(rgba, rgb888, 3 * sizeof(fb_bitfield)) == 0) { format = QImage::Format_RGB888; } else if (memcmp(rgba, bgr888, 3 * sizeof(fb_bitfield)) == 0) {
D.W.