thermal: Consolidate launching glmark2 as GPU heater

Currently the glmark2 is used to heat GPU for thermal test, this patch
consolidates launching glmark2 from serial console. The glmark2 heater is
optional now, which means no apparent fail will be reported if there is no
glmark2 or it cannot be launched.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.com>
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh
index 95eda91..13f695d 100755
--- a/thermal/thermal_06.sh
+++ b/thermal/thermal_06.sh
@@ -28,19 +28,15 @@
 source ../include/functions.sh
 source ../include/thermal_functions.sh
 
-CPU_HEAT_BIN=../utils/heat_cpu
-GPU_HEAT_BIN=/usr/bin/glmark2
 TEST_LOOP=100
+CPU_HEAT_BIN=../utils/heat_cpu
 cpu_pid=0
-gpu_pid=0
 
 heater_kill() {
     if [ $cpu_pid != 0 ]; then
 	kill -9 $cpu_pid
     fi
-    if [ $gpu_pid != 0 ]; then
-	kill -9 $gpu_pid
-    fi
+    kill_glmark2
 }
 
 check_trip_point_change() {
@@ -60,14 +56,7 @@
     test -z $cpu_pid && cpu_pid=0
     check "start cpu heat binary" "test $cpu_pid -ne 0"
 
-    if [ -x $GPU_HEAT_BIN ]; then
-        $GPU_HEAT_BIN &
-        gpu_pid=$(ps | grep $GPU_HEAT_BIN| awk '{print $1}')
-        test -z $gpu_pid && gpu_pid=0
-        check "start gpu heat binary" "test $gpu_pid -ne 0"
-    else
-        echo "glmark2 not found." 1>&2
-    fi
+    start_glmark2
 
     local index=0
     for trip in $(ls $dirpath | grep "trip_point_['$MAX_ZONE']_temp"); do