Lines Matching defs:func
707 struct vpu_func *func;
714 func = &vpu->encoder;
716 func = &vpu->decoder;
733 v4l2_fh_init(&inst->fh, func->vfd);
740 inst->fh.m2m_ctx = v4l2_m2m_ctx_init(func->m2m_dev, inst, vpu_m2m_queue_init);
791 int vpu_add_func(struct vpu_dev *vpu, struct vpu_func *func)
796 if (!vpu || !func)
799 if (func->vfd)
802 func->m2m_dev = v4l2_m2m_init(&vpu_m2m_ops);
803 if (IS_ERR(func->m2m_dev)) {
805 func->vfd = NULL;
806 return PTR_ERR(func->m2m_dev);
811 v4l2_m2m_release(func->m2m_dev);
819 if (func->type == VPU_CORE_TYPE_ENC) {
832 v4l2_m2m_release(func->m2m_dev);
836 func->vfd = vfd;
838 ret = v4l2_m2m_register_media_controller(func->m2m_dev, func->vfd, func->function);
840 v4l2_m2m_release(func->m2m_dev);
841 func->m2m_dev = NULL;
842 video_unregister_device(func->vfd);
843 func->vfd = NULL;
850 void vpu_remove_func(struct vpu_func *func)
852 if (!func)
855 if (func->m2m_dev) {
856 v4l2_m2m_unregister_media_controller(func->m2m_dev);
857 v4l2_m2m_release(func->m2m_dev);
858 func->m2m_dev = NULL;
860 if (func->vfd) {
861 video_unregister_device(func->vfd);
862 func->vfd = NULL;