Beispiel #1
0
void query_del_by_conn( irc_t *irc, struct im_connection *ic )
{
	query_t *q, *n, *def;
	int count = 0;
	
	q = irc->queries;
	def = query_default( irc );
	
	while( q )
	{
		if( q->ic == ic )
		{
			n = q->next;
			query_del( irc, q );
			q = n;
			
			count ++;
		}
		else
		{
			q = q->next;
		}
	}
	
	if( count > 0 )
		imcb_log( ic, "Flushed %d unanswered question(s) for this connection.", count );
	
	q = query_default( irc );
	if( q && q != def )
		query_display( irc, q );
}
Beispiel #2
0
void query_answer( irc_t *irc, query_t *q, int ans )
{
	int disp = 0;
	
	if( !q )
	{
		q = query_default( irc );
		disp = 1;
	}
	if( ans )
	{
		if( q->ic )
			imcb_log( q->ic, "Accepted: %s", q->question );
		else
			irc_usermsg( irc, "Accepted: %s", q->question );
		q->yes( q->data );
	}
	else
	{
		if( q->ic )
			imcb_log( q->ic, "Rejected: %s", q->question );
		else
			irc_usermsg( irc, "Rejected: %s", q->question );
		q->no( q->data );
	}
	q->data = NULL;
	
	query_del( irc, q );
	
	if( disp && ( q = query_default( irc ) ) )
		query_display( irc, q );
}
Beispiel #3
0
query_t *query_add( irc_t *irc, struct im_connection *ic, char *question,
                    query_callback yes, query_callback no, void *data )
{
	query_t *q = g_new0( query_t, 1 );
	
	q->ic = ic;
	q->question = g_strdup( question );
	q->yes = yes;
	q->no = no;
	q->data = data;
	
	if( strchr( irc->umode, 'b' ) != NULL )
	{
		char *s;
		
		/* At least for the machine-parseable version, get rid of
		   newlines to make "parsing" easier. */
		for( s = q->question; *s; s ++ )
			if( *s == '\r' || *s == '\n' )
				*s = ' ';
	}
	
	if( irc->queries )
	{
		query_t *l = irc->queries;
		
		while( l->next ) l = l->next;
		l->next = q;
	}
	else
	{
		irc->queries = q;
	}
	
	if( g_strcasecmp( set_getstr( &irc->set, "query_order" ), "lifo" ) == 0 || irc->queries == q )
		query_display( irc, q );
	
	return( q );
}
Beispiel #4
0
TIMM_OSAL_ERRORTYPE CDisplayDSS::init_dss_composition(int dss_fd, unsigned int display_ix, unsigned int requestedOvls, struct dsscomp_setup_mgr_data** mgr_data)
{
    struct dsscomp_display_info disp_info;
    struct dss2_ovl_info* ovlInfo;
    unsigned int disp_ovls = 0;

    if (requestedOvls < 1 || requestedOvls > MAX_OVLS_PER_COMPOSITION)
    {
        MMS_IL_PRINT("Illegal number of overlays per composition (%d)\n", requestedOvls);
        return TIMM_OSAL_ERR_UNKNOWN;
    }

    memset((void *) &disp_info, 0, sizeof(disp_info));

    if (query_display(dss_fd, display_ix, &disp_info))
    {
        MMS_IL_PRINT("Display ID %d query failed\n", display_ix);
        return TIMM_OSAL_ERR_UNKNOWN;
    }

    //if(disp_info.state != OMAP_DSS_DISPLAY_ACTIVE)
    //{
    //    MMS_IL_PRINT("Display ID %d is in non active state: %d\n", display_ix, disp_info.state);
    //}

    MMS_IL_PRINT("Owned overlays 0x%08X\n", disp_info.overlays_owned);
    MMS_IL_PRINT("Available overlays 0x%08X\n", disp_info.overlays_available);

    // Count overlays on the output display
    for (int i = disp_info.overlays_owned; i; i >>= 1)
    {
        if (i & 1)
        {
            disp_ovls++;
        }
    }

    // TODO: In the below case claim the needed resources
    if (disp_ovls < requestedOvls)
    {
        MMS_IL_PRINT("Ovls needed: %d, Ovls attached to display: %d\n", requestedOvls, disp_ovls);
        return TIMM_OSAL_ERR_UNKNOWN;
    }

    *mgr_data = (struct dsscomp_setup_mgr_data*) malloc(sizeof(struct dsscomp_setup_mgr_data) + sizeof(struct dss2_ovl_info)*disp_ovls);
    ovlInfo = (struct dss2_ovl_info*)((*mgr_data) + sizeof(struct dsscomp_setup_mgr_data));

    if (*mgr_data == NULL)
    {
        MMS_IL_PRINT("Manager data memory allocation failed\n");
        return TIMM_OSAL_ERR_ALLOC;
    }

    memset((void*)*mgr_data, 0, sizeof(struct dsscomp_setup_mgr_data) + sizeof(struct dss2_ovl_info)*disp_ovls);

    (*mgr_data)->mgr = disp_info.mgr;
    (*mgr_data)->mgr.ix = disp_info.channel;
    (*mgr_data)->mgr.trans_enabled = 0;
    (*mgr_data)->mgr.interlaced = 0;
    (*mgr_data)->mgr.alpha_blending = 1;
    (*mgr_data)->mgr.cpr_enabled = 0;
    (*mgr_data)->mgr.swap_rb = 0;

    (*mgr_data)->win.x = 0;
    (*mgr_data)->win.y = 0;
    (*mgr_data)->win.w = disp_info.timings.x_res;
    (*mgr_data)->win.h = disp_info.timings.y_res;

    MMS_IL_PRINT("Display W = %d H = %d\n", disp_info.timings.x_res, disp_info.timings.y_res);
    MMS_IL_PRINT("Using (*mgr_data)->mgr.ix: %d\n", (*mgr_data)->mgr.ix);
    //ovlInfo->addressing = OMAP_DSS_BUFADDR_DIRECT;

    /* Update user window config data with the display resolution */
    /*DSScfg.window.left = 0;
    DSScfg.window.right = 0;
    DSScfg.window.width  = disp_info.timings.x_res;
    DSScfg.window.height = disp_info.timings.y_res;

    // Store display resolution for automatic window adjustment calc */
    /*DispayW = DSScfg.window.width;
    DispayH = DSScfg.window.height;
    */
    DispayW = disp_info.timings.x_res;
    DispayH = disp_info.timings.y_res;
// clip display size up to physical display dimentions
    if (DSScfg.disp_w > DispayW)
        DSScfg.disp_w = DispayW;
    if (DSScfg.disp_h > DispayH)
        DSScfg.disp_h = DispayH;

    int ownedOvls = disp_info.overlays_owned;
    unsigned int ix = 0;
    unsigned int ix_saved = 0;
    int zOrder = 3;
    //int test;
    ownedOvls &= (0x00000001|(1<<DSScfg.disp_overlay)); // Select GFX (will be disabled from following loop) and selected overlay

    while((ownedOvls != 0) && (ix_saved < disp_ovls))
    {
        if (ownedOvls & 1)
        {
            struct dss2_ovl_info* ovl;

            if(ix != DSScfg.disp_overlay)
            {
                MMS_IL_PRINT("Stopped overlay %d\n", ix);
                ovl = &(*mgr_data)->ovls[ix_saved];

                ovl->cfg.ix = ix;
                ovl->cfg.mgr_ix = disp_info.channel;

                ovl->cfg.zonly = 0;
                ovl->cfg.zorder = zOrder--;
            }
            else
            {

                ovl = &(*mgr_data)->ovls[ix_saved];
                ovl->cfg.ix = ix;
                ovl->cfg.mgr_ix = disp_info.channel;

                mActivePipe_idx = ix_saved; // Save index to Active (displayed) pipeline
                ovl->cfg.zonly  = 0;
                ovl->cfg.zorder = DSScfg.disp_Zorder;

                ovl->cfg.cconv = CTBL_BT601_5;
                ovl->cfg.ilace = OMAP_DSS_ILACE_NONE;
                //User config section. Setting the default values
                ovl->cfg.global_alpha = DSScfg.globalAlpha;
                ovl->cfg.rotation = DSScfg.rotation;
                ovl->cfg.mirror = DSScfg.mirror;
                ovl->cfg.win.w = DSScfg.disp_w;
                ovl->cfg.win.h = DSScfg.disp_h;
                MMS_IL_PRINT("Using overlay %d\n", ix);
            }
            ix_saved++;
            //test = check_dss_overlay(DSSfd, DSSCOMP_SETUP_MODE_APPLY, DSSdata, ix);
            //MMS_IL_PRINT("DSSCIOC_CHECK_OVL %d returnede 0x%08X\n", ix, test);
        } else {
            MMS_IL_PRINT("Skipped overlay %d\n", ix);
        }

        ownedOvls >>= 1;
        ix++;
    }

    (*mgr_data)->num_ovls = ix_saved;

    //test = set_dss_mgr_data(DSSfd, DSSCOMP_SETUP_MODE_APPLY, DSSdata, 0);
    //MMS_IL_PRINT("Setting up DSS manager data status %d (0x%08X)\n", test, test);

    return TIMM_OSAL_ERR_NONE;
}