From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7950320CA6 for ; Fri, 26 Dec 2025 12:25:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766751928; cv=none; b=VyWuG0SLz6sdWD+zB1xj4pIEzzXHWaUwuYWHzkBKqHYckm3GSML2YeU6Hl5oP3xK4MQ9HR0ZPd1T2l5acFFvpM4q//Bg+K18eCkuWKQy2+xOxitU/LzykjEBPuxYWq1eVKDBvNgHtkSkYDPaB+nz8MfMv9mTdR5Sm0aZBHRubm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766751928; c=relaxed/simple; bh=s0igInVi2fsL8o4Z4M/V+k7XSMGGxM39qOmVRGDnFFo=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=CJ9ikpx9fgouRcsjP0HyLpdcRk5JQa6xTyNlla9AhzLwoRR2/JZwUc40FQu9eDKjm8HQGK+If0qNp5QXA4p+aCEDVUAzX0GT4Fi5NjBX47WpK2tvSiTLbpuVyvrTWl+/MxiQh6qJnEmzOAHvQXTYkdC8WwM2VA+f05nKpZKLDs4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WxDROA42; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WxDROA42" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-47a95efd2ceso64454325e9.2 for ; Fri, 26 Dec 2025 04:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766751924; x=1767356724; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=x/QWZMgTcROcYFJ0cFP0webMTrmmuMu3SFDdjIFr7Xg=; b=WxDROA42RUsr0RY3rgG+wgchKtUffrDJ3mducqIIRnG6S4wXv8RNF/Wxe1NDCsKszJ nJLhqzIzqYWYv3vIYrHNtnKnmXFsnVbalMuCOX5PDYmJrHnzcLnUMhrcQeUj/MANVmuz EwVmyjjdQXAWobnVt9hXJy2uMl6gsobG4YrLrM1lrSECsAMZfEbniPJJ1f5F1yNHSF2Q o91AFXXS3oHFyWmBdnsgmeY3omOg5LUT72ikVUVRrhcT6A0Lte4uoSP1KBwFyoLy3g1D mQ1CIH1y6ZYubF6YW/DYicj8umCJxt5/aisihz654x6GbAyiwxOPGaNUK2Ff96cbX+hl 5NEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766751924; x=1767356724; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=x/QWZMgTcROcYFJ0cFP0webMTrmmuMu3SFDdjIFr7Xg=; b=NoptZl7/fxB6y6HAYdon6HTWzAWyqVNV2bg3xK6cBfS2tXn5c07uSGsmX2llaqmOQF dbsFqEWG18T5sVULfIHGAChTlWi9yyHM6JFZzFBJzkudB0faojYJMMgWL1zNvbu+axAo w64kL3Zer2dGK9FjIHwtSXK4QojsWVNDaLiJ3biVB6QyRYCwsub+hWDKFkYzaYs4hdy/ lEnDTyUvYSAWi6RFGzR6MIlY0fLiIG7A4W097+s7EasbfpQenVfpEHK8UAUr7QyKsWbK 4rfy/kukvkIvDFCmaBM7yczSpdulJEokyprfRa3+bITaP5oVKo2uqq4E6irX+SfGALWg pGiA== X-Forwarded-Encrypted: i=1; AJvYcCWWdhFENOjmuZ1llOcc32xIlPXUAsKXteNrFZS65ppUuY+xDoqVXLizMBv4eOTImv5JG/WhZl+5phwh8UQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwD9x/835+YWfRzOvtpTfKa44s4EJtijmUvXkbLtlmPzo5MIo4d cJdrvCx/BWoGkxlEUzkHvlz/YYdOIj3ggAGYb3XG5GsROoXDr1+qTXwx X-Gm-Gg: AY/fxX7p3e0UYqrzbOkRosyiIzvkfidGSkDmLIym0eo77/OujL5oCiiohkHd1ikmHhQ fdspNgLXxQ0Fdbbns2PLtaJPxX62uWS9f46CQlHwuBr1xIH6NjT9dN0j1FkGA76Fufd0QP9cEeo QEywGEWHahXaLiBIchTlHWVdziyG40pM1KB3WIb9EnrB9VIpGHcWA4sBf78tVvbXthlSxUpmW2u cmZVrk0FSRuW0LotQ97OvyEuSAQlZHO3ZEX2yyZ+NjBOdgb4nX2W8TW5ksshh14CsXAEd98KKpT hXCk5P8qaI1g6UrEfDsVjKt90insgXUz3xZcNTrSj1smYNSZPTOcTEegCULStIYlTQMlXywRgMt wcMpqmCBq2tXIQewJ6nLHpv5OjhElCgLzt6ZKD7irb1+HoTau3CNaUcbGfeQB9uBU8iQYpNzoYu Z0bnyJcwgkyR79e4Ypp3/BA426nnn72UoDNm/8gcorTN+cQNdEaCqZCaQ6v10x8Jcxs6emWRT+f MXMcCcSvQ== X-Google-Smtp-Source: AGHT+IGc8Z2MAoLbOks33fyQFWGK5GI9Gp1WejsRvglw//425ZHkxFEhT7LmB7wnFeheTO44I6eLuA== X-Received: by 2002:a05:600c:620d:b0:47b:da85:b9ef with SMTP id 5b1f17b1804b1-47d19569c23mr295125695e9.16.1766751924042; Fri, 26 Dec 2025 04:25:24 -0800 (PST) Received: from smtpclient.apple (static.253.36.98.91.clients.your-server.de. [91.98.36.253]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324ea82feasm45346320f8f.24.2025.12.26.04.25.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Dec 2025 04:25:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81.1.3\)) Subject: Re: [PATCH v2 2/3] media: rkvdec: Add support for the VDPU346 variant From: Christian Hewitt In-Reply-To: Date: Fri, 26 Dec 2025 16:25:09 +0400 Cc: Detlev Casanova , Nicolas Dufresne , =?utf-8?Q?Olivier_Cr=C3=AAte?= , Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Dmitry Osipenko , Thomas Gleixner , Dragan Simic , Chukun Pan , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <71EA9FB8-83DB-4785-86C1-2E6BA9C739D9@gmail.com> References: <20251226113140.573759-1-christianshewitt@gmail.com> <20251226113140.573759-3-christianshewitt@gmail.com> To: Diederik de Haas X-Mailer: Apple Mail (2.3826.700.81.1.3) > On 26 Dec 2025, at 4:00=E2=80=AFpm, Diederik de Haas = wrote: >=20 > Hi Christian, >=20 > On Fri Dec 26, 2025 at 12:31 PM CET, Christian Hewitt wrote: >> VDPU346 is similar to VDPU381 but with a single core and limited >> to 4K60 media. It is also limited to H264 L5.1 and omits AV1 and >> AVS2 capabilities. VDPU346 is used with RK3566 and RK3568. >>=20 >> Signed-off-by: Christian Hewitt >> Reviewed-by: Nicolas Dufresne >> --- >> .../media/platform/rockchip/rkvdec/rkvdec.c | 103 = ++++++++++++++++++ >> 1 file changed, 103 insertions(+) >>=20 >> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c = b/drivers/media/platform/rockchip/rkvdec/rkvdec.c >> index e547057dc75f..6b39e99d8a8b 100644 >> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c >> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c >> @@ -236,6 +236,62 @@ static const struct rkvdec_ctrls = rkvdec_hevc_ctrls =3D { >> .num_ctrls =3D ARRAY_SIZE(rkvdec_hevc_ctrl_descs), >> }; >>=20 >> +static const struct rkvdec_ctrl_desc vdpu346_hevc_ctrl_descs[] =3D { >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_DECODE_PARAMS, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_SPS, >> + .cfg.ops =3D &rkvdec_ctrl_ops, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_PPS, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_SCALING_MATRIX, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_DECODE_MODE, >> + .cfg.min =3D V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED, >> + .cfg.max =3D V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED, >> + .cfg.def =3D V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_START_CODE, >> + .cfg.min =3D V4L2_STATELESS_HEVC_START_CODE_ANNEX_B, >> + .cfg.def =3D V4L2_STATELESS_HEVC_START_CODE_ANNEX_B, >> + .cfg.max =3D V4L2_STATELESS_HEVC_START_CODE_ANNEX_B, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_MPEG_VIDEO_HEVC_PROFILE, >> + .cfg.min =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, >> + .cfg.max =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10, >> + .cfg.menu_skip_mask =3D >> + BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE), >> + .cfg.def =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_MPEG_VIDEO_HEVC_LEVEL, >> + .cfg.min =3D V4L2_MPEG_VIDEO_HEVC_LEVEL_1, >> + .cfg.max =3D V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS, >> + .cfg.ops =3D &rkvdec_ctrl_ops, >> + .cfg.dims =3D { 65 }, >> + }, >> + { >> + .cfg.id =3D V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS, >> + .cfg.ops =3D &rkvdec_ctrl_ops, >> + .cfg.dims =3D { 65 }, >> + }, >> +}; >> + >> +static const struct rkvdec_ctrls vdpu346_hevc_ctrls =3D { >> + .ctrls =3D vdpu346_hevc_ctrl_descs, >> + .num_ctrls =3D ARRAY_SIZE(vdpu346_hevc_ctrl_descs), >> +}; >> + >> static const struct rkvdec_ctrl_desc vdpu38x_hevc_ctrl_descs[] =3D { >> { >> .cfg.id =3D V4L2_CID_STATELESS_HEVC_DECODE_PARAMS, >> @@ -463,6 +519,41 @@ static const struct rkvdec_coded_fmt_desc = rk3288_coded_fmts[] =3D { >> } >> }; >>=20 >> +static const struct rkvdec_coded_fmt_desc vdpu346_coded_fmts[] =3D { >> + { >> + .fourcc =3D V4L2_PIX_FMT_HEVC_SLICE, >> + .frmsize =3D { >> + .min_width =3D 64, >> + .max_width =3D 65472, >=20 > This should be 4096 according to page 469 of RK3568 TRM Part 2 ... >=20 >> + .step_width =3D 64, >> + .min_height =3D 64, >> + .max_height =3D 65472, >=20 > ... and this 2304. >=20 >> + .step_height =3D 16, >> + }, >> + .ctrls =3D &vdpu346_hevc_ctrls, >> + .ops =3D &rkvdec_vdpu381_hevc_fmt_ops, >> + .num_decoded_fmts =3D ARRAY_SIZE(rkvdec_hevc_decoded_fmts), >> + .decoded_fmts =3D rkvdec_hevc_decoded_fmts, >> + .subsystem_flags =3D VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF, >> + }, >> + { >> + .fourcc =3D V4L2_PIX_FMT_H264_SLICE, >> + .frmsize =3D { >> + .min_width =3D 64, >> + .max_width =3D 65520, >=20 > This too should be 4096 according to page 469 of RK3568 TRM Part 2 ... >=20 >> + .step_width =3D 64, >> + .min_height =3D 64, >> + .max_height =3D 65520, >=20 > ... and this 2304. >=20 > I guess this also explains the 'green images' Nicolas noticed. Quite probably. I=E2=80=99ve picked the above changes into my working = tree (for those following it) and will send a v3 series in response to the next revision of Detlev=E2=80=99s patches. > + .step_height =3D 16, >> + }, >> + .ctrls =3D &rkvdec_h264_ctrls, >> + .ops =3D &rkvdec_vdpu381_h264_fmt_ops, >> + .num_decoded_fmts =3D ARRAY_SIZE(rkvdec_h264_decoded_fmts), >> + .decoded_fmts =3D rkvdec_h264_decoded_fmts, >> + .subsystem_flags =3D VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF, >> + }, >=20 > I see you've reversed the order of the blocks so that HEVC now comes > before the H264 block. While that makes it consistent with what Detlev > has in their v7 and with the existing code in the driver ... I = actually > prefer having H264 before HEVC as the alphabetical sorting order is > H264 before HEVC. > In the existing code the VP9 'stuff' is listed below H264 and HEVC. >=20 > But then Detlev should do that too in their patch set ... and = 'ideally' > the order of the existing code be updated to be alphabetically too. >=20 > OTOH, a consistent order works for me too. I believe the reorder was requested by Nic (offline from the list) so there=E2=80=99s probably a reason behind it. I=E2=80=99ll keep things = aligned to the order in Detlev=E2=80=99s series (whatever that is). Christian > Cheers, > Diederik >=20 >> +}; >> + >> static const struct rkvdec_coded_fmt_desc vdpu381_coded_fmts[] =3D { >> { >> .fourcc =3D V4L2_PIX_FMT_HEVC_SLICE, >> @@ -1643,6 +1734,14 @@ static const struct rkvdec_variant_ops = vdpu381_variant_ops =3D { >> .flatten_matrices =3D transpose_and_flatten_matrices, >> }; >>=20 >> +static const struct rkvdec_variant vdpu346_variant =3D { >> + .coded_fmts =3D vdpu346_coded_fmts, >> + .num_coded_fmts =3D ARRAY_SIZE(vdpu346_coded_fmts), >> + .rcb_sizes =3D vdpu381_rcb_sizes, >> + .num_rcb_sizes =3D ARRAY_SIZE(vdpu381_rcb_sizes), >> + .ops =3D &vdpu381_variant_ops, >> +}; >> + >> static const struct rkvdec_variant vdpu381_variant =3D { >> .coded_fmts =3D vdpu381_coded_fmts, >> .num_coded_fmts =3D ARRAY_SIZE(vdpu381_coded_fmts), >> @@ -1691,6 +1790,10 @@ static const struct of_device_id = of_rkvdec_match[] =3D { >> .compatible =3D "rockchip,rk3399-vdec", >> .data =3D &rk3399_rkvdec_variant, >> }, >> + { >> + .compatible =3D "rockchip,rk3568-vdec", >> + .data =3D &vdpu346_variant, >> + }, >> { >> .compatible =3D "rockchip,rk3588-vdec", >> .data =3D &vdpu381_variant,