예제 #1
0
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);
}
예제 #2
0
static void __gsc_m2m_job_abort(struct gsc_ctx *ctx)
{
	int ret;

	ret = gsc_m2m_ctx_stop_req(ctx);
	if ((ret == -ETIMEDOUT) || (ctx->state & GSC_CTX_ABORT)) {
		gsc_ctx_state_lock_clear(GSC_CTX_STOP_REQ | GSC_CTX_ABORT, ctx);
		gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR);
	}
}
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);
}