Thread (2 messages) 2 messages, 2 authors, 2016-06-30
STALE3662d

[PATCH] media: s5p-mfc fix vidioc_g_crop() to return crop info.

From: Shuah Khan <hidden>
Date: 2016-06-29 23:34:01
Also in: linux-media, lkml
Subsystem: media input infrastructure (v4l/dvb), the rest · Maintainers: Mauro Carvalho Chehab, Linus Torvalds

Fix vidioc_g_crop() to report crop information irrepective of ctx state.
g_crop is expected to return crop information as long as the passed in
v4l2_crop type field is vV4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE.

Signed-off-by: Shuah Khan <redacted>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index a01a373..4ace9e1 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -774,12 +774,9 @@ static int vidioc_g_crop(struct file *file, void *priv,
 	struct s5p_mfc_dev *dev = ctx->dev;
 	u32 left, right, top, bottom;
 
-	if (ctx->state != MFCINST_HEAD_PARSED &&
-	ctx->state != MFCINST_RUNNING && ctx->state != MFCINST_FINISHING
-					&& ctx->state != MFCINST_FINISHED) {
-			mfc_err("Cannont set crop\n");
-			return -EINVAL;
-		}
+	if (cr->type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
+		return -EINVAL;
+
 	if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_H264) {
 		left = s5p_mfc_hw_call(dev->mfc_ops, get_crop_info_h, ctx);
 		right = left >> S5P_FIMV_SHARED_CROP_RIGHT_SHIFT;
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help