Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d44da046 authored by Seung-Woo Kim's avatar Seung-Woo Kim Committed by Mauro Carvalho Chehab
Browse files

[media] s5p-mfc: fix state check from encoder queue_setup



MFCINST_GOT_INST state is set to encoder context with set_format
only for capture buffer. In queue_setup of encoder called during
reqbufs, it is checked MFCINST_GOT_INST state for both capture
and output buffer. So this patch fixes encoder to check
MFCINST_GOT_INST state only for capture buffer from queue_setup.

Signed-off-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 4f50efad
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1819,11 +1819,12 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq,
	struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv);
	struct s5p_mfc_dev *dev = ctx->dev;

	if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
		if (ctx->state != MFCINST_GOT_INST) {
			mfc_err("inavlid state: %d\n", ctx->state);
			return -EINVAL;
		}
	if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {

		if (ctx->dst_fmt)
			*plane_count = ctx->dst_fmt->num_planes;
		else