Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

Added Makefile rule for spu programs. Added Readme.

  • Loading branch information
martinlowinski committed Aug 10, 2009
1 parent 730f979 commit 0bc06b1c75f078304f71b2feed2452e0f6673938
Showing with 88 additions and 56 deletions.
  1. +3 −0
  2. +35 −0 README.PS3
  3. +1 −0
  4. +49 −56 src/video/ps3/spulibs/Makefile
@@ -40,6 +40,9 @@ SDLMAIN_TARGET = libSDLmain.a

# SPU programs
include $(srcdir)/src/video/ps3/spulibs/Makefile

DIST = acinclude.m4 Borland.html BUGS build-scripts configure COPYING CREDITS docs docs.html include INSTALL Makefile.dc Makefile.minimal README* sdl.m4 SDL.spec src test TODO VisualC.html VisualC VisualCE WhatsNew Xcode

HDRS = SDL.h SDL_audio.h SDL_cdrom.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
@@ -0,0 +1,35 @@

SDL on Sony Playstation3

First, you have to install the Cell SDK
- Download the Cell SDK installer RPM and ISO images to
a temporary directory such as /tmp/cellsdk.
- Mount the image: mount -o loop CellSDK-Devel-Fedora_3. /tmp/cellsdk
- Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm
- Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install

You'll than need to install the SPU-libs
- Run make ps3-libs && make ps3libs-install

Finally, install SDL
- Go to SDL-1.2/ and build SDL like any other GNU style package.
- Build the configure-script with ./
- Configure SDL for your needs: ./configure --enable-video-ps3 ...
- Build and install it: make && make install

- Mouse & Keyboard support
- On SPU-side the current scaler and converter restrictions are:
- resolution has to be a multiple of 8 (will work on that)
- scaler/converter only supports the YV12 and IYUV format
- the scaler works only bilinear (lanzos would be nice)
- Optimize the SPU-program handling on the PPE side
- Integrate spumedia in SDL

Have fun!
Dirk Herrendoerfer <d.herrendoerfer [at] de [dot ibm [dot] com>

@@ -1523,6 +1523,7 @@ CheckPS3()
SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/cell/sdk/usr/lib -lspe2 -lfb_writer_spu -lyuv2rgb_spu -lbilin_scaler_spu"
echo "*** Before building SDL please run make ps3libs"
@@ -3,81 +3,74 @@

# Toolchain

SPU_CFLAGS=-g -W -Wall -Winline -Wno-main -I. -I /usr/spu/include -I /opt/cell/sdk/usr/spu/include -finline-limit=10000 -Winline -ftree-vectorize -funroll-loops -fmodulo-sched -ffast-math -fPIC -O2

# Usually /usr/lib, depending on your distribution

all: libfb_writer_spu.a \ libyuv2rgb_spu.a \ libbilin_scaler_spu.a

ps3libs: $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/ \
$(SPU_LIBDIR)/ $(SPU_LIBDIR)/libyuv2rgb_spu.a \
$(SPU_LIBDIR)/ $(SPU_LIBDIR)/libbilin_scaler_spu.a

# fb_writer
fb_writer_spu-embed.o: fb_writer.c spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o fb_writer_spu fb_writer.c -lm
$(PPU_EMBEDSPU) -m32 fb_writer_spu fb_writer_spu fb_writer_spu-embed.o
$(SHELL) $(auxdir)/mkinstalldirs $(SPU_LIBDIR) fb_writer_spu-embed.o
$(PPU_LD) -o -shared fb_writer_spu-embed.o
# fb_writer (basically copying from a to b)
$(SPU_LIBDIR)/fb_writer_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/fb_writer.c $(SPU_SRCDIR)/spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/fb_writer_spu $(SPU_SRCDIR)/fb_writer.c -lm
$(PPU_EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o

libfb_writer_spu.a: fb_writer_spu-embed.o
$(PPU_AR) -qcs libfb_writer_spu.a fb_writer_spu-embed.o
$(SPU_LIBDIR)/libfb_writer_spu.a: $(SPU_LIBDIR)/fb_writer_spu-embed.o
$(PPU_AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o

$(SPU_LIBDIR)/ $(SPU_LIBDIR)/fb_writer_spu-embed.o
$(PPU_LD) -o $(SPU_LIBDIR)/ -shared $(SPU_LIBDIR)/fb_writer_spu-embed.o

# yuv2rgb_converter
yuv2rgb_spu-embed.o: yuv2rgb_converter.c spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o yuv2rgb_spu yuv2rgb_converter.c -lm
$(PPU_EMBEDSPU) -m32 yuv2rgb_spu yuv2rgb_spu yuv2rgb_spu-embed.o

libyuv2rgb_spu.a: yuv2rgb_spu-embed.o
$(PPU_AR) -qcs libyuv2rgb_spu.a yuv2rgb_spu-embed.o
# yuv2rgb_converter (converting YV12/IYUV to RGB)
$(SPU_LIBDIR)/yuv2rgb_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/yuv2rgb_converter.c $(SPU_SRCDIR)/spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_SRCDIR)/yuv2rgb_converter.c -lm
$(PPU_EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o yuv2rgb_spu-embed.o
$(PPU_LD) -o -shared yuv2rgb_spu-embed.o
$(SPU_LIBDIR)/libyuv2rgb_spu.a: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
$(PPU_AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o

$(SPU_LIBDIR)/ $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
$(PPU_LD) -o $(SPU_LIBDIR)/ -shared $(SPU_LIBDIR)/yuv2rgb_spu-embed.o

# bilin_scaler
bilin_scaler_spu-embed.o: bilin_scaler.c spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o bilin_scaler_spu bilin_scaler.c -lm
$(PPU_EMBEDSPU) -m32 bilin_scaler_spu bilin_scaler_spu bilin_scaler_spu-embed.o

libbilin_scaler_spu.a: bilin_scaler_spu-embed.o
$(PPU_AR) -qcs libbilin_scaler_spu.a bilin_scaler_spu-embed.o
# bilin_scaler (scaling bilinear YV12/IYUV pictures with resolutions /16)
$(SPU_LIBDIR)/bilin_scaler_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/bilin_scaler.c $(SPU_SRCDIR)/spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_SRCDIR)/bilin_scaler.c -lm
$(PPU_EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o bilin_scaler_spu-embed.o
$(PPU_LD) -o -shared bilin_scaler_spu-embed.o
$(SPU_LIBDIR)/libbilin_scaler_spu.a: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
$(PPU_AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o

install: libfb_writer_spu.a \ libyuv2rgb_spu.a \ libbilin_scaler_spu.a
$(INSTALL) -c -m 0755 $(PREFIX)/.
$(INSTALL) -c -m 0655 libfb_writer_spu.a $(PREFIX)/.
$(INSTALL) -c -m 0755 $(PREFIX)/.
$(INSTALL) -c -m 0655 libyuv2rgb_spu.a $(PREFIX)/.
$(INSTALL) -c -m 0755 $(PREFIX)/.
$(INSTALL) -c -m 0655 libbilin_scaler_spu.a $(PREFIX)/.
$(SPU_LIBDIR)/ $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
$(PPU_LD) -o $(SPU_LIBDIR)/ -shared $(SPU_LIBDIR)/bilin_scaler_spu-embed.o

uninstall: $(PREFIX)/ $(PREFIX)/libfb_writer_spu.a \
$(PREFIX)/ $(PREFIX)/libyuv2rgb_spu.a \
$(PREFIX)/ $(PREFIX)/libbilin_scaler_spu.a
rm -f $(PREFIX)/libfb_writer_spu.a
rm -f $(PREFIX)/
rm -f $(PREFIX)/
rm -f $(PREFIX)/libyuv2rgb_spu.a
rm -f $(PREFIX)/
rm -f $(PREFIX)/libbilin_scaler_spu.a
ps3libs-install: $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/ \
$(SPU_LIBDIR)/ $(SPU_LIBDIR)/libyuv2rgb_spu.a \
$(SPU_LIBDIR)/ $(SPU_LIBDIR)/libbilin_scaler_spu.a
$(INSTALL) -c -m 0755 $(SPU_LIBDIR)/ $(DESTDIR)$(libdir)/.
$(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libfb_writer_spu.a $(DESTDIR)$(libdir)/.
$(INSTALL) -c -m 0755 $(SPU_LIBDIR)/ $(DESTDIR)$(libdir)/.
$(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libyuv2rgb_spu.a $(DESTDIR)$(libdir)/.
$(INSTALL) -c -m 0755 $(SPU_LIBDIR)/ $(DESTDIR)$(libdir)/.
$(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libbilin_scaler_spu.a $(DESTDIR)$(libdir)/.

rm -f $(DESTDIR)$(libdir)/libfb_writer_spu.a
rm -f $(DESTDIR)$(libdir)/
rm -f $(DESTDIR)$(libdir)/
rm -f $(DESTDIR)$(libdir)/libyuv2rgb_spu.a
rm -f $(DESTDIR)$(libdir)/
rm -f $(DESTDIR)$(libdir)/libbilin_scaler_spu.a

rm -f bilin_scaler_spu-embed.o libbilin_scaler_spu.a bilin_scaler_spu
rm -f yuv2rgb_spu-embed.o libyuv2rgb_spu.a yuv2rgb_spu
rm -f fb_writer_spu-embed.o libfb_writer_spu.a fb_writer_spu
rm -f $(SPU_LIBDIR)/*

0 comments on commit 0bc06b1

Please sign in to comment.