From 0ea56cc075a9217314be69d1056d9a2abcd921c5 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 1 Aug 2015 07:00:22 +0200 Subject: [PATCH] eglfs_kms: Subpixel antialiasing type [ChangeLog][QPA][eglfs][kms] Provide subpixel antialiasing type. Change-Id: I1eed487cea675d988a128f63a9d5c2c0ddeae21f Reviewed-by: Laszlo Agocs --- .../eglfs_kms/qeglfskmsdevice.cpp | 1 + .../eglfs_kms/qeglfskmsscreen.cpp | 18 ++++++++++++++++++ .../eglfs_kms/qeglfskmsscreen.h | 3 +++ 3 files changed, 22 insertions(+) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp index f3df1f8445..7528d9fe2e 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp @@ -284,6 +284,7 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr false, drmModeGetCrtc(m_dri_fd, crtc_id), modes, + connector->subpixel, connectorProperty(connector, QByteArrayLiteral("DPMS")) }; diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp index 227c8f9a62..d2a86c1e25 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp @@ -321,6 +321,24 @@ qreal QEglFSKmsScreen::refreshRate() const return refresh > 0 ? refresh : 60; } +QPlatformScreen::SubpixelAntialiasingType QEglFSKmsScreen::subpixelAntialiasingTypeHint() const +{ + switch (m_output.subpixel) { + default: + case DRM_MODE_SUBPIXEL_UNKNOWN: + case DRM_MODE_SUBPIXEL_NONE: + return Subpixel_None; + case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB: + return Subpixel_RGB; + case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR: + return Subpixel_BGR; + case DRM_MODE_SUBPIXEL_VERTICAL_RGB: + return Subpixel_VRGB; + case DRM_MODE_SUBPIXEL_VERTICAL_BGR: + return Subpixel_VBGR; + } +} + QPlatformScreen::PowerState QEglFSKmsScreen::powerState() const { return m_powerState; diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h index 2ce8700478..7fd6ccaa31 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h @@ -60,6 +60,7 @@ struct QEglFSKmsOutput bool mode_set; drmModeCrtcPtr saved_crtc; QList modes; + int subpixel; drmModePropertyPtr dpms_prop; }; @@ -104,6 +105,8 @@ public: QEglFSKmsOutput &output() { return m_output; } void restoreMode(); + SubpixelAntialiasingType subpixelAntialiasingTypeHint() const Q_DECL_OVERRIDE; + QPlatformScreen::PowerState powerState() const Q_DECL_OVERRIDE; void setPowerState(QPlatformScreen::PowerState state) Q_DECL_OVERRIDE;