/* Command handler */ static int onedram_req_active_handler(S5pc1xxOneDRAMState *s) { uint16_t cmd = INT_COMMAND(INT_MASK_CMD_RES_ACTIVE); onedram_send_cmd_to_pda(s, cmd); return COMMAND_SUCCESS; }
static int onedram_smp_req_handler(S5pc1xxOneDRAMState *s) { uint16_t cmd; onedram_put_authority(s); cmd = INT_COMMAND(INT_MASK_CMD_SMP_REP); onedram_send_cmd_to_pda(s, cmd); return COMMAND_SUCCESS; }
int onedram_try_get_authority(S5pc1xxOneDRAMState *s) { uint16_t cmd = 0; if(!onedram_read_sem(s)) return TRUE; cmd = INT_COMMAND(INT_MASK_CMD_SMP_REQ); onedram_send_cmd_to_pda(s, cmd); return FALSE; }
/* Boot up timer */ static void onedram_bootup(void *opaque) { uint16_t cmd; S5pc1xxOneDRAMState *s = (S5pc1xxOneDRAMState *)opaque; if(!s->vmodem_bootup) { onedram_io_writel(s, ONEDRAM_MBX_AB, IPC_CP_READY_FOR_LOADING); s->vmodem_bootup = 1; } else { /* Init the in/out head/tail */ onedram_write_inhead(s, 0); onedram_write_intail(s, 0); onedram_write_outhead(s, 0); onedram_write_outtail(s, 0); /* put the authority to AP to let it access to shared memory */ onedram_put_authority(s); cmd = INT_COMMAND(INT_MASK_CMD_PHONE_START|CP_CHIP_INFINEON); onedram_send_cmd_to_pda(s, cmd); qemu_del_timer(s->bootup_timer); } }
/***************************************************************************** * Open *****************************************************************************/ static int Open( vlc_object_t *p_this ) { sout_stream_t *p_stream = (sout_stream_t *)p_this; sout_stream_sys_t *p_sys; vlc_value_t val; config_ChainParse( p_stream, CFG_PREFIX, ppsz_sout_options, p_stream->p_cfg ); p_sys = malloc( sizeof( sout_stream_sys_t ) ); if( !p_sys ) return VLC_ENOMEM; p_stream->p_sys = p_sys; p_sys->b_inited = false; p_sys->psz_id = var_CreateGetString( p_stream, CFG_PREFIX "id" ); p_sys->i_height = var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "height" ); var_AddCallback( p_stream, CFG_PREFIX "height", HeightCallback, p_stream ); p_sys->i_width = var_CreateGetIntegerCommand( p_stream, CFG_PREFIX "width" ); var_AddCallback( p_stream, CFG_PREFIX "width", WidthCallback, p_stream ); var_Get( p_stream, CFG_PREFIX "sar", &val ); if( val.psz_string ) { char *psz_parser = strchr( val.psz_string, ':' ); if( psz_parser ) { *psz_parser++ = '\0'; p_sys->i_sar_num = atoi( val.psz_string ); p_sys->i_sar_den = atoi( psz_parser ); vlc_ureduce( &p_sys->i_sar_num, &p_sys->i_sar_den, p_sys->i_sar_num, p_sys->i_sar_den, 0 ); } else { msg_Warn( p_stream, "bad aspect ratio %s", val.psz_string ); p_sys->i_sar_num = p_sys->i_sar_den = 1; } free( val.psz_string ); } else { p_sys->i_sar_num = p_sys->i_sar_den = 1; } p_sys->i_chroma = 0; val.psz_string = var_GetNonEmptyString( p_stream, CFG_PREFIX "chroma" ); if( val.psz_string && strlen( val.psz_string ) >= 4 ) { memcpy( &p_sys->i_chroma, val.psz_string, 4 ); msg_Dbg( p_stream, "Forcing image chroma to 0x%.8x (%4.4s)", p_sys->i_chroma, (char*)&p_sys->i_chroma ); } free( val.psz_string ); #define INT_COMMAND( a ) do { \ var_Create( p_stream, CFG_PREFIX #a, \ VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND ); \ var_AddCallback( p_stream, CFG_PREFIX #a, a ## Callback, \ p_stream ); } while(0) INT_COMMAND( alpha ); INT_COMMAND( x ); INT_COMMAND( y ); #undef INT_COMMAND p_stream->pf_add = Add; p_stream->pf_del = Del; p_stream->pf_send = Send; p_stream->pace_nocontrol = true; return VLC_SUCCESS; }