u32 fimc_is_video_poll(struct file *file, struct fimc_is_video_ctx *vctx, struct poll_table_struct *wait) { u32 ret = 0; u32 video_type = vctx->type; switch (video_type) { case FIMC_IS_VIDEO_TYPE_OUTPUT: ret = vb2_poll(vctx->q_src.vbq, file, wait); break; case FIMC_IS_VIDEO_TYPE_CAPTURE: ret = vb2_poll(vctx->q_dst.vbq, file, wait); break; case FIMC_IS_VIDEO_TYPE_M2M: merr("video poll is not supported", vctx); ret = -EINVAL; break; default: merr("invalid type(%d)", vctx, video_type); break; } return ret; }
unsigned int vb2_fop_poll(struct file *file, poll_table *wait) { struct video_device *vdev = video_devdata(file); struct vb2_queue *q = vdev->queue; struct mutex *lock = q->lock ? q->lock : vdev->lock; unsigned res; void *fileio; /* * If this helper doesn't know how to lock, then you shouldn't be using * it but you should write your own. */ WARN_ON(!lock); if (lock && mutex_lock_interruptible(lock)) return POLLERR; fileio = q->fileio; res = vb2_poll(vdev->queue, file, wait); /* If fileio was started, then we have a new queue owner. */ if (!fileio && q->fileio) q->owner = file->private_data; if (lock) mutex_unlock(lock); return res; }
static unsigned int vcap_poll(struct file *file, struct poll_table_struct *wait) { struct vcap_client_data *c_data = file->private_data; struct vb2_queue *q; unsigned int mask = 0; switch (c_data->op_mode) { case VC_VCAP_OP: q = &c_data->vc_vidq; return vb2_poll(q, file, wait); case VP_VCAP_OP: q = &c_data->vp_in_vidq; mask = poll_work(q, file, wait, 0); q = &c_data->vp_out_vidq; mask |= poll_work(q, file, wait, 1); return mask; case VC_AND_VP_VCAP_OP: q = &c_data->vp_out_vidq; mask = poll_work(q, file, wait, 0); return mask; default: pr_err("VCAP Error: %s: Unknown operation mode", __func__); return POLLERR; } return 0; }
static unsigned int fimc_capture_poll(struct file *file, struct poll_table_struct *wait) { struct fimc_dev *fimc = video_drvdata(file); return vb2_poll(&fimc->vid_cap.vbq, file, wait); }
static unsigned int fimc_is_bayer_video_poll(struct file *file, struct poll_table_struct *wait) { struct fimc_is_core *isp = video_drvdata(file); dbg_sensor("%s\n", __func__); return vb2_poll(&isp->video_sensor.common.vbq, file, wait); }
static unsigned int unicam_camera_poll(struct file *file, poll_table * pt) { struct soc_camera_device *icd = file->private_data; pr_debug("-enter"); pr_debug("-exit"); return vb2_poll(&icd->vb2_vidq, file, pt); }
static unsigned int fimc_capture_poll(struct file *file, struct poll_table_struct *wait) { struct fimc_ctx *ctx = file->private_data; struct fimc_dev *fimc = ctx->fimc_dev; return vb2_poll(&fimc->vid_cap.vbq, file, wait); }
static unsigned int pwc_video_poll(struct file *file, poll_table *wait) { struct pwc_device *pdev = video_drvdata(file); if (!pdev->udev) return POLL_ERR; return vb2_poll(&pdev->vb_queue, file, wait); }
static unsigned int fimc_is_isp_poll(struct file *file, struct poll_table_struct *wait) { struct fimc_is_dev *is_dev; is_dev = video_drvdata(file); return vb2_poll(&is_dev->video[FIMC_IS_VIDEO_NUM_BAYER].vbq, file, wait); }
static unsigned int mxr_video_poll(struct file *file, struct poll_table_struct *wait) { struct mxr_layer *layer = video_drvdata(file); mxr_dbg(layer->mdev, "%s:%d\n", __func__, __LINE__); return vb2_poll(&layer->vb_queue, file, wait); }
static unsigned int fimc_is_scc_video_poll(struct file *file, struct poll_table_struct *wait) { struct fimc_is_video_ctx *video_ctx = file->private_data; dbg("%s\n", __func__); return vb2_poll(&video_ctx->vbq, file, wait); }
/* * Poll the video queue. * * This function implements video queue polling and is intended to be used by * the device poll handler. */ unsigned int uvcg_queue_poll(struct uvc_video_queue *queue, struct file *file, poll_table *wait) { unsigned int ret; mutex_lock(&queue->mutex); ret = vb2_poll(&queue->queue, file, wait); mutex_unlock(&queue->mutex); return ret; }
static unsigned int xvip_dma_poll(struct file *file, poll_table *wait) { struct v4l2_fh *vfh = file->private_data; struct xvip_dma *dma = to_xvip_dma(vfh->vdev); int ret; mutex_lock(&dma->lock); ret = vb2_poll(&dma->queue, file, wait); mutex_unlock(&dma->lock); return ret; }
static unsigned int myvivi_poll(struct file *file, struct poll_table_struct *wait) { struct v4l2_fh *fh = file->private_data; unsigned int res; res = vb2_poll(&myvivi_vb_vidqueue, file, wait); if (v4l2_event_pending(fh)) res |= POLLPRI; else poll_wait(file, &fh->wait, wait); return res; }
static unsigned int camera_v4l2_poll(struct file *filep, struct poll_table_struct *wait) { int rc = 0; struct camera_v4l2_private *sp = fh_to_private(filep->private_data); if (sp->is_vb2_valid == 1) rc = vb2_poll(&sp->vb2_q, filep, wait); poll_wait(filep, &sp->fh.wait, wait); if (v4l2_event_pending(&sp->fh)) rc |= POLLPRI; return rc; }
static unsigned int fimc_lite_poll(struct file *file, struct poll_table_struct *wait) { struct fimc_lite *fimc = video_drvdata(file); int ret; if (mutex_lock_interruptible(&fimc->lock)) return POLL_ERR; ret = vb2_poll(&fimc->vb_queue, file, wait); mutex_unlock(&fimc->lock); return ret; }
int fimc_is_video_poll(struct file *file, struct fimc_is_video_ctx *vctx, struct poll_table_struct *wait) { u32 ret = 0; struct fimc_is_queue *queue; BUG_ON(!vctx); queue = GET_QUEUE(vctx); ret = vb2_poll(queue->vbq, file, wait); return ret; }
/* * msm_fd_poll - Fd device pool method. * @file: Pointer to file struct. * @wait: Pointer to pool table struct. */ static unsigned int msm_fd_poll(struct file *file, struct poll_table_struct *wait) { struct fd_ctx *ctx = msm_fd_ctx_from_fh(file->private_data); unsigned int ret; ret = vb2_poll(&ctx->vb2_q, file, wait); if (atomic_read(&ctx->subscribed_for_event)) { poll_wait(file, &ctx->fh.wait, wait); if (v4l2_event_pending(&ctx->fh)) ret |= POLLPRI; } return ret; }
static unsigned int hwcam_dev_vo_poll( struct file* filep, struct poll_table_struct* wait) { unsigned int rc = 0; hwcam_dev_t* cam = video_drvdata(filep); hwcam_user_t* user = VO2USER(filep->private_data); BUG_ON(!cam || !user); if (user->f_format_valid) { rc = vb2_poll(&user->vb2q, filep, wait); } poll_wait(filep, &user->eq.wait, wait); if (v4l2_event_pending(&user->eq)) { rc |= POLLPRI | POLLOUT | POLLIN; } return rc; }
static unsigned int mx3_camera_poll(struct file *file, poll_table *pt) { struct soc_camera_device *icd = file->private_data; return vb2_poll(&icd->vb2_vidq, file, pt); }
static unsigned int iss_video_poll(struct file *file, poll_table *wait) { struct iss_video_fh *vfh = to_iss_video_fh(file->private_data); return vb2_poll(&vfh->queue, file, wait); }
/* * Poll the video queue. * * This function implements video queue polling and is intended to be used by * the device poll handler. */ __poll_t uvcg_queue_poll(struct uvc_video_queue *queue, struct file *file, poll_table *wait) { return vb2_poll(&queue->queue, file, wait); }
static unsigned int nxp_video_poll(struct file *file, struct poll_table_struct *tbl) { struct nxp_video *me = file->private_data; return vb2_poll(me->vbq, file, tbl); }