From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9ABC9C982C5 for ; Wed, 16 Sep 2026 12:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8/cceW2iupljbZpYmmQYEMoRBaTccpI/8+iCBIrYlWA=; b=b5NbFjxDbytuHq EMr80ZdnwBAACJl6LUrSOem8kjINeyoEEft/jEzIeuV46R9N7ZLXgGNhBKcgWYvXEKtCdscXVjbpv 9Eb2yeb+TKeGx8mVVmcYBAdkK6OM2H1950E0zndVinNSL1kHK12czu+BmzOEdpLrpteqBVyK9ok3Y +2fj2weW7nushq1nUAvbq5skF7UQO7XfLki+B/AL7u+nT5wk9yt4aCSg0YxKOARNqPmtp2iC4GTL0 +VrI042jepwpsXj+KLaWOJU0/lHi3F46XQAGyG6Zh8r+O09eBecf33q9ANnuGtbElzuAVMi5MYhl8 GTTZvg0kd9z82EugOAig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x6pAC-00000009DDN-1hKV; Wed, 16 Sep 2026 12:55:00 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x6pA4-00000009D9U-4330 for linux-rockchip@lists.infradead.org; Wed, 16 Sep 2026 12:54:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1789563290; bh=qUx4hsf6eU4bj1x64ZWHjM8moLvtJhuV3tVMfQYaZOc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqoAekRtgVNCDR3hKlL17SGzg9fGWjHvpIFWQftUc0zvHPv6M6t6Y4KQAfkw/IPfT nzG0OzfozDMQsJXRxD8+ouZUvN4RDSWDXgvB5SV6V6rrZq10fX7nrZYtCEDoxhITwR yj0GIPFQ612JROA33/95ei7siYtiizW+1ae8aIGlGCvZbvzzDG9ylhKM+OQawS3MqT 7bPMSkjgDWWq/lWseZtnZVaSeMR1ek2QCfWqTLBmuCRUkfGSZ9tcsflvl+5sYfQ2y0 QPaXOj3j8Kofjy8tOcvE1GRfy5V5i5QWeyd/SFQrRr3YYcG0ftMIZ0xSEVOqvw3e3a BRAkFTdZkv6FA== Received: from benjamin-XPS-13-9310 (unknown [100.64.1.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by bali.collaboradmins.com (Postfix) with ESMTPSA id 2329917E12B9; Wed, 16 Sep 2026 14:54:50 +0200 (CEST) From: Benjamin Gaignard To: nicolas.dufresne@collabora.com, benjamin.gaignard@collabora.com, p.zabel@pengutronix.de, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH v1 3/7] media: verisilicon: h264: Use alloc/free helpers for auxiliary buffers Date: Wed, 16 Sep 2026 14:54:39 +0200 Message-ID: <20260916125443.78602-4-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916125443.78602-1-benjamin.gaignard@collabora.com> References: <20260916125443.78602-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260916_055453_202305_8BFB8B87 X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Simplify and clean up the code by using the helpers. Signed-off-by: Benjamin Gaignard --- drivers/media/platform/verisilicon/hantro_h264.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/verisilicon/hantro_h264.c b/drivers/media/platform/verisilicon/hantro_h264.c index 2414782f1eb6..68dde1cd1ac2 100644 --- a/drivers/media/platform/verisilicon/hantro_h264.c +++ b/drivers/media/platform/verisilicon/hantro_h264.c @@ -494,26 +494,21 @@ int hantro_h264_dec_prepare_run(struct hantro_ctx *ctx) void hantro_h264_dec_exit(struct hantro_ctx *ctx) { - struct hantro_dev *vpu = ctx->dev; struct hantro_h264_dec_hw_ctx *h264_dec = &ctx->h264_dec; struct hantro_aux_buf *priv = &h264_dec->priv; - dma_free_coherent(vpu->dev, priv->size, priv->cpu, priv->dma); + hantro_free_aux_buf(ctx, priv); } int hantro_h264_dec_init(struct hantro_ctx *ctx) { - struct hantro_dev *vpu = ctx->dev; struct hantro_h264_dec_hw_ctx *h264_dec = &ctx->h264_dec; struct hantro_aux_buf *priv = &h264_dec->priv; struct hantro_h264_dec_priv_tbl *tbl; - priv->cpu = dma_alloc_coherent(vpu->dev, sizeof(*tbl), &priv->dma, - GFP_KERNEL); - if (!priv->cpu) + if (hantro_allocate_aux_buf(ctx, priv, sizeof(*tbl))) return -ENOMEM; - priv->size = sizeof(*tbl); tbl = priv->cpu; memcpy(tbl->cabac_table, h264_cabac_table, sizeof(tbl->cabac_table)); -- 2.53.0 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip