xref: /OK3568_Linux_fs/external/libmali/overlay/S10libmali_rk3288 (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2#
3# Change libmali link for rk3288w ....
4#
5
6case "$1" in
7	start)
8		GPUINFO=/sys/devices/platform/*gpu/gpuinfo
9
10		# filter out non-rk3288 devices
11		grep -q "Mali-T76x.*0x0750" $GPUINFO || exit 0
12
13		LIBMALI=$(find /usr/lib -maxdepth 2 -name libmali.so)
14		cd ${LIBMALI%/*}
15
16		# find the correct libmali for the gpu chip
17		SUBVER=$(grep -o "r[01]p0" $GPUINFO)
18		LIBMALI=$(ls libmali-midgard-t76x-*-$SUBVER-*.so | head -1)
19		[ -z "$LIBMALI" ] && exit 1
20
21		# bind with the new libmali
22		echo "Using $LIBMALI"
23		mount --bind $LIBMALI libmali.so
24		;;
25	stop) ;;
26	*)
27        echo "Usage: $0 {start|stop}"
28        exit 1
29        ;;
30esac
31exit 0
32
33