summaryrefslogtreecommitdiff
path: root/sys/src/cmd/aux/vga/s3hwgc.c
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
commite5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch)
treed8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/aux/vga/s3hwgc.c
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/aux/vga/s3hwgc.c')
-rwxr-xr-xsys/src/cmd/aux/vga/s3hwgc.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/sys/src/cmd/aux/vga/s3hwgc.c b/sys/src/cmd/aux/vga/s3hwgc.c
new file mode 100755
index 000000000..d0ec22920
--- /dev/null
+++ b/sys/src/cmd/aux/vga/s3hwgc.c
@@ -0,0 +1,82 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+
+#include "pci.h"
+#include "vga.h"
+
+static void
+init(Vga* vga, Ctlr* ctlr)
+{
+ ctlr->flag |= Finit;
+
+ if(cflag)
+ return;
+ /*
+ * Use of the on-chip hwgc requires using enhanced mode.
+ */
+ if(vga->ctlr == 0 || (vga->ctlr->flag & Henhanced) == 0 || vga->mode->z < 8){
+ cflag = 1;
+ return;
+ }
+ resyncinit(vga, ctlr, Uenhanced, 0);
+}
+
+static void
+load(Vga* vga, Ctlr* ctlr)
+{
+ ctlr->flag |= Fload;
+
+ if(cflag)
+ return;
+ /*
+ * Use of the on-chip hwgc requires using enhanced mode.
+ */
+ if(vga->ctlr == 0 || (vga->ctlr->flag & Uenhanced) == 0 || vga->mode->z < 8)
+ cflag = 1;
+}
+
+Ctlr bt485hwgc = {
+ "bt485hwgc", /* name */
+ 0, /* snarf */
+ 0, /* options */
+ 0, /* init */
+ 0, /* load */
+ 0, /* dump */
+};
+
+Ctlr rgb524hwgc = {
+ "rgb524hwgc", /* name */
+ 0, /* snarf */
+ 0, /* options */
+ 0, /* init */
+ 0, /* load */
+ 0, /* dump */
+};
+
+Ctlr s3hwgc = {
+ "s3hwgc", /* name */
+ 0, /* snarf */
+ 0, /* options */
+ init, /* init */
+ load, /* load */
+ 0, /* dump */
+};
+
+Ctlr tvp3020hwgc = {
+ "tvp3020hwgc", /* name */
+ 0, /* snarf */
+ 0, /* options */
+ 0, /* init */
+ 0, /* load */
+ 0, /* dump */
+};
+
+Ctlr tvp3026hwgc = {
+ "tvp3026hwgc", /* name */
+ 0, /* snarf */
+ 0, /* options */
+ 0, /* init */
+ 0, /* load */
+ 0, /* dump */
+};