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: 9206323 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 C2CD660752 for ; Wed, 29 Jun 2016 23:34:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4C73285C3 for ; Wed, 29 Jun 2016 23:34:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A739F28637; Wed, 29 Jun 2016 23:34:20 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A22C285C3 for ; Wed, 29 Jun 2016 23:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751828AbcF2XeA (ORCPT ); Wed, 29 Jun 2016 19:34:00 -0400 Received: from resqmta-po-02v.sys.comcast.net ([96.114.154.161]:54390 "EHLO resqmta-po-02v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbcF2Xd7 (ORCPT ); Wed, 29 Jun 2016 19:33:59 -0400 Received: from resomta-po-10v.sys.comcast.net ([96.114.154.234]) by resqmta-po-02v.sys.comcast.net with SMTP id IOuwbQaUdBAXOIOzWbYaq8; 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=JRvOfMx5ipI0Nd8URCdZwU4MYNG+EAIDJR0vExiAD3xDeKYnkh1uIFGFgAwFOTwZI WqOD0JAP4j03lwqgNYv94OdrpU4XnTdO3fjNqKY9MhjPLF+PRy+F2jUgq3HO2yFS3E fpxDYIVoXnWRrPgTvdEkviqdUlLiisun+cLH0yK1zVYTbu7GUL5itanZZ9dRLCsn0i QN0XOex9mRVdS6782JFopSaDTN4ZNXvs94jrStqRcH8OFEo+nlMBYs1UWz10Kx5ZfE t2xjlXqrua0b56axOTx/G0JZpGa8JNrOLMwkD5DX0PRv17xhlGlN/JUZ4ujHzYDfDG 3bfjqEWX2pesQ== 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 Cc: Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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;