Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_backend.cpp
Show All 25 Lines | |||||
26 | #include "cursor.h" | 26 | #include "cursor.h" | ||
27 | #include "logging.h" | 27 | #include "logging.h" | ||
28 | #include "logind.h" | 28 | #include "logind.h" | ||
29 | #include "main.h" | 29 | #include "main.h" | ||
30 | #include "scene_qpainter_drm_backend.h" | 30 | #include "scene_qpainter_drm_backend.h" | ||
31 | #include "screens_drm.h" | 31 | #include "screens_drm.h" | ||
32 | #include "udev.h" | 32 | #include "udev.h" | ||
33 | #include "wayland_server.h" | 33 | #include "wayland_server.h" | ||
34 | #include <colorcorrection/gammaramp.h> | ||||
34 | #if HAVE_GBM | 35 | #if HAVE_GBM | ||
35 | #include "egl_gbm_backend.h" | 36 | #include "egl_gbm_backend.h" | ||
36 | #include <gbm.h> | 37 | #include <gbm.h> | ||
37 | #endif | 38 | #endif | ||
38 | // KWayland | 39 | // KWayland | ||
39 | #include <KWayland/Server/seat_interface.h> | 40 | #include <KWayland/Server/seat_interface.h> | ||
40 | #include <KWayland/Server/outputconfiguration_interface.h> | 41 | #include <KWayland/Server/outputconfiguration_interface.h> | ||
41 | // KF5 | 42 | // KF5 | ||
Show All 26 Lines | |||||
68 | { | 69 | { | ||
69 | 70 | | |||
70 | DrmBackend::DrmBackend(QObject *parent) | 71 | DrmBackend::DrmBackend(QObject *parent) | ||
71 | : Platform(parent) | 72 | : Platform(parent) | ||
72 | , m_udev(new Udev) | 73 | , m_udev(new Udev) | ||
73 | , m_udevMonitor(m_udev->monitor()) | 74 | , m_udevMonitor(m_udev->monitor()) | ||
74 | , m_dpmsFilter() | 75 | , m_dpmsFilter() | ||
75 | { | 76 | { | ||
77 | setSupportsGammaControl(true); | ||||
76 | handleOutputs(); | 78 | handleOutputs(); | ||
77 | } | 79 | } | ||
78 | 80 | | |||
79 | DrmBackend::~DrmBackend() | 81 | DrmBackend::~DrmBackend() | ||
80 | { | 82 | { | ||
81 | #if HAVE_GBM | 83 | #if HAVE_GBM | ||
82 | if (m_gbmDevice) { | 84 | if (m_gbmDevice) { | ||
83 | gbm_device_destroy(m_gbmDevice); | 85 | gbm_device_destroy(m_gbmDevice); | ||
▲ Show 20 Lines • Show All 670 Lines • ▼ Show 20 Line(s) | |||||
754 | { | 756 | { | ||
755 | #if HAVE_GBM | 757 | #if HAVE_GBM | ||
756 | return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing}; | 758 | return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing}; | ||
757 | #else | 759 | #else | ||
758 | return QVector<CompositingType>{QPainterCompositing}; | 760 | return QVector<CompositingType>{QPainterCompositing}; | ||
759 | #endif | 761 | #endif | ||
760 | } | 762 | } | ||
761 | 763 | | |||
764 | int DrmBackend::gammaRampSize(int screen) const | ||||
765 | { | ||||
766 | if (m_outputs.size() <= screen) { | ||||
767 | return 0; | ||||
768 | } | ||||
769 | return m_outputs.at(screen)->m_crtc->getGammaRampSize(); | ||||
770 | } | ||||
771 | | ||||
772 | bool DrmBackend::setGammaRamp(int screen, ColorCorrect::GammaRamp &gamma) | ||||
773 | { | ||||
774 | if (m_outputs.size() <= screen) { | ||||
775 | return false; | ||||
776 | } | ||||
777 | return m_outputs.at(screen)->m_crtc->setGammaRamp(gamma); | ||||
778 | } | ||||
779 | | ||||
762 | QString DrmBackend::supportInformation() const | 780 | QString DrmBackend::supportInformation() const | ||
763 | { | 781 | { | ||
764 | QString supportInfo; | 782 | QString supportInfo; | ||
765 | QDebug s(&supportInfo); | 783 | QDebug s(&supportInfo); | ||
766 | s.nospace(); | 784 | s.nospace(); | ||
767 | s << "Name: " << "DRM" << endl; | 785 | s << "Name: " << "DRM" << endl; | ||
768 | s << "Active: " << m_active << endl; | 786 | s << "Active: " << m_active << endl; | ||
769 | s << "Atomic Mode Setting: " << m_atomicModeSetting << endl; | 787 | s << "Atomic Mode Setting: " << m_atomicModeSetting << endl; | ||
770 | return supportInfo; | 788 | return supportInfo; | ||
771 | } | 789 | } | ||
772 | 790 | | |||
773 | } | 791 | } |