comparison src/video/ps3/SDL_ps3video.h @ 3141:3df74541339b gsoc2009_ps3

Added ps3 video driver based on the dummy driver. Added spulib for copying to framebuffer. Added SPU managing functions. Added open/close and taking control of the framebuffer.
author Martin Lowinski <martin@goldtopf.org>
date Fri, 29 May 2009 09:50:21 +0000
parents
children c146645a770e
comparison
equal deleted inserted replaced
3140:9ef99b844c60 3141:3df74541339b
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22 #include "SDL_config.h"
23
24 #include <libspe2.h>
25
26 #ifndef _SDL_ps3video_h
27 #define _SDL_ps3video_h
28
29 #include "../SDL_sysvideo.h"
30
31 /* Debugging
32 * 0: No debug messages
33 * 1: Video debug messages
34 * 2: SPE debug messages
35 * 3: Memory adresses
36 */
37 #define DEBUG_LEVEL 2
38
39 #ifdef DEBUG_LEVEL
40 #define deprintf( level, fmt, args... ) \
41 do \
42 { \
43 if ( (unsigned)(level) <= DEBUG_LEVEL ) \
44 { \
45 fprintf( stdout, fmt, ##args ); \
46 fflush( stdout ); \
47 } \
48 } while ( 0 )
49 #else
50 #define deprintf( level, fmt, args... )
51 #endif
52
53 /* Default framebuffer device on PS3 */
54 #define PS3DEV "/dev/fb0"
55
56 /* SPU thread data */
57 typedef struct spu_data {
58 spe_context_ptr_t ctx;
59 pthread_t thread;
60 spe_program_handle_t program;
61 char * program_name;
62 unsigned int booted;
63 unsigned int keepalive;
64 unsigned int entry;
65 int error_code;
66 void * argp;
67 } spu_data_t;
68
69 /* Private display data */
70 typedef struct SDL_VideoData
71 {
72 /* Framebuffer device descriptor */
73 int fbdev;
74 /* mmap'd access to fbdev */
75 uint8_t * frame_buffer;
76 /* SPE threading stuff */
77 spu_data_t * fb_thread_data;
78 /* Framebuffer transfer data */
79 volatile struct fb_writer_parms_t * fb_parms __attribute__((aligned(128)));
80 } SDL_VideoData;
81
82 #endif /* _SDL_ps3video_h */
83
84 /* vi: set ts=4 sw=4 expandtab: */