Eliminate bogus rate check in fbdevModeSupported. Hmm. Potentially bogus

rate selection necessary for Mac fbdev
Don't know about fb changes to pixmaps, so can't track dirt.
Add Mac specific 1280x854 mode. Warn when requested mode isn't found.
Add ability to soft-boot video cards.
Add region expand request. FIXME: need test cases
This commit is contained in:
Keith Packard 2004-07-26 17:14:27 +00:00
parent 20913b7d5d
commit f15f881727
8 changed files with 92 additions and 7 deletions

View File

@ -115,10 +115,6 @@ static Bool
fbdevModeSupported (KdScreenInfo *screen,
const KdMonitorTiming *t)
{
/* XXX: Remove this */
if (t->rate > 75)
return FALSE;
return TRUE;
}
@ -172,7 +168,7 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
screen->width = 1024;
screen->height = 768;
}
screen->rate = 75;
screen->rate = 103; /* FIXME: should get proper value from fb driver */
}
if (!screen->fb[0].depth)
screen->fb[0].depth = 16;

View File

@ -100,8 +100,10 @@ kaaPixmapSave (ScreenPtr pScreen, KdOffscreenArea *area)
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pKaaPixmap->area = NULL;
#if 0
if (!pKaaPixmap->dirty)
return;
#endif
KdCheckSync (pPixmap->drawable.pScreen);

View File

@ -147,6 +147,12 @@ const KdMonitorTiming kdMonitorTimings[] = {
1, 32, 38, KdSyncPositive, /* 65.937 */
},
/* 1280x854 modes */
{ 1280, 854, 103, 12500, /* ADDED */
56, 16, 128, KdSyncPositive, /* 102.554 */
1, 216, 12, KdSyncPositive,
},
/* 1280x960 modes */
{ 1280, 960, 85, 148500, /* VESA */
64, 224, 448, KdSyncPositive, /* 85.938 */
@ -263,6 +269,7 @@ KdFindMode (KdScreenInfo *screen,
return t;
}
}
ErrorF("Warning: mode not found, using default\n");
return &kdMonitorTimings[MONITOR_TIMING_DEFAULT];
}

View File

@ -638,6 +638,20 @@ VbeDPMS(Vm86InfoPtr vi, int mode)
return TRUE;
}
Bool
VbeBoot(Vm86InfoPtr vi)
{
int code;
int bus = 1;
int device = 0;
int function = 0;
vi->vms.regs.eax = (bus << 8) | (device << 3) | (function & 0x7);
code = VbeDoInterruptE6 (vi);
ErrorF ("Boot: %d\n", code);
return TRUE;
}
int
VbeDoInterrupt10(Vm86InfoPtr vi)
{
@ -677,3 +691,17 @@ VbeDoInterrupt10(Vm86InfoPtr vi)
}
return code;
}
int
VbeDoInterruptE6(Vm86InfoPtr vi)
{
int code;
int oldax;
oldax = vi->vms.regs.eax & 0xffff;
code = Vm86DoPOST (vi);
ErrorF("POST (0x%04X): 0x%04X\n",
oldax, vi->vms.regs.eax & 0xffff);
return code;
}

View File

@ -157,4 +157,10 @@ VbeDPMS(Vm86InfoPtr vi, int mode);
int
VbeDoInterrupt10(Vm86InfoPtr vi);
Bool
VbeBoot(Vm86InfoPtr vi);
int
VbeDoInterruptE6(Vm86InfoPtr vi);
#endif

View File

@ -41,6 +41,7 @@ Bool vesa_verbose = FALSE;
Bool vesa_force_text = FALSE;
Bool vesa_restore_font = TRUE;
Bool vesa_map_holes = TRUE;
Bool vesa_boot = FALSE;
#define VesaPriv(scr) ((VesaScreenPrivPtr) (scr)->driver)
@ -216,6 +217,9 @@ vesaInitialize (KdCardInfo *card, VesaCardPrivPtr priv)
if(!priv->vi)
goto fail;
if (vesa_boot)
VbeBoot (priv->vi);
priv->modes = vesaGetModes (priv->vi, &priv->nmode);
if (!priv->modes)
@ -1756,6 +1760,7 @@ vesaUseMsg (void)
ErrorF("-map-holes Use contiguous memory map (For seg fault with rare BIOS)\n");
ErrorF("-verbose Emit diagnostic messages during BIOS initialization\n");
ErrorF("-force-text Always use standard 25x80 text mode on server exit or VT switch\n");
ErrorF("-boot Soft boot video card\n");
/* XXX: usage for -vesatest, -no-map-holes (don't need?),
* XXX: and -trash-font. Also in man page. */
}
@ -1802,6 +1807,9 @@ vesaProcessArgument (int argc, char **argv, int i)
} else if(!strcmp(argv[i], "-trash-font")) {
vesa_restore_font = FALSE;
return 1;
} else if(!strcmp(argv[i], "-boot")) {
vesa_boot = TRUE;
return 1;
}
return 0;

View File

@ -219,7 +219,8 @@ Vm86DoInterrupt(Vm86InfoPtr vi, int num)
off = MMW(vi,num * 4);
if(MAKE_POINTER(seg, off) < ROM_BASE ||
MAKE_POINTER(seg, off) >= ROM_BASE + ROM_SIZE) {
ErrorF("Interrupt pointer doesn't point at ROM\n");
ErrorF("Interrupt pointer (seg %x off %x) doesn't point at ROM\n",
seg, off);
return -1;
}
memcpy(&(LM(vi,vi->ret_code)), retcode_data, sizeof(retcode_data));
@ -244,6 +245,40 @@ Vm86DoInterrupt(Vm86InfoPtr vi, int num)
return 0;
}
int
Vm86DoPOST(Vm86InfoPtr vi)
{
U16 seg, off;
int code;
seg = 0xC000;
off = 3;
if(MAKE_POINTER(seg, off) < ROM_BASE ||
MAKE_POINTER(seg, off) >= ROM_BASE + ROM_SIZE) {
ErrorF("BIOS pointer (seg %x off %x) doesn't point at ROM\n",
seg, off);
return -1;
}
memcpy(&(LM(vi,vi->ret_code)), retcode_data, sizeof(retcode_data));
vi->vms.regs.ss = POINTER_SEGMENT(vi->stack_base);
vi->vms.regs.esp = STACK_SIZE;
PUSHW(vi, POINTER_SEGMENT(vi->ret_code));
PUSHW(vi, POINTER_OFFSET(vi->ret_code));
vi->vms.regs.cs = seg;
vi->vms.regs.eip = off;
OsBlockSignals ();
code = vm86_loop(vi);
OsReleaseSignals ();
if(code < 0) {
ErrorF("vm86 failed (errno %d)\n", errno);
return -1;
} else if(code != 0) {
ErrorF("vm86 returned 0x%04X\n", code);
return -1;
} else
return 0;
}
#define DEBUG_VBE 0
#if DEBUG_VBE
#define DBG(x) ErrorF x; usleep(10*1000)

View File

@ -136,6 +136,9 @@ Vm86Cleanup(Vm86InfoPtr vi);
int
Vm86DoInterrupt(Vm86InfoPtr vi, int num);
int
Vm86DoPOST(Vm86InfoPtr vi);
int
Vm86IsMemory(Vm86InfoPtr vi, U32 i);