From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38B40CCF9F8 for ; Wed, 5 Nov 2025 09:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Cc:To:From:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Za5SFfJdUSs4ovxk3irOqAFzaOUi+WDBP56v5okOn24=; b=A/BBg1qQMPkRH6xUXZ7HG66uKq q9ZgNo3fqKJ7VJ9FooY7Fc1COiqXkYO60c0GhK67resyMAlDGhlwvmg5TzkmrCEzGAs4FqAtgAlE5 0sH8nyvHiODE22vgbYhGD0Ajm3ezt6zmAllM1zzitTExeUaG//A3NHFNf3YhBJfVWrIus59Zn/1pH Ob/M/TmGC6cYlhxdO547lqXz+eYgkH0uamHsTIQG/YBD6hUgUVbpuvAhQq3MkTlWCvk/775b6W3iz sZd0rt4OXibwXzcBsUHSl3u41cjspGrf5W25tIMv5LkzwLMUqyALQS3qPaiXcVi60caxWfGkAGKUT DAT/hJkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGZc7-0000000DMcP-3WUo; Wed, 05 Nov 2025 09:15:35 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGZc2-0000000DMaX-2YnP for linux-arm-kernel@lists.infradead.org; Wed, 05 Nov 2025 09:15:32 +0000 Received: from [192.168.88.20] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BE6F7E0; Wed, 5 Nov 2025 10:13:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1762334011; bh=50jz2fHstpIgoTh2QxMi6UxDUq/i0Zl8H9ZlZ8RG8SA=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=Lxg2kyugG4pYF8iZgxINcyCpcEMzP6BaTuL83xDZfRN4kkFZh5ZI4lmjzRGS7vLl7 De+c7KgdMkJvlORK7G0M9t7L++1MP/XApvP/6k6KoJ+FWZe2UJOX6rYBjLmu6CNcdw eWd/8RHtOuEYLXO4o9rBMmxpSuzFDdpvLptBpP+Q= Message-ID: Date: Wed, 5 Nov 2025 11:15:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 00/11] drm: Add new pixel formats for Xilinx Zynqmp From: Tomi Valkeinen To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Dmitry Baryshkov , Pekka Paalanen , Pekka Paalanen , Dmitry Baryshkov , Vishal Sagar , Anatoliy Klymenko , Laurent Pinchart References: <20251001-xilinx-formats-v6-0-014b076b542a@ideasonboard.com> Content-Language: en-US Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+uUN4Zdw2 wCEZjx3o0Z34diXBaMRJ3rAk9yB90UJAnLtb8A97Oq64DskLF81GCYB2P1i0qrG7UjpASgC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RwIbDAAKCRD6PaqMvJYe 9fA7EACS6exUedsBKmt4pT7nqXBcRsqm6YzT6DeCM8PWMTeaVGHiR4TnNFiT3otD5UpYQI7S suYxoTdHrrrBzdlKe5rUWpzoZkVK6p0s9OIvGzLT0lrb0HC9iNDWT3JgpYDnk4Z2mFi6tTbq xKMtpVFRA6FjviGDRsfkfoURZI51nf2RSAk/A8BEDDZ7lgJHskYoklSpwyrXhkp9FHGMaYII m9EKuUTX9JPDG2FTthCBrdsgWYPdJQvM+zscq09vFMQ9Fykbx5N8z/oFEUy3ACyPqW2oyfvU CH5WDpWBG0s5BALp1gBJPytIAd/pY/5ZdNoi0Cx3+Z7jaBFEyYJdWy1hGddpkgnMjyOfLI7B CFrdecTZbR5upjNSDvQ7RG85SnpYJTIin+SAUazAeA2nS6gTZzumgtdw8XmVXZwdBfF+ICof 92UkbYcYNbzWO/GHgsNT1WnM4sa9lwCSWH8Fw1o/3bX1VVPEsnESOfxkNdu+gAF5S6+I6n3a ueeIlwJl5CpT5l8RpoZXEOVtXYn8zzOJ7oGZYINRV9Pf8qKGLf3Dft7zKBP832I3PQjeok7F yjt+9S+KgSFSHP3Pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251105_011530_800157_786C125E X-CRM114-Status: GOOD ( 34.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Maintainers, Pinging on this again. Tomi On 22/10/2025 10:33, Tomi Valkeinen wrote: > Hi DRM maintainers, > > On 01/10/2025 16:22, Tomi Valkeinen wrote: >> Add new DRM pixel formats and add support for those in the Xilinx zynqmp >> display driver. > > Could someone merge this one, or at least the patches 1 to 6 (I can > merge the xilinx patches separately). > > Tomi > >> All other formats except XVUY2101010 are already supported in upstream >> gstreamer, but gstreamer's kmssink does not have the support yet, as it >> obviously cannot support the formats without kernel having the formats. >> >> Xilinx has support for these formats in their BSP kernel, and Xilinx has >> a branch here, adding the support to gstreamer kmssink: >> >> https://github.com/Xilinx/gst-plugins-bad.git xlnx-rebase-v1.18.5 >> >> New formats added: >> >> DRM_FORMAT_Y8 >> - 8-bit Y-only >> - fourcc: "GREY" >> - gstreamer: GRAY8 >> >> DRM_FORMAT_Y10_P32 >> - 10-bit Y-only, three pixels packed into 32-bits >> - fourcc: "YPA4" >> - gstreamer: GRAY10_LE32 >> >> DRM_FORMAT_XV15 >> - Like NV12, but with 10-bit components >> - fourcc: "XV15" >> - gstreamer: NV12_10LE32 >> >> DRM_FORMAT_XV20 >> - Like NV16, but with 10-bit components >> - fourcc: "XV20" >> - gstreamer: NV16_10LE32 >> >> DRM_FORMAT_X403 >> - 10-bit planar 4:4:4, with three samples packed into 32-bits >> - fourcc: "X403" >> - gstreamer: Y444_10LE32 >> >> XVUY2101010 >> - 10-bit 4:4:4, one pixel in 32 bits >> - fourcc: "XY30" >> >> Some notes: >> >> I know the 8-bit greyscale format has been discussed before, and the >> guidance was to use DRM_FORMAT_R8. While I'm not totally against that, I >> would argue that adding DRM_FORMAT_Y8 makes sense, as: >> >> 1) We can mark it as 'is_yuv' in the drm_format_info, and this can help >> the drivers handle e.g. full/limited range. Probably some hardware >> handles grayscale as a value used for all RGB components, in which case >> R8 makes sense, but when the hardware handles the Y-only pixels as YCbCr, >> where Cb and Cr are "neutral", it makes more sense to consider the >> format as an YUV format rather than RGB. >> >> 2) We can have the same fourcc as in v4l2. While not strictly necessary, >> it's a constant source of confusion when the fourccs differ. >> >> 3) It (possibly) makes more sense for the user to use Y8/GREY format >> instead of R8, as, in my experience, the documentation usually refers >> to gray(scale) format or Y-only format. >> >> As we add new Y-only formats, it makes sense to have similar terms, so >> we need to adjust the Y10_P32 format name accordingly. >> >> I have made some adjustments to the formats compared to the Xilinx's >> branch. E.g. The DRM_FORMAT_Y10_P32 format in Xilinx's kmssink uses >> fourcc "Y10 ", and DRM_FORMAT_Y10. I didn't like those, as the format is >> a packed format, three 10-bit pixels in a 32-bit container, and I think >> Y10 means a 10-bit pixel in a 16-bit container. >> >> Generally speaking, if someone has good ideas for the format define >> names or fourccs, speak up, as it's not easy to invent good names =). >> That said, keeping them the same as in the Xilinx trees will, of course, >> be slightly easier for the users of Xilinx platforms. >> >> I made WIP additions to modetest to support most of these formats, >> partially based on Xilinx's code: >> >> https://github.com/tomba/libdrm.git xilinx >> >> A few thoughts about that: >> >> modetest uses bo_create_dumb(), and as highlighted in recent discussions >> in the kernel list [1], dumb buffers are only for RGB formats. They may >> work for non-RGB formats, but that's platform specific. None of the >> formats I add here are RGB formats. Do we want to go this way with >> modetest? >> >> I also feel that the current structure of modetest is not well suited to >> more complicated formats. Both the buffer allocation is a bit more >> difficult (see "Add virtual_width and pixels_per_container"), and the >> drawing is complicated (see, e.g., "Add support for DRM_FORMAT_XV15 & >> DRM_FORMAT_XV20"). >> >> I have recently added support for these Xilinx formats to both kms++ [2] and >> pykms/pixutils [3][4] (WIP), and it's not been easy... But I have to say I >> think I like the template based version in kms++. That won't work in >> modetest, of course, but a non-templated version might be implementable, >> but probably much slower. >> >> In any case, I slighly feel it's not worth merging the modetest patches >> I have for these formats: they complicate the code quite a bit, break >> the RGB-only rule, and I'm not sure if there really are (m)any users. If >> we want to add support to modetest, I think a bigger rewrite of the test >> pattern code might be in order. >> >> [1] https://lore.kernel.org/all/20250109150310.219442-26-tzimmermann%40suse.de/ >> [2] git@github.com:tomba/kmsxx.git xilinx >> [3] git@github.com:tomba/pykms.git xilinx >> [4] git@github.com:tomba/pixutils.git xilinx >> >> Signed-off-by: Tomi Valkeinen >> --- >> Changes in v6: >> - Added tags for reviews >> - Rebased on v6.17 >> - Link to v5: https://lore.kernel.org/r/20250425-xilinx-formats-v5-0-c74263231630@ideasonboard.com >> >> Changes in v5: >> - Add comment about Y-only formats, clarifying how the display pipeline >> handles them (they're handled as YCbCr, with Cb and Cr as "neutral") >> - Clarify X403 format in the patch description >> - Set unused Y-only CSC offsets to 0 (instead of 0x1800). >> - Add R-bs >> - Link to v4: https://lore.kernel.org/r/20250326-xilinx-formats-v4-0-322a300c6d72@ideasonboard.com >> >> Changes in v4: >> - Reformat the drm_format_info entries a bit >> - Calculate block size only once in drm_format_info_bpp() >> - Declare local variables in separate lines >> - Add review tags >> - Fix commit message referring to Y10_LE32 (should be Y10_P32) >> - Link to v3: https://lore.kernel.org/r/20250212-xilinx-formats-v3-0-90d0fe106995@ideasonboard.com >> >> Changes in v3: >> - Drop "drm: xlnx: zynqmp: Fix max dma segment size". It is already >> pushed. >> - Add XVUY2101010 format. >> - Rename DRM_FORMAT_Y10_LE32 to DRM_FORMAT_Y10_P32. >> - Link to v2: https://lore.kernel.org/r/20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com >> >> Changes in v2: >> - I noticed V4L2 already has fourcc Y10P, referring to MIPI-style packed >> Y10 format. So I changed Y10_LE32 fourcc to YPA4. If logic has any >> relevance here, P means packed, A means 10, 4 means "in 4 bytes". >> - Added tags to "Fix max dma segment size" patch >> - Updated description for "Add warning for bad bpp" >> - Link to v1: https://lore.kernel.org/r/20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com >> >> --- >> Tomi Valkeinen (11): >> drm/fourcc: Add warning for bad bpp >> drm/fourcc: Add DRM_FORMAT_XV15/XV20 >> drm/fourcc: Add DRM_FORMAT_Y8 >> drm/fourcc: Add DRM_FORMAT_Y10_P32 >> drm/fourcc: Add DRM_FORMAT_X403 >> drm/fourcc: Add DRM_FORMAT_XVUY2101010 >> drm: xlnx: zynqmp: Use drm helpers when calculating buffer sizes >> drm: xlnx: zynqmp: Add support for XV15 & XV20 >> drm: xlnx: zynqmp: Add support for Y8 and Y10_P32 >> drm: xlnx: zynqmp: Add support for X403 >> drm: xlnx: zynqmp: Add support for XVUY2101010 >> >> drivers/gpu/drm/drm_fourcc.c | 28 ++++++++++++++++--- >> drivers/gpu/drm/xlnx/zynqmp_disp.c | 55 +++++++++++++++++++++++++++++++++++--- >> include/uapi/drm/drm_fourcc.h | 29 ++++++++++++++++++++ >> 3 files changed, 105 insertions(+), 7 deletions(-) >> --- >> base-commit: e5f0a698b34ed76002dc5cff3804a61c80233a7a >> change-id: 20241120-xilinx-formats-f71901621833 >> >> Best regards, >