From patchwork Fri Feb 3 09:16:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 52420 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp731630wrn; Fri, 3 Feb 2023 01:24:39 -0800 (PST) X-Google-Smtp-Source: AK7set9znFyieblT76yXm46phgwJnkoQCZMkj3FO2KwPn8N7xKgJ3bgK9qpwMc1BpJk3jEKj7ios X-Received: by 2002:a17:906:c411:b0:889:14ec:21ae with SMTP id u17-20020a170906c41100b0088914ec21aemr9785440ejz.32.1675416279294; Fri, 03 Feb 2023 01:24:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675416279; cv=none; d=google.com; s=arc-20160816; b=owjU2oKZU3a+Clu/fKctHHlQAY4edb63xEdpFjAc24Yg0739VOG+f7et42j6i4FhxK ncOWnlorlZiInGywWHewSngNMXcpwzwKk1wvsdurJQH8Y1ZLfWicjFxZjBvssY8JId/G 3nnDXIKjdIUmZ6O6ApD5ugOG5JWYtu7+wMLYW+qXoYRhdf8d8k5haUjn6NJlCMWcvb84 CZDy55XsK2FAt0K+opBbl48LqdPAwN0HhC6AxC/xfd9WY/XUPihRPtriaChNlt5LBwOT fclirv+cFuboWg6TR/M2OqLNib/s9DC5Ozy7+F1+fXxRtHOKQjEHZbr7hG+PNzP0h3ID 8rsA== 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=Q9/nKjZTN8T+/8Na7Rls+w7nCVRsnVZN0vJMpDzvswVy4TmvZtUD6cHUD+2HH1xiQD 0ARD8s78m66y4rMbu1DvEpD1/TAylTJkswf/KwV7k4ddLFWXSDFEopYD7SlOkNABl25M fddyFcKexGd+5G9HlcRU37X1WO8rw6DM1WB3QbRWzDlOZPQR9MnH6Thw8okUDQJsk2TA K3ywQSBmnmIypvBeUoT80rwQt+6XPgyidRcseHF1WAlxxBW511ptDhBtj3uNzf7jBs7S G3xhmtBiK8qedD1aJA5MV4V2d2TFWf0eWXFt+EiCcOih6oKi28A2arAcjBuDW0b/vnAF P6og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=krTDlQ3U; 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 u27-20020a170906109b00b0087d0121def7si3324316eju.248.2023.02.03.01.24.15; Fri, 03 Feb 2023 01:24:39 -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=krTDlQ3U; 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 S232858AbjBCJR3 (ORCPT + 99 others); Fri, 3 Feb 2023 04:17:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232701AbjBCJQ7 (ORCPT ); Fri, 3 Feb 2023 04:16:59 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5842A991D1; Fri, 3 Feb 2023 01:16:37 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:d413:5f9c:fc3a:208d]) (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 4B5B66602F08; Fri, 3 Feb 2023 09:16:35 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675415795; bh=WeghlRFY57k/XRhbZSebcHWkeNrEWgqxdzHNHRFL4B0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krTDlQ3UYuk65VZzTeSbLvrLvgLmqYPYXnfZRrtZLyf8H4jab9+9UueZ9fAJYMqjG U3YfkwlW2KqcsKGU/P2KlFuhZHav+2oByHo7CgdNaX+wwUmUHDYF+Z5qOhFkX5Je9N lCCw7A/X59NxP2oo7HviS3nees+4SbipjbHkdxW2UxZKOtnSKj4ErY9NyeUM2qLji6 FOLWwCGqfJ7M7QClzl8MDIRTFRk8NKeDVpoQ9NPfFNDePWoTOWI8Io/7RlSxwLS2KZ n7noqfkXp664quBYN0DC49PPLgaZTyjEMnwV1moTs66+h4BpwJOW61eaMw1w8sYAlB 2FCW/45YK2Ktw== 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 v8 1/6] media: verisilicon: Do not set context src/dst formats in reset functions Date: Fri, 3 Feb 2023 10:16:17 +0100 Message-Id: <20230203091622.127279-2-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230203091622.127279-1-benjamin.gaignard@collabora.com> References: <20230203091622.127279-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?1756801300249961397?= X-GMAIL-MSGID: =?utf-8?q?1756801300249961397?= 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; }