From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796110094; b=0eFWOaxjORVM1JvS0uov7Zn7hMMYU9Q40FOrn9XBohnnZNb5qeN7waOgknknuug5WVOX 6njry1N5JvJpNoCpYtS4T2Gau0xq4MRbv5lgKuA+zVqP0LC4Rdp++z4fWp5C6kEOnDXIu 8zP1CphjPxC1AJ/umh40w7jzZOL9hQANYIbN+B//TPwXRaxnIqtIcIaTfBi0S2WMjTgG5 GvunidvoION3RyVm/tmgoVn9Iw2z/1EII4TuhsjLjbwbH0QTH2aM/zIfR+a+/pnRD9lNf szV5nShPePGFGRlHOFO9uu59ZEK4EAjACPvihH9qaT3VpznLagC61IhnX5nPimqjSRA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796110094; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=hcoyVrKQ2fOzEMro+Q1fH0qI7QcPm+iXpwYawBb34L4=; b=UiiW34+GYv51SoqJ1DSDinOOxG0OAMUvJitiueXQ5UD68gJC2CWM3g60t5upR5bBgjRJ vNTaO8UlznDA29s2aq7KpKK1yTJVxun3w3qTFKeLfyq854F2nv9su4uZjP1VG+EAgkyMq FodjglsUNXSNT0ZFBxC69DdKnnjOb8ldi4LoC3IxVvtIAfDuilCbQCOs9Z203PzWWtlTC 3DdhHXsTbhQmjbzJ7cq8/9bu2VVhlMsM0nuG0e217YrnQpeKPOLDbKADB4PPpigz5aHTj pDyMeGbQTl7ApYZgpYZQJQlQcyjjQvQKyEehH6Mr4HChn1vL9QeI/fgz4wC96XCxVTw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F+s732Wn; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EE46606A685; Tue, 1 Dec 2026 07:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F+s732Wn Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796110094; b=BBOO8xEG14lxCpad4tRdrDpbvCRYuqu+t/LQJJ2UCiq9aRs6RL4twqE2fmd85hJEijSD AKjqRjAH8N0I4VTLTHFmZAYGJi91lzETtG6FpO97TR8syOeEeHKwY6uNroBMV4Bs8xWkV 0LF5M6PGnyX0Abre4AOiuZG7uNuBLj8tSt7zLyggKJxUiKdlOAY0lFUwP6I7SIHaenaCC OYMCFLvt//JmH+Li56E3tsowXmYkKo/RSJdYsz7gWF5WrVp3XDlooLcQlKRF0HRI7k07X hJEUyMJSuEgWovdul01NB9/0o5b/3Uv1f24dvucIL8Xwz/JsYzT/NDrYzWXD5O9g6AA== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796110094; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=hcoyVrKQ2fOzEMro+Q1fH0qI7QcPm+iXpwYawBb34L4=; b=d7C6zosCkDLVf0nQWLwqLnonqNgbhGSOKyq0m3rGFp2U8an50biGGVKJ050i3WKtGOla 1tIl5XYtqTqWFqwovWUtU5FM3LRkZTtPzyck9im5WvCLjxdCIbrtRirc9+lhb2aqz6n7p YsG8oYb693r4O5IKr/GwS0R6bbpnpcQ/DcdgetuH9e6yO53KkJLvpIcQ9kAxlwgGlVG6i CuBVtQh6Oa1lWGdBWdV7b6yujYwbSfe3lfTedo2GLvvKvUC+oCc7HSdWkh9FQ5Iuyq8vF 9elPxEOWrsc06OZoiHgevzpO1g52CM3J84aawrx8/mIQ9z3jQ565BLWOY86V2KLzrEA== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id F29041F00893; Tue, 1 Dec 2026 07:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796110094; bh=hcoyVrKQ2fOzEMro+Q1fH0qI7QcPm+iXpwYawBb34L4=; h=From:Date:Subject:To:Cc:Reply-To; b=F+s732Wn90ZYTWNQLe29COSHVQm0bdQfxcy9WV/MECd3jNsCzxxP/C5fN44PwRHkN /Hj35noBK9QbSNMw3WLR4KELPGQeusyYXaqy3KU1bgwRjC2wuHbXvJq04T4ScFVMWx /YNRq4MHyJuW8369Et/l/lPIO0tBL3YEEbk6lNgjGitQIkd+MUs6KysV9DZ/OTU9fr uDLjdPVsxey6EF0rlMocUdREOA9zmjl0BCqUtMuEYbvU3VVYcIFCnc9KE93xfnD5s4 XBbWUlktwWYxgsD+l53KZ6mtLJSvLAsYh03MAeq0zHVZBnVST8WmKc+2jqn7MToe9Q 89DOd869+nc3A== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 7FA154EC31; Tue, 1 Dec 2026 07:28:10 +0000 (UTC) From: Arun Iyengar via B4 Relay Date: Tue, 01 Dec 2026 07:28:10 +0000 Subject: [PATCH] media: verisilicon: av1: Fix the reference scale register order X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261201-av1-ref-scale-v1-1-f0a1002cd279@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzNDIwND3cQyQ92i1DTd4uTEnFRd4xQjE4M0A8Mks5QkJaCeAqBUZgXYvOh YCL+4NCkrNbkEZIhSbS0A1dTkiHEAAAA= X-Change-ID: 20261201-av1-ref-scale-3d240f01b6db To: Nicolas Dufresne , Benjamin Gaignard , Philipp Zabel , Mauro Carvalho Chehab , Heiko Stuebner , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Arun Iyengar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796110090; l=4067; i=aiyengar1990@gmail.com; s=20261110; h=from:subject:message-id; bh=gYH37YK4hmZ7dxPt0CGlqkYLijUdBBmEV9HQxU5vQdQ=; b=X8k8I7K221gjLFwyxZlO3KSXCVihLeA3aVs2xyaSShHc5FvNEyJ0l/K4uzjI/PYIvdH2LdYM6 Si2s4CdcAMgBz3Rmt39vIoppigeJuxv6bt+z4WTQxpLpRB4ROQEbXM3 X-Developer-Key: i=aiyengar1990@gmail.com; a=ed25519; pk=zXpRgUTrhaFe6jLyPqbBy3ccfkj04w0g2690Wv3mg+0= X-Endpoint-Received: by B4 Relay for aiyengar1990@gmail.com/20261110 with auth_id=1480 X-Original-From: Arun Iyengar Reply-To: aiyengar1990@gmail.com Content-Transfer-Encoding: 7bit From: Arun Iyengar The horizontal scale field is bits 16-31 and the vertical one bits 0-15. The driver wrote the width ratio into the vertical field and the height ratio into the horizontal one, so references whose width and height ratios differ were scaled with the wrong factors. Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder") Cc: stable@vger.kernel.org Signed-off-by: Arun Iyengar --- Tested on RK3588 with five libaom streams whose references scale differently in x and y: bit-exact with libdav1d, wrong before. Developed with Claude (Anthropic), which wrote the code and the commit message. I reviewed every change. --- .../verisilicon/rockchip_vpu981_hw_av1_dec.c | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c index f143df99cdb5..3dcbd8095938 100644 --- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c +++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c @@ -86,44 +86,44 @@ rockchip_vpu981_av1_dec_set_ref(struct hantro_ctx *ctx, int ref, int idx, case 0: hantro_reg_write(vpu, &av1_ref0_height, height); hantro_reg_write(vpu, &av1_ref0_width, width); - hantro_reg_write(vpu, &av1_ref0_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref0_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref0_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref0_ver_scale, scale_height); break; case 1: hantro_reg_write(vpu, &av1_ref1_height, height); hantro_reg_write(vpu, &av1_ref1_width, width); - hantro_reg_write(vpu, &av1_ref1_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref1_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref1_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref1_ver_scale, scale_height); break; case 2: hantro_reg_write(vpu, &av1_ref2_height, height); hantro_reg_write(vpu, &av1_ref2_width, width); - hantro_reg_write(vpu, &av1_ref2_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref2_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref2_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref2_ver_scale, scale_height); break; case 3: hantro_reg_write(vpu, &av1_ref3_height, height); hantro_reg_write(vpu, &av1_ref3_width, width); - hantro_reg_write(vpu, &av1_ref3_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref3_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref3_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref3_ver_scale, scale_height); break; case 4: hantro_reg_write(vpu, &av1_ref4_height, height); hantro_reg_write(vpu, &av1_ref4_width, width); - hantro_reg_write(vpu, &av1_ref4_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref4_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref4_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref4_ver_scale, scale_height); break; case 5: hantro_reg_write(vpu, &av1_ref5_height, height); hantro_reg_write(vpu, &av1_ref5_width, width); - hantro_reg_write(vpu, &av1_ref5_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref5_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref5_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref5_ver_scale, scale_height); break; case 6: hantro_reg_write(vpu, &av1_ref6_height, height); hantro_reg_write(vpu, &av1_ref6_width, width); - hantro_reg_write(vpu, &av1_ref6_ver_scale, scale_width); - hantro_reg_write(vpu, &av1_ref6_hor_scale, scale_height); + hantro_reg_write(vpu, &av1_ref6_hor_scale, scale_width); + hantro_reg_write(vpu, &av1_ref6_ver_scale, scale_height); break; default: pr_warn("AV1 invalid reference frame index\n"); --- base-commit: 95c189b26efb07257888ccf9d873a5c366aafbc6 change-id: 20261201-av1-ref-scale-3d240f01b6db Best regards, -- Arun Iyengar