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 | setSupportsNightColor(true); | ||||
76 | handleOutputs(); | 78 | handleOutputs(); | ||
77 | m_cursor[0] = nullptr; | 79 | m_cursor[0] = nullptr; | ||
78 | m_cursor[1] = nullptr; | 80 | m_cursor[1] = nullptr; | ||
79 | } | 81 | } | ||
80 | 82 | | |||
81 | DrmBackend::~DrmBackend() | 83 | DrmBackend::~DrmBackend() | ||
82 | { | 84 | { | ||
83 | #if HAVE_GBM | 85 | #if HAVE_GBM | ||
▲ Show 20 Lines • Show All 658 Lines • ▼ Show 20 Line(s) | |||||
742 | { | 744 | { | ||
743 | #if HAVE_GBM | 745 | #if HAVE_GBM | ||
744 | return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing}; | 746 | return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing}; | ||
745 | #else | 747 | #else | ||
746 | return QVector<CompositingType>{QPainterCompositing}; | 748 | return QVector<CompositingType>{QPainterCompositing}; | ||
747 | #endif | 749 | #endif | ||
748 | } | 750 | } | ||
749 | 751 | | |||
752 | int DrmBackend::gammaRampSize(int screen) const | ||||
753 | { | ||||
754 | if (m_outputs.size() <= screen) { | ||||
755 | return 0; | ||||
756 | } | ||||
757 | return m_outputs.at(screen)->m_crtc->getGammaRampSize(); | ||||
758 | } | ||||
759 | | ||||
760 | bool DrmBackend::setGammaRamp(int screen, ColorCorrect::GammaRamp &gamma) | ||||
761 | { | ||||
762 | if (m_outputs.size() <= screen) { | ||||
763 | return false; | ||||
764 | } | ||||
765 | return m_outputs.at(screen)->m_crtc->setGammaRamp(gamma); | ||||
766 | } | ||||
767 | | ||||
750 | } | 768 | } |