Permalink
Browse files

gdev: added autogen.sh and fixed configure scripts

gdev: fixed gdev_nvidia_nvc0.c not to use PCOPY when using the blob
  • Loading branch information...
1 parent 7039c68 commit cba977ca8072a4958b59cd78ecbf7e583fc5b463 Shinpei Kato committed Mar 31, 2012
Showing with 59 additions and 21 deletions.
  1. +44 −0 common/autogen.sh
  2. +2 −0 common/gdev_nvidia_nvc0.c
  3. +4 −14 driver/configure
  4. +1 −0 driver/gdev/gdev_conf.h
  5. +8 −7 lib/configure
View
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+pscnv_exist=$(lsmod | grep pscnv | wc -l)
+nouveau_exist=$(lsmod | grep nouveau | wc -l)
+nvidia_exist=$(lsmod | grep nvidia | wc -l)
+driver=''
+
+if [ ! $pscnv_exist -eq 0 ] ; then
+ driver='pscnv'
+ DRIVER='PSCNV'
+elif [ ! $nouveau_exist -eq 0 ] ; then
+ driver='nouveau'
+ DRIVER='NOUVEAU'
+elif [ ! $nvidia_exist -eq 0 ] ; then
+ driver='nvi'
+ DRIVER='NVI'
+fi
+
+echo "Detecting device driver... $driver"
+
+# create Driver.mk
+cat > Driver.mk << EOF
+#
+# Copyright (C) Shinpei Kato
+# All Rights Reserved
+#
+# This is automatically generated by autogen.sh script.
+#
+
+DRIVER_NAME=$driver
+EOF
+
+# create gdev_autogen.h
+cat > gdev_autogen.h << EOF
+/*
+ * Copyright (C) Shinpei Kato
+ * All Rights Reserved
+ *
+ * This is automatically generated by autogen.sh script.
+ *
+ */
+
+#define GDEV_DRIVER_$DRIVER
+EOF
@@ -420,8 +420,10 @@ static void nvc0_init(struct gdev_ctx *ctx)
__gdev_out_ring(ctx, 0x90c0); /* COMPUTE */
__gdev_begin_ring_nvc0(ctx, GDEV_SUBCH_NV_M2MF, 0, 1);
__gdev_out_ring(ctx, 0x9039); /* M2MF */
+#ifndef GDEV_DRIVER_NVI /* when using the blob, disable PCOPY. */
__gdev_begin_ring_nvc0(ctx, GDEV_SUBCH_NV_PCOPY0, 0, 1);
__gdev_out_ring(ctx, 0x490b5); /* PCOPY0 */
+#endif
#ifdef GDEV_NVIDIA_USE_PCOPY1
__gdev_begin_ring_nvc0(ctx, GDEV_SUBCH_NV_PCOPY1, 0, 1);
__gdev_out_ring(ctx, 0x590b8 /* 0x590b5 */); /* PCOPY1 */
View
@@ -1,19 +1,5 @@
#!/bin/sh
-pscnv_exist=$(lsmod | grep pscnv | wc -l)
-nouveau_exist=$(lsmod | grep nouveau | wc -l)
-driver=''
-
-if [ ! $pscnv_exist -eq 0 ] ; then
- driver='pscnv'
-elif [ ! $nouveau_exist -eq 0 ] ; then
- driver='nouveau'
-fi
-
-echo "Detecting device driver... $driver"
-touch ./Driver.mk
-echo "DRIVER_NAME=$driver" > ./Driver.mk
-
gdev='gdev'
common='common'
@@ -34,5 +20,9 @@ do
esac
done
+# copy driver-independent files
cp -fr ../$gdev/* ./
cp -fr ../../$common/* ./
+
+# detect which driver to be used
+sh ./autogen.sh
@@ -25,6 +25,7 @@
#ifndef __GDEV_CONF_H__
#define __GDEV_CONF_H__
+#include "gdev_autogen.h"
#include "gdev_nvidia.h"
// #include "gdev_amd.h"
// #include "gdev_intel.h"
View
@@ -3,11 +3,7 @@
topdir='../..'
common='common'
-# kernel-space Gdev or user-space Gdev
target='kernel'
-# pscnv or nouveau
-backend='pscnv'
-# debug on/off
debug=0
# parse the given options.
@@ -29,14 +25,19 @@ do
done
if [ $target = 'kernel' ] ; then
+# all files are driver-independent
cp -f ../kernel/* .
cp -f $topdir/$common/*.h .
elif [ $target = 'user' ] ; then
+# copy driver-independent files
cp -f ../user/gdev/* .
-cp -f ../user/$backend/* .
cp -f $topdir/$common/* .
-touch backend.mk
-echo "BACKEND=$backend" > backend.mk
+# detect which driver to be used
+echo 'hello'
+sh ./autogen.sh
+. ./Driver.mk
+# copy driver-dependent files
+cp -f ../user/$DRIVER_NAME/* .
else
echo "Error: invalid target '$target'"
fi

0 comments on commit cba977c

Please sign in to comment.