From 42f442d08cb7640a517a2f4098c36c00d03166ea Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Tue, 21 Nov 2023 05:35:42 +0000 Subject: [PATCH] drm: make master Signed-off-by: Caleb Connolly --- src/drm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/drm.c b/src/drm.c index 7129a68..abdcd32 100644 --- a/src/drm.c +++ b/src/drm.c @@ -128,6 +128,8 @@ static int drm_init(int fd) return -errno; } + drmSetMaster(fd); + /* iterate all connectors */ for (i = 0; i < res->count_connectors; ++i) { /* get information for each connector */ @@ -424,9 +426,6 @@ int drm_framebuffer_init(int *handle, const char *card) return ret; } - printf("DRM mode %dx%d @ %dHz\n", drm->bufs[0].width, drm->bufs[0].height, - drm->mode.vrefresh); - /* draw some colors for 5seconds */ // modeset_draw(*handle); @@ -458,6 +457,8 @@ void drm_framebuffer_close(int handle) modeset_destroy_fb(handle, &drm->bufs[1]); modeset_destroy_fb(handle, &drm->bufs[0]); + drmDropMaster(handle); + /* free allocated memory */ free(drm); }