comparison src/video/ps3/SDL_ps3video.c @ 3142:c146645a770e gsoc2009_ps3

Roughly working framebuffer.
author Martin Lowinski <martin@goldtopf.org>
date Thu, 04 Jun 2009 07:02:15 +0000
parents 3df74541339b
children 0d8d1f870964
comparison
equal deleted inserted replaced
3141:3df74541339b 3142:c146645a770e
55 /* SPU specific functions */ 55 /* SPU specific functions */
56 int SPE_Start(_THIS, spu_data_t * spe_data); 56 int SPE_Start(_THIS, spu_data_t * spe_data);
57 int SPE_Stop(_THIS, spu_data_t * spe_data); 57 int SPE_Stop(_THIS, spu_data_t * spe_data);
58 int SPE_Boot(_THIS, spu_data_t * spe_data); 58 int SPE_Boot(_THIS, spu_data_t * spe_data);
59 int SPE_Shutdown(_THIS, spu_data_t * spe_data); 59 int SPE_Shutdown(_THIS, spu_data_t * spe_data);
60 int SPE_SendMsg(_THIS, spu_data_t * spe_data, unsigned int msg); 60 int SPE_SendMsg(spu_data_t * spe_data, unsigned int msg);
61 int SPE_WaitForMsg(_THIS, spu_data_t * spe_data, unsigned int msg); 61 int SPE_WaitForMsg(spu_data_t * spe_data, unsigned int msg);
62 void SPE_RunContext(void *thread_argp); 62 void SPE_RunContext(void *thread_argp);
63 63
64 /* Stores the SPE executable name of fb_writer_spu */ 64 /* Stores the SPE executable name of fb_writer_spu */
65 extern spe_program_handle_t fb_writer_spu; 65 extern spe_program_handle_t fb_writer_spu;
66 66
260 SDL_SetError("[PS3->SPU] Could not create pthread for spe"); 260 SDL_SetError("[PS3->SPU] Could not create pthread for spe");
261 return -1; 261 return -1;
262 } 262 }
263 263
264 if (spe_data->keepalive) 264 if (spe_data->keepalive)
265 SPE_WaitForMsg(_this, spe_data, SPU_READY); 265 SPE_WaitForMsg(spe_data, SPU_READY);
266 } 266 }
267 267
268 268
269 /* Stop the SPE thread */ 269 /* Stop the SPE thread */
270 int SPE_Stop(_THIS, spu_data_t * spe_data) 270 int SPE_Stop(_THIS, spu_data_t * spe_data)
309 309
310 /* (Stop and) shutdown the SPE */ 310 /* (Stop and) shutdown the SPE */
311 int SPE_Shutdown(_THIS, spu_data_t * spe_data) 311 int SPE_Shutdown(_THIS, spu_data_t * spe_data)
312 { 312 {
313 if (spe_data->keepalive && spe_data->booted) { 313 if (spe_data->keepalive && spe_data->booted) {
314 SPE_SendMsg(_this, spe_data, SPU_EXIT); 314 SPE_SendMsg(spe_data, SPU_EXIT);
315 SPE_Stop(_this, spe_data); 315 SPE_Stop(_this, spe_data);
316 } 316 }
317 317
318 /* Destroy SPE context */ 318 /* Destroy SPE context */
319 deprintf(2, "[PS3->SPU] Destroy SPE context: %s\n", spe_data->program_name); 319 deprintf(2, "[PS3->SPU] Destroy SPE context: %s\n", spe_data->program_name);
325 deprintf(2, "[PS3->SPU] SPE shutdown successful: %s\n", spe_data->program_name); 325 deprintf(2, "[PS3->SPU] SPE shutdown successful: %s\n", spe_data->program_name);
326 return 0; 326 return 0;
327 } 327 }
328 328
329 /* Send message to the SPE via mailboxe */ 329 /* Send message to the SPE via mailboxe */
330 int SPE_SendMsg(_THIS, spu_data_t * spe_data, unsigned int msg) 330 int SPE_SendMsg(spu_data_t * spe_data, unsigned int msg)
331 { 331 {
332 deprintf(2, "[PS3->SPU] Sending message %u to %s\n", msg, spe_data->program_name); 332 deprintf(2, "[PS3->SPU] Sending message %u to %s\n", msg, spe_data->program_name);
333 /* Send one message, block until message was sent */ 333 /* Send one message, block until message was sent */
334 unsigned int spe_in_mbox_msgs[1]; 334 unsigned int spe_in_mbox_msgs[1];
335 spe_in_mbox_msgs[0] = msg; 335 spe_in_mbox_msgs[0] = msg;
343 return 0; 343 return 0;
344 } 344 }
345 345
346 346
347 /* Read 1 message from SPE, block until at least 1 message was received */ 347 /* Read 1 message from SPE, block until at least 1 message was received */
348 int SPE_WaitForMsg(_THIS, spu_data_t * spe_data, unsigned int msg) 348 int SPE_WaitForMsg(spu_data_t * spe_data, unsigned int msg)
349 { 349 {
350 deprintf(2, "[PS3->SPU] Waiting for message from %s\n", spe_data->program_name); 350 deprintf(2, "[PS3->SPU] Waiting for message from %s\n", spe_data->program_name);
351 unsigned int out_messages[1]; 351 unsigned int out_messages[1];
352 while (!spe_out_mbox_status(spe_data->ctx)); 352 while (!spe_out_mbox_status(spe_data->ctx));
353 int mbox_read = spe_out_mbox_read(spe_data->ctx, out_messages, 1); 353 int mbox_read = spe_out_mbox_read(spe_data->ctx, out_messages, 1);