From patchwork Wed May 13 07:25:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 6394611 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F0DD49F399 for ; Wed, 13 May 2015 07:25:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C03F6203AB for ; Wed, 13 May 2015 07:25:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69338203F7 for ; Wed, 13 May 2015 07:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbbEMHZe (ORCPT ); Wed, 13 May 2015 03:25:34 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:30641 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635AbbEMHZb (ORCPT ); Wed, 13 May 2015 03:25:31 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NOA00KN11YHMA40@mailout1.samsung.com>; Wed, 13 May 2015 16:25:29 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 97.83.28411.86CF2555; Wed, 13 May 2015 16:25:28 +0900 (KST) X-AuditID: cbfee68e-f79c56d000006efb-85-5552fc68ac6f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A1.44.03871.86CF2555; Wed, 13 May 2015 16:25:28 +0900 (KST) Received: from localhost.localdomain ([10.252.83.121]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NOA00AN01YCD160@mmp2.samsung.com>; Wed, 13 May 2015 16:25:28 +0900 (KST) From: Seung-Woo Kim To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, k.debski@samsung.com, mchehab@osg.samsung.com Cc: m.szyprowski@samsung.com, s.nawrocki@samsung.com, sw0312.kim@samsung.com Subject: [PATCH] s5p-mfc: fix state check from encoder queue_setup Date: Wed, 13 May 2015 16:25:25 +0900 Message-id: <1431501925-16905-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsWyRsSkQDfjT1CoweIGFYsfry+wWfRs2Mpq MeP8PiaLtUfuslusflZhcfhNO1Bo8ks2B3aPLf132T36tqxi9Pi8SS6AOYrLJiU1J7MstUjf LoEr48K3jSwFU7kqunftYWtgPMLRxcjJISFgItF+YRobhC0mceHeeiCbi0NIYCmjxIS268ww RYfXdbFDJKYzSnxrbWAESQgJ/GCUOLxMA8RmE9CR2L/kNyuILSJQLHHz9nUmEJtZwEfi+Zf9 YHFhASeJv/8PsYDYLAKqEk9WnAHbzCvgJvHhyU1WiGUKEgvuvQW7QkLgPZvEg0dToBoEJL5N BmnmAErISmw6AHWcpMTBFTdYJjAKLmBkWMUomlqQXFCclF5kpFecmFtcmpeul5yfu4kRGKCn /z3r28F484D1IUYBDkYlHl6FDUGhQqyJZcWVuYcYTYE2TGSWEk3OB8ZBXkm8obGZkYWpiamx kbmlmZI4b4LUz2AhgfTEktTs1NSC1KL4otKc1OJDjEwcnFINjFMM/6YVnJJRTkpZ9rwq55mO rJP5+8D3Pqxaxge+Lj2VGvrTounA/cyZv3fzqXw4Zb/n2bv/jnEanI6b6v+sCZ/MLC7wp21J msClSbO+lzzPqctSXPRFdZ783NS96XxOW65vlf93SGGt9y5ul/3/rpmdSNGUY5uvZr/hoeT0 DvHQ37dPWkr5pymxFGckGmoxFxUnAgChRIdASwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42I5/e+xoG7Gn6BQgyUT5Cx+vL7AZtGzYSur xYzz+5gs1h65y26x+lmFxeE37UChyS/ZHNg9tvTfZffo27KK0ePzJrkA5qgGRpuM1MSU1CKF 1Lzk/JTMvHRbJe/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoOVKCmWJOaVAoYDE4mIl fTtME0JD3HQtYBojdH1DguB6jAzQQMIaxowL3zayFEzlqujetYetgfEIRxcjJ4eEgInE4XVd 7BC2mMSFe+vZuhi5OIQEpjNKfGttYARJCAn8YJQ4vEwDxGYT0JHYv+Q3K4gtIlAscfP2dSYQ m1nAR+L5l/1gcWEBJ4m//w+xgNgsAqoST1acYQOxeQXcJD48uckKsUxBYsG9t2wTGLkXMDKs YhRNLUguKE5KzzXSK07MLS7NS9dLzs/dxAgO/2fSOxhXNVgcYhTgYFTi4VXYEBQqxJpYVlyZ e4hRgoNZSYR36TugEG9KYmVValF+fFFpTmrxIUZToO0TmaVEk/OBsZlXEm9obGJmZGlkbmhh ZGyuJM57Mt8nVEggPbEkNTs1tSC1CKaPiYNTqoGRc0XKcvejt3+s/uF8J/aM83P3d2ffT9D5 t2LyLj77rIVtmzY1ce98dXRD4d4HRQdfrK6dd6yQJ7S3mv3Ab5HbsaXr/klPO5Nys5/F5SjP vp+HrK8v983qbKp0znx4n9V2cZ8tm/QMESGmJdYPvaxNp+UuXM/8anrJxP6kh/ez3qx5dUKE /fOvKUosxRmJhlrMRcWJAFIQ9S2VAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP MFCINST_GOT_INST state is set to encoder context with set_format only for catpure 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 to encoder to check MFCINST_GOT_INST state only for capture buffer from queue_setup. Signed-off-by: Seung-Woo Kim Reviewed-by: Andrzej Hajda Acked-by: Kamil Debski --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index e65993f..2e57e9f 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -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 (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->state != MFCINST_GOT_INST) { + mfc_err("inavlid state: %d\n", ctx->state); + return -EINVAL; + } + if (ctx->dst_fmt) *plane_count = ctx->dst_fmt->num_planes; else