[meta-freescale] [meta-fsl-arm][PATCH V2 3/4] xf86-video-imxfb-vivante: Add autohdmi utility

Neena Busireddy neena.busireddy at freescale.com
Fri Jan 23 20:44:03 PST 2015


This utility is used to monitor hdmi display hot plug and reconfigure
xserver (through exa driver) if it detects the display change.

Signed-off-by: Neena Busireddy <neena.busireddy at freescale.com>
---
 .../xf86-video-imxfb-vivante/rc.autohdmi           |   32 ++++++++++++++++++++
 .../xf86-video-imxfb-vivante_3.10.53-1.1.0.bb      |   26 ++++++++++++++--
 2 files changed, 55 insertions(+), 3 deletions(-)
 create mode 100644 recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi

diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi
new file mode 100644
index 0000000..3a49e22
--- /dev/null
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi
@@ -0,0 +1,32 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          rc.autohdmi
+# Required-Start:    $all
+# Required-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+do_start() {
+	export DISPLAY=:0
+	autohdmi &
+	exit 0
+}
+
+case "$1" in
+    start)
+	do_start
+        ;;
+    restart|reload|force-reload)
+        echo "Error: argument '$1' not supported" >&2
+        exit 3
+        ;;
+    stop)
+        ;;
+    *)
+        echo "Usage: $0 start|stop" >&2
+        exit 3
+        ;;
+esac
diff --git a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.53-1.1.0.bb b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.53-1.1.0.bb
index 0b5e9ff..266ca56 100644
--- a/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.53-1.1.0.bb
+++ b/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.53-1.1.0.bb
@@ -6,17 +6,22 @@ require recipes-graphics/xorg-driver/xorg-driver-video.inc
 
 PE = "3"
 
-inherit autotools-brokensep
+inherit autotools-brokensep update-rc.d pkgconfig
 
 DEPENDS += "virtual/xserver virtual/libx11 virtual/libgal-x11 imx-gpu-viv pixman"
 
 LIC_FILES_CHKSUM = "file://EXA/src/vivante_fbdev/vivante.h;endline=19;md5=95cf961a2ceacdf7cf43caef25766779"
 
-SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-viv-${PV}.tar.gz"
+SRC_URI = "${FSL_MIRROR}/xserver-xorg-video-imx-viv-${PV}.tar.gz \
+            file://rc.autohdmi"
+
 SRC_URI[md5sum] = "3ffa0f66bc0935a50cda9ebd5240ee2d"
 SRC_URI[sha256sum] = "f5836d86944a667f9fd1789911cdb7d8c54f6158a7776d28124942c4a94ddff6"
 
-EXTRA_OEMAKE += "-C EXA/src -f makefile.linux prefix=${D}/usr \
+INITSCRIPT_NAME = "rc.autohdmi"
+INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
+
+EXTRA_OEMAKE += "-C ${S} -d -f Makefile prefix=${D}/usr \
                  sysroot=${STAGING_DIR_TARGET} \
                  BUSID_HAS_NUMBER=1 \
                  BUILD_IN_YOCTO=1 \
@@ -28,6 +33,8 @@ CFLAGS += "-I${STAGING_INCDIR}/xorg \
 
 S = "${WORKDIR}/xserver-xorg-video-imx-viv-${PV}/"
 
+PACKAGES =+ "xserver-xorg-extension-viv-autohdmi"
+
 # FIXME: The Freescale provided Makefile has hardcodec include paths
 #        and this does not work in case prefix is different than /usr,
 #        sed it.
@@ -47,6 +54,10 @@ do_install_append () {
 	install -d ${D}${includedir}
 	cp -axr ${S}/EXA/src/vivante_gal/vivante_priv.h ${D}${includedir}
 	cp -axr ${S}/EXA/src/vivante_gal/vivante_gal.h ${D}${includedir}
+
+	install -d ${D}/${sysconfdir}/init.d
+	install -m 755 ${WORKDIR}/rc.autohdmi ${D}/${sysconfdir}/init.d/rc.autohdmi
+
 	find ${D}${includedir} -type f -exec chmod 660 {} \;
 }
 
@@ -57,5 +68,14 @@ RDEPENDS_${PN} += "libvivante-dri-mx6 \
                    xserver-xorg-extension-dri2 \
                    xserver-xorg-extension-glx"
 
+REALSOLIBS := "${SOLIBS}"
+SOLIBS = "${SOLIBSDEV}"
+
+FILES_${PN} = "${libdir}/*/*/*/vivante_drv${SOLIBS}"
+FILES_${PN}-dev = "${includedir} /usr/src ${libdir}/libfsl_x11_ext${SOLIBSDEV}"
+FILES_${PN}-dbg = "${libdir}/*/*/*/.debug ${libdir}/.debug/libfsl_x11_ext${SOLIBS} ${exec_prefix}/bin/.debug/autohdmi"
+
+FILES_xserver-xorg-extension-viv-autohdmi = " ${libdir}/libfsl_x11_ext${SOLIBS} ${exec_prefix}/bin/autohdmi ${sysconfdir}/init.d/rc.autohdmi"
+
 PACKAGE_ARCH = "${MACHINE_SOCARCH}"
 COMPATIBLE_MACHINE = "(mx6)"
-- 
1.7.9.5



More information about the meta-freescale mailing list