[RFC xf86-video-freedreno] add OutputClass conf

Rob Clark robdclark at gmail.com
Tue Jul 8 07:01:52 PDT 2014


This enables the xserver to associate the drm driver name "msm" to the
xf86-video-freedreno driver.

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
Not sure if anyone has a better suggestion for how to do that videodrv
abi check in configure.ac.  The problem is, we don't want to install
the .conf file snippet(s) for older xserver, as it will error out at
startup complaining about unknown section "OutputClass".

If this is the best way, I'll push it and update some of the other
drivers.  (I assume Thierry already has patches for tegra.)

 Makefile.am            |  2 +-
 conf/42-freedreno.conf |  5 +++++
 conf/Makefile.am       | 23 +++++++++++++++++++++++
 configure.ac           | 26 ++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 conf/42-freedreno.conf
 create mode 100644 conf/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index 7052905..cff4dc4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,4 +19,4 @@
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src man
+SUBDIRS = src man conf
diff --git a/conf/42-freedreno.conf b/conf/42-freedreno.conf
new file mode 100644
index 0000000..608873c
--- /dev/null
+++ b/conf/42-freedreno.conf
@@ -0,0 +1,5 @@
+Section "OutputClass"
+	Identifier "Video driver for Qualcomm processors"
+	MatchDriver "msm"
+	Driver "freedreno"
+EndSection
diff --git a/conf/Makefile.am b/conf/Makefile.am
new file mode 100644
index 0000000..6b87c43
--- /dev/null
+++ b/conf/Makefile.am
@@ -0,0 +1,23 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+if HAS_XORG_CONF_DIR
+dist_config_DATA = 42-freedreno.conf
+endif
diff --git a/configure.ac b/configure.ac
index 02f9f42..3dc2d4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,31 @@ AM_CONDITIONAL(LIBUDEV, [ test "x$LIBUDEV" = "xyes" ] )
 AC_SUBST([LIBUDEV_CFLAGS])
 AC_SUBST([LIBUDEV_LIBS])
 
+
+# Define a configure option for an alternate X Server configuration directory
+sysconfigdir=`$PKG_CONFIG --variable=sysconfigdir xorg-server`
+AC_ARG_WITH(xorg-conf-dir,
+            AC_HELP_STRING([--with-xorg-conf-dir=DIR],
+                           [Default xorg.conf.d directory [[default=from $PKG_CONFIG xorg-server]]]),
+            [configdir="$withval"],
+            [configdir="$sysconfigdir"])
+AC_SUBST(configdir)
+
+# compare two version strings:
+verlte() {
+    low=`echo -n "$1
+$2" | sort -V | head -n1`
+    test "$1" = "$low"
+}
+
+# Older xserver is unhappy to encounter the new OutputClass
+# sections, so avoid installing them if built for older
+# server:
+ABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server`
+verlte "18.0" "$ABI_VERSION" || sysconfigdir=""
+
+AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$sysconfigdir" != "x"])
+
 # Checks for header files.
 AC_HEADER_STDC
 
@@ -98,4 +123,5 @@ AC_OUTPUT([
 	Makefile
 	src/Makefile
 	man/Makefile
+	conf/Makefile
 ])
-- 
1.9.3



More information about the xorg-devel mailing list