aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/gpu_neon/Makefile16
-rw-r--r--plugins/gpu_neon/gpu.c2
-rw-r--r--plugins/gpu_neon/vout_fb.c29
3 files changed, 34 insertions, 13 deletions
diff --git a/plugins/gpu_neon/Makefile b/plugins/gpu_neon/Makefile
index 0778754..f227752 100644
--- a/plugins/gpu_neon/Makefile
+++ b/plugins/gpu_neon/Makefile
@@ -9,8 +9,15 @@ CFLAGS += -fno-strict-aliasing
SRC += gpu.c
ifeq "$(ARCH)" "arm"
+ARM_CORTEXA8 ?= 1
+ifeq "$(ARM_CORTEXA8)" "1"
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
-SRC += vout_fb.c ../../frontend/cspace_neon.s
+SRC += ../../frontend/cspace_neon.s
+else
+CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
+SRC += ../../frontend/cspace.c
+endif
+SRC += vout_fb.c
EXT = so
endif
ifeq "$(ARCH)" "x86_64"
@@ -20,7 +27,12 @@ SRC += vout_sdl.c
EXT = so.x86
endif
-TARGETS = gpu_neon.$(EXT) gpu_peops.$(EXT) gpu_unai.$(EXT)
+HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
+
+TARGETS = gpu_peops.$(EXT) gpu_unai.$(EXT)
+ifeq "$(HAVE_NEON)" "1"
+TARGETS += gpu_neon.$(EXT)
+endif
gpu_neon.$(EXT): SRC += psx_gpu_if.c
gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c
index 3f21fa9..24f731e 100644
--- a/plugins/gpu_neon/gpu.c
+++ b/plugins/gpu_neon/gpu.c
@@ -24,7 +24,7 @@
//#define log_anomaly gpu_log
#define log_anomaly(...)
-struct psx_gpu gpu __attribute__((aligned(64)));
+struct psx_gpu gpu __attribute__((aligned(2048)));
static noinline void do_reset(void)
{
diff --git a/plugins/gpu_neon/vout_fb.c b/plugins/gpu_neon/vout_fb.c
index 864776e..b84a86b 100644
--- a/plugins/gpu_neon/vout_fb.c
+++ b/plugins/gpu_neon/vout_fb.c
@@ -25,10 +25,23 @@ int vout_finish(void)
return 0;
}
-static void blit(void)
+static void check_mode_change(void)
{
static uint32_t old_status;
static int old_h;
+
+ // width|rgb24 change?
+ if ((gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || gpu.screen.h != old_h)
+ {
+ old_status = gpu.status.reg;
+ old_h = gpu.screen.h;
+ screen_buf = cbs->pl_vout_set_mode(gpu.screen.hres,
+ gpu.screen.h, gpu.status.rgb24 ? 24 : 16);
+ }
+}
+
+static void blit(void)
+{
int x = gpu.screen.x & ~1; // alignment needed by blitter
int y = gpu.screen.y;
int w = gpu.screen.w;
@@ -39,14 +52,6 @@ static void blit(void)
uint8_t *dest;
fb_offs = y * 1024 + x;
-
- if ((gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || h != old_h) // width|rgb24 change?
- {
- old_status = gpu.status.reg;
- old_h = h;
- screen_buf = cbs->pl_vout_set_mode(stride, h, gpu.status.rgb24 ? 24 : 16);
- }
-
dest = (uint8_t *)screen_buf;
// only do centering, at least for now
@@ -97,7 +102,11 @@ void GPUupdateLace(void)
}
renderer_flush_queues();
- blit();
+ check_mode_change();
+ if (cbs->pl_vout_raw_flip)
+ cbs->pl_vout_raw_flip(gpu.screen.x, gpu.screen.y);
+ else
+ blit();
gpu.state.fb_dirty = 0;
}