- Use the miniport services to map the frame buffer.

svn path=/trunk/; revision=8767
This commit is contained in:
David Welch 2004-03-16 21:11:44 +00:00
parent 32a05a4377
commit 9eb9832b02
3 changed files with 32 additions and 11 deletions

View file

@ -1,9 +1,9 @@
/*
* entry.c
*
* $Revision: 1.2 $
* $Revision: 1.3 $
* $Author: dwelch $
* $Date: 2004/03/04 23:11:43 $
* $Date: 2004/03/16 21:11:44 $
*
*/
@ -189,9 +189,6 @@ DrvEnableDriver(IN ULONG EngineVersion,
vgaPreCalc();
// FIXME: Use Vidport to map the memory properly
vidmem = (char *)(0xd0000000 + 0xa0000);
VGADDI_InitializeOffScreenMem((640 * 480) >> 3, 65536 - ((640 * 480) >> 3));
DriveEnableData->pdrvfn = FuncList;
@ -367,6 +364,7 @@ DrvDisableSurface(IN DHPDEV PDev)
PDEVSURF pdsurf = ppdev->AssociatedSurf;
CHECKPOINT;
DPRINT( "KMDriver: %x\n", ppdev->KMDriver );
DeinitVGA(ppdev);
// EngFreeMem(pdsurf->BankSelectInfo);
CHECKPOINT;
if (pdsurf->BankInfo != NULL) {

View file

@ -1,4 +1,5 @@
#include "../vgaddi.h"
#include "../vgavideo/vgavideo.h"
static WORD PaletteBuffer[] = {
16, 0, // 16 entries, start with 0
@ -101,9 +102,33 @@ DWORD getAvailableModes(HANDLE Driver,
return modes.NumModes;
}
BOOL DeinitVGA(PPDEV ppdev)
{
VIDEO_MEMORY VideoMemory;
ULONG ReturnedDataLength;
VideoMemory.RequestedVirtualAddress = (PVOID)ppdev->fbScreen;
if (EngDeviceIoControl(ppdev->KMDriver,
IOCTL_VIDEO_UNMAP_VIDEO_MEMORY,
(PVOID)&VideoMemory,
sizeof(VIDEO_MEMORY),
NULL,
0,
&ReturnedDataLength))
{
DbgPrint("Failed to unmap video memory.\n");
DbgBreakPoint();
return(FALSE);
}
return(TRUE);
}
BOOL InitVGA(PPDEV ppdev, BOOL bFirst)
{
ULONG ReturnedDataLength;
VIDEO_MEMORY VideoMemory;
VIDEO_MEMORY_INFORMATION VideoMemoryInfo;
ppdev->sizeSurf.cx = 640;
ppdev->sizeSurf.cy = 480;
@ -142,11 +167,7 @@ BOOL InitVGA(PPDEV ppdev, BOOL bFirst)
return(FALSE);
}
/*
gotta fix this up.. it prevents drawing to vidmem right now
if (bFirst) {
if (bFirst) {
// map video memory into virtual memory
VideoMemory.RequestedVirtualAddress = NULL;
@ -162,7 +183,8 @@ gotta fix this up.. it prevents drawing to vidmem right now
}
ppdev->fbScreen = VideoMemoryInfo.FrameBufferBase;
vidmem = (PUCHAR)ppdev->fbScreen;
}
*/
return TRUE;
}

View file

@ -201,6 +201,7 @@ typedef VOID (*PFN_ScreenToScreenBlt)(PDEVSURF, PRECTL, PPOINTL, INT);
#define DEVSURF_IDENT ('V' + ('S' << 8) + ('R' << 16) + ('F' << 24))
BOOL InitVGA(PPDEV ppdev, BOOL bFirst); // screen.c: initialize VGA mode
BOOL DeinitVGA(PPDEV ppdev); // screen.c: Free resources allocated in InitVGA
#define DRIVER_EXTRA_SIZE 0
#define ALLOC_TAG TAG('D', 'v', 'g', 'a') // Dvga tag