Added Makefile rule for spu programs. Added Readme. gsoc2009_ps3
authorMartin Lowinski <martin@goldtopf.org>
Mon, 10 Aug 2009 18:05:33 +0000
branchgsoc2009_ps3
changeset 315495e48f7a3a93
parent 3153 a16c4ec43631
child 3155 abc49915ccb2
Added Makefile rule for spu programs. Added Readme.
Makefile.in
README.PS3
configure.in
src/video/ps3/spulibs/Makefile
     1.1 --- a/Makefile.in	Mon Aug 10 13:28:58 2009 +0000
     1.2 +++ b/Makefile.in	Mon Aug 10 18:05:33 2009 +0000
     1.3 @@ -40,6 +40,9 @@
     1.4  SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
     1.5  SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
     1.6  
     1.7 +# SPU programs
     1.8 +include $(srcdir)/src/video/ps3/spulibs/Makefile
     1.9 +
    1.10  DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-OS2.zip Watcom-Win32.zip WhatsNew Xcode
    1.11  
    1.12  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
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/README.PS3	Mon Aug 10 18:05:33 2009 +0000
     2.3 @@ -0,0 +1,35 @@
     2.4 +
     2.5 +SDL on Sony Playstation3
     2.6 +------------------------
     2.7 +
     2.8 +Installation:
     2.9 +  First, you have to install the Cell SDK
    2.10 +  - Download the Cell SDK installer RPM and ISO images to
    2.11 +    a temporary directory such as /tmp/cellsdk.
    2.12 +  - Mount the image: mount -o loop CellSDK-Devel-Fedora_3.1.0.0.0.iso /tmp/cellsdk
    2.13 +  - Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm
    2.14 +  - Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install
    2.15 +
    2.16 +  You'll than need to install the SPU-libs
    2.17 +  - Run make ps3-libs && make ps3libs-install
    2.18 +
    2.19 +  Finally, install SDL
    2.20 +  - Go to SDL-1.2/ and build SDL like any other GNU style package.
    2.21 +  e.g.
    2.22 +    - Build the configure-script with ./autogen.sh
    2.23 +    - Configure SDL for your needs: ./configure --enable-video-ps3 ...
    2.24 +    - Build and install it: make && make install
    2.25 +
    2.26 +
    2.27 +Todo:
    2.28 +  - Mouse & Keyboard support
    2.29 +  - On SPU-side the current scaler and converter restrictions are:
    2.30 +    - resolution has to be a multiple of 8 (will work on that)
    2.31 +    - scaler/converter only supports the YV12 and IYUV format
    2.32 +    - the scaler works only bilinear (lanzos would be nice)
    2.33 +  - Optimize the SPU-program handling on the PPE side
    2.34 +  - Integrate spumedia in SDL
    2.35 +
    2.36 +Have fun!
    2.37 +  Dirk Herrendoerfer <d.herrendoerfer [at] de [dot ibm [dot] com>
    2.38 +
     3.1 --- a/configure.in	Mon Aug 10 13:28:58 2009 +0000
     3.2 +++ b/configure.in	Mon Aug 10 18:05:33 2009 +0000
     3.3 @@ -1523,6 +1523,7 @@
     3.4        SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
     3.5        EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
     3.6        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/cell/sdk/usr/lib -lspe2 -lfb_writer_spu -lyuv2rgb_spu -lbilin_scaler_spu"
     3.7 +	  echo "*** Before building SDL please run make ps3libs"
     3.8        have_video=yes
     3.9      fi   
    3.10    fi
     4.1 --- a/src/video/ps3/spulibs/Makefile	Mon Aug 10 13:28:58 2009 +0000
     4.2 +++ b/src/video/ps3/spulibs/Makefile	Mon Aug 10 18:05:33 2009 +0000
     4.3 @@ -3,81 +3,74 @@
     4.4  
     4.5  # Toolchain
     4.6  SPU_GCC=/usr/bin/spu-gcc
     4.7 -PPU_GCC=/usr/bin/gcc
     4.8  PPU_EMBEDSPU=/usr/bin/embedspu
     4.9  PPU_AR=/usr/bin/ar
    4.10  PPU_LD=/usr/bin/ld
    4.11 -INSTALL=/usr/bin/install
    4.12 -
    4.13 +SPU_SRCDIR=$(srcdir)/src/video/ps3/spulibs
    4.14 +SPU_LIBDIR=$(srcdir)/src/video/ps3/spulibs/libs
    4.15  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
    4.16  
    4.17 -# Usually /usr/lib, depending on your distribution
    4.18 -PREFIX=/usr/lib
    4.19  
    4.20 +ps3libs: $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/libfb_writer_spu.so \
    4.21 +				$(SPU_LIBDIR)/libyuv2rgb_spu.so $(SPU_LIBDIR)/libyuv2rgb_spu.a \
    4.22 +				$(SPU_LIBDIR)/libbilin_scaler_spu.so $(SPU_LIBDIR)/libbilin_scaler_spu.a
    4.23  
    4.24 -all: libfb_writer_spu.a libfb_writer_spu.so \
    4.25 -				libyuv2rgb_spu.so libyuv2rgb_spu.a \
    4.26 -				libbilin_scaler_spu.so libbilin_scaler_spu.a
    4.27 +$(SPU_LIBDIR):
    4.28 +	$(SHELL) $(auxdir)/mkinstalldirs $(SPU_LIBDIR)
    4.29  
    4.30 +# fb_writer (basically copying from a to b)
    4.31 +$(SPU_LIBDIR)/fb_writer_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/fb_writer.c $(SPU_SRCDIR)/spu_common.h
    4.32 +	$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/fb_writer_spu $(SPU_SRCDIR)/fb_writer.c -lm
    4.33 +	$(PPU_EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o
    4.34  
    4.35 -# fb_writer
    4.36 -fb_writer_spu-embed.o: fb_writer.c spu_common.h
    4.37 -	$(SPU_GCC) $(SPU_CFLAGS) -o fb_writer_spu fb_writer.c -lm
    4.38 -	$(PPU_EMBEDSPU) -m32 fb_writer_spu fb_writer_spu fb_writer_spu-embed.o
    4.39 +$(SPU_LIBDIR)/libfb_writer_spu.a: $(SPU_LIBDIR)/fb_writer_spu-embed.o
    4.40 +	$(PPU_AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o
    4.41  
    4.42 -libfb_writer_spu.so: fb_writer_spu-embed.o
    4.43 -	$(PPU_LD) -o libfb_writer_spu.so -shared -soname=libfb_writer_spu.so fb_writer_spu-embed.o
    4.44 +$(SPU_LIBDIR)/libfb_writer_spu.so: $(SPU_LIBDIR)/fb_writer_spu-embed.o
    4.45 +	$(PPU_LD) -o $(SPU_LIBDIR)/libfb_writer_spu.so -shared -soname=libfb_writer_spu.so $(SPU_LIBDIR)/fb_writer_spu-embed.o
    4.46  
    4.47 -libfb_writer_spu.a: fb_writer_spu-embed.o
    4.48 -	$(PPU_AR) -qcs libfb_writer_spu.a fb_writer_spu-embed.o
    4.49  
    4.50 +# yuv2rgb_converter (converting YV12/IYUV to RGB)
    4.51 +$(SPU_LIBDIR)/yuv2rgb_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/yuv2rgb_converter.c $(SPU_SRCDIR)/spu_common.h
    4.52 +	$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_SRCDIR)/yuv2rgb_converter.c -lm
    4.53 +	$(PPU_EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    4.54  
    4.55 -# yuv2rgb_converter
    4.56 -yuv2rgb_spu-embed.o: yuv2rgb_converter.c spu_common.h
    4.57 -	$(SPU_GCC) $(SPU_CFLAGS) -o yuv2rgb_spu yuv2rgb_converter.c -lm
    4.58 -	$(PPU_EMBEDSPU) -m32 yuv2rgb_spu yuv2rgb_spu yuv2rgb_spu-embed.o
    4.59 +$(SPU_LIBDIR)/libyuv2rgb_spu.a: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    4.60 +	$(PPU_AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    4.61  
    4.62 -libyuv2rgb_spu.a: yuv2rgb_spu-embed.o
    4.63 -	$(PPU_AR) -qcs libyuv2rgb_spu.a yuv2rgb_spu-embed.o
    4.64 +$(SPU_LIBDIR)/libyuv2rgb_spu.so: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    4.65 +	$(PPU_LD) -o $(SPU_LIBDIR)/libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    4.66  
    4.67 -libyuv2rgb_spu.so: yuv2rgb_spu-embed.o
    4.68 -	$(PPU_LD) -o libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so yuv2rgb_spu-embed.o
    4.69  
    4.70 +# bilin_scaler (scaling bilinear YV12/IYUV pictures with resolutions /16)
    4.71 +$(SPU_LIBDIR)/bilin_scaler_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/bilin_scaler.c $(SPU_SRCDIR)/spu_common.h
    4.72 +	$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_SRCDIR)/bilin_scaler.c -lm
    4.73 +	$(PPU_EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    4.74  
    4.75 -# bilin_scaler
    4.76 -bilin_scaler_spu-embed.o: bilin_scaler.c spu_common.h
    4.77 -	$(SPU_GCC) $(SPU_CFLAGS) -o bilin_scaler_spu bilin_scaler.c -lm
    4.78 -	$(PPU_EMBEDSPU) -m32 bilin_scaler_spu bilin_scaler_spu bilin_scaler_spu-embed.o
    4.79 +$(SPU_LIBDIR)/libbilin_scaler_spu.a: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    4.80 +	$(PPU_AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    4.81  
    4.82 -libbilin_scaler_spu.a: bilin_scaler_spu-embed.o
    4.83 -	$(PPU_AR) -qcs libbilin_scaler_spu.a bilin_scaler_spu-embed.o
    4.84 +$(SPU_LIBDIR)/libbilin_scaler_spu.so: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    4.85 +	$(PPU_LD) -o $(SPU_LIBDIR)/libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    4.86  
    4.87 -libbilin_scaler_spu.so: bilin_scaler_spu-embed.o
    4.88 -	$(PPU_LD) -o libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so bilin_scaler_spu-embed.o
    4.89  
    4.90 -install: libfb_writer_spu.a libfb_writer_spu.so \
    4.91 -				libyuv2rgb_spu.so libyuv2rgb_spu.a \
    4.92 -				libbilin_scaler_spu.so libbilin_scaler_spu.a
    4.93 -	$(INSTALL) -c -m 0755 libfb_writer_spu.so $(PREFIX)/.
    4.94 -	$(INSTALL) -c -m 0655 libfb_writer_spu.a $(PREFIX)/.
    4.95 -	$(INSTALL) -c -m 0755 libyuv2rgb_spu.so $(PREFIX)/.
    4.96 -	$(INSTALL) -c -m 0655 libyuv2rgb_spu.a $(PREFIX)/.
    4.97 -	$(INSTALL) -c -m 0755 libbilin_scaler_spu.so $(PREFIX)/.
    4.98 -	$(INSTALL) -c -m 0655 libbilin_scaler_spu.a $(PREFIX)/.
    4.99 +ps3libs-install: $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/libfb_writer_spu.so \
   4.100 +				$(SPU_LIBDIR)/libyuv2rgb_spu.so $(SPU_LIBDIR)/libyuv2rgb_spu.a \
   4.101 +				$(SPU_LIBDIR)/libbilin_scaler_spu.so $(SPU_LIBDIR)/libbilin_scaler_spu.a
   4.102 +	$(INSTALL) -c -m 0755 $(SPU_LIBDIR)/libfb_writer_spu.so $(DESTDIR)$(libdir)/.
   4.103 +	$(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libfb_writer_spu.a $(DESTDIR)$(libdir)/.
   4.104 +	$(INSTALL) -c -m 0755 $(SPU_LIBDIR)/libyuv2rgb_spu.so $(DESTDIR)$(libdir)/.
   4.105 +	$(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libyuv2rgb_spu.a $(DESTDIR)$(libdir)/.
   4.106 +	$(INSTALL) -c -m 0755 $(SPU_LIBDIR)/libbilin_scaler_spu.so $(DESTDIR)$(libdir)/.
   4.107 +	$(INSTALL) -c -m 0655 $(SPU_LIBDIR)/libbilin_scaler_spu.a $(DESTDIR)$(libdir)/.
   4.108  
   4.109 +ps3libs-uninstall:
   4.110 +	rm -f $(DESTDIR)$(libdir)/libfb_writer_spu.a
   4.111 +	rm -f $(DESTDIR)$(libdir)/libfb_writer_spu.so
   4.112 +	rm -f $(DESTDIR)$(libdir)/libyuv2rgb_spu.so
   4.113 +	rm -f $(DESTDIR)$(libdir)/libyuv2rgb_spu.a
   4.114 +	rm -f $(DESTDIR)$(libdir)/libbilin_scaler_spu.so
   4.115 +	rm -f $(DESTDIR)$(libdir)/libbilin_scaler_spu.a
   4.116  
   4.117 -uninstall: $(PREFIX)/libfb_writer_spu.so $(PREFIX)/libfb_writer_spu.a \
   4.118 -		$(PREFIX)/libyuv2rgb_spu.so $(PREFIX)/libyuv2rgb_spu.a \
   4.119 -		$(PREFIX)/libbilin_scaler_spu.so $(PREFIX)/libbilin_scaler_spu.a
   4.120 -	rm -f $(PREFIX)/libfb_writer_spu.a
   4.121 -	rm -f $(PREFIX)/libfb_writer_spu.so
   4.122 -	rm -f $(PREFIX)/libyuv2rgb_spu.so
   4.123 -	rm -f $(PREFIX)/libyuv2rgb_spu.a
   4.124 -	rm -f $(PREFIX)/libbilin_scaler_spu.so
   4.125 -	rm -f $(PREFIX)/libbilin_scaler_spu.a
   4.126 -
   4.127 -
   4.128 -clean:
   4.129 -	rm -f bilin_scaler_spu-embed.o libbilin_scaler_spu.so libbilin_scaler_spu.a bilin_scaler_spu
   4.130 -	rm -f yuv2rgb_spu-embed.o libyuv2rgb_spu.so libyuv2rgb_spu.a yuv2rgb_spu
   4.131 -	rm -f fb_writer_spu-embed.o libfb_writer_spu.so libfb_writer_spu.a fb_writer_spu
   4.132 +ps3libs-clean:
   4.133 +	rm -f $(SPU_LIBDIR)/*