summaryrefslogtreecommitdiff
path: root/hw/kdrive/trident
diff options
context:
space:
mode:
Diffstat (limited to 'hw/kdrive/trident')
-rw-r--r--hw/kdrive/trident/Imakefile4
-rw-r--r--hw/kdrive/trident/trident.c48
-rw-r--r--hw/kdrive/trident/trident.h5
3 files changed, 44 insertions, 13 deletions
diff --git a/hw/kdrive/trident/Imakefile b/hw/kdrive/trident/Imakefile
index 838cca4d1..1f881a49d 100644
--- a/hw/kdrive/trident/Imakefile
+++ b/hw/kdrive/trident/Imakefile
@@ -1,5 +1,5 @@
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
-XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/trident/Imakefile,v 1.4 2000/09/15 07:25:12 keithp Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/trident/Imakefile,v 1.5 2000/09/19 23:49:55 keithp Exp $
KDRIVE=..
#include "../Kdrive.tmpl"
@@ -7,7 +7,7 @@ SRCS = trident.c tridentdraw.c tridentcurs.c tridentstub.c
OBJS = trident.o tridentdraw.o tridentcurs.o tridentstub.o
-DEFINES = -DVESA
+DEFINES = -DVESA /* -DUSE_PCI*/
INCLUDES = -I. $(KDINCS) -I$(KDRIVE)/fbdev -I$(KDRIVE)/vesa
diff --git a/hw/kdrive/trident/trident.c b/hw/kdrive/trident/trident.c
index df4e6cde9..7c8c9cc69 100644
--- a/hw/kdrive/trident/trident.c
+++ b/hw/kdrive/trident/trident.c
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.c,v 1.12 2000/09/27 20:46:36 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.c,v 1.13 2000/10/11 06:04:40 keithp Exp $ */
#include "trident.h"
#define extern
@@ -33,14 +33,32 @@
Bool
tridentCardInit (KdCardInfo *card)
{
- int k;
- char *pixels;
+ int k;
+ char *pixels;
TridentCardInfo *tridentc;
+ CARD8 r39;
tridentc = (TridentCardInfo *) xalloc (sizeof (TridentCardInfo));
if (!tridentc)
return FALSE;
+ iopl (3);
+ tridentc->cop_base = (CARD8 *) KdMapDevice (TRIDENT_COP_BASE(card),
+ TRIDENT_COP_SIZE(card));
+ tridentc->cop = (Cop *) (tridentc->cop_base + TRIDENT_COP_OFF(card));
+ tridentc->mmio = FALSE;
+ r39 = tridentReadIndex (tridentc, 0x3d4, 0x39);
+ if (r39 & 1)
+ {
+ tridentc->mmio = TRUE;
+ r39 = tridentReadIndex (tridentc, 0x3d4, 0x39);
+ if ((r39 & 1) == 0)
+ {
+ ErrorF ("Trident: inconsisent IO mapping values\n");
+ return FALSE;
+ }
+ }
+
#ifdef VESA
if (!vesaInitialize (card, &tridentc->vesa))
#else
@@ -51,11 +69,6 @@ tridentCardInit (KdCardInfo *card)
return FALSE;
}
- iopl (3);
- tridentc->cop_base = (CARD8 *) KdMapDevice (TRIDENT_COP_BASE(card),
- TRIDENT_COP_SIZE(card));
- tridentc->cop = (Cop *) (tridentc->cop_base + TRIDENT_COP_OFF(card));
- tridentc->mmio = FALSE;
#ifdef USE_PCI
tridentc->window = (CARD32 *) (tridentc->cop_base + 0x10000);
#else
@@ -92,15 +105,32 @@ tridentScreenInit (KdScreenInfo *screen)
if (tridents->vesa.mapping != VESA_LINEAR)
screen->dumb = TRUE;
tridents->screen = tridents->vesa.fb;
+ memory = tridents->vesa.fb_size;
#else
tridents->screen = tridentc->fb.fb;
+ memory = (2048 + 512) * 1024;
#endif
screen_size = screen->fb[0].byteStride * screen->height;
- memory = (2048 + 512) * 1024;
if (tridents->screen && memory >= screen_size + 2048)
+ {
+ memory -= 2048;
tridents->cursor_base = tridents->screen + memory - 2048;
+ }
else
tridents->cursor_base = 0;
+ memory -= screen_size;
+#if 0
+ if (memory > screen->fb[0].byteStride)
+ {
+ screen->off_screen = tridents->screen + screen_size;
+ screen->off_screen_size = memory - screen_size;
+ }
+ else
+ {
+ screen->off_screen = 0;
+ screen->off_screen_size = 0;
+ }
+#endif
screen->driver = tridents;
return TRUE;
}
diff --git a/hw/kdrive/trident/trident.h b/hw/kdrive/trident/trident.h
index 15b64a01f..46ba6c0f6 100644
--- a/hw/kdrive/trident/trident.h
+++ b/hw/kdrive/trident/trident.h
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.h,v 1.6 2000/09/15 07:25:12 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.h,v 1.7 2000/10/11 06:04:40 keithp Exp $ */
#ifndef _TRIDENT_H_
#define _TRIDENT_H_
@@ -34,7 +34,6 @@
/*
* offset from ioport beginning
*/
-#define USE_PCI
#ifdef USE_PCI
#define TRIDENT_COP_BASE(c) (c->attr.address[1])
@@ -219,6 +218,8 @@ typedef struct _tridentScreenInfo {
#endif
CARD8 *cursor_base;
CARD8 *screen;
+ CARD8 *off_screen;
+ int off_screen_size;
TridentCursor cursor;
} TridentScreenInfo;