コード例 #1
0
void vdin_vf_init(void)
{
    int i;

	vfq_init(&display_q);
	vfq_init(&recycle_q);
	vfq_init(&newframe_q);
	vf_provider_init(&vdin_vf_prov, PROVIDER_NAME ,&vdin_vf_provider, NULL);
	for (i = 0; i < (BT656IN_VF_POOL_SIZE ); ++i)
	{
		vfq_push(&newframe_q, &vfpool[i]);
	}
    newframe_q.wr_index = BT656IN_VF_POOL_SIZE -1;

    init_flag = 1;
}
コード例 #2
0
static  int  jpeg_decode(logo_object_t *plogo)
{
	ulong timeout;
	jpeg_private_t *priv=(jpeg_private_t*)plogo->parser->priv;
#ifdef CONFIG_AM_STREAMING	
	amvdec_start();
#endif
       	feed_vb(plogo->parser->logo_pic_info.size);
	timeout = jiffies + HZ * 2;//wait 2s
    
    	while (time_before(jiffies, timeout)) {
		if (priv->state == PIC_DECODED) {
			/* disable OSD layer to expose logo on video layer  */
			amlog_mask_level(LOG_MASK_PARSER,LOG_LEVEL_LOW,"[jpeglogo]: logo decoded.\n");
			break;
		}
    	}
#ifdef CONFIG_AM_STREAMING		
    	amvdec_stop();
#endif
	free_irq(INT_MAILBOX_1A, (void *)hardware_init);
	if (priv->state > PIC_NA) 
	{
		if(plogo->para.output_dev_type == LOGO_DEV_VID)
		{
#ifdef CONFIG_AM_VIDEO 
                     vf_provider_init(&jpeglogo_vf_prov, "jpeglogo_provider", &jpeglogo_vf_provider_op, NULL);
			vf_reg_provider(&jpeglogo_vf_prov);
#endif
			kernel_thread(thread_progress, plogo, 0);
		}else
		{
			plogo->parser->decoder.jpg.out_canvas_index=priv->canvas_index;
			kfree(priv);
		}
    		
	}
	else
	{
		amlog_mask_level(LOG_MASK_PARSER,LOG_LEVEL_LOW,"deocod jpeg uncompleted\n");
		return FAIL;
	}
	return SUCCESS;
}
コード例 #3
0
ファイル: ppmgr_vpp.c プロジェクト: madmaze/Meson-3-Kernel
void vf_ppmgr_init_provider(void)
{
	vf_provider_init(&ppmgr_vf_prov, PROVIDER_NAME ,&ppmgr_vf_provider, NULL);
}
コード例 #4
0
ファイル: d2d3_drv.c プロジェクト: akuster/linux-meson
static int d2d3_probe(struct platform_device *pdev)
{
        int ret = 0;
        struct d2d3_dev_s *devp;
        struct resource *res;

        /* kmalloc d2d3 dev */
        devp = kmalloc(sizeof(struct d2d3_dev_s), GFP_KERNEL);
        if (!devp)
        {
                printk("[d2d3]%s: failed to allocate memory for d2d3 device.\n",__func__);
                ret = -ENOMEM;
                goto failed_kmalloc_devp;
        }
        memset(devp,0,sizeof(d2d3_dev_t));
        d2d3_devp = devp;
        //spin_lock_init(&d2d3_devp->buf_lock);
        d2d3_devp->flag = D2D3_BYPASS;
	/*disable hw&path*/
	d2d3_enable_hw(false);
	d2d3_enable_path(false,&d2d3_devp->param);
        /*create cdev and register with sysfs*/
        ret = d2d3_add_cdev(&devp->cdev, &d2d3_fops,0);
        if (ret) {
                printk("[d2d3]%s: failed to add device.\n",__func__);
                /* @todo do with error */
                goto failed_add_cdev;
        }
        /*create the udev node /dev/...*/
        devp->dev = d2d3_create_device(&pdev->dev,0);
        if (devp->dev == NULL) {
                printk("[d2d3]%s: device_create create error.\n",__func__);
                ret = -EEXIST;
                goto failed_create_device;
        }
        ret = device_create_file(devp->dev, &dev_attr_debug);
        if(ret < 0){
                printk(KERN_ERR "[d2d3]%s: failed create device attr file.\n",__func__);
                goto failed_create_device_file;
        }
      #ifdef CONFIG_USE_OF
      	res = &memobj;
       	ret = find_reserve_block(pdev->dev.of_node->name,0);
      	if(ret < 0){
             pr_err("\nd2d3 memory resource undefined.\n");
             return -EFAULT;
     	}
      	printk("[d2d3]%s: hhhhhhhhhhhhhh[%d].\n",__func__,__LINE__);
      	res->start = (phys_addr_t)get_reserve_block_addr(ret);
      	res->end = res->start+ (phys_addr_t)get_reserve_block_size(ret)-1;
      #else
        /* get device memory */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
                pr_err("[d2d3]%s: can't get memory resource.\n",__func__);
                ret = -EFAULT;
                goto failed_get_resource;
        }
	#endif
        devp->mem_start = res->start;
        devp->mem_size  = res->end - res->start + 1;
        printk("[d2d3]%s: mem_start = 0x%x, mem_size = 0x%x.\n",__func__, devp->mem_start,devp->mem_size);
#ifdef CONFIG_USE_OF
     	if (pdev->dev.of_node) {
               	ret = of_property_read_u32(pdev->dev.of_node,"irq",&(res->start));
              	if(ret) {
                       pr_err("don't find d2d3  match irq\n");
                     	goto failed_get_resource;
             	}
              res->end = res->start;
              res->flags = IORESOURCE_IRQ;
      	}
#else
	/*get d2d3's irq*/
        res = platform_get_resource(pdev,IORESOURCE_MEM,0);
        if (!res) {
                pr_err("[d2d3]%s: can't get irq resource.\n",__func__);
                ret = -EFAULT;
                goto failed_get_resource;
        }
#endif
        devp->irq = res->start;
        sprintf(devp->vfm_name,"%s",VFM_NAME);
        platform_set_drvdata(pdev,(void *)devp);
        dev_set_drvdata(devp->dev,(void *)devp);

        vf_receiver_init(&d2d3_vf_recv, devp->vfm_name, &d2d3_vf_receiver, NULL);
        vf_reg_receiver(&d2d3_vf_recv);

        vf_provider_init(&d2d3_vf_prov, devp->vfm_name, &d2d3_vf_provider, NULL);
        return ret;
failed_get_resource:
        device_remove_file(&pdev->dev,&dev_attr_debug);
failed_create_device_file:
        device_del(&pdev->dev);
failed_create_device:
        cdev_del(&devp->cdev);
failed_add_cdev:
        kfree(devp);
failed_kmalloc_devp:
        return ret;
}