Skip to content

Commit

Permalink
Remove threading for s3virge and voodoo
Browse files Browse the repository at this point in the history
  • Loading branch information
clementgallet committed Sep 16, 2024
1 parent 02ef34e commit 780d42e
Show file tree
Hide file tree
Showing 11 changed files with 474 additions and 829 deletions.
7 changes: 2 additions & 5 deletions src/include/86box/vid_voodoo_fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@
#ifndef VIDEO_VOODOO_FIFO_H
#define VIDEO_VOODOO_FIFO_H

void voodoo_wake_fifo_thread(voodoo_t *voodoo);
void voodoo_wake_fifo_thread_now(voodoo_t *voodoo);
void voodoo_wake_timer(void *priv);
void voodoo_queue_command(voodoo_t *voodoo, uint32_t addr_type, uint32_t val);
void voodoo_flush(voodoo_t *voodoo);
void voodoo_wake_fifo_threads(voodoo_set_t *set, voodoo_t *voodoo);
void voodoo_execute_commands(voodoo_set_t *set, voodoo_t *voodoo);
void voodoo_wait_for_swap_complete(voodoo_t *voodoo);
void voodoo_fifo_thread(void *param);
void voodoo_execute_command(voodoo_t *voodoo);

#endif /*VIDEO_VOODOO_FIFO_H*/
22 changes: 0 additions & 22 deletions src/include/86box/vid_voodoo_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ void voodoo_codegen_close(voodoo_t *voodoo);
src_b = CLAMP(src_b); \
} while (0)

void voodoo_render_thread_1(void *param);
void voodoo_render_thread_2(void *param);
void voodoo_render_thread_3(void *param);
void voodoo_render_thread_4(void *param);
void voodoo_queue_triangle(voodoo_t *voodoo, voodoo_params_t *params);

extern int voodoo_recomp;
Expand All @@ -280,29 +276,11 @@ extern int tris;
static __inline void
voodoo_wake_render_thread(voodoo_t *voodoo)
{
thread_set_event(voodoo->wake_render_thread[0]); /*Wake up render thread if moving from idle*/
if (voodoo->render_threads >= 2)
thread_set_event(voodoo->wake_render_thread[1]); /*Wake up render thread if moving from idle*/
if (voodoo->render_threads == 4) {
thread_set_event(voodoo->wake_render_thread[2]); /*Wake up render thread if moving from idle*/
thread_set_event(voodoo->wake_render_thread[3]); /*Wake up render thread if moving from idle*/
}
}

static __inline void
voodoo_wait_for_render_thread_idle(voodoo_t *voodoo)
{
while (!PARAM_EMPTY(0) || (voodoo->render_threads >= 2 && !PARAM_EMPTY(1)) || (voodoo->render_threads == 4 && (!PARAM_EMPTY(2) || !PARAM_EMPTY(3))) || voodoo->render_voodoo_busy[0] || (voodoo->render_threads >= 2 && voodoo->render_voodoo_busy[1]) || (voodoo->render_threads == 4 && (voodoo->render_voodoo_busy[2] || voodoo->render_voodoo_busy[3]))) {
voodoo_wake_render_thread(voodoo);
if (!PARAM_EMPTY(0) || voodoo->render_voodoo_busy[0])
thread_wait_event(voodoo->render_not_full_event[0], 1);
if (voodoo->render_threads >= 2 && (!PARAM_EMPTY(1) || voodoo->render_voodoo_busy[1]))
thread_wait_event(voodoo->render_not_full_event[1], 1);
if (voodoo->render_threads == 4 && (!PARAM_EMPTY(2) || voodoo->render_voodoo_busy[2]))
thread_wait_event(voodoo->render_not_full_event[2], 1);
if (voodoo->render_threads == 4 && (!PARAM_EMPTY(3) || voodoo->render_voodoo_busy[3]))
thread_wait_event(voodoo->render_not_full_event[3], 1);
}
}

#endif /*VIDEO_VOODOO_RENDER_H*/
Loading

0 comments on commit 780d42e

Please sign in to comment.