From patchwork Tue Jan 31 13:03:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 50817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2738825wrn; Tue, 31 Jan 2023 05:06:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtyEv+AZZAKTfONhItw/7pKADHUxkIfjQ4bJgQP50n+aAwDa4x/blsXkY5kx8TgBpGULFdX X-Received: by 2002:a05:6402:ea8:b0:494:fae3:c0df with SMTP id h40-20020a0564020ea800b00494fae3c0dfmr57303629eda.12.1675170362151; Tue, 31 Jan 2023 05:06:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675170362; cv=none; d=google.com; s=arc-20160816; b=iMubYqTVOjTwUVcbik9OxX1ZNxiAepx03pxu1ZLpBjS4v477AhGuApyv0/KiOdkYGa VmXneeiZXCqSXjVV9wZYA377cl8Es5non6XCCQ4PkbsaZMHw60lucp0KYLFR9NhLwWYa rUnCDyrNMqneovsCsWx7cL44my0Y9ykjXKFVL/TRy6j/OMuzGGo2uwB1/G4NABWRkUzF hxXDFF8JNd9aNs+cOQ5Lpa4T649iQ5NIp5z9R2bE4a+y6Ck2Uw2q+I7qidHeaub/qRSK 5rjimQJw9WFydsB9w9LzYAB2XCpTuFsRbRveLFTZnVd8Qn8cARgVnVLBFijOc72aAe3y CufA== 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=FWFw2akwC7evxp9bghungt84Kr1yPe38PxNHWnTCsp0=; b=LmBAvtVKd09kGvlDKyqjCodCuWQylcEfcotovBmnKBXrtwf5l6q8CZ8+PY9F9PfWkB OUsu4oGlfIJ8JQyXj3ho9cY7jP4ZpxkFroInX561SMfDjRc/W9Vg/e/fqXLe/RJR42k6 kupEXORmcjzUCLnqQWFHEuR7PyF2kxUT1yA4uHOanGktviYzl08NxpkVg7GQbsRyx/OD VIjrs3OmcoXI/zwJt7DSHwDHvnbIQh0wYTwBbE1aY9nmbeSOjmsxsu4BJ8a+/FVcVrhZ RCoWiy6edZUkvchwm0i+sjfhqevRHiEBdonxCIvTkEehdUbrvsXr0pkOOQkPk2j+wpAa OjKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CPMZQW+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a50e60d000000b004a08fd958aesi19172390edm.430.2023.01.31.05.05.38; Tue, 31 Jan 2023 05:06:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CPMZQW+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231751AbjAaNDu (ORCPT + 99 others); Tue, 31 Jan 2023 08:03:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjAaNDq (ORCPT ); Tue, 31 Jan 2023 08:03:46 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71127DBC3; Tue, 31 Jan 2023 05:03:44 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:d507:461a:a036:bf89]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 74C096602E64; Tue, 31 Jan 2023 13:03:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675170222; bh=WeghlRFY57k/XRhbZSebcHWkeNrEWgqxdzHNHRFL4B0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CPMZQW+6mPld5iY05XVu/jzKUp14nNRqILmG+2SeyHEsWilC7fJXkERMX1p6Sn0cp 3PzweKxJo4Y258kOw6aKYw7NzlkuXMiYcCGJE8T3mzL/nh/ZuCDePHuT1CjOPyrQun AKuWoTwNyxRBf6Lu0mjVtbkSJqbSRnefKzUgCpsf9hQTw4Oxq12JzW7LVKfp531/Bl HQx8rmiJ1GNWtak7KSh8FQj0R/It5ZwEGx0cYhMouGa28rpkUYslr912DwZmeH2ZXx kt1f6p9C4dqmkKK86M/h6zyGx6PB+kkpARFbwnrA8t9bIn/CnD+cCD1VxLdFC7hkk7 J6kvO3O6S7a0g== From: Benjamin Gaignard To: ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, mchehab@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.co.uk Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v7 1/5] media: verisilicon: Do not set context src/dst formats in reset functions Date: Tue, 31 Jan 2023 14:03:23 +0100 Message-Id: <20230131130327.776899-2-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230131130327.776899-1-benjamin.gaignard@collabora.com> References: <20230131130327.776899-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756543437574786829?= X-GMAIL-MSGID: =?utf-8?q?1756543437574786829?= Setting context source and destination formats should only be done in hantro_set_fmt_out() and hantro_set_fmt_cap() after check that the targeted queue is not busy. Remove these calls from hantro_reset_encoded_fmt() and hantro_reset_raw_fmt() to clean the driver. Fixes: dc39473d0340 ("media: hantro: imx8m: Enable 10bit decoding") Signed-off-by: Benjamin Gaignard --- drivers/media/platform/verisilicon/hantro_v4l2.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c index 2c7a805289e7..33cb865238de 100644 --- a/drivers/media/platform/verisilicon/hantro_v4l2.c +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c @@ -381,13 +381,10 @@ hantro_reset_encoded_fmt(struct hantro_ctx *ctx) vpu_fmt = hantro_get_default_fmt(ctx, true); - if (ctx->is_encoder) { - ctx->vpu_dst_fmt = vpu_fmt; + if (ctx->is_encoder) fmt = &ctx->dst_fmt; - } else { - ctx->vpu_src_fmt = vpu_fmt; + else fmt = &ctx->src_fmt; - } hantro_reset_fmt(fmt, vpu_fmt); fmt->width = vpu_fmt->frmsize.min_width; @@ -407,11 +404,9 @@ hantro_reset_raw_fmt(struct hantro_ctx *ctx) raw_vpu_fmt = hantro_get_default_fmt(ctx, false); if (ctx->is_encoder) { - ctx->vpu_src_fmt = raw_vpu_fmt; raw_fmt = &ctx->src_fmt; encoded_fmt = &ctx->dst_fmt; } else { - ctx->vpu_dst_fmt = raw_vpu_fmt; raw_fmt = &ctx->dst_fmt; encoded_fmt = &ctx->src_fmt; }