aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2024-03-16 03:00:34 +0100
committerJaroslav Hensl <jara@hensl.cz>2024-03-16 03:00:34 +0100
commit9f21d0176ae56805cde87deecace34013a88e7db (patch)
treedc72ededbb257cde6eb7383b3649e02090cfe682
parenteb7836674bb1335621e1fd64e147385fb0982d55 (diff)
downloadvmdisp9x-9f21d0176ae56805cde87deecace34013a88e7db.tar.gz
moved GMR from SYSTEM to SHARED, tune SVGA_GMR_LIMITv1.2024.0.39
-rw-r--r--vmdisp9x.inf2
-rw-r--r--vxd_main.c5
-rw-r--r--vxd_svga.c18
3 files changed, 15 insertions, 10 deletions
diff --git a/vmdisp9x.inf b/vmdisp9x.inf
index 8e70f74..d2d6925 100644
--- a/vmdisp9x.inf
+++ b/vmdisp9x.inf
@@ -233,7 +233,7 @@ HKLM,Software\Microsoft\Windows\CurrentVersion\OpenGLdrivers,QEMUFX,2,"qmfxgl32.
;mesa:HKLM,Software\Microsoft\Windows\CurrentVersion\OpenGLdrivers,VMWSVGA,2,"vmwsgl32.dll"
;mesa:HKLM,Software\Mesa3D\global,LP_NATIVE_VECTOR_WIDTH,,128
;mesa:HKLM,Software\Mesa3D\global,SVGA_CLEAR_DX_FLAGS,,1
-;mesa:HKLM,Software\Mesa3D\global,SVGA_GMR_LIMIT,,192
+;mesa:HKLM,Software\Mesa3D\global,SVGA_GMR_LIMIT,,128
[DX.addReg]
;mefix:HKLM,System\CurrentControlSet\Control\SessionManager\KnownDLLs,DDRAW,2,"ddrawme.dll"
diff --git a/vxd_main.c b/vxd_main.c
index 5d55847..c9d3b01 100644
--- a/vxd_main.c
+++ b/vxd_main.c
@@ -138,7 +138,7 @@ void Sys_Critical_Init_proc()
// nop
}
-DWORD __stdcall Device_IO_Control_proc(struct DIOCParams *params);
+DWORD __stdcall Device_IO_Control_proc(DWORD vmhandle, struct DIOCParams *params);
/*
* 32-bit DeviceIoControl ends here
@@ -148,6 +148,7 @@ void __declspec(naked) Device_IO_Control_entry()
{
_asm {
push esi /* struct DIOCParams */
+ push ebx /* VMHandle */
call Device_IO_Control_proc
retn
}
@@ -465,7 +466,7 @@ void Device_Dynamic_Init_proc(DWORD VM)
#undef VDDFUNC
/* process user space (PM32, RING-3) call */
-DWORD __stdcall Device_IO_Control_proc(struct DIOCParams *params)
+DWORD __stdcall Device_IO_Control_proc(DWORD vmhandle, struct DIOCParams *params)
{
DWORD *inBuf = (DWORD*)params->lpInBuffer;
DWORD *outBuf = (DWORD*)params->lpOutBuffer;
diff --git a/vxd_svga.c b/vxd_svga.c
index e68ae31..2761e0d 100644
--- a/vxd_svga.c
+++ b/vxd_svga.c
@@ -148,6 +148,9 @@ static char SVGA_conf_pref_fifo[] = "PreferFIFO";
static char SVGA_conf_hw_version[] = "HWVersion";
static char SVGA_vxd_name[] = "vmwsmini.vxd";
+/* VM handle */
+extern DWORD ThisVM;
+
/* prototypes */
DWORD SVGA_GetDevCap(DWORD search_id);
@@ -199,7 +202,7 @@ static void SVGA_OTable_alloc()
if(otable == NULL)
{
- otable = (SVGA_OT_info_entry_t *)_PageAllocate(RoundToPages(sizeof(otable_setup)), PG_SYS, 0, 0, 0x0, 0x100000, NULL, PAGEFIXED);
+ otable = (SVGA_OT_info_entry_t *)_PageAllocate(RoundToPages(sizeof(otable_setup)), PG_VM, ThisVM, 0, 0x0, 0x100000, NULL, PAGEFIXED);
if(otable)
{
memcpy(otable, &(otable_setup[0]), sizeof(otable_setup));
@@ -213,7 +216,7 @@ static void SVGA_OTable_alloc()
SVGA_OT_info_entry_t *entry = &otable[i];
if(entry->size != 0 && (entry->flags & SVGA_OT_FLAG_ALLOCATED) == 0)
{
- entry->lin = (void*)_PageAllocate(RoundToPages(entry->size), PG_SYS, 0, 0, 0x0, 0x100000, &entry->phy, PAGECONTIG | PAGEUSEALIGN | PAGEFIXED);
+ entry->lin = (void*)_PageAllocate(RoundToPages(entry->size), PG_VM, ThisVM, 0, 0x0, 0x100000, &entry->phy, PAGECONTIG | PAGEUSEALIGN | PAGEFIXED);
if(entry->lin)
{
dbg_printf(dbg_mob_allocate, i);
@@ -243,7 +246,7 @@ static void SVGA_DB_alloc()
SVGA3D_MAX_SURFACE_IDS * sizeof(SVGA_DB_surface_t) +
sizeof(SVGA_DB_t);
- svga_db = (SVGA_DB_t*)_PageAllocate(RoundToPages(size), PG_SYS, 0, 0, 0x0, 0x100000, NULL, PAGEFIXED);
+ svga_db = (SVGA_DB_t*)_PageAllocate(RoundToPages(size), PG_VM, ThisVM, 0, 0x0, 0x100000, NULL, PAGEFIXED);
if(svga_db)
{
memset(svga_db, 0, size);
@@ -740,6 +743,7 @@ static DWORD getPPN(DWORD virtualaddr)
return phy/P_SIZE;
}
+
/**
* Allocate guest memory region (GMR) - HW needs know memory physical
* addressed of pages in (virtual) memory block.
@@ -785,7 +789,7 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
dbg_printf(dbg_pages, rinfo->size, nPages, P_SIZE);
/* first try to allocate continuous physical memory space, 1st page is used for GMR descriptor */
- laddr = _PageAllocate(nPages+1, PG_SYS, 0, 0, 0x0, 0x100000, &phy, PAGECONTIG | PAGEUSEALIGN | PAGEFIXED);
+ laddr = _PageAllocate(nPages+1, PG_VM, ThisVM, 0, 0x0, 0x100000, &phy, PAGECONTIG | PAGEUSEALIGN | PAGEFIXED);
if(laddr)
{
@@ -819,7 +823,7 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
DWORD mobphy = 0;
/* allocate user block */
- laddr = _PageAllocate(nPages, PG_SYS, 0, 0, 0x0, 0x100000, NULL, PAGEFIXED);
+ laddr = _PageAllocate(nPages, PG_VM, ThisVM, 0, 0x0, 0x100000, NULL, PAGEFIXED);
if(!laddr)
{
@@ -854,7 +858,7 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
blk_pages = ((blocks+blk_pages+1)/(P_SIZE/sizeof(SVGAGuestMemDescriptor))) + 1;
/* allocate memory for GMR descriptor */
- pgblk = _PageAllocate(blk_pages, PG_SYS, 0, 0, 0x0, 0x100000, NULL, PAGEFIXED);
+ pgblk = _PageAllocate(blk_pages, PG_VM, ThisVM, 0, 0x0, 0x100000, NULL, PAGEFIXED);
if(!pgblk)
{
_PageFree((PVOID)laddr, 0);
@@ -904,7 +908,7 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
{
int i;
/* for simplicity we're always creating table of depth 2, first page is page of PPN pages */
- mob = (DWORD *)_PageAllocate(1 + (nPages + PTONPAGE - 1)/PTONPAGE, PG_SYS, 0, 0, 0x0, 0x100000, &mobphy, PAGECONTIG | PAGEUSEALIGN | PAGEFIXED);
+ mob = (DWORD *)_PageAllocate(1 + (nPages + PTONPAGE - 1)/PTONPAGE, PG_VM, ThisVM, 0, 0x0, 0x100000, &mobphy, PAGECONTIG | PAGEUSEALIGN | PAGEFIXED);
if(!mob)
{