Fix 640x480x60 mode, drop inb/outb on non-x86 machines

This commit is contained in:
Keith Packard 2000-05-24 23:57:56 +00:00
parent a6d519e527
commit 325fb002e8
5 changed files with 18 additions and 10 deletions

View File

@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/kcmap.c,v 1.2 2000/02/23 20:29:52 dawes Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/kcmap.c,v 1.3 2000/05/06 22:17:39 keithp Exp $ */
#include "kdrive.h" #include "kdrive.h"
@ -55,12 +55,12 @@ KdSetColormap (ScreenPtr pScreen, int fb)
* true/direct as well as pseudo/static visuals * true/direct as well as pseudo/static visuals
*/ */
for (i = 0; i < (1 << pScreenPriv->screen->fb[i].depth); i++) for (i = 0; i < (1 << pScreenPriv->screen->fb[fb].depth); i++)
pixels[i] = i; pixels[i] = i;
QueryColors (pCmap, (1 << pScreenPriv->screen->fb[i].depth), pixels, colors); QueryColors (pCmap, (1 << pScreenPriv->screen->fb[fb].depth), pixels, colors);
for (i = 0; i < (1 << pScreenPriv->screen->fb[i].depth); i++) for (i = 0; i < (1 << pScreenPriv->screen->fb[fb].depth); i++)
{ {
defs[i].pixel = i; defs[i].pixel = i;
defs[i].red = colors[i].red; defs[i].red = colors[i].red;
@ -70,7 +70,7 @@ KdSetColormap (ScreenPtr pScreen, int fb)
} }
(*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, fb, (*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, fb,
(1 << pScreenPriv->screen->fb[i].depth), (1 << pScreenPriv->screen->fb[fb].depth),
defs); defs);
/* recolor hardware cursor */ /* recolor hardware cursor */

View File

@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.3 2000/02/23 20:29:53 dawes Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.4 2000/05/06 22:17:39 keithp Exp $ */
#include "kdrive.h" #include "kdrive.h"
#ifdef PSEUDO8 #ifdef PSEUDO8
@ -58,7 +58,7 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
#ifndef FB_OLD_SCREEN #ifndef FB_OLD_SCREEN
WindowPtr pWin = WindowTable[pScreen->myNum]; WindowPtr pWin = WindowTable[pScreen->myNum];
WindowPtr pChild; WindowPtr pChild;
Bool WasViewable = (Bool)(pWin->viewable); Bool WasViewable;
Bool anyMarked; Bool anyMarked;
RegionPtr pOldClip, bsExposed; RegionPtr pOldClip, bsExposed;
#ifdef DO_SAVE_UNDERS #ifdef DO_SAVE_UNDERS
@ -67,6 +67,9 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
WindowPtr pLayerWin; WindowPtr pLayerWin;
BoxRec box; BoxRec box;
if (!pWin)
return;
WasViewable = (Bool)(pWin->viewable);
if (WasViewable) if (WasViewable)
{ {
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)

View File

@ -56,8 +56,8 @@ const KdMonitorTiming kdMonitorTimings[] = {
1, 20, 24, KdSyncNegative, /* 72.809 */ 1, 20, 24, KdSyncNegative, /* 72.809 */
}, },
{ 640, 480, 60, 25175, /* VESA */ { 640, 480, 60, 25175, /* VESA */
8, 40, 144, KdSyncNegative, /* 31.469 */ 16, 48, 160, KdSyncNegative, /* 31.469 */
2, 25, 29, KdSyncNegative, /* 59.940 */ 10, 33, 45, KdSyncNegative, /* 59.940 */
}, },
/* 800x600 modes */ /* 800x600 modes */

View File

@ -27,12 +27,17 @@
#include <stdio.h> #include <stdio.h>
#ifdef linux #ifdef linux
#ifdef __i386__
#define extern static #define extern static
#include <asm/io.h> #include <asm/io.h>
#undef extern #undef extern
#define _VgaInb(r) inb(r) #define _VgaInb(r) inb(r)
#define _VgaOutb(v,r) outb(v,r) #define _VgaOutb(v,r) outb(v,r)
#else
#define _VgaInb(r) 0
#define _VgaOutb(v,r)
#endif
#define _VgaByteAddr(a) ((VGAVOL8 *) (a)) #define _VgaByteAddr(a) ((VGAVOL8 *) (a))
#define _VgaBytePort(a) (a) #define _VgaBytePort(a) (a)

View File

@ -57,7 +57,7 @@ typedef struct _vgaValue {
typedef enum _vgaAccess { typedef enum _vgaAccess {
VgaAccessMem, VgaAccessIo, VgaAccessIndMem, VgaAccessIndIo, VgaAccessMem, VgaAccessIo, VgaAccessIndMem, VgaAccessIndIo,
VgaAccessDone, VgaAccessDone
} VgaAccess; } VgaAccess;
typedef struct _vgaMap { typedef struct _vgaMap {