static unsigned int g2d_poll(struct file *file, struct poll_table_struct *wait) { struct g2d_ctx *ctx = fh2ctx(file->private_data); struct g2d_dev *dev = ctx->dev; unsigned int res; mutex_lock(&dev->mutex); res = v4l2_m2m_poll(file, ctx->m2m_ctx, wait); mutex_unlock(&dev->mutex); return res; }
static int g2d_release(struct file *file) { struct g2d_dev *dev = video_drvdata(file); struct g2d_ctx *ctx = fh2ctx(file->private_data); v4l2_ctrl_handler_free(&ctx->ctrl_handler); v4l2_fh_del(&ctx->fh); v4l2_fh_exit(&ctx->fh); kfree(ctx); v4l2_info(&dev->v4l2_dev, "instance closed\n"); return 0; }
static int g2d_mmap(struct file *file, struct vm_area_struct *vma) { struct g2d_ctx *ctx = fh2ctx(file->private_data); struct g2d_dev *dev = ctx->dev; int ret; if (mutex_lock_interruptible(&dev->mutex)) return -ERESTARTSYS; ret = v4l2_m2m_mmap(file, ctx->m2m_ctx, vma); mutex_unlock(&dev->mutex); return ret; }
static int g2d_mmap(struct file *file, struct vm_area_struct *vma) { struct g2d_ctx *ctx = fh2ctx(file->private_data); return v4l2_m2m_mmap(file, ctx->m2m_ctx, vma); }
static unsigned int g2d_poll(struct file *file, struct poll_table_struct *wait) { struct g2d_ctx *ctx = fh2ctx(file->private_data); return v4l2_m2m_poll(file, ctx->m2m_ctx, wait); }