Exemplo n.º 1
0
static int ovl2mem_callback(unsigned int userdata)
{
	int fence_idx = 0;
	int layid = 0;

	DISPMSG("ovl2mem_callback(%x), current tick=%d, release tick: %d\n",
		pgc->session, get_ovl2mem_ticket(), userdata);
	for (layid = 0; layid < (HW_OVERLAY_COUNT + 1); layid++) {
		fence_idx = mtkfb_query_idx_by_ticket(pgc->session, layid, userdata);
		if (fence_idx >= 0) {
			disp_ddp_path_config *data_config = dpmgr_path_get_last_config(pgc->dpmgr_handle);
			WDMA_CONFIG_STRUCT wdma_layer;
			wdma_layer.dstAddress = 0;
			if (data_config && (layid >= HW_OVERLAY_COUNT)) {
				wdma_layer.dstAddress = mtkfb_query_buf_mva(pgc->session, layid, fence_idx);
				wdma_layer.outputFormat = data_config->wdma_config.outputFormat;
				wdma_layer.srcWidth = data_config->wdma_config.srcWidth;
				wdma_layer.srcHeight = data_config->wdma_config.srcHeight;
				wdma_layer.dstPitch = data_config->wdma_config.dstPitch;
				DISPMSG("mem_seq %x-seq+ %d\n", pgc->session, mtkfb_query_frm_seq_by_addr(pgc->session,
					layid, wdma_layer.dstAddress));
				dprec_logger_frame_seq_end(pgc->session, mtkfb_query_frm_seq_by_addr(pgc->session,
					layid, wdma_layer.dstAddress));

				dprec_mmp_dump_wdma_layer(&wdma_layer, 1);

			}
			mtkfb_release_fence(pgc->session, layid, fence_idx);
		}
	}

	atomic_set(&g_release_ticket, userdata);
}
Exemplo n.º 2
0
int ovl2mem_trigger(int blocking, void *callback, unsigned int userdata)
{
    int ret = -1;
    int fence_idx = 0;
    int layid = 0;
    DISPFUNC();

    if(pgc->need_trigger_path == 0)
    {
        DISPMSG("ovl2mem_trigger do not trigger\n");
        if ((atomic_read(&g_trigger_ticket) - atomic_read(&g_release_ticket)) == 1)
        {
            DISPMSG("ovl2mem_trigger(%x), configue input, but does not config output!!\n", pgc->session);
            for(layid = 0; layid < (HW_OVERLAY_COUNT + 1); layid++)
            {
                fence_idx = mtkfb_query_idx_by_ticket(pgc->session, layid, atomic_read(&g_trigger_ticket));
                if(fence_idx >=0) 
                {
                    mtkfb_release_fence(pgc->session, layid, fence_idx);
                }
            }
        }
        return ret;
    }
    _ovl2mem_path_lock(__func__);

    dpmgr_path_start(pgc->dpmgr_handle, ovl2mem_cmdq_enabled());
    dpmgr_path_trigger(pgc->dpmgr_handle, pgc->cmdq_handle_config, ovl2mem_cmdq_enabled());
        
    cmdqRecWait(pgc->cmdq_handle_config, CMDQ_EVENT_DISP_WDMA1_EOF);
    
    dpmgr_path_stop(pgc->dpmgr_handle, ovl2mem_cmdq_enabled());

    ///cmdqRecDumpCommand(pgc->cmdq_handle_config);
    
    cmdqRecFlushAsyncCallback(pgc->cmdq_handle_config, ovl2mem_callback, atomic_read(&g_trigger_ticket));

    cmdqRecReset(pgc->cmdq_handle_config);
    
    pgc->need_trigger_path = 0;
    atomic_add(1, &g_trigger_ticket );
    
    _ovl2mem_path_unlock(__func__);

    dprec_logger_frame_seq_begin(pgc->session,  mtkfb_query_frm_seq_by_addr(pgc->session, 0, 0));
    DISPMSG("ovl2mem_trigger ovl2mem_seq %d-seq %d\n", get_ovl2mem_ticket(), mtkfb_query_frm_seq_by_addr(pgc->session, 0, 0));
    
    return ret;
}
Exemplo n.º 3
0
static int ovl2mem_callback(unsigned int userdata)
{
    int fence_idx = 0;
    int layid = 0;

    DISPMSG("ovl2mem_callback(%x), current tick=%d, release tick: %d\n", pgc->session, get_ovl2mem_ticket(), userdata);
    for(layid = 0; layid < (HW_OVERLAY_COUNT + 1); layid++)
    {
        fence_idx = mtkfb_query_idx_by_ticket(pgc->session, layid, userdata);
        if(fence_idx <0) 
		{
			if(fence_idx == -1)
			{
				//DISPPR_ERROR("find fence idx for layer %d,addr 0x%08x fail, unregistered addr%d\n", layid, userdata, fence_idx); 
			}
			else if(fence_idx == -2)
			{

			}
			else
			{
				///DISPPR_ERROR("find fence idx for layer %d,addr 0x%08x fail,reason unknown%d\n", layid, userdata, fence_idx);
			}
		}
		else
		{   
		    disp_ddp_path_config *data_config= dpmgr_path_get_last_config(pgc->dpmgr_handle);
		    if(data_config && (layid == 4))
		    {
		        WDMA_CONFIG_STRUCT wdma_layer;
                wdma_layer.dstAddress = mtkfb_query_buf_mva(pgc->session, layid, fence_idx);
                wdma_layer.outputFormat = data_config->wdma_config.outputFormat;
                wdma_layer.srcWidth = data_config->wdma_config.srcWidth;
                wdma_layer.srcHeight = data_config->wdma_config.srcHeight;
                wdma_layer.dstPitch = data_config->wdma_config.dstPitch;
                
                dprec_mmp_dump_wdma_layer(&wdma_layer, 1);
            }
			mtkfb_release_fence(pgc->session, layid, fence_idx);
		}
    }
    
    atomic_set(&g_release_ticket, userdata);

}