aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Anderson <scott@anderso.nz>2018-08-09 14:01:06 +1200
committerScott Anderson <scott@anderso.nz>2018-08-09 14:01:06 +1200
commit8a07f0f19ae49b1ccd7c15ef63643b10503f7a65 (patch)
treeda374e082971a17cf91d0224ecea2ad4006b308f
parent88518d18c6214fd0222f4447fb9bf98521e5cd81 (diff)
downloadexternal_drm_info-8a07f0f19ae49b1ccd7c15ef63643b10503f7a65.tar.gz
external_drm_info-8a07f0f19ae49b1ccd7c15ef63643b10503f7a65.tar.bz2
external_drm_info-8a07f0f19ae49b1ccd7c15ef63643b10503f7a65.zip
Add compatibility with old libdrm
Targeting current Debian stable (stretch). Add minimum version to reflect the version Debian has.
-rw-r--r--drm_info.c26
-rw-r--r--meson.build2
2 files changed, 27 insertions, 1 deletions
diff --git a/drm_info.c b/drm_info.c
index c92b8ec..69d9b5b 100644
--- a/drm_info.c
+++ b/drm_info.c
@@ -12,6 +12,32 @@
#include <xf86drm.h>
#include <xf86drmMode.h>
+// Defines for comaptibility with old libdrm
+
+// drm.h
+
+#ifndef DRM_CAP_CRTC_IN_VBLANK_EVENT
+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
+#endif
+
+#ifndef DRM_CAP_SYNCOBJ
+#define DRM_CAP_SYNCOBJ 0x13
+#endif
+
+// drm_fourcc.h
+
+#ifndef DRM_FORMAT_R16
+#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ')
+#endif
+
+#ifndef DRM_FORMAT_RG1616
+#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2')
+#endif
+
+#ifndef DRM_FORMAT_GR1616
+#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2')
+#endif
+
#define L_LINE "│ "
#define L_VAL "├───"
#define L_LAST "└───"
diff --git a/meson.build b/meson.build
index 0385c44..a194052 100644
--- a/meson.build
+++ b/meson.build
@@ -10,5 +10,5 @@ project('drm_info', 'c',
add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c')
executable('drm_info', 'drm_info.c',
- dependencies: dependency('libdrm')
+ dependencies: dependency('libdrm', version: '>= 2.4.74'),
)