From 093e654725dbd512617dd59a84f39c5aadecb8c0 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Fri, 26 Jul 2024 17:21:01 -0700 Subject: [PATCH] nv2a: Wrap pfifo direct renderer calls --- hw/xbox/nv2a/pfifo.c | 4 ++-- hw/xbox/nv2a/pgraph/pgraph.c | 12 ++++++++++++ hw/xbox/nv2a/pgraph/pgraph.h | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/xbox/nv2a/pfifo.c b/hw/xbox/nv2a/pfifo.c index 295cbbf27b..0e55826ad3 100644 --- a/hw/xbox/nv2a/pfifo.c +++ b/hw/xbox/nv2a/pfifo.c @@ -461,13 +461,13 @@ void *pfifo_thread(void *arg) while (true) { d->pfifo.fifo_kick = false; - d->pgraph.renderer->ops.process_pending(d); + pgraph_process_pending(d); if (!d->pfifo.halt) { pfifo_run_pusher(d); } - d->pgraph.renderer->ops.process_pending_reports(d); + pgraph_process_pending_reports(d); if (!d->pfifo.fifo_kick) { qemu_cond_broadcast(&d->pfifo.fifo_idle_cond); diff --git a/hw/xbox/nv2a/pgraph/pgraph.c b/hw/xbox/nv2a/pgraph/pgraph.c index 0062efa15f..b2e1f220df 100644 --- a/hw/xbox/nv2a/pgraph/pgraph.c +++ b/hw/xbox/nv2a/pgraph/pgraph.c @@ -2872,3 +2872,15 @@ void pgraph_write_zpass_pixel_cnt_report(NV2AState *d, uint32_t parameter, NV2A_DPRINTF("Report result %d @%" HWADDR_PRIx, result, offset); } + +void pgraph_process_pending(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + pg->renderer->ops.process_pending(d); +} + +void pgraph_process_pending_reports(NV2AState *d) +{ + PGRAPHState *pg = &d->pgraph; + pg->renderer->ops.process_pending_reports(d); +} diff --git a/hw/xbox/nv2a/pgraph/pgraph.h b/hw/xbox/nv2a/pgraph/pgraph.h index 799e879c06..cc409c058e 100644 --- a/hw/xbox/nv2a/pgraph/pgraph.h +++ b/hw/xbox/nv2a/pgraph/pgraph.h @@ -250,6 +250,8 @@ void pgraph_init(NV2AState *d); void pgraph_init_thread(NV2AState *d); void pgraph_destroy(PGRAPHState *pg); void pgraph_context_switch(NV2AState *d, unsigned int channel_id); +void pgraph_process_pending(NV2AState *d); +void pgraph_process_pending_reports(NV2AState *d); int pgraph_method(NV2AState *d, unsigned int subchannel, unsigned int method, uint32_t parameter, uint32_t *parameters, size_t num_words_available, size_t max_lookahead_words,