aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-04-16 12:59:09 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-04-16 12:59:09 +0200
commitc9929a4e0eab5eb94aebe7f91a91f37239d1bc6c (patch)
treeb6b3b0710d183fd34503a2fd0e6205df0ac1e4e7 /drmtools.c
parent2d62ce153a386d8c67dfd0d965d746a754ef4129 (diff)
downloadfbida-c9929a4e0eab5eb94aebe7f91a91f37239d1bc6c.tar.gz
add device_open()
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drmtools.c b/drmtools.c
index 84dbbeb..8fab4b5 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -14,6 +14,7 @@
#include "gfx.h"
#include "drmtools.h"
+#include "logind.h"
/* ------------------------------------------------------------------ */
@@ -88,7 +89,7 @@ int drm_init_dev(const char *dev, const char *output, const char *mode)
int i, rc;
/* open device */
- drm_fd = open(dev, O_RDWR | O_CLOEXEC);
+ drm_fd = device_open(dev);
if (drm_fd < 0) {
fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno));
return -1;
@@ -247,7 +248,7 @@ static void drm_suspend_display(void)
static void drm_resume_display(void)
{
- drm_fd = open(drm_dev, O_RDWR | O_CLOEXEC);
+ drm_fd = device_open(drm_dev);
drm_init_fb(&fb1, drm_fmt, false);
if (fb2.mem)
drm_init_fb(&fb2, drm_fmt, false);
@@ -333,7 +334,7 @@ void drm_info(const char *device)
} else {
snprintf(dev, sizeof(dev), DRM_DEV_NAME, DRM_DIR_NAME, 0);
}
- drm_fd = open(dev, O_RDWR | O_CLOEXEC);
+ drm_fd = device_open(dev);
if (drm_fd < 0) {
fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno));
return;