Commit c97fb611 authored by Keith Packard's avatar Keith Packard
Browse files

Rework vesa driver for shadowing and multiple screen support. Allow enable

    to fail and avoid crashing
parent 38059656
XCOMM $XFree86$
#include <Server.tmpl>
#if BuildRender
RENDERINCS=-I$(KDRIVE)/../../render -I$(EXTINCSRC)
#endif
KDINCS = -I$(KDRIVE) -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I$(KDRIVE)/../../fb -I$(KDRIVE)/../../mi \
-I$(KDRIVE)/../../miext/shadow \
-I$(KDRIVE)/../../include -I$(KDRIVE)/../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC) $(RENDERINCS)
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: xc/programs/Xserver/hw/nvfb/Imakefile,v 3.8 1996/12/23 06:30:19 dawes Exp $
#include <Server.tmpl>
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = fbdev.c fbinit.c
OBJS = fbdev.o fbinit.o
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = $(KDINCS) -I.
NormalLibraryObjectRule()
NormalLibraryTarget(fbdev,$(OBJS))
......
......@@ -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/fbdev/fbdev.c,v 1.2 1999/12/30 03:03:08 robin Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/fbdev/fbdev.c,v 1.4 2000/05/06 22:17:41 keithp Exp $ */
#include "fbdev.h"
......@@ -136,7 +136,7 @@ fbdevPreserve (KdCardInfo *card)
{
}
void
Bool
fbdevEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
......@@ -148,7 +148,11 @@ fbdevEnable (ScreenPtr pScreen)
/* display it on the LCD */
k = ioctl (priv->fd, FBIOPUT_VSCREENINFO, &priv->var);
if (k < 0)
{
perror ("FBIOPUT_VSCREENINFO");
return FALSE;
}
return TRUE;
}
Bool
......
......@@ -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/fbdev/fbdev.h,v 1.2 1999/12/30 03:03:08 robin Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/fbdev/fbdev.h,v 1.4 2000/05/06 22:17:42 keithp Exp $ */
#ifndef _FBDEV_H_
#define _FBDEV_H_
......@@ -56,7 +56,7 @@ fbdevInitScreen (ScreenPtr pScreen);
void
fbdevPreserve (KdCardInfo *card);
void
Bool
fbdevEnable (ScreenPtr pScreen);
Bool
......
XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/igs/Imakefile,v 1.1 2000/05/06 22:17:42 keithp Exp $
#include <Server.tmpl>
XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/igs/Imakefile,v 1.2 2000/05/24 23:52:47 keithp Exp $
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = igs.c igscmap.c igscurs.c igsdraw.c igsreg.c igsstub.c
OBJS = igs.o igscmap.o igscurs.o igsdraw.o igsreg.o igsstub.o
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = -I. $(KDINCS)
NormalLibraryObjectRule()
NormalLibraryTarget(igs,$(OBJS))
......
/*
* $XFree86: xc/programs/Xserver/hw/kdrive/igs/igs.c,v 1.1 2000/05/06 22:17:43 keithp Exp $
* $XFree86: xc/programs/Xserver/hw/kdrive/igs/igs.c,v 1.2 2000/05/24 23:52:47 keithp Exp $
*
* Copyright 1999 SuSE, Inc.
*
......@@ -331,7 +331,7 @@ igsGetClock (int target, int *Mp, int *Np, int *Pp, int maxM, int maxN, int maxP
*Pp = P;
}
void
Bool
igsEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
......@@ -562,6 +562,7 @@ igsEnable (ScreenPtr pScreen)
VgaFetch (&igsvga->card, reg));
}
#endif
return TRUE;
}
Bool
......
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: xc/programs/Xserver/hw/nvfb/Imakefile,v 3.8 1996/12/23 06:30:19 dawes Exp $
#include <Server.tmpl>
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = itsy.c ts.c kbd.c
OBJS = itsy.o ts.o kbd.o
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = -I. $(KDINCS)
NormalLibraryObjectRule()
NormalLibraryTarget(itsy,$(OBJS))
......
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: $
#include <Server.tmpl>
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = keyboard.c linux.c ps2.c
OBJS = keyboard.o linux.o ps2.o
INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = -I. $(KDINCS)
NormalLibraryObjectRule()
NormalLibraryTarget(linux,$(OBJS))
......
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: xc/programs/Xserver/hw/nvfb/Imakefile,v 3.8 1996/12/23 06:30:19 dawes Exp $
#include <Server.tmpl>
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = s3.c s3clock.c s3cmap.c s3curs.c s3draw.c s3gc.c s3reg.c s3stub.c
OBJS = s3.o s3clock.o s3cmap.o s3curs.o s3draw.o s3gc.o s3reg.o s3stub.o
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = -I. $(KDINCS)
NormalLibraryObjectRule()
NormalLibraryTarget(savage,$(OBJS))
......
......@@ -964,7 +964,7 @@ s3SetGlobalBitmap (ScreenPtr pScreen, int ma)
}
}
void
Bool
s3Enable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
......@@ -1667,6 +1667,7 @@ s3Enable (ScreenPtr pScreen)
}
}
#endif
return TRUE;
}
void
......
......@@ -463,7 +463,7 @@ typedef struct _s3ScreenInfo {
Bool s3CardInit (KdCardInfo *);
Bool s3ScreenInit (KdScreenInfo *);
void s3Enable (ScreenPtr pScreen);
Bool s3Enable (ScreenPtr pScreen);
void s3Disable (ScreenPtr pScreen);
void s3Fini (ScreenPtr pScreen);
......
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: xc/programs/Xserver/hw/nvfb/Imakefile,v 3.8 1996/12/23 06:30:19 dawes Exp $
#include <Server.tmpl>
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = sis.c sisclock.c siscmap.c siscurs.c sisdraw.c sisio.c sisstub.c
OBJS = sis.o sisclock.o siscmap.o siscurs.o sisdraw.o sisio.o sisstub.o
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = -I. $(KDINCS)
NormalLibraryObjectRule()
NormalLibraryTarget(sis530,$(OBJS))
......
......@@ -530,7 +530,7 @@ sisPreserve (KdCardInfo *card)
memcpy (sisc->save.text_save, sisc->frameBuffer, SIS_TEXT_SAVE);
}
void
Bool
sisEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
......@@ -827,6 +827,7 @@ sisEnable (ScreenPtr pScreen)
#endif
_sisSetCrtc (sisc, &crtc);
return TRUE;
}
Bool
......
......@@ -1149,7 +1149,7 @@ typedef struct _sisScreenInfo {
Bool sisCardInit (KdCardInfo *);
Bool sisScreenInit (KdScreenInfo *);
void sisEnable (ScreenPtr pScreen);
Bool sisEnable (ScreenPtr pScreen);
void sisDisable (ScreenPtr pScreen);
void sisFini (ScreenPtr pScreen);
......
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: xc/programs/Xserver/hw/nvfb/Imakefile,v 3.8 1996/12/23 06:30:19 dawes Exp $
#include <Server.tmpl>
XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/trident/Imakefile,v 1.2 2000/08/29 17:20:15 keithp Exp $
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = trident.c tridentdraw.c tridentcurs.c tridentstub.c
......@@ -8,9 +9,7 @@ OBJS = trident.o tridentdraw.o tridentcurs.o tridentstub.o
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)
INCLUDES = -I. $(KDINCS) -I$(KDRIVE)/fbdev -I$(KDRIVE)/vesa
NormalLibraryObjectRule()
NormalLibraryTarget(trident,$(OBJS))
......
......@@ -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.6 2000/08/26 00:17:50 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.c,v 1.7 2000/08/29 17:20:15 keithp Exp $ */
#include "trident.h"
#define extern
......@@ -72,7 +72,7 @@ tridentScreenInit (KdScreenInfo *screen)
return FALSE;
memset (tridents, '\0', sizeof (TridentScreenInfo));
#ifdef VESA
if (!vesaScreenInit (screen))
if (!vesaScreenInitialize (screen, &tridents->vesa))
#else
if (!fbdevScreenInit (screen))
#endif
......@@ -83,14 +83,16 @@ tridentScreenInit (KdScreenInfo *screen)
if (!tridentc->cop)
screen->dumb = TRUE;
#ifdef VESA
tridentc->screen = tridentc->vesa.fb;
if (tridents->vesa.mapping != VESA_LINEAR)
screen->dumb = TRUE;
tridents->screen = tridents->vesa.fb;
#else
tridentc->screen = tridentc->fb.fb;
tridents->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->screen + memory - 2048;
if (tridents->screen && memory >= screen_size + 2048)
tridents->cursor_base = tridents->screen + memory - 2048;
else
tridents->cursor_base = 0;
screen->driver = tridents;
......@@ -100,7 +102,11 @@ tridentScreenInit (KdScreenInfo *screen)
Bool
tridentInitScreen (ScreenPtr pScreen)
{
#ifdef VESA
return vesaInitScreen (pScreen);
#else
return fbdevInitScreen (pScreen);
#endif
}
CARD8
......@@ -215,18 +221,21 @@ tridentResetMMIO (TridentCardInfo *tridentc)
tridentPause ();
}
void
Bool
tridentEnable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
TridentCardInfo *tridentc = pScreenPriv->card->driver;
#ifdef VESA
vesaEnable (pScreen);
if (!vesaEnable (pScreen))
return FALSE;
#else
fbdevEnable (pScreen);
if (!fbdevEnable (pScreen))
return FALSE;
#endif
tridentSetMMIO (tridentc);
return TRUE;
}
void
......
......@@ -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.2 1999/12/30 03:03:16 robin Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/trident.h,v 1.4 2000/08/29 17:20:15 keithp Exp $ */
#ifndef _TRIDENT_H_
#define _TRIDENT_H_
......@@ -151,11 +151,10 @@ typedef struct _tridentSave {
typedef struct _tridentCardInfo {
#ifdef VESA
VesaPrivRec vesa;
VesaCardPrivRec vesa;
#else
FbdevPriv fb;
#endif
CARD8 *screen;
CARD8 *cop_base;
Cop *cop;
CARD32 cop_depth;
......@@ -178,7 +177,11 @@ typedef struct _tridentCursor {
#define TRIDENT_CURSOR_HEIGHT 64
typedef struct _tridentScreenInfo {
#ifdef VESA
VesaScreenPrivRec vesa;
#endif
CARD8 *cursor_base;
CARD8 *screen;
TridentCursor cursor;
} TridentScreenInfo;
......
......@@ -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.4 2000/05/06 22:17:51 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/trident/tridentcurs.c,v 1.5 2000/08/29 17:20:15 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->screen;
offset = tridents->cursor_base - (CARD8 *) tridents->screen;
offset >>= 10;
tridentWriteIndex (tridentc, 0x3d4, 0x44, (CARD8) (offset & 0xff));
tridentWriteIndex (tridentc, 0x3d4, 0x45, (CARD8) (offset >> 8));
......
XCOMM $XConsortium: Imakefile /main/10 1996/12/02 10:20:33 lehors $
XCOMM $XFree86: xc/programs/Xserver/hw/nvfb/Imakefile,v 3.8 1996/12/23 06:30:19 dawes Exp $
#include <Server.tmpl>
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = s3.c s3clock.c s3cmap.c s3curs.c s3draw.c s3gc.c s3stub.c
OBJS = s3.o s3clock.o s3cmap.o s3curs.o s3draw.o s3gc.o s3stub.o
INCLUDES = -I.. -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
-I../../../fb -I../../../mi -I../../../include -I../../../os \
-I$(EXTINCSRC) -I$(XINCLUDESRC)
INCLUDES = -I. $(KDINCS)
DEFINES = -DS3_TRIO
......
......@@ -636,7 +636,7 @@ s3Preserve (KdCardInfo *card)
* Enable the card for rendering. Manipulate the initial settings
* of the card here.
*/
void
Bool
s3Enable (ScreenPtr pScreen)
{
KdScreenPriv(pScreen);
......@@ -904,6 +904,7 @@ s3Enable (ScreenPtr pScreen)
LockS3 (s3c);
_s3SetDepth (s3c->s3, crtc);
UnlockS3 (s3c);
return TRUE;
}
void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment