Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Equivalent of export QWS_DISPLAY=LinuxFb::littleendian in QT 5.x

Equivalent of export QWS_DISPLAY=LinuxFb::littleendian in QT 5.x

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 3.0k 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.
  • S Offline
    S Offline
    Sidii
    wrote on last edited by
    #1

    Hi All,

    Any idea what is equivalent of :

    @export QWS_DISPLAY=LinuxFb::littleendian@

    in QT 5.x??

    1 Reply Last reply
    0
    • A Offline
      A Offline
      agocs
      wrote on last edited by
      #2

      AFAIK there is no equivalent for the time being.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sidii
        wrote on last edited by
        #3

        Dear agocs, thanks for the reply.
        Any idea how to achieve this? I need QT libraries in little endian. I did cross compilation and got libraries in big endian. It seems QT5.2.1 dont supports -llitle endian flag during configure.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          agocs
          wrote on last edited by
          #4

          Since you are building Qt yourself anyway, you could change the sources a bit to get the behavior of the old littleendian parameter for QWS.

          In qtbase/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp you have QLinuxFbScreen::doRedraw(). You could extend it with some conversion of mScreenImage before passing it to drawImage().

          As for the Qt build, the host and target architecture is detected automatically. There are no configure parameters anymore that can affect this.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sidii
            wrote on last edited by
            #5

            Hi Agocs, thanks for your reply.

            Are you sure we need to modify:

            @QLinuxFbScreen::doRedraw()@

            Actually the color conversion is taking place in the below function. I also figured out that my lcd screen depth = 16

            @static QImage::Format determineFormat(const fb_var_screeninfo &info, int depth)
            {
            const fb_bitfield rgba[4] = { info.red, info.green, info.blue, info.transp };

            QImage::Format format = QImage::Format_Invalid;
            
            switch (depth) {
            

            case 16: {
            const fb_bitfield rgb565[4] = {{11, 5, 0}, {5, 6, 0},{0, 5, 0}, {0, 0, 0}};

                const fb_bitfield bgr565[4] = {{0, 5, 0}, {5, 6, 0},
                                               {11, 5, 0}, {0, 0, 0}};
            

            const fb_bitfield brg565[4] = {{0, 5, 0}, {11, 5, 0},
            {5, 6, 0}, {0, 0, 0}};

                if (memcmp(rgba, rgb565, 3 * sizeof(fb_bitfield)) == 0) {
                    format = QImage::Format_RGB16;
              qDebug()<<"Siddharth: Inside First If";
                }
            

            else if (memcmp(rgba, bgr565, 3 * sizeof(fb_bitfield)) == 0) {
            qDebug()<<"Sid: Inside Second If";
            format = QImage::Format_RGB16;
            // pixeltype = BGRPixel;
            }
            break;
            }

            @

            Is there any need to touch the above function??

            Let me know your views on this.

            Thanks

            1 Reply Last reply
            0
            • A Offline
              A Offline
              agocs
              wrote on last edited by
              #6

              Not sure how that could help you. There is nothing you can do with the format, RGB16 is pretty much the only option. The problem is that the actual order of the r, g, b components depends on the endianness. So if your framebuffer really needs bgr then the image data has to be converted. Alternatively, is there a way to swtich the framebuffer to rgb?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sidii
                wrote on last edited by
                #7

                Thanks Agocs for the reply.
                As of now i don't have any documentation/user manual for the lcd panel. But i will sure check them if i get across any details.

                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