From 19e7cf877b6a925517238c59485edf5fe85bf2a1 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 13 Aug 2011 00:47:16 +0300 Subject: [PATCH] gpu_neon: frameskip: skip blits until flipped --- plugins/gpu_neon/gpu.c | 2 +- plugins/gpu_neon/gpu.h | 1 + plugins/gpu_neon/vout_fb.c | 22 ++++++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c index 5bd41512..2db43797 100644 --- a/plugins/gpu_neon/gpu.c +++ b/plugins/gpu_neon/gpu.c @@ -113,7 +113,7 @@ void GPUwriteStatus(uint32_t data) uint32_t cmd = data >> 24; if (cmd < ARRAY_SIZE(gpu.regs)) { - if (cmd != 0 && gpu.regs[cmd] == data) + if (cmd != 0 && cmd != 5 && gpu.regs[cmd] == data) return; gpu.regs[cmd] = data; } diff --git a/plugins/gpu_neon/gpu.h b/plugins/gpu_neon/gpu.h index 033581e8..cc202c53 100644 --- a/plugins/gpu_neon/gpu.h +++ b/plugins/gpu_neon/gpu.h @@ -74,6 +74,7 @@ struct psx_gpu { uint32_t enabled:1; uint32_t active:1; uint32_t frame_ready:1; + uint32_t skipped_blits:5; const int *advice; } frameskip; }; diff --git a/plugins/gpu_neon/vout_fb.c b/plugins/gpu_neon/vout_fb.c index b7cb41b2..1dfa8abe 100644 --- a/plugins/gpu_neon/vout_fb.c +++ b/plugins/gpu_neon/vout_fb.c @@ -81,20 +81,29 @@ static void blit(void) void GPUupdateLace(void) { - if (gpu.frameskip.enabled && !gpu.frameskip.frame_ready) + if (gpu.status.blanking || !gpu.state.fb_dirty) return; - if (!gpu.status.blanking && gpu.state.fb_dirty) { - renderer_flush_queues(); - blit(); - gpu.state.fb_dirty = 0; + if (gpu.frameskip.enabled) { + if (!gpu.frameskip.frame_ready && gpu.frameskip.skipped_blits < 6) { + gpu.frameskip.skipped_blits++; + return; + } + gpu.frameskip.frame_ready = 0; + gpu.frameskip.skipped_blits = 0; } + + renderer_flush_queues(); + blit(); + gpu.state.fb_dirty = 0; } long GPUopen(void) { gpu.frameskip.enabled = cbs->frameskip; gpu.frameskip.advice = &cbs->fskip_advice; + gpu.frameskip.active = 0; + gpu.frameskip.frame_ready = 1; cbs->pl_vout_open(); screen_buf = cbs->pl_vout_flip(); @@ -110,9 +119,6 @@ long GPUclose(void) void GPUrearmedCallbacks(const struct rearmed_cbs *cbs_) { cbs = cbs_; - gpu.frameskip.enabled = cbs->frameskip; - gpu.frameskip.advice = &cbs->fskip_advice; - gpu.frameskip.active = gpu.frameskip.frame_ready = 0; } // vim:shiftwidth=2:expandtab -- 2.39.5