aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <emulator@emulace.cz>2024-07-25 12:52:08 +0200
committerJaroslav Hensl <emulator@emulace.cz>2024-07-25 12:52:08 +0200
commitbbcb8a42582dd2062d1fca5fa6eff3b49485f11f (patch)
tree06c9b1456a14be950d99be356223ba0729043f62
parent30887e23b200bfac41ee5cfe2d6c919edd1bddfd (diff)
downloadvmdisp9x-bbcb8a42582dd2062d1fca5fa6eff3b49485f11f.tar.gz
vmware compatibility
-rw-r--r--makefile2
-rw-r--r--vxd_svga_cb.c47
-rw-r--r--vxd_svga_st.c6
3 files changed, 45 insertions, 10 deletions
diff --git a/makefile b/makefile
index deb8731..3c7d9c2 100644
--- a/makefile
+++ b/makefile
@@ -12,7 +12,7 @@ OBJS += &
INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
-VER_BUILD = 65
+VER_BUILD = 66
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD)
diff --git a/vxd_svga_cb.c b/vxd_svga_cb.c
index fdf844b..3b6e124 100644
--- a/vxd_svga_cb.c
+++ b/vxd_svga_cb.c
@@ -79,6 +79,7 @@ extern DWORD present_fence;
extern BOOL ST_FB_invalid;
BOOL CB_queue_check(SVGACBHeader *tracked);
+inline BOOL CB_queue_check_inline(SVGACBHeader *tracked);
/*
* Locals
@@ -93,7 +94,7 @@ static uint64 cb_next_id = {0, 0};
#define WAIT_FOR_CB(_cb, _forcesync) \
do{ \
/*dbg_printf(dbg_wait_cb, __LINE__);*/ \
- while(!CB_queue_check(_cb)){ \
+ while(!CB_queue_check_inline(_cb)){ \
WAIT_FOR_CB_SYNC_ ## _forcesync \
} \
}while(0)
@@ -194,11 +195,12 @@ static void SVGA_cb_id_inc()
* @return: TRUE if tracked is complete or TRUE id queue is empty
*/
-BOOL CB_queue_check(SVGACBHeader *tracked)
+inline BOOL CB_queue_check_inline(SVGACBHeader *tracked)
{
cb_queue_t *last = NULL;
cb_queue_t *item = cb_queue_info.first;
BOOL in_queue = FALSE;
+ BOOL need_restart = FALSE;
while(item != NULL)
{
@@ -216,7 +218,7 @@ BOOL CB_queue_check(SVGACBHeader *tracked)
if(cb->status > SVGA_CB_STATUS_COMPLETED)
{
- SVGA_CB_restart();
+ need_restart = TRUE;
}
item = item->next;
@@ -234,6 +236,12 @@ BOOL CB_queue_check(SVGACBHeader *tracked)
cb_queue_info.last = last;
+ if(need_restart)
+ {
+ SVGA_CB_restart();
+ return TRUE; /* queue is always empty on restart */
+ }
+
if(cb_queue_info.first == NULL)
{
return TRUE;
@@ -247,6 +255,11 @@ BOOL CB_queue_check(SVGACBHeader *tracked)
return FALSE;
}
+BOOL CB_queue_check(SVGACBHeader *tracked)
+{
+ return CB_queue_check_inline(tracked);
+}
+
void CB_queue_insert(SVGACBHeader *cb)
{
cb_queue_t *item = (cb_queue_t*)(cb-1);
@@ -264,13 +277,29 @@ void CB_queue_insert(SVGACBHeader *cb)
}
}
+void CB_queue_erase()
+{
+ cb_queue_t *item = cb_queue_info.first;
+ while(item != NULL)
+ {
+ SVGACBHeader *cb = (SVGACBHeader*)(item+1);
+
+ cb->status = SVGA_CB_STATUS_QUEUE_FULL;
+
+ item = item->next;
+ }
+
+ cb_queue_info.first = NULL;
+ cb_queue_info.last = NULL;
+}
+
-void SVGA_CMB_submit_critical(DWORD FBPTR cmb, DWORD cmb_size, SVGA_CMB_status_t FBPTR status, DWORD flags, DWORD DXCtxId)
+static void SVGA_CMB_submit_critical(DWORD FBPTR cmb, DWORD cmb_size, SVGA_CMB_status_t FBPTR status, DWORD flags, DWORD DXCtxId)
{
DWORD fence = 0;
SVGACBHeader *cb = ((SVGACBHeader *)cmb)-1;
- CB_queue_check(NULL);
+ CB_queue_check_inline(NULL);
if(status)
{
@@ -587,6 +616,11 @@ void SVGA_CB_stop()
cbe->cbstart.context = SVGA_CB_CONTEXT_0;
status = SVGA_CB_ctr(sizeof(cb_enable_t));
+
+ SVGA_Sync();
+
+ CB_queue_erase();
+
dbg_printf(dbg_cb_stop_status, status);
}
}
@@ -597,6 +631,7 @@ void SVGA_CB_stop()
**/
void SVGA_CB_restart()
{
- cb_context0 = FALSE;
+ SVGA_CB_stop();
+
SVGA_CB_start();
}
diff --git a/vxd_svga_st.c b/vxd_svga_st.c
index 5f2e85a..1109d9b 100644
--- a/vxd_svga_st.c
+++ b/vxd_svga_st.c
@@ -78,7 +78,7 @@ void st_defineScreen(DWORD w, DWORD h, DWORD bpp)
SVGAFifoCmdDefineScreen *screen;
SVGAFifoCmdDefineGMRFB *fbgmr;
SVGA3dCmdDefineGBScreenTarget *stid;
- SVGA3dCmdDefineGBSurface_v4 *gbsurf;
+ SVGA3dCmdDefineGBSurface_v3 *gbsurf;
SVGA3dCmdBindGBSurface *gbbind;
SVGA3dCmdBindGBScreenTarget *stbind;
SVGA_DB_surface_t *sinfo;
@@ -128,7 +128,7 @@ void st_defineScreen(DWORD w, DWORD h, DWORD bpp)
cmdoff = 0;
/* create gb texture */
- gbsurf = SVGA_cmd3d_ptr(cmdbuf, &cmdoff, SVGA_3D_CMD_DEFINE_GB_SURFACE_V4, sizeof(SVGA3dCmdDefineGBSurface_v4));
+ gbsurf = SVGA_cmd3d_ptr(cmdbuf, &cmdoff, SVGA_3D_CMD_DEFINE_GB_SURFACE_V3, sizeof(SVGA3dCmdDefineGBSurface_v3));
gbsurf->sid = ST_SURFACE_ID;
gbsurf->surfaceFlags.low = SVGA3D_SURFACE_SCREENTARGET | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_BIND_RENDER_TARGET;
gbsurf->surfaceFlags.hi = 0;
@@ -144,7 +144,7 @@ void st_defineScreen(DWORD w, DWORD h, DWORD bpp)
gbsurf->size.height = h;
gbsurf->size.depth = 1;
gbsurf->arraySize = 1;
- gbsurf->bufferByteStride = SVGA_pitch(w, 32);
+ //gbsurf->bufferByteStride = SVGA_pitch(w, 32);
/* bind texture to our GMR/mob */
gbbind = SVGA_cmd3d_ptr(cmdbuf, &cmdoff, SVGA_3D_CMD_BIND_GB_SURFACE, sizeof(SVGA3dCmdBindGBSurface));