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