Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1674672rdf; Sun, 5 Nov 2023 09:07:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOwqTopKBl+0XsfA+sgrRDbIA37l+OnurdJwZ/4UpXHbUhP0KpsJjYBH6M7Je/Y1wJGNiN X-Received: by 2002:a05:6a00:cd1:b0:6c3:44e2:3e96 with SMTP id b17-20020a056a000cd100b006c344e23e96mr11971802pfv.27.1699204036425; Sun, 05 Nov 2023 09:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699204036; cv=none; d=google.com; s=arc-20160816; b=hhDOyVdlx6uDiBpAoDW1hQaazZYY8SznqWYSFNQmGexW514BC0IamYwrWSTvgIJy8J u61/ZxZ7iVIEJiCOehgJPo5gn73+cnETw/uXeFkrajAyAFwTN+3treP2f7VXJeVJhbIp JVfKQ5cy4YHCSt/KDU4X0CvPdr+3h2XNIL8ASugn2LzrC7OjZ0Z8ttnVga41iarXAOmS 531uhYMTETs64GLTLqzyqBx125c0bGcstVYRZmiNDehEhIuWMRMSk8zwZaDVD1G95Ui2 X4b+pcsq20NpwTgQmuv4G+B9RTLVLskPrr+vfOyfQoUqz8lMA4ZPCgASQykuwS0JvpiB wDPA== 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=DHrB2MDEvgLvMGiiGW4ysBRF9ISWcTsdFhQXpZT8qmk=; fh=ZAb5e/67NTsWML6RpVmzFEm3L9CC7ETVZIg6hSgYq5w=; b=r3piiowJOV3ZTxU7N8QdJ/Cd0AQuhT+zWzJAzdy5+cXp/m5bRNCmj5XXNnR1j+tUTS t3xzvsZZ6mHyQ4OrENnZEiVjukawUwDrSLjcR8Uj2cnW5akeMrKDTlp3tSaq0NYGV2zo 13wfRnOnftRnIo1y+2mGm4XyHY5Uhd4J3sQSlpIEPvN/j+CR5SEoDHLttY6x6iWL04Uc zi1ruTBiSlCmbtGQFpoIEPWNjKNudQUjxcD6z4M9Y2SW7vfNppdC8zpe0MjBeGF4utSw l/H9NYso61qxeOg0Z2bSQ0uVqagtlzINSYDfOzUuSWoUP8+3O15GM4mmi7G/KFMT9eaR 46IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=qmG2UqLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id fb12-20020a056a002d8c00b0069100706960si6283745pfb.116.2023.11.05.09.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 09:07:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kwiboo.se header.s=fe-e1b5cab7be header.b=qmG2UqLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 418BC809A742; Sun, 5 Nov 2023 09:07:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbjKERGf (ORCPT + 99 others); Sun, 5 Nov 2023 12:06:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjKERGe (ORCPT ); Sun, 5 Nov 2023 12:06:34 -0500 Received: from smtp.forwardemail.net (smtp.forwardemail.net [149.28.215.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86726CC; Sun, 5 Nov 2023 09:06:31 -0800 (PST) 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=1699203989; bh=DHrB2MDEvgLvMGiiGW4ysBRF9ISWcTsdFhQXpZT8qmk=; b=qmG2UqLYMHESXsPdAlgbWWmznBQ+5Rc/W8EIDO0qSi+1yFUmMT+7+LjPru6aNwNGUsKKRYzb/ EY6npsho/gelDfv/bMhMUH5ndDkQCcOqZCToPdUe0PMb38XzUz5XHCLQMEYwMYTtgLjz4KhCRUu g2nf26aFjz09K1jtw4iXOLCLAUYi36nTcDGJD9A13XdIsr8M7IWP/XQB+e7g+eWEKqsgD4JOqzH Nab8uOYS4hQZIMT/Ova8vLF2KuzcAjAK6OQVaDE3MvKT7EjLO0Ole1+rQ98P5NmDGs12WosfF9m 4StMPGZuIZleIWK657/cEYge1ZXLPL+xPAI2af7/C2uQ== From: Jonas Karlman To: Ezequiel Garcia , Mauro Carvalho Chehab , Hans Verkuil , "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 v4 07/11] media: rkvdec: Move rkvdec_reset_decoded_fmt helper Date: Sun, 5 Nov 2023 16:55:06 +0000 Message-ID: <20231105165521.3592037-8-jonas@kwiboo.se> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231105165521.3592037-1-jonas@kwiboo.se> References: <20231105165521.3592037-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: 6547c91a42ad2f8d15246935 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Sun, 05 Nov 2023 09:07:05 -0800 (PST) Move rkvdec_reset_decoded_fmt() and the called rkvdec_reset_fmt() helper functions in preparation for adding a new caller in an upcoming patch. Signed-off-by: Jonas Karlman --- v4: - No change v3: - New patch drivers/staging/media/rkvdec/rkvdec.c | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index 0570c790ad08..7a79840470e1 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -37,6 +37,29 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx, DIV_ROUND_UP(pix_mp->height, 16); } +static void rkvdec_reset_fmt(struct rkvdec_ctx *ctx, struct v4l2_format *f, + u32 fourcc) +{ + memset(f, 0, sizeof(*f)); + f->fmt.pix_mp.pixelformat = fourcc; + f->fmt.pix_mp.field = V4L2_FIELD_NONE; + f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709; + f->fmt.pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; + f->fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT; + f->fmt.pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT; +} + +static void rkvdec_reset_decoded_fmt(struct rkvdec_ctx *ctx) +{ + struct v4l2_format *f = &ctx->decoded_fmt; + + rkvdec_reset_fmt(ctx, f, ctx->coded_fmt_desc->decoded_fmts[0]); + f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + f->fmt.pix_mp.width = ctx->coded_fmt.fmt.pix_mp.width; + f->fmt.pix_mp.height = ctx->coded_fmt.fmt.pix_mp.height; + rkvdec_fill_decoded_pixfmt(ctx, &f->fmt.pix_mp); +} + static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl) { struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl); @@ -169,18 +192,6 @@ rkvdec_find_coded_fmt_desc(u32 fourcc) return NULL; } -static void rkvdec_reset_fmt(struct rkvdec_ctx *ctx, struct v4l2_format *f, - u32 fourcc) -{ - memset(f, 0, sizeof(*f)); - f->fmt.pix_mp.pixelformat = fourcc; - f->fmt.pix_mp.field = V4L2_FIELD_NONE; - f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709; - f->fmt.pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; - f->fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT; - f->fmt.pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT; -} - static void rkvdec_reset_coded_fmt(struct rkvdec_ctx *ctx) { struct v4l2_format *f = &ctx->coded_fmt; @@ -196,17 +207,6 @@ static void rkvdec_reset_coded_fmt(struct rkvdec_ctx *ctx) ctx->coded_fmt_desc->ops->adjust_fmt(ctx, f); } -static void rkvdec_reset_decoded_fmt(struct rkvdec_ctx *ctx) -{ - struct v4l2_format *f = &ctx->decoded_fmt; - - rkvdec_reset_fmt(ctx, f, ctx->coded_fmt_desc->decoded_fmts[0]); - f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - f->fmt.pix_mp.width = ctx->coded_fmt.fmt.pix_mp.width; - f->fmt.pix_mp.height = ctx->coded_fmt.fmt.pix_mp.height; - rkvdec_fill_decoded_pixfmt(ctx, &f->fmt.pix_mp); -} - static int rkvdec_enum_framesizes(struct file *file, void *priv, struct v4l2_frmsizeenum *fsize) { -- 2.42.0