drm: make master

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
This commit is contained in:
Caleb Connolly 2023-11-21 05:35:42 +00:00
parent 458926088e
commit 42f442d08c
No known key found for this signature in database
GPG key ID: 7930459FB9303217

View file

@ -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);
}