Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_object_crtc.cpp
Show All 17 Lines | |||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "drm_object_crtc.h" | 20 | #include "drm_object_crtc.h" | ||
21 | #include "drm_backend.h" | 21 | #include "drm_backend.h" | ||
22 | #include "drm_output.h" | 22 | #include "drm_output.h" | ||
23 | #include "drm_buffer.h" | 23 | #include "drm_buffer.h" | ||
24 | #include "drm_pointer.h" | 24 | #include "drm_pointer.h" | ||
25 | #include "logging.h" | 25 | #include "logging.h" | ||
26 | #include <colorcorrection/gammaramp.h> | | |||
27 | 26 | | |||
28 | namespace KWin | 27 | namespace KWin | ||
29 | { | 28 | { | ||
30 | 29 | | |||
31 | DrmCrtc::DrmCrtc(uint32_t crtc_id, DrmBackend *backend, int resIndex) | 30 | DrmCrtc::DrmCrtc(uint32_t crtc_id, DrmBackend *backend, int resIndex) | ||
32 | : DrmObject(crtc_id, backend->fd()), | 31 | : DrmObject(crtc_id, backend->fd()), | ||
33 | m_resIndex(resIndex), | 32 | m_resIndex(resIndex), | ||
34 | m_backend(backend) | 33 | m_backend(backend) | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 104 | if (m_output->setModeLegacy(m_blackBuffer)) { | |||
109 | } | 108 | } | ||
110 | m_currentBuffer = nullptr; | 109 | m_currentBuffer = nullptr; | ||
111 | m_nextBuffer = nullptr; | 110 | m_nextBuffer = nullptr; | ||
112 | return true; | 111 | return true; | ||
113 | } | 112 | } | ||
114 | return false; | 113 | return false; | ||
115 | } | 114 | } | ||
116 | 115 | | |||
117 | bool DrmCrtc::setGammaRamp(const ColorCorrect::GammaRamp &gamma) { | 116 | bool DrmCrtc::setGammaRamp(const GammaRamp &gamma) | ||
118 | bool isError = drmModeCrtcSetGamma(m_backend->fd(), m_id, gamma.size, | 117 | { | ||
119 | gamma.red, gamma.green, gamma.blue); | 118 | uint16_t *red = const_cast<uint16_t *>(gamma.red()); | ||
119 | uint16_t *green = const_cast<uint16_t *>(gamma.green()); | ||||
120 | uint16_t *blue = const_cast<uint16_t *>(gamma.blue()); | ||||
121 | | ||||
122 | const bool isError = drmModeCrtcSetGamma(m_backend->fd(), m_id, | ||||
123 | gamma.size(), red, green, blue); | ||||
124 | | ||||
120 | return !isError; | 125 | return !isError; | ||
121 | } | 126 | } | ||
122 | 127 | | |||
123 | } | 128 | } |