From patchwork Fri Jan 27 09:21:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 4617 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp737171wrn; Fri, 27 Jan 2023 01:26:38 -0800 (PST) X-Google-Smtp-Source: AK7set/oMBlJGF9t01059zWk881WwAt0dXJOEfHhNBuFMa4UnCRbt5p7jeh8UC91REpcSQ89FFiE X-Received: by 2002:a17:902:ec82:b0:196:1c45:6fc8 with SMTP id x2-20020a170902ec8200b001961c456fc8mr13687915plg.60.1674811598038; Fri, 27 Jan 2023 01:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674811598; cv=none; d=google.com; s=arc-20160816; b=J6AbAPaeAviX6VcKSn++hX/IvniDpEg9VPzwZIt5qdIYp2UtYGIXqOs99zkRxYgxdc QMHwq6RroQAdjLObcJC6YsVOfeCFGIt3uIDbDvqlYFCfIH+mbeS74TbyWH9Q1DBBcHMh 3ZKWWwv5sQ+pbQHMUhBU+4uBB9ZrMh2Dj5BVCcWxHr+O0VNgxq8Qzwq0uYuW2E4RohSj d5a8TEG4yArE1kNct3COeNHxwy/X9maN7DFGAMjy6enrAJZglbSofZxAHc4soRbGgiKh IJwIb4l42hI5tzSYtM20Nw7tUb2N9TTzZFj8FjlTgk8AcycLx1fxCAtZ3IKDUV3Acn/D qeKQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=JqU2ziZpQ6tGO+jycVPlfCSLO5fmdPRdIx6bdphJuU0=; b=EHBubuh1fZ8ok8cUiSXVDqTbdIhaQn+nWY5Ig9mfyYk4PAz0KL5AJlYPhz3OIResml 0/RcqQWtaCs3klOg9FddDvOw677l0LpjQJsAGBcb1SvWhisdgeVr3CtaVQttSTW1sASI OC6qh4wy7a8sDTVX5wQZVPt+JCtRT52QspOjwiCMWTJSmZpZiCzzhE4SCPJiwFr7pBtC 5pWzqYeFN9AlZcwOahxGyTEeAfWHoXQZLFBj72bBbvG8PjYmlPHH3pvjy/I+9puTRYFk vTEiYDWbJxAXva5yRp4oWfpZ+E1essxTP3N9fXkPjcnF55KMYwfgdoDiUkfX+KkpHTRQ FKVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=b4PszC+N; 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 h10-20020a170902f2ca00b0019282cb9cf1si3935155plc.201.2023.01.27.01.26.26; Fri, 27 Jan 2023 01:26:38 -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=b4PszC+N; 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 S232578AbjA0JVh (ORCPT + 99 others); Fri, 27 Jan 2023 04:21:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231967AbjA0JVf (ORCPT ); Fri, 27 Jan 2023 04:21:35 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1BA293D0; Fri, 27 Jan 2023 01:21:34 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:4623:efe7:8a8:33c2]) (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 B35FF6602E66; Fri, 27 Jan 2023 09:21:32 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1674811293; bh=REsCtAkZRuIgQgakBRZ6FEEcPq8lAcKiHRdXzz5RX8s=; h=From:To:Cc:Subject:Date:From; b=b4PszC+NphdjWD0SnVj5join0Iiiuu16xO81xWXFlCKCIIOgsCrUoQZLn/Rzh9kFu dQyfWf4jdiIFsbkLDaH5w93/r1j0PPa8Hrd6BbCCYx0TdOIDo8BnTG5KSl+NalC8IG HTYQV3Tm3NvZOpWrb8J2ELoHW8jvrysU77zwO56SNR/DFKbRcJ97LbvJ4NTclsAYMf a/WRkpS1gha8n9DjVju5QE5Fa3wqJ/KJIwDzzk7i5pdhmioGAxThBDS2rpD30zPixA nFgQeYVYhVgswsF+KU5U5ztbZY2c8Hbb5gpNTWnHUsf0zZ60Yck/GrpkEyo9cn/Jii Wle80RsO+J5ew== 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 v5 0/2] media: verisilicon: HEVC: fix 10bits handling Date: Fri, 27 Jan 2023 10:21:24 +0100 Message-Id: <20230127092126.318268-1-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 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?1756167246281697666?= X-GMAIL-MSGID: =?utf-8?q?1756167246281697666?= When decoding a 10bits bitstreams HEVC driver should only expose 10bits pixel formats. To fulfill this requirement it is needed to call hantro_reset_raw_fmt() and to only change driver internal state in case of success. Fluster score (140/147) doesn't change after this series. version 5: - Add Nicolas's review tags - Add Fixes tags version 4: - Split the change in 2 patches. - Change hantro_check_depth_match() prototype to avoid using ctx->bit_depth - Return the result of hantro_reset_raw_fmt() to the caller. - Only set ctx->bit_depth when hantro_reset_raw_fmt() returns is ok. Benjamin Gaignard (2): media: verisilicon: Do not change context bit depth before validating the format media: verisilicon: HEVC: Only propose 10 bits compatible pixels formats .../media/platform/verisilicon/hantro_drv.c | 44 ++++++++++++--- .../platform/verisilicon/hantro_postproc.c | 2 +- .../media/platform/verisilicon/hantro_v4l2.c | 53 +++++++++---------- .../media/platform/verisilicon/hantro_v4l2.h | 3 +- .../media/platform/verisilicon/imx8m_vpu_hw.c | 2 + 5 files changed, 66 insertions(+), 38 deletions(-)