Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. display Transformed:Rot180 changes colors
Forum Updated to NodeBB v4.3 + New Features

display Transformed:Rot180 changes colors

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 935 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Peter Steinberg
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DWOM
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved