From 495eab932257c0925a4ab89071c43249ec1d1698 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 4 Feb 2011 15:00:03 +0200 Subject: [PATCH] gpu_unai: support bgr888->rgb565 conversion for maemo --- Makefile.maemo | 1 + frontend/arm_utils.h | 9 +++++++++ plugins/gpu_unai/Makefile | 3 +++ plugins/gpu_unai/gpu.cpp | 10 ++++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile.maemo b/Makefile.maemo index 8a710cc3..06f21dc7 100644 --- a/Makefile.maemo +++ b/Makefile.maemo @@ -2,6 +2,7 @@ USE_GTK=1 USE_ALSA=1 USE_OSS=0 +export MAEMO=1 LDFLAGS += $(shell pkg-config --libs hildon-1 libpulse) EXTRA_CFLAGS += -march=armv7-a -O3 -mfpu=neon -funsafe-math-optimizations \ -mstructure-size-boundary=32 -falign-functions=32 -falign-loops \ diff --git a/frontend/arm_utils.h b/frontend/arm_utils.h index f7d637e9..a5dcb9b6 100644 --- a/frontend/arm_utils.h +++ b/frontend/arm_utils.h @@ -1,3 +1,12 @@ +#ifdef __cplusplus +extern "C" +{ +#endif + void bgr555_to_rgb565(void *dst, void *src, int bytes); void bgr888_to_rgb888(void *dst, void *src, int bytes); void bgr888_to_rgb565(void *dst, void *src, int bytes); + +#ifdef __cplusplus +} +#endif diff --git a/plugins/gpu_unai/Makefile b/plugins/gpu_unai/Makefile index a89ca6bf..e7640c6a 100644 --- a/plugins/gpu_unai/Makefile +++ b/plugins/gpu_unai/Makefile @@ -4,6 +4,9 @@ CFLAGS += -ggdb -fPIC -Wall -DREARMED ifndef DEBUG CFLAGS += -O2 -ffast-math -fomit-frame-pointer endif +ifdef MAEMO +CFLAGS += -DMAEMO +endif CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp # -fschedule-insns (from -O2+) causes bugs, probably bad asm() statements CFLAGS += -fno-schedule-insns -fno-schedule-insns2 diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp index f6dd167c..5152327a 100644 --- a/plugins/gpu_unai/gpu.cpp +++ b/plugins/gpu_unai/gpu.cpp @@ -864,11 +864,10 @@ void GPU_updateLace(void) #else #include "../../frontend/plugin_lib.h" +#include "../../frontend/arm_utils.h" extern "C" { -extern void bgr555_to_rgb565(void *dst, void *src, int bytes); -extern void bgr888_to_rgb888(void *dst, void *src, int bytes); static const struct rearmed_cbs *cbs; static void *screen_buf; @@ -904,10 +903,17 @@ static void blit(void) if (isRGB24) { +#ifndef MAEMO for (; h1-- > 0; dest += w0 * 3, srcs += 1024) { bgr888_to_rgb888(dest, srcs, w0 * 3); } +#else + for (; h1-- > 0; dest += w0 * 2, srcs += 1024) + { + bgr888_to_rgb565(dest, srcs, w0 * 3); + } +#endif } else { -- 2.39.2