aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorVincent Vanlaer <vincent.vanlaer@skynet.be>2018-02-04 21:50:52 +0100
committerVincent Vanlaer <vincent.vanlaer@skynet.be>2018-02-09 17:29:14 +0100
commitf5e5d1983b96f848ed89bdd3b0ea9825efa75063 (patch)
treed1d3fe8f6b24474f5f3811c45f107d5ab47e2d6f /backend/drm
parentab011406add31c518f6f352189b1dc6246a74fdb (diff)
Do not allow gamma control without a crtc
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index eef1e333..70e6a1cf 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -232,13 +232,21 @@ static void wlr_drm_connector_set_gamma(struct wlr_output *output,
uint32_t size, uint16_t *r, uint16_t *g, uint16_t *b) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
- drm->iface->crtc_set_gamma(drm, conn->crtc, r, g, b, size);
+
+ if (conn->crtc) {
+ drm->iface->crtc_set_gamma(drm, conn->crtc, r, g, b, size);
+ }
}
static uint32_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
- return drm->iface->crtc_get_gamma_size(drm, conn->crtc);
+
+ if (conn->crtc) {
+ return drm->iface->crtc_get_gamma_size(drm, conn->crtc);
+ }
+
+ return 0;
}
void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) {