From 7beee68f8d8617557990a5f860d9d1f99c4ba009 Mon Sep 17 00:00:00 2001 From: Anton Kindestam Date: Sat, 2 Jun 2018 12:53:54 +0200 Subject: context_drm_egl: Fix CRTC setup and release code when using atomic The previous code did not save enough information about the old state, and could end up changing what plane the fbcon:s FB got attached to, or in worse case causing a blank screen (observed in some multi-screen setups on Sandy Bridge). In addition refactor the handling of drmModeModeInfo property blobs to not leak, as well as enable reuse of already created blobs. --- video/out/vo_drm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/out/vo_drm.c') diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c index ed41d2aab0..7f5290110f 100644 --- a/video/out/vo_drm.c +++ b/video/out/vo_drm.c @@ -153,8 +153,8 @@ static bool fb_setup_double_buffering(struct vo *vo) p->front_buf = 0; for (unsigned int i = 0; i < 2; i++) { - p->bufs[i].width = p->kms->mode.hdisplay; - p->bufs[i].height = p->kms->mode.vdisplay; + p->bufs[i].width = p->kms->mode.mode.hdisplay; + p->bufs[i].height = p->kms->mode.mode.vdisplay; } for (unsigned int i = 0; i < BUF_COUNT; i++) { @@ -186,7 +186,7 @@ static bool crtc_setup(struct vo *vo) int ret = drmModeSetCrtc(p->kms->fd, p->kms->crtc_id, p->bufs[MOD(p->front_buf - 1, BUF_COUNT)].fb, 0, 0, &p->kms->connector->connector_id, 1, - &p->kms->mode); + &p->kms->mode.mode); p->active = true; return ret == 0; } -- cgit v1.2.3