Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2348850rdh; Sun, 29 Oct 2023 11:47:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJyodhs308ic479HSemtor8qXuTWhb+Ts00yfQkuY2JIIwGtKQMJ+w1kkfwT6xzaSp2QM6 X-Received: by 2002:a05:6358:6f1a:b0:169:4412:b6ef with SMTP id r26-20020a0563586f1a00b001694412b6efmr11772630rwn.7.1698605233724; Sun, 29 Oct 2023 11:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698605233; cv=none; d=google.com; s=arc-20160816; b=NcnyP34jaZFXENiJfg1gS+WpdHo/qo5vywISx9AevcLcYcbmIlPbbDX2251ReNp/gR wx5YfKN7mDE05NbotyfNbCa2dI9SLlFODN3epFaSNIuGWtwtUEPm1Yyx9qz3y3MJywDM rvlq3wQNJDvdaRfRpuZxN2cA9LSrmMym4HsKDI0d60vXpFouiE0ClpK0Vro1CRLGq9cP CwFSvoJRlTVhrCDpn+uR1FAXTCtprMKIMGhn1Alg7dzy+vfa1HBbYAhic2JnyGqijnIt 1Vk0EaOVcNXvzOTqlWG/WxO5Cd0r8MmFXLE6BN4DStwC/4HUp1yzfEHktSsyPZeU17jm /1hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UMyPdcE6zeOq+5y1/omox7ixHdl35HYxXzyXW/wl23I=; fh=mpVSHlz6QLTMQJyYfdyLOAes1Kk5kund3qIBSdmv/MI=; b=U7JTyFVXDhKgvaTWMNgHzqd4jEfW712BVfH08/0HUlt7+T2e+deA9vFbaODBe/Cfgz 17fS1RpGwpee/0amVZDB9otq6L8+ExF30/FWBhE4tSpKu/hQsueM16OCsHrT3LBJi3Up 1oPQE2G+dyZCBNU6fNZFq7SYrLqyOt9UfTmtgBAG1c+/AzpMOcdwVp6ldXwvzsvCuRZ5 jvSwL49iQNhZmdPuG2xiv+d6vYoqrG8RlOa4oVzccxizmtfNNY8W7o1eyVEPuq+ss+8D d8UPKBXKGvNiPs37OFv9IGZRfGM5CRt42MufAeZXk+iUw+lThi8y2ET6AYsJJVyy9zRQ fjIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=lE3nli2o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y15-20020a17090a784f00b0026d034f6baesi2822966pjl.117.2023.10.29.11.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 11:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=lE3nli2o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kwiboo.se Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8C7118065022; Sun, 29 Oct 2023 11:46:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230468AbjJ2SqK (ORCPT + 99 others); Sun, 29 Oct 2023 14:46:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbjJ2Spy (ORCPT ); Sun, 29 Oct 2023 14:45:54 -0400 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29C2BF9; Sun, 29 Oct 2023 11:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1698605142; bh=UMyPdcE6zeOq+5y1/omox7ixHdl35HYxXzyXW/wl23I=; b=lE3nli2oYpMorwQo+LsSbQHSSDPujm7p/vNaHj71imDFPnRp4hJkOYFOdU5M1kq674n3xxfFz qWeso4OPawlpbmDuV9yV3caMVQF+9j1vgVJViFMcLso25cnjcjGrgoM9CLTcYcMo3Ejzo2vHKmE mXsBmG3qhvY87dWcQyBsIEAZqXlhPYbsxK0W2+0Qkq3gc2GSkfqMcyaytvsqVbJj7pCVDjrW5ef rq07aOGI9zWyYOEQYcEpqcQ04L6R7SGStbhKLxYEJBGopWRUoLSn2YBYk4Rehjuu/+vKp2KSwVQ 5jkzhGs89+FrwXQn32eXyTTZ/0jlFHhsxwqx1q6zLd3g== From: Jonas Karlman To: Ezequiel Garcia , Mauro Carvalho Chehab , "Greg Kroah-Hartman" Cc: Alex Bee , Nicolas Dufresne , Benjamin Gaignard , Sebastian Fricke , Christopher Obbard , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Jonas Karlman Subject: [PATCH v3 05/10] media: rkvdec: h264: Remove SPS validation at streaming start Date: Sun, 29 Oct 2023 18:34:12 +0000 Message-ID: <20231029183427.1781554-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029183427.1781554-1-jonas@kwiboo.se> References: <20231029183427.1781554-1-jonas@kwiboo.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-ForwardEmail-ID: 653ea5cc8fe0ffca230b0f49 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 29 Oct 2023 11:46:21 -0700 (PDT) SPS parameters is validated in try_ctrl() ops so there is no need to re-validate when streaming starts. Remove the unnecessary call to validate sps at streaming start. Suggested-by: Ezequiel Garcia Signed-off-by: Jonas Karlman --- v3: - New patch drivers/staging/media/rkvdec/rkvdec-h264.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c index 8bce8902b8dd..815d5359ddd5 100644 --- a/drivers/staging/media/rkvdec/rkvdec-h264.c +++ b/drivers/staging/media/rkvdec/rkvdec-h264.c @@ -1070,17 +1070,6 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) struct rkvdec_dev *rkvdec = ctx->dev; struct rkvdec_h264_priv_tbl *priv_tbl; struct rkvdec_h264_ctx *h264_ctx; - struct v4l2_ctrl *ctrl; - int ret; - - ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl, - V4L2_CID_STATELESS_H264_SPS); - if (!ctrl) - return -EINVAL; - - ret = rkvdec_h264_validate_sps(ctx, ctrl->p_new.p_h264_sps); - if (ret) - return ret; h264_ctx = kzalloc(sizeof(*h264_ctx), GFP_KERNEL); if (!h264_ctx) @@ -1089,8 +1078,8 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) priv_tbl = dma_alloc_coherent(rkvdec->dev, sizeof(*priv_tbl), &h264_ctx->priv_tbl.dma, GFP_KERNEL); if (!priv_tbl) { - ret = -ENOMEM; - goto err_free_ctx; + kfree(h264_ctx); + return -ENOMEM; } h264_ctx->priv_tbl.size = sizeof(*priv_tbl); @@ -1100,10 +1089,6 @@ static int rkvdec_h264_start(struct rkvdec_ctx *ctx) ctx->priv = h264_ctx; return 0; - -err_free_ctx: - kfree(h264_ctx); - return ret; } static void rkvdec_h264_stop(struct rkvdec_ctx *ctx) -- 2.42.0