static int gsc_m2m_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *reqbufs) { struct gsc_ctx *ctx = fh_to_ctx(fh); struct gsc_dev *gsc = ctx->gsc_dev; struct gsc_frame *frame; u32 max_cnt; max_cnt = (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? gsc->variant->in_buf_cnt : gsc->variant->out_buf_cnt; if (reqbufs->count > max_cnt) return -EINVAL; else if (reqbufs->count == 0) { if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) gsc_ctx_state_lock_clear(GSC_SRC_FMT, ctx); else gsc_ctx_state_lock_clear(GSC_DST_FMT, ctx); } gsc_set_protected_content(gsc, ctx->gsc_ctrls.drm_en->cur.val); frame = ctx_get_frame(ctx, reqbufs->type); frame->cacheable = ctx->gsc_ctrls.cacheable->val; gsc->vb2->set_cacheable(gsc->alloc_ctx, frame->cacheable); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int jpeg_enc_m2m_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *reqbufs) { struct jpeg_ctx *ctx = priv; return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int fimc_m2m_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *reqbufs) { struct fimc_ctx *ctx = fh_to_ctx(fh); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
int v4l2_m2m_ioctl_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *rb) { struct v4l2_fh *fh = file->private_data; return v4l2_m2m_reqbufs(file, fh->m2m_ctx, rb); }
/* * msm_jpegdma_reqbufs - V4l2 ioctl request buffers handler. * @file: Pointer to file struct. * @fh: V4l2 File handle. * @req: Pointer to v4l2_requestbuffer struct. */ static int msm_jpegdma_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *req) { struct jpegdma_ctx *ctx = msm_jpegdma_ctx_from_fh(fh); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, req); }
static int jpeg_dec_m2m_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *reqbufs) { struct jpeg_ctx *ctx = priv; struct vb2_queue *vq; vq = v4l2_m2m_get_vq(ctx->m2m_ctx, reqbufs->type); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int gsc_m2m_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *reqbufs) { struct gsc_ctx *ctx = fh_to_ctx(fh); struct gsc_dev *gsc = ctx->gsc_dev; u32 max_cnt; max_cnt = (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? gsc->variant->in_buf_cnt : gsc->variant->out_buf_cnt; if (reqbufs->count > max_cnt) return -EINVAL; return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int jpeg_dec_m2m_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *reqbufs) { struct jpeg_ctx *ctx = priv; struct vb2_queue *vq; vq = v4l2_m2m_get_vq(ctx->m2m_ctx, reqbufs->type); if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ctx->dev->vb2->set_cacheable(ctx->dev->alloc_ctx, ctx->input_cacheable); else if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) ctx->dev->vb2->set_cacheable(ctx->dev->alloc_ctx, ctx->output_cacheable); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int gsc_m2m_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *reqbufs) { struct gsc_ctx *ctx = fh_to_ctx(fh); struct gsc_dev *gsc = ctx->gsc_dev; u32 max_cnt; max_cnt = (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? gsc->variant->in_buf_cnt : gsc->variant->out_buf_cnt; if (reqbufs->count > max_cnt) { return -EINVAL; } else if (reqbufs->count == 0) { if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) gsc_ctx_state_lock_clear(GSC_SRC_FMT, ctx); else gsc_ctx_state_lock_clear(GSC_DST_FMT, ctx); } return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int rot_v4l2_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *reqbufs) { struct rot_ctx *ctx = priv; struct rot_dev *rot = ctx->rot_dev; struct rot_frame *frame; frame = ctx_get_frame(ctx, reqbufs->type); if (IS_ERR(frame)) return PTR_ERR(frame); if (frame == &ctx->s_frame) clear_bit(CTX_SRC, &ctx->flags); else if (frame == &ctx->d_frame) clear_bit(CTX_DST, &ctx->flags); frame->cacheable = ctx->cacheable; rot->vb2->set_cacheable(rot->alloc_ctx, frame->cacheable); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }
static int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *reqbufs) { struct g2d_ctx *ctx = priv; return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); }