From e929dec505f8d3692248fe0d42c84a37c994ad39 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 18 Aug 2012 02:37:49 +0300 Subject: psx_gpu: switch to 1024 width again. --- plugins/gpulib/gpu.c | 16 ++-------------- plugins/gpulib/gpu.h | 5 +++-- plugins/gpulib/vout_pl.c | 9 +++++---- 3 files changed, 10 insertions(+), 20 deletions(-) (limited to 'plugins/gpulib') diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c index 462e301..e133f07 100644 --- a/plugins/gpulib/gpu.c +++ b/plugins/gpulib/gpu.c @@ -9,7 +9,6 @@ */ #include -#include #include #include "gpu.h" @@ -138,21 +137,8 @@ long GPUinit(void) { int ret; ret = vout_init(); - - gpu.state.enhancement_available = 0; ret |= renderer_init(); - if (gpu.state.enhancement_available) { - if (gpu.enhancement_bufer == NULL) - gpu.enhancement_bufer = malloc(2048 * 1024 * 2 + 1024 * 512 * 2); - if (gpu.enhancement_bufer == NULL) - gpu_log("OOM for enhancement buffer\n"); - } - else if (gpu.enhancement_bufer != NULL) { - free(gpu.enhancement_bufer); - gpu.enhancement_bufer = NULL; - } - gpu.state.frame_count = &gpu.zero; gpu.state.hcnt = &gpu.zero; gpu.frameskip.active = 0; @@ -164,6 +150,7 @@ long GPUinit(void) long GPUshutdown(void) { + renderer_finish(); return vout_finish(); } @@ -221,6 +208,7 @@ void GPUwriteStatus(uint32_t data) gpu.screen.vres = vres[(gpu.status.reg >> 19) & 3]; update_width(); update_height(); + renderer_notify_res_change(); break; default: if ((cmd & 0xf0) == 0x10) diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h index f514395..5ad2a46 100644 --- a/plugins/gpulib/gpu.h +++ b/plugins/gpulib/gpu.h @@ -67,7 +67,6 @@ struct psx_gpu { uint32_t old_interlace:1; uint32_t allow_interlace:2; uint32_t blanked:1; - uint32_t enhancement_available:1; uint32_t enhancement_enable:1; uint32_t enhancement_active:1; uint32_t *frame_count; @@ -90,7 +89,7 @@ struct psx_gpu { uint32_t last_flip_frame; uint32_t pending_fill[3]; } frameskip; - void *enhancement_bufer; + uint16_t *enhancement_bufer; }; extern struct psx_gpu gpu; @@ -102,11 +101,13 @@ int do_cmd_list(uint32_t *list, int count, int *last_cmd); struct rearmed_cbs; int renderer_init(void); +void renderer_finish(void); void renderer_sync_ecmds(uint32_t * ecmds); void renderer_update_caches(int x, int y, int w, int h); void renderer_flush_queues(void); void renderer_set_interlace(int enable, int is_odd); void renderer_set_config(const struct rearmed_cbs *config); +void renderer_notify_res_change(void); int vout_init(void); int vout_finish(void); diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c index 5131034..cbd8034 100644 --- a/plugins/gpulib/vout_pl.c +++ b/plugins/gpulib/vout_pl.c @@ -68,18 +68,19 @@ static void blit(void) uint8_t *dest; dest = (uint8_t *)screen_buf; - if (dest == NULL) + if (dest == NULL || w == 0 || stride == 0) return; if (gpu.state.enhancement_active) { - vram = gpu.enhancement_bufer; + // this layout is gpu_neon specific.. + vram = gpu.enhancement_bufer + + (x + 8) / stride * 1024 * 1024; x *= 2; y *= 2; w *= 2; h *= 2; stride *= 2; - vram_stride = 2048; - vram_mask = 2048 * 1024 - 1; + vram_mask = 1024 * 1024 - 1; } fb_offs = y * vram_stride + x; -- cgit v1.2.3