Exemplo n.º 1
0
static int it660x_in_canvas_init(unsigned int mem_start, unsigned int mem_size)
{
    int i, canvas_start_index ;
    unsigned int canvas_width  = 1920 << 1;
    unsigned int canvas_height = 1080;
    unsigned decbuf_start = mem_start + IT660XIN_ANCI_DATA_SIZE;
    amit660xin_dec_info.decbuf_size   = 0x400000;

    i = (unsigned)((mem_size - IT660XIN_ANCI_DATA_SIZE) / amit660xin_dec_info.decbuf_size);

    amit660xin_dec_info.canvas_total_count = (IT660XIN_VF_POOL_SIZE > i)? i : IT660XIN_VF_POOL_SIZE;

    amit660xin_dec_info.pbufAddr  = mem_start;

    if(vdin_devp_it660x->index )
        canvas_start_index = tvin_canvas_tab[1][0];
    else
        canvas_start_index = tvin_canvas_tab[0][0];

    for ( i = 0; i < amit660xin_dec_info.canvas_total_count; i++)
    {
        canvas_config(canvas_start_index + i, decbuf_start + i * amit660xin_dec_info.decbuf_size,
            canvas_width, canvas_height, CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
    }
    set_tvin_canvas_info(canvas_start_index ,amit660xin_dec_info.canvas_total_count );
    return 0;
}
Exemplo n.º 2
0
static int mipi_vdin_canvas_init(vdin_ops_privdata_t* data,unsigned int mem_start, unsigned int mem_size)
{
    int i, canvas_start_index ;
    unsigned int canvas_width  = (data->input.active_pixel*data->input.depth)>>3;
    unsigned int canvas_height = data->input.active_line;
    unsigned decbuf_start = mem_start;
    unsigned decbuf_size   = canvas_width*canvas_height + 0x1000;

#if 0
    if( mem_size >= CANVAS_SIZE_6_500M){
	canvas_width  = 2592 << 1;
	canvas_height = 1952;
	decbuf_size   = canvas_width*canvas_height + 0x1000;
	mipi_dbg("mipi_vdin_canvas_init--5M canvas config\n");
    }else if( mem_size >= CANVAS_SIZE_6_300M ){
	canvas_width  = 2048 << 1;
	canvas_height = 1536;
	decbuf_size  = canvas_width*canvas_height + 0x1000;
	mipi_dbg("mipi_vdin_canvas_init--3M canvas config\n");
    }
#endif

    i = (unsigned)(mem_size  / decbuf_size);

    data->canvas_total_count = (VDIN_VF_POOL_MAX_SIZE > i)? i : VDIN_VF_POOL_MAX_SIZE;
    data->decbuf_size = decbuf_size;

    if((data->param.port == TVIN_PORT_MIPI_NV12)||(data->param.port == TVIN_PORT_MIPI_NV21)){
        if(data->vdin_num)
            canvas_start_index = tvin_canvas_tab[1][0];
        else
            canvas_start_index = tvin_canvas_tab[0][0];

        for ( i = 0; i < data->canvas_total_count; i++){
            canvas_config(canvas_start_index + i, decbuf_start + i * data->decbuf_size,
                data->input.active_pixel, canvas_height, CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
        }
        for ( i = 0; i < data->canvas_total_count; i++){
            canvas_config(VDIN_START_CANVAS_CHROMA_OFFSET+canvas_start_index + i, decbuf_start + (i * data->decbuf_size)+(data->input.active_line*data->input.active_pixel),
                data->input.active_pixel, canvas_height/2, CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
        }
    }else{
        if(data->vdin_num)
            canvas_start_index = tvin_canvas_tab[1][0];
        else
            canvas_start_index = tvin_canvas_tab[0][0];

        for ( i = 0; i < data->canvas_total_count; i++){
            canvas_config(canvas_start_index + i, decbuf_start + i * data->decbuf_size,
                canvas_width, canvas_height, CANVAS_ADDR_NOWRAP, CANVAS_BLKMODE_LINEAR);
        }
    }

    set_tvin_canvas_info(canvas_start_index ,data->canvas_total_count);
    return 0;
}