#!/bin/sh -x
KERNEL=drm-intel
KERNEL_VERSION=`uname -r`
export LD_LIBRARY_PATH=/opt/gfx-test/lib
sync

cp -f /home/jbarnes/working/$KERNEL/drivers/gpu/drm/drm.ko /lib/modules/$KERNEL_VERSION/kernel/drivers/gpu/drm
cp -f /home/jbarnes/working/$KERNEL/drivers/gpu/drm/i915/i915.ko /lib/modules/$KERNEL_VERSION/kernel/drivers/gpu/drm/i915/

echo 0 > /sys/class/vtconsole/vtcon1/bind
rmmod i915
rmmod drm_kms_helper
rmmod drm
sync
dmesg -n 8
modprobe drm #debug=4
modprobe i915 modeset=1 $@
sync
echo 1 > /sys/class/vtconsole/vtcon1/bind
#startx -- /opt/gfx-test/bin/Xorg -verbose -retro
