From patchwork Wed Jun 29 23:33:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9206327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3871060752 for ; Wed, 29 Jun 2016 23:36:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 271F1284AA for ; Wed, 29 Jun 2016 23:36:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 169E728609; Wed, 29 Jun 2016 23:36:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9623B284AA for ; Wed, 29 Jun 2016 23:36:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIOzw-0006wl-SM; Wed, 29 Jun 2016 23:34:24 +0000 Received: from resqmta-po-10v.sys.comcast.net ([2001:558:fe16:19:96:114:154:169]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIOzt-0006vp-Pz for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2016 23:34:22 +0000 Received: from resomta-po-10v.sys.comcast.net ([96.114.154.234]) by resqmta-po-10v.sys.comcast.net with SMTP id IOyfbHrOObI5JIOzWbwa2N; Wed, 29 Jun 2016 23:33:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1467243238; bh=ctTvJfEHGRTPNm2QyHzT9nBEva1UCiPdfWzcxnRbcls=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=WTQTVYW2NQ4XGi1UkJpD3Rb0wO0WtWFBjvggSTZNEldWfZIkpSXKBRCOHxPYKbIyf voLfiPecSKHak6aIrRQAM8YHpO+3qCo5nZE5WAWGQFoBOKAwPMo8FCU9glSwuC8oLb obgcV9ZaCAgW4UdZFLvqHUlr0+iGKw4wGYpDSM/2AOUX12rJth+Gdwd1jraAUEck3r nIb4vBsykG9ISTysLoehkOAH/qwHCQ8d9O7O9O72IeSbuHYYqjTOHwXkG4Xz2WzHA6 TaxXYdvfeF1w5I+0PXQrlmCb8bC1hwofy2FGax5KrQsaqSHF+cVJuOxw1ni1t6Vgok RMrwbrHnjdLsQ== Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-10v.sys.comcast.net with comcast id CnZx1t00L1LXgTt01nZxSD; Wed, 29 Jun 2016 23:33:58 +0000 Received: from shuah-XPS-13-9350.sisa.samsung.com (shuah-xps.internal [192.168.1.87]) by mail.gonehiking.org (Postfix) with ESMTP id 1F4599F2F6; Wed, 29 Jun 2016 17:33:57 -0600 (MDT) From: Shuah Khan To: kyungmin.park@samsung.com, k.debski@samsung.com, jtp.park@samsung.com, mchehab@kernel.org, javier@osg.samsung.com Subject: [PATCH] media: s5p-mfc fix vidioc_g_crop() to return crop info. Date: Wed, 29 Jun 2016 17:33:56 -0600 Message-Id: <1467243236-13395-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160629_163421_942149_7DE9915B X-CRM114-Status: UNSURE ( 7.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;