From patchwork Sun Oct 29 18:34:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 739950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8C6FC00142 for ; Sun, 29 Oct 2023 18:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230470AbjJ2SqD (ORCPT ); Sun, 29 Oct 2023 14:46:03 -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 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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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)