diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-04-16 12:59:09 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-04-16 12:59:09 +0200 |
commit | c9929a4e0eab5eb94aebe7f91a91f37239d1bc6c (patch) | |
tree | b6b3b0710d183fd34503a2fd0e6205df0ac1e4e7 /drmtools.c | |
parent | 2d62ce153a386d8c67dfd0d965d746a754ef4129 (diff) | |
download | fbida-c9929a4e0eab5eb94aebe7f91a91f37239d1bc6c.tar.gz |
add device_open()
Diffstat (limited to 'drmtools.c')
-rw-r--r-- | drmtools.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; |