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. DPMS on Raspi Os Bookworm and Qt 6.8.1
QtWS25 Last Chance

DPMS on Raspi Os Bookworm and Qt 6.8.1

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 148 Views
  • 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.
  • M Offline
    M Offline
    matzrm
    wrote on 18 Dec 2024, 09:30 last edited by
    #1

    Hi,

    my goal is control the power status of the attached monitor to enable/disable based on a power scheduling.

    The problem is that when the QtApp is running with EGLFS_KMS as qpa platform it's created as a client master, so program as kmsblank can't connect to drm to control DPMS property.

    So I tried to add the code in my QtApp ...

                       drmModePropertyPtr prop = drmModeGetProperty(drm_fd, connector->props[i]);
                        if (prop && QString::fromLocal8Bit(prop->name) == "DPMS") {
                            int nRet = drmModeConnectorSetProperty(drm_fd, connector->connector_id, prop->prop_id, dpmsMode);
                            qDebug()  << "Set DPMS "  << nRet;
                            drmModeFreeProperty(prop);
                            bRet = true;
                        }else{
                            drmModeFreeProperty(prop);
                        }
    

    But the results is the same, because I can't open my drm card because is there a master.

    So the question is...is there an Qt api or anoyher way to control monitor DPMS?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      matzrm
      wrote on 18 Dec 2024, 14:50 last edited by matzrm
      #2

      I understand that only with Qt we can control DRM properties because it is the master and DRM can accepts only one master. But I don't need to implement any other drm interface, but I have to use qtplatform library, because they are speaking with drm.

      So, investigating inside the code I have found a solution, but it use QPlatformScreen that is a Private Api:

      add to cmake:

      target_include_directories(appeturnix-qt6 PRIVATE
       ${qt_include_path}/QtGui/6.8.1/QtGui
      )
      

      and then you can use QPlatformScreen that is a private library...so...

      QPlatformScreen *pScreen = screen->handle();
      pScreen->setPowerState(QPlatformScreen::PowerStateOff);
      
      1 Reply Last reply
      0
      • M matzrm has marked this topic as solved on 18 Dec 2024, 14:51

      1/2

      18 Dec 2024, 09:30

      • Login

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