From cfb1ba178ac5e23e94a1fcc747d6d74e45dbfd62 Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Thu, 17 Nov 2016 15:09:55 -0600
Subject: [PATCH] etnaviv: enable for am57xx for 2d acceleration

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
 configs/bb.org-debian-jessie-lxqt-2gb-v4.4.conf |  1 +
 configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf |  1 +
 tools/hwpack/am57xx-beagle-x15.conf             |  2 +-
 tools/setup_sdcard.sh                           | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/configs/bb.org-debian-jessie-lxqt-2gb-v4.4.conf b/configs/bb.org-debian-jessie-lxqt-2gb-v4.4.conf
index 7e0bedf0d..0e3b7a0b3 100644
--- a/configs/bb.org-debian-jessie-lxqt-2gb-v4.4.conf
+++ b/configs/bb.org-debian-jessie-lxqt-2gb-v4.4.conf
@@ -150,6 +150,7 @@ repo_rcnee_pkg_list="	\
 	rcn-ee-archive-keyring	\
 	rcnee-access-point	\
 	tiomapconf	\
+	xserver-xorg-video-armada-etnaviv	\
 	xserver-xorg-video-omap	\
 "
 
diff --git a/configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf b/configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf
index 6497fae86..55e3f1ff3 100644
--- a/configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf
+++ b/configs/bb.org-debian-jessie-lxqt-4gb-v4.4.conf
@@ -190,6 +190,7 @@ repo_rcnee_pkg_list="	\
 	tiomapconf	\
 	upm	\
 	vpdma-dra7xx-installer	\
+	xserver-xorg-video-armada-etnaviv	\
 	xserver-xorg-video-omap	\
 "
 
diff --git a/tools/hwpack/am57xx-beagle-x15.conf b/tools/hwpack/am57xx-beagle-x15.conf
index 8f6c53845..621f50dac 100644
--- a/tools/hwpack/am57xx-beagle-x15.conf
+++ b/tools/hwpack/am57xx-beagle-x15.conf
@@ -29,5 +29,5 @@ conf_kernel="ti"
 usbnet_mem=
 dtb=
 SERIAL="ttyO2"
-drm="omapdrm"
+drm="etnaviv"
 drm_device_identifier="HDMI-A-1"
diff --git a/tools/setup_sdcard.sh b/tools/setup_sdcard.sh
index daa0814a3..bc5c0a06d 100755
--- a/tools/setup_sdcard.sh
+++ b/tools/setup_sdcard.sh
@@ -1477,6 +1477,21 @@ populate_rootfs () {
 		fi
 	fi
 
+	if [ "x${drm}" = "xetnaviv" ] ; then
+		wfile="/etc/X11/xorg.conf"
+		if [ -f ${TEMPDIR}/disk${wfile} ] ; then
+			if [ -f ${TEMPDIR}/disk/usr/lib/xorg/modules/drivers/armada_drv.so ] then
+				sudo sed -i -e 's:modesetting:armada:g' ${TEMPDIR}/disk${wfile}
+				sudo sed -i -e 's:fbdev:armada:g' ${TEMPDIR}/disk${wfile}
+			else
+				sudo sed -i -e 's:modesetting:omap:g' ${TEMPDIR}/disk${wfile}
+				sudo sed -i -e 's:fbdev:omap:g' ${TEMPDIR}/disk${wfile}
+			fi
+			sudo sed -i -e 's:#HWcursor_false::g' ${TEMPDIR}/disk${wfile}
+			sudo sed -i -e 's:16:24:g' ${TEMPDIR}/disk${wfile}
+		fi
+	fi
+
 	if [ "${usbnet_mem}" ] ; then
 		echo "vm.min_free_kbytes = ${usbnet_mem}" >> ${TEMPDIR}/disk/etc/sysctl.conf
 	fi
-- 
GitLab