summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2018-07-13 17:07:38 +0100
committerRussell King <rmk@armlinux.org.uk>2018-07-13 17:14:11 +0100
commita1441c12c98e01a0e1c3cad634347aa1cc905c30 (patch)
treebd0bdd747f8d3e227921f8179e265591dd46b955
parent1ba4f3f91696f0fec8430faf80dc6eb8bc19ed1d (diff)
src: bump minimum libdrm to 2.4.47 and use drmSetClientCap()
drmSetClientCap() was added in libdrm version 2.4.47, which is a useful wrapper for our universal plane support. Use this instead of open coding this functionality. DRM_CLIENT_CAP_UNIVERSAL_PLANES was introduced in 2.4.56, but we don't want to force that version just for this definition. Provide a compat definition for this. Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r--common/compat-drm.h8
-rw-r--r--configure.ac2
-rw-r--r--src/common_drm_plane.c8
3 files changed, 12 insertions, 6 deletions
diff --git a/common/compat-drm.h b/common/compat-drm.h
new file mode 100644
index 0000000..7247572
--- /dev/null
+++ b/common/compat-drm.h
@@ -0,0 +1,8 @@
+#ifndef COMPAT_DRM_H
+#define COMPAT_DRM_H
+
+#ifndef DRM_CLIENT_CAP_UNIVERSAL_PLANES
+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
+#endif
+
+#endif
diff --git a/configure.ac b/configure.ac
index a62169c..15e73cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,7 +251,7 @@ XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
# Obtain compilter/linker options for the driver dependencies
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.38])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.47])
PKG_CHECK_MODULES(DRMARMADA, [libdrm_armada >= 2.0.0])
save_LDFLAGS="$LDFLAGS"
diff --git a/src/common_drm_plane.c b/src/common_drm_plane.c
index db73c3a..dd44e5d 100644
--- a/src/common_drm_plane.c
+++ b/src/common_drm_plane.c
@@ -16,6 +16,7 @@
#include "xf86.h"
+#include "compat-drm.h"
#include "common_drm.h"
static drmModePropertyPtr plane_hash_property(struct common_drm_info *drm,
@@ -222,12 +223,9 @@ static Bool plane_parse_types(ScrnInfoPtr pScrn,
static Bool plane_universal_planes(ScrnInfoPtr pScrn, Bool enable)
{
struct common_drm_info *drm = GET_DRM_INFO(pScrn);
- struct drm_set_client_cap cap = {
- .capability = DRM_CLIENT_CAP_UNIVERSAL_PLANES,
- .value = enable,
- };
- return drmIoctl(drm->fd, DRM_IOCTL_SET_CLIENT_CAP, &cap) == 0;
+ return drmSetClientCap(drm->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES,
+ enable) == 0;
}
drmModePropertyPtr common_drm_plane_get_property(ScrnInfoPtr pScrn,