aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-01-18 10:24:19 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-01-18 12:27:47 +0100
commit1eeeaefecb634ea734059685648c058dd600bcae (patch)
treec03f7dab7aa64179f295ebb83e0d4bdbdb7b5e67 /drmtools.c
parent1e49f9371f39475be7d2a3a9be2994ce5d27870b (diff)
downloadfbida-1eeeaefecb634ea734059685648c058dd600bcae.tar.gz
kbd: experimental libinput support
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drmtools.c b/drmtools.c
index b1eae37..f731a92 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -10,6 +10,7 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <sys/stat.h>
#include "gfx.h"
#include "drmtools.h"
@@ -226,6 +227,7 @@ static void drm_flush_display(bool second)
gfxstate *drm_init(const char *device, const char *output,
const char *mode, bool pageflip)
{
+ struct stat st;
gfxstate *gfx;
char dev[64];
@@ -266,6 +268,9 @@ gfxstate *drm_init(const char *device, const char *output,
gfx->cleanup_display = drm_cleanup_display;
gfx->flush_display = drm_flush_display;
+ fstat(drm_fd, &st);
+ gfx->devnum = st.st_rdev;
+
if (pageflip) {
if (drm_init_fb(&fb2) == 0) {
gfx->mem2 = fb2.mem;