diff options
author | Jaroslav Hensl <emulator@emulace.cz> | 2024-09-07 20:32:25 +0100 |
---|---|---|
committer | Jaroslav Hensl <emulator@emulace.cz> | 2024-09-07 20:32:25 +0100 |
commit | ce109028d616c331e7a722115205dfda964bb1c1 (patch) | |
tree | e86ae5418dac71714431082aafa7c870eff6be71 /vxd_svga_cb.c | |
parent | a31f4e91c1908b937e5d4f8421f0257043a89829 (diff) | |
download | vmdisp9x-ce109028d616c331e7a722115205dfda964bb1c1.tar.gz |
bottleneck - don't wait in critical sections, resource garbage collector in driver
Diffstat (limited to 'vxd_svga_cb.c')
-rw-r--r-- | vxd_svga_cb.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/vxd_svga_cb.c b/vxd_svga_cb.c index b368ba7..24bc383 100644 --- a/vxd_svga_cb.c +++ b/vxd_svga_cb.c @@ -111,6 +111,13 @@ static uint64 cb_next_id = {0, 0}; #define WAIT_FOR_CB_SYNC_0
#define WAIT_FOR_CB_SYNC_1 SVGA_Sync();
+#define WAIT_FOR_CB_FINAL(_cb) \
+ do{ \
+ while(!CB_queue_check_inline(_cb)){ \
+ SVGA_Sync(); \
+ } \
+ }while(0)
+
/* wait for all commands */
void SVGA_Flush_CB()
{
@@ -158,7 +165,8 @@ void SVGA_CMB_free(DWORD *cmb) {
SVGACBHeader *cb = ((SVGACBHeader *)cmb)-1;
- WAIT_FOR_CB(cb, 1);
+ //WAIT_FOR_CB(cb, 1);
+ WAIT_FOR_CB_FINAL(cb);
_PageFree(cb-1, 0);
}
@@ -469,6 +477,8 @@ void SVGA_CMB_submit(DWORD FBPTR cmb, DWORD cmb_size, SVGA_CMB_status_t FBPTR st SVGACBHeader *cb = ((SVGACBHeader *)cmb)-1;
BOOL proc_by_cb = cb_support && cb_context0 && (flags & SVGA_CB_FORCE_FIFO) == 0;
+ Wait_Semaphore(cb_sem, 0);
+
/* wait and tidy CB queue */
if(proc_by_cb)
{
@@ -678,6 +688,7 @@ void SVGA_CMB_submit(DWORD FBPTR cmb, DWORD cmb_size, SVGA_CMB_status_t FBPTR st status->fifo_fence_last = SVGA_fence_passed();
}
+ Signal_Semaphore(cb_sem);
//dbg_printf(dbg_cmd_off, cmb[0]);
}
|