From patchwork Tue Oct 21 11:07:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 5114331 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9852A9F374 for ; Tue, 21 Oct 2014 11:08:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F22D2011E for ; Tue, 21 Oct 2014 11:08:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3B4620123 for ; Tue, 21 Oct 2014 11:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932366AbaJULIS (ORCPT ); Tue, 21 Oct 2014 07:08:18 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:62599 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932347AbaJULIO (ORCPT ); Tue, 21 Oct 2014 07:08:14 -0400 Received: by mail-pa0-f51.google.com with SMTP id lj1so1199616pab.10 for ; Tue, 21 Oct 2014 04:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=p8/mcbHCP/n4F70wCZzKuGNK164fQwI0TaExeQ2YLR4=; b=SrfQYCmhGm7PnptGXXsSEo3GeFmhsluc6VmmGNEqTPMmfQxyRlQmFjR7nmh6R2VTjd vwhULfIfAqFakTv79gFUowNNaaUJHbKh/g+16aSQ0lhUcSPfJRmLNC8AAhRDELowpBPS aRPkiBuMAPDt/REqKfLfkROnvIWT7myAP+QzPtnNc0uwe3b61rXbQxMCos39mPNfQU5Q VjQa6xJNVqVtij6Gaw2zvO3HqRGuzB5Uzf6GsTSI4LYz6joWDi/OINXh5sjYXdT1ccBq /wune0RhrOpNelJybbDjDzj5w7izMUYJVBwlkwHFdxXr1qwW91s7xsBOo+eJ3Q/g5F2h IBDQ== X-Received: by 10.66.196.1 with SMTP id ii1mr33760513pac.79.1413889694142; Tue, 21 Oct 2014 04:08:14 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id s9sm11680849pdp.1.2014.10.21.04.08.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 04:08:13 -0700 (PDT) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: k.debski@samsung.com, wuchengli@chromium.org, posciak@chromium.org, arun.m@samsung.com, ihf@chromium.org, prathyush.k@samsung.com, kiran@chromium.org, arunkk.samsung@gmail.com Subject: [PATCH v3 12/13] [media] s5p-mfc: fix V4L2_CID_MIN_BUFFERS_FOR_CAPTURE on resolution change. Date: Tue, 21 Oct 2014 16:37:06 +0530 Message-Id: <1413889627-8431-13-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1413889627-8431-1-git-send-email-arun.kk@samsung.com> References: <1413889627-8431-1-git-send-email-arun.kk@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 From: Pawel Osciak G_CTRL on V4L2_CID_MIN_BUFFERS_FOR_CAPTURE will fail if userspace happens to query it after getting a resolution change event and before the codec has a chance to parse the header and switch to an initialized state. Signed-off-by: Pawel Osciak Signed-off-by: Kiran AVND Signed-off-by: Arun Kumar K --- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index a98fe02..de90465 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -740,7 +740,8 @@ static int s5p_mfc_dec_g_v_ctrl(struct v4l2_ctrl *ctrl) ctx->state < MFCINST_ABORT) { ctrl->val = ctx->pb_count; break; - } else if (ctx->state != MFCINST_INIT) { + } else if (ctx->state != MFCINST_INIT && + ctx->state != MFCINST_RES_CHANGE_END) { v4l2_err(&dev->v4l2_dev, "Decoding not initialised\n"); return -EINVAL; }