aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index abcfcf8a..eef1e333 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -140,6 +140,7 @@ bool wlr_drm_resources_init(struct wlr_drm_backend *drm) {
for (size_t i = 0; i < drm->num_crtcs; ++i) {
struct wlr_drm_crtc *crtc = &drm->crtcs[i];
crtc->id = res->crtcs[i];
+ crtc->legacy_crtc = drmModeGetCrtc(drm->fd, crtc->id);
wlr_drm_get_crtc_props(drm->fd, crtc->id, &crtc->props);
}
@@ -166,6 +167,7 @@ void wlr_drm_resources_free(struct wlr_drm_backend *drm) {
for (size_t i = 0; i < drm->num_crtcs; ++i) {
struct wlr_drm_crtc *crtc = &drm->crtcs[i];
drmModeAtomicFree(crtc->atomic);
+ drmModeFreeCrtc(crtc->legacy_crtc);
if (crtc->mode_id) {
drmModeDestroyPropertyBlob(drm->fd, crtc->mode_id);
}
@@ -235,8 +237,8 @@ static void wlr_drm_connector_set_gamma(struct wlr_output *output,
static uint32_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
- drmModeCrtc *crtc = conn->old_crtc;
- return crtc ? crtc->gamma_size : 0;
+ struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
+ return drm->iface->crtc_get_gamma_size(drm, conn->crtc);
}
void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) {