DPMS on Raspi Os Bookworm and Qt 6.8.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?
-
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);
-