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. There is no picture in lcd
Qt 6.11 is out! See what's new in the release blog

There is no picture in lcd

Scheduled Pinned Locked Moved Solved General and Desktop
23 Posts 3 Posters 6.3k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #14

    What OS are you running on your target ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    J 1 Reply Last reply
    0
    • SGaistS SGaist

      What OS are you running on your target ?

      J Offline
      J Offline
      junzhang
      wrote on last edited by
      #15

      @SGaist
      / # uname -a
      uname -a
      Linux mdm9607 3.18.20 #1 PREEMPT Mon Feb 13 10:40:15 CST 2017 armv7l GNU/Linux
      / #

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #16

        The distribution would be more useful.

        Also, are you running your application as root ?

        What exact message are you getting on the console when you launch the application ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        J 2 Replies Last reply
        0
        • SGaistS SGaist

          The distribution would be more useful.

          Also, are you running your application as root ?

          What exact message are you getting on the console when you launch the application ?

          J Offline
          J Offline
          junzhang
          wrote on last edited by junzhang
          #17

          @SGaist
          yes, we run an application with root access.
          we test with Qt/examples/qws/framebuffer, the message is below:

          root@mdm9607:/home# ./framebuffer
          ./framebuffer
          The framebuffer device was opened successfully.

          Fixed screen info:
          id: mdssfb_20000
          smem_start: 0x8fc80000
          smem_len: 155648
          type: 0
          type_aux: 0
          visual: 2
          xpanstep: 1
          ypanstep: 1
          ywrapstep: 0
          line_length: 480
          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: 240
          yres: 320
          xres_virtual: 240
          yres_virtual: 320
          yoffset: 0
          xoffset: 0
          bits_per_pixel: 16
          grayscale: 0
          red: offset: 11, length: 5, msb_right: 0
          green: offset: 5, length: 6, msb_right: 0
          blue: offset: 0, length: 5, msb_right: 0
          transp: offset: 0, length: 0, msb_right: 0
          nonstd: 0
          activate: 16
          height: -1
          width: -1
          accel_flags: 0x0
          pixclock: 0
          left_margin: 0
          right_margin: 0
          upper_margin: 0
          lower_margin: 0
          hsync_len: 0
          vsync_len: 0
          sync: 0
          vmode: 0

          Frame Buffer Performance test...
          Average: 395 usecs
          Bandwidth: 375.791 MByte/Sec
          Max. FPS: 2531.646 fps

          Will draw 3 rectangles on the screen,
          they should be colored red, green and blue (in that order).
          Done.
          root@mdm9607:/home#

          l change the Qt/examples/qws/framebuffer/main.c
          void drawRect_rgb16(int x0, int y0, int width, int height, int color)
          {
          const int bytesPerPixel = 2;
          const int stride = finfo.line_length / bytesPerPixel;
          const int red = (color & 0xff0000) >> (16 + 3);
          const int green = (color & 0xff00) >> (8 + 2);
          const int blue = (color & 0xff) >> 3;
          const short color16 = blue | (green << 5) | (red << (5 + 6));

          short *dest = (short*)(frameBuffer)
          	  + (y0 + vinfo.yoffset) * stride
          	  + (x0 + vinfo.xoffset);
          
          int x, y;
          for (y = 0; y < height; ++y) {
              for (x = 0; x < width; ++x) {
                  dest[x] = color16;
              }
              dest += stride;
          }//add by junzhang
          if(ioctl(fbFd, FBIOPAN_DISPLAY, &vinfo)!= 0)
          {
              return -1;
          }//
          

          }
          there is nothing in lcd unless l add that code when l test with framebuffer example, the message is the same whether l add that code or not.

          1 Reply Last reply
          0
          • SGaistS SGaist

            The distribution would be more useful.

            Also, are you running your application as root ?

            What exact message are you getting on the console when you launch the application ?

            J Offline
            J Offline
            junzhang
            wrote on last edited by
            #18

            @SGaist
            l want to add
            if(ioctl(fbFd, FBIOPAN_DISPLAY, &vinfo)!= 0)
            {
            return -1;
            }/
            to the code which update framebuffer in Qt,
            it's mean that if something update in Qt, it will be write data to framebuffer, so, i will add that code in the function which update framebuffer.
            it's that ok?
            if ok, pls tell which function update framebuffer. thx.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #19

              You likely should check the QLinuxFbScreen class.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply
              0
              • SGaistS SGaist

                You likely should check the QLinuxFbScreen class.

                J Offline
                J Offline
                junzhang
                wrote on last edited by
                #20

                @SGaist
                thx, l found it and it's show ok.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #21

                  Do you mean by adding you ioctl code ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  J 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Do you mean by adding you ioctl code ?

                    J Offline
                    J Offline
                    junzhang
                    wrote on last edited by
                    #22

                    @SGaist
                    yes, l add inctl to refresh data to lcd.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #23

                      Ok

                      Then please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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