summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2000-08-29 17:20:15 +0000
committerKeith Packard <keithp@keithp.com>2000-08-29 17:20:15 +0000
commit38059656849a5bab5b56b23359a90aca4ba396c7 (patch)
tree9f76ec3eb279d2324e66a886e0cb594399daf40e /hw
parent77331f967077ca2fefbfb117c7e9bc2bf65b5e31 (diff)
Use VESA driver underneath
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/trident/Imakefile4
-rw-r--r--hw/kdrive/trident/trident.c44
-rw-r--r--hw/kdrive/trident/trident.h9
-rw-r--r--hw/kdrive/trident/tridentcurs.c4
-rw-r--r--hw/kdrive/trident/tridentstub.c8
5 files changed, 61 insertions, 8 deletions
diff --git a/hw/kdrive/trident/Imakefile b/hw/kdrive/trident/Imakefile
index f2456a214..e758276e0 100644
--- a/hw/kdrive/trident/Imakefile
+++ b/hw/kdrive/trident/Imakefile
@@ -6,7 +6,9 @@ SRCS = trident.c tridentdraw.c tridentcurs.c tridentstub.c
OBJS = trident.o tridentdraw.o tridentcurs.o tridentstub.o
-INCLUDES = -I.. -I../fbdev -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
+DEFINES = -DVESA
+
+INCLUDES = -I.. -I../fbdev -I../vesa -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
diff --git a/hw/kdrive/trident/trident.c b/hw/kdrive/trident/trident.c
index 932e4ddb4..0148ebaa2 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.3 2000/01/21 01:12:02 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.c,v 1.6 2000/08/26 00:17:50 keithp Exp $ */
#include "trident.h"
#define extern
@@ -41,7 +41,11 @@ tridentCardInit (KdCardInfo *card)
if (!tridentc)
return FALSE;
+#ifdef VESA
+ if (!vesaInitialize (card, &tridentc->vesa))
+#else
if (!fbdevInitialize (card, &tridentc->fb))
+#endif
{
xfree (tridentc);
return FALSE;
@@ -67,19 +71,26 @@ tridentScreenInit (KdScreenInfo *screen)
if (!tridents)
return FALSE;
memset (tridents, '\0', sizeof (TridentScreenInfo));
+#ifdef VESA
+ if (!vesaScreenInit (screen))
+#else
if (!fbdevScreenInit (screen))
+#endif
{
xfree (tridents);
return FALSE;
}
if (!tridentc->cop)
screen->dumb = TRUE;
+#ifdef VESA
+ tridentc->screen = tridentc->vesa.fb;
+#else
+ tridentc->screen = tridentc->fb.fb;
+#endif
screen_size = screen->fb[0].byteStride * screen->height;
memory = (2048 + 512) * 1024;
if (memory >= screen_size + 2048)
- {
- tridents->cursor_base = tridentc->fb.fb + memory - 2048;
- }
+ tridents->cursor_base = tridentc->screen + memory - 2048;
else
tridents->cursor_base = 0;
screen->driver = tridents;
@@ -124,7 +135,11 @@ tridentPreserve (KdCardInfo *card)
{
TridentCardInfo *tridentc = card->driver;
+#ifdef VESA
+ vesaPreserve(card);
+#else
fbdevPreserve (card);
+#endif
tridentPause ();
tridentc->save.reg_3c4_0e = tridentReadIndex (tridentc, 0x3c4, 0x0e);
tridentc->save.reg_3d4_36 = tridentReadIndex (tridentc, 0x3d4, 0x36);
@@ -206,14 +221,22 @@ tridentEnable (ScreenPtr pScreen)
KdScreenPriv(pScreen);
TridentCardInfo *tridentc = pScreenPriv->card->driver;
+#ifdef VESA
+ vesaEnable (pScreen);
+#else
fbdevEnable (pScreen);
+#endif
tridentSetMMIO (tridentc);
}
void
tridentDisable (ScreenPtr pScreen)
{
+#ifdef VESA
+ vesaDisable (pScreen);
+#else
fbdevDisable (pScreen);
+#endif
}
const CARD8 tridentDPMSModes[4] = {
@@ -242,7 +265,11 @@ tridentRestore (KdCardInfo *card)
TridentCardInfo *tridentc = card->driver;
tridentResetMMIO (tridentc);
+#ifdef VESA
+ vesaRestore (card);
+#else
fbdevRestore (card);
+#endif
}
void
@@ -261,7 +288,11 @@ tridentCardFini (KdCardInfo *card)
if (tridentc->cop_base)
KdUnmapDevice ((void *) tridentc->cop_base, TRIDENT_COP_SIZE);
+#ifdef VESA
+ vesaCardFini (card);
+#else
fbdevCardFini (card);
+#endif
}
KdCardFuncs tridentFuncs = {
@@ -288,6 +319,11 @@ KdCardFuncs tridentFuncs = {
tridentDrawDisable, /* disableAccel */
tridentDrawFini, /* finiAccel */
+#ifdef VESA
+ vesaGetColors, /* getColors */
+ vesaPutColors, /* putColors */
+#else
fbdevGetColors, /* getColors */
fbdevPutColors, /* putColors */
+#endif
};
diff --git a/hw/kdrive/trident/trident.h b/hw/kdrive/trident/trident.h
index 96db29366..c4b0d862b 100644
--- a/hw/kdrive/trident/trident.h
+++ b/hw/kdrive/trident/trident.h
@@ -25,7 +25,11 @@
#ifndef _TRIDENT_H_
#define _TRIDENT_H_
+#ifdef VESA
+#include <vesa.h>
+#else
#include <fbdev.h>
+#endif
/*
* offset from ioport beginning
@@ -146,7 +150,12 @@ typedef struct _tridentSave {
} TridentSave;
typedef struct _tridentCardInfo {
+#ifdef VESA
+ VesaPrivRec vesa;
+#else
FbdevPriv fb;
+#endif
+ CARD8 *screen;
CARD8 *cop_base;
Cop *cop;
CARD32 cop_depth;
diff --git a/hw/kdrive/trident/tridentcurs.c b/hw/kdrive/trident/tridentcurs.c
index 19b45c68b..8daa5fe9f 100644
--- a/hw/kdrive/trident/tridentcurs.c
+++ b/hw/kdrive/trident/tridentcurs.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/tridentcurs.c,v 1.2 1999/12/30 03:03:17 robin Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/tridentcurs.c,v 1.4 2000/05/06 22:17:51 keithp Exp $ */
#include "trident.h"
#include "cursorstr.h"
@@ -221,7 +221,7 @@ tridentLoadCursor (ScreenPtr pScreen, int x, int y)
}
/* Set address for cursor bits */
- offset = tridents->cursor_base - (CARD8 *) tridentc->fb.fb;
+ offset = tridents->cursor_base - (CARD8 *) tridentc->screen;
offset >>= 10;
tridentWriteIndex (tridentc, 0x3d4, 0x44, (CARD8) (offset & 0xff));
tridentWriteIndex (tridentc, 0x3d4, 0x45, (CARD8) (offset >> 8));
diff --git a/hw/kdrive/trident/tridentstub.c b/hw/kdrive/trident/tridentstub.c
index 0a5e4380a..42b905e42 100644
--- a/hw/kdrive/trident/tridentstub.c
+++ b/hw/kdrive/trident/tridentstub.c
@@ -50,5 +50,11 @@ InitInput (int argc, char **argv)
int
ddxProcessArgument (int argc, char **argv, int i)
{
- return KdProcessArgument (argc, argv, i);
+ int ret;
+
+#ifdef VESA
+ if (!(ret = vesaProcessArgument (argc, argv, i)))
+#endif
+ ret = KdProcessArgument(argc, argv, i);
+ return ret;
}