Loading drivers/media/platform/msm/ais/fd/msm_fd_dev.c +15 −6 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ static int msm_fd_open(struct file *file) ctx->vb2_q.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; ctx->vb2_q.io_modes = VB2_USERPTR; ctx->vb2_q.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; mutex_init(&ctx->lock); ret = vb2_queue_init(&ctx->vb2_q); if (ret < 0) { dev_err(device->dev, "Error queue init\n"); Loading Loading @@ -480,7 +481,9 @@ static int msm_fd_release(struct file *file) msm_cpp_vbif_register_error_handler((void *)ctx, VBIF_CLIENT_FD, NULL); mutex_lock(&ctx->lock); vb2_queue_release(&ctx->vb2_q); mutex_unlock(&ctx->lock); vfree(ctx->stats); Loading Loading @@ -510,7 +513,9 @@ static unsigned int msm_fd_poll(struct file *file, struct fd_ctx *ctx = msm_fd_ctx_from_fh(file->private_data); unsigned int ret; mutex_lock(&ctx->lock); ret = vb2_poll(&ctx->vb2_q, file, wait); mutex_unlock(&ctx->lock); if (atomic_read(&ctx->subscribed_for_event)) { poll_wait(file, &ctx->fh.wait, wait); Loading Loading @@ -748,9 +753,9 @@ static int msm_fd_reqbufs(struct file *file, int ret; struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); mutex_lock(&ctx->fd_device->recovery_lock); mutex_lock(&ctx->lock); ret = vb2_reqbufs(&ctx->vb2_q, req); mutex_unlock(&ctx->fd_device->recovery_lock); mutex_unlock(&ctx->lock); return ret; } Loading @@ -766,9 +771,9 @@ static int msm_fd_qbuf(struct file *file, void *fh, int ret; struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); mutex_lock(&ctx->fd_device->recovery_lock); mutex_lock(&ctx->lock); ret = vb2_qbuf(&ctx->vb2_q, pb); mutex_unlock(&ctx->fd_device->recovery_lock); mutex_unlock(&ctx->lock); return ret; } Loading @@ -785,9 +790,9 @@ static int msm_fd_dqbuf(struct file *file, int ret; struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); mutex_lock(&ctx->fd_device->recovery_lock); mutex_lock(&ctx->lock); ret = vb2_dqbuf(&ctx->vb2_q, pb, file->f_flags & O_NONBLOCK); mutex_unlock(&ctx->fd_device->recovery_lock); mutex_unlock(&ctx->lock); return ret; } Loading @@ -803,7 +808,9 @@ static int msm_fd_streamon(struct file *file, struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); int ret; mutex_lock(&ctx->lock); ret = vb2_streamon(&ctx->vb2_q, buf_type); mutex_unlock(&ctx->lock); if (ret < 0) dev_err(ctx->fd_device->dev, "Stream on fails\n"); Loading @@ -822,7 +829,9 @@ static int msm_fd_streamoff(struct file *file, struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); int ret; mutex_lock(&ctx->lock); ret = vb2_streamoff(&ctx->vb2_q, buf_type); mutex_unlock(&ctx->lock); if (ret < 0) dev_err(ctx->fd_device->dev, "Stream off fails\n"); Loading drivers/media/platform/msm/ais/fd/msm_fd_dev.h +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ struct fd_ctx { struct msm_fd_mem_pool mem_pool; struct msm_fd_stats *stats; struct msm_fd_buf_handle work_buf; struct mutex lock; }; /* Loading Loading
drivers/media/platform/msm/ais/fd/msm_fd_dev.c +15 −6 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ static int msm_fd_open(struct file *file) ctx->vb2_q.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; ctx->vb2_q.io_modes = VB2_USERPTR; ctx->vb2_q.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; mutex_init(&ctx->lock); ret = vb2_queue_init(&ctx->vb2_q); if (ret < 0) { dev_err(device->dev, "Error queue init\n"); Loading Loading @@ -480,7 +481,9 @@ static int msm_fd_release(struct file *file) msm_cpp_vbif_register_error_handler((void *)ctx, VBIF_CLIENT_FD, NULL); mutex_lock(&ctx->lock); vb2_queue_release(&ctx->vb2_q); mutex_unlock(&ctx->lock); vfree(ctx->stats); Loading Loading @@ -510,7 +513,9 @@ static unsigned int msm_fd_poll(struct file *file, struct fd_ctx *ctx = msm_fd_ctx_from_fh(file->private_data); unsigned int ret; mutex_lock(&ctx->lock); ret = vb2_poll(&ctx->vb2_q, file, wait); mutex_unlock(&ctx->lock); if (atomic_read(&ctx->subscribed_for_event)) { poll_wait(file, &ctx->fh.wait, wait); Loading Loading @@ -748,9 +753,9 @@ static int msm_fd_reqbufs(struct file *file, int ret; struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); mutex_lock(&ctx->fd_device->recovery_lock); mutex_lock(&ctx->lock); ret = vb2_reqbufs(&ctx->vb2_q, req); mutex_unlock(&ctx->fd_device->recovery_lock); mutex_unlock(&ctx->lock); return ret; } Loading @@ -766,9 +771,9 @@ static int msm_fd_qbuf(struct file *file, void *fh, int ret; struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); mutex_lock(&ctx->fd_device->recovery_lock); mutex_lock(&ctx->lock); ret = vb2_qbuf(&ctx->vb2_q, pb); mutex_unlock(&ctx->fd_device->recovery_lock); mutex_unlock(&ctx->lock); return ret; } Loading @@ -785,9 +790,9 @@ static int msm_fd_dqbuf(struct file *file, int ret; struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); mutex_lock(&ctx->fd_device->recovery_lock); mutex_lock(&ctx->lock); ret = vb2_dqbuf(&ctx->vb2_q, pb, file->f_flags & O_NONBLOCK); mutex_unlock(&ctx->fd_device->recovery_lock); mutex_unlock(&ctx->lock); return ret; } Loading @@ -803,7 +808,9 @@ static int msm_fd_streamon(struct file *file, struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); int ret; mutex_lock(&ctx->lock); ret = vb2_streamon(&ctx->vb2_q, buf_type); mutex_unlock(&ctx->lock); if (ret < 0) dev_err(ctx->fd_device->dev, "Stream on fails\n"); Loading @@ -822,7 +829,9 @@ static int msm_fd_streamoff(struct file *file, struct fd_ctx *ctx = msm_fd_ctx_from_fh(fh); int ret; mutex_lock(&ctx->lock); ret = vb2_streamoff(&ctx->vb2_q, buf_type); mutex_unlock(&ctx->lock); if (ret < 0) dev_err(ctx->fd_device->dev, "Stream off fails\n"); Loading
drivers/media/platform/msm/ais/fd/msm_fd_dev.h +1 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,7 @@ struct fd_ctx { struct msm_fd_mem_pool mem_pool; struct msm_fd_stats *stats; struct msm_fd_buf_handle work_buf; struct mutex lock; }; /* Loading