From patchwork Wed Jan 15 09:03:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940078 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 1D887C02183 for ; Wed, 15 Jan 2025 09:05:34 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wRaJ5/ccgNx/RxoeeO86UDDJs0OPJg/Ybswa3PlM/FM=; b=HZF51yJkvqGcPU+rB3HSCSXZP/ DsfI6F0nt6mRnAHQzzUkIQVrFOPtnFEGN+BZgPKunniiwNl7ibN9fX9TrCBv2K5LAEGEvv3QUcgmJ Na0n1ItzKI30l5WpGZZAu1mVaAeC8EVfA11hiqZ8jpQFpj3QunD7EkaywS8aBmEHWSpFqOXNC7p2h 8dlgwP3T2yaw05OxG6+dBx2s3z1F1oGfkoktkQIPDeK2pVg7WiI2zSQ07fJt798pfi2D7BODGinKf +JVwnIaT1dIYlYRRRXaWFW42AIP6xQtAdtlTPkfLDmkJV8ySLl52n/P0ghi480NcRl/chpS/gE2jL 4njcygUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzKv-0000000BDsn-3x2H; Wed, 15 Jan 2025 09:05:17 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJg-0000000BDO0-0UHS for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:01 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AFEDA73E; Wed, 15 Jan 2025 10:02:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931780; bh=BAt3uc6nPGNZCBjCplDEQ3lvr4SijGOwtJPTUPOoygU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nBvNIVCMJcFLjsyAAiwgEAt22A7Vww6QXRNRtXliezNxkib1UBowCwAzEcZtiayev k8umeN5vz1EJ4/dxA3u0hlEgTp20+ceuRbSyDFK/VW+km0RuHALpHpfcGORL6K562f +TEuOYVo2flPlgQZ1bVaYq9z59ioFnLF539Px4Ps= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:30 +0200 Subject: [PATCH v2 01/10] drm/fourcc: Add warning for bad bpp MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-1-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1442; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=BAt3uc6nPGNZCBjCplDEQ3lvr4SijGOwtJPTUPOoygU=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n48iSXc2BjCEN+uQsHpIk0Q7sns9A9Gr17N grkQiX/f7CJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+AAKCRD6PaqMvJYe 9fDDD/43GBkraeVwOyPiSc0RunT0Nk4jtVZ9ZopUVkIIdWStVtde4EhMxJPHIa+gPEmUnzmr1tX m+/LjX5qGj/UKXLdEOd0m3BqfjGbUBg6nsR3nDc8r3d4dJEZgp+0hPNbbIXemb/FKtvRobqSr2w wrzOQUEk7Q0boBDI+9uJUrf+laEhRCOKBkLedKtsJ1Vla6EXuaORV8CUx7oXvPOHNJ05QM+ekPa HAX2OMcRbhvAHC0f1XhXc3AxoEH+CV3m2SytVRLkowQoEkS2WKcC3DVomB177DbjxC9Pj5Sz57g LqFf8D901TFXmVvTAzB0eLHniNjDzN67AGFdCmcIX0ozGZklFpjfJS6oyWa62VPOzumjsny2NOU Pm6M9e6zGCfScXU8DUExHBvfcoLCtLpWV6eLJM0VA7CVgNS3BLZ66E8Cv4WsP9hmhKUmIoCrAP0 3MTY+e9Gle6idG/+K7iDcyfJS5KMeJiHmkH6CO8BuGvneaMBVzVOZ2d3XMtEXOOiPLeZvMsFMZL iqz535t+/p/o3wiueR4CC+QgUD2R7K6pMK8OqA6Bb/i+3B4fZ93L/UkwxR5vXooQvL03l+RHJ08 y4GDcL+NROcYz6NBpAJOczSZ+QNtjk7p2W4EApu+05V1qmPUpR1t76GR96ATbCxLRJZoDStgp0z DW0Hj54r1NWFmUg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010400_296266_82164234 X-CRM114-Status: GOOD ( 11.60 ) 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 drm_format_info_bpp() cannot be used for formats which do not have an integer bits-per-pixel in a pixel block. E.g. DRM_FORMAT_XV15's (not yet in upstream) plane 0 has three 10-bit pixels (Y components), and two padding bits, in a 4 byte block. That is 10.666... bits per pixel when considering the whole 4 byte block, which is what drm_format_info_bpp() does. Thus a driver that supports such formats cannot use drm_format_info_bpp(), It is a driver bug if this happens, but so handle wrong calls by printing a warning and returning 0. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_fourcc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 193cf8ed7912..e84c4ed6928c 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -429,6 +429,13 @@ unsigned int drm_format_info_bpp(const struct drm_format_info *info, int plane) if (!info || plane < 0 || plane >= info->num_planes) return 0; + if (info->char_per_block[plane] * 8 % + (drm_format_info_block_width(info, plane) * + drm_format_info_block_height(info, plane))) { + pr_warn("unable to return an integer bpp\n"); + return 0; + } + return info->char_per_block[plane] * 8 / (drm_format_info_block_width(info, plane) * drm_format_info_block_height(info, plane)); From patchwork Wed Jan 15 09:03:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940079 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 6E2E5C02180 for ; Wed, 15 Jan 2025 09:06:46 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aOOyGUbDzicb1G/j9ogjHVcDlERLbZ/tgzdiqB6jZvg=; b=OgW1RmobXSuhb8tbql05HEQgwr fzSwkzazmGo/T4SMTJTujgQAZKwSQWnAHi7pVyX/ccA5nSwjY4H0yXHpp8NXapIdZwgA0sPjHFWZJ L+u97BYVds8/IclCBPG0ti4qKKndijNG3mcaCM9bRoX6iCvmgWjb0JdLtbRV793KldowOjSfBzfEX gcoJoXp4+oBK9lovqbEe7+yECE6qNfDLkQFRGqYKjuo9HeffG2e7VooXwmG119OHt3pK5DJkjn08v XZdtCWtzB+4H/tZELW+wZiIe+r4NO4zZ2chnungcb3ujClvxLZ8Htsf3ygvlrHDRtkKmDYyZiq8gb hWhh4HyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzM9-0000000BEEz-2J31; Wed, 15 Jan 2025 09:06:33 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJg-0000000BDO6-0rwn for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:01 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 85BC81112; Wed, 15 Jan 2025 10:03:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931781; bh=peMIGVKca9OHRX4eHaZ33k92czm9ZLEx61OIc/CzyAk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lttgIIk77PK/OKpV1fcfrlTXJ3qvp0e7RvCPSfuvk38YIEsiqjwt9HJ0XIdzDkPt5 r4XxYFASwd1dlfN0Tr13qR1fu/aLeBelUr+ogeXuQDJE1DmOAoWNdZ1NG7lD3pKAKp ZWB6uyHHX5bdbkI7fZQJPwn0ym29tS7whXWZ9Lww= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:31 +0200 Subject: [PATCH v2 02/10] drm/fourcc: Add DRM_FORMAT_XV15/XV20 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-2-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2152; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=peMIGVKca9OHRX4eHaZ33k92czm9ZLEx61OIc/CzyAk=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n4vxsUx7sqsVEIYcLW6/JfmxjbT77jBhtQg TpJei9aoVmJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+AAKCRD6PaqMvJYe 9f92EACyZInkaNXOhF3+mN5CubzSVIhuJi0eD/cJdZPzJdBhUewjTlqFjdlefzbfzeJgF/0uKWM 9ANR4vQnuu/trfyuvtnD868JyFABVAh0IiS99ceeQ/eMSTsb3diZ/xpiumtS19tmQDRhBZpVora HwQzXE0Ei8Yc0F0iEo7dpqFNgZ58ZP7WoLoeZbf0/1rKzlkjPVNLRdWSmmNqDtw75KnXpCcrQMm 0FGQZD9Qr4vexHHV+ajHhgh+ahjeRXHf3/FTpAVqn6pqJ6mi9p0vamMAR5Pl5FP54zJCbQ8iydm uojAiL2MW2uFmIsq44u1Hl0DPUsu3lzt/sk2f5G2nH5hWhnonFHZJNxJCHQX6YrNqmq9UBW0T55 PMR1i2XSJS0fYC6kTAcP066evtdI4zK7eM/fRJN1v2Z97KIyHqXsVFE/1IjHIKrcFvFxOvchyMF n0rCHu1ojj+zXogCils22GOh3U+B/ZSPXPGWmG42GuVxHndSk4hsRRWEJgzAWAYFw+TzXhuwNxV 2MeIFWfwaSWvNfLAtR5qWU+qZ9JhPs2cbnXDj/IyDWCKYGPo61qL2FBVxIibSxYD60AEZaFvR+e Sedxz0PsNWrvRMidl/HNk6n1ZcPBsPbELr1Qjiul/kpptZQu79FRyeuO6ix7lk0TdFKco2VFM0p zk8wqTV2Fn4bOzw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010400_392255_5F6A75F9 X-CRM114-Status: GOOD ( 10.78 ) 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 Add two new pixel formats: DRM_FORMAT_XV15 ("XV15") DRM_FORMAT_XV20 ("XV20") The formats are 2 plane 10 bit per component YCbCr, with the XV15 2x2 subsampled whereas XV20 is 2x1 subsampled. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_fourcc.c | 8 ++++++++ include/uapi/drm/drm_fourcc.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index e84c4ed6928c..adb2d44630ee 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -318,6 +318,14 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_P030, .depth = 0, .num_planes = 2, .char_per_block = { 4, 8, 0 }, .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true}, + { .format = DRM_FORMAT_XV15, .depth = 0, + .num_planes = 2, .char_per_block = { 4, 8, 0 }, + .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, + .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_XV20, .depth = 0, + .num_planes = 2, .char_per_block = { 4, 8, 0 }, + .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, + .vsub = 1, .is_yuv = true }, }; unsigned int i; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 78abd819fd62..2a00adcfb1ff 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -304,6 +304,14 @@ extern "C" { #define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') #define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') +/* + * 2 plane 10 bit per component YCrCb + * index 0 = Y plane, [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian + * index 1 = Cb:Cr plane, [63:0] x:Cr2:Cb2:Cr1:x:Cb1:Cr0:Cb0 2:10:10:10:2:10:10:10 little endian + */ +#define DRM_FORMAT_XV15 fourcc_code('X', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane 2:10:10:10 */ +#define DRM_FORMAT_XV20 fourcc_code('X', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane 2:10:10:10 */ + /* * 2 plane YCbCr * index 0 = Y plane, [7:0] Y From patchwork Wed Jan 15 09:03:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940080 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 8943AC02180 for ; Wed, 15 Jan 2025 09:08:04 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OTEmncciocPRgY7H5fUjlRkCt48qMFTt++Vy8wJxvVM=; b=0L8kEc0BIC4GSYiss78/VmBj3p 1oJXnofgzsFg9+Cb/YQXeK8ixs41tZ1J/8nkH8Weba3e7Xg+cL+bf8VjcuhmFTZNt0kI5y5cyS+yj QtwoCBCqxEiCGcPP44ADPAKY1M1pbO6nQ4qsGrdhkKaclNd4T1PcVYZ946XvuorVLRIDGC0qX4qFO wwR8OrpgpVYFi1fgObtuqNH1P4OdEapgoNkx4G7hDYxQv4/pRvrHxvDNJO5eqi2oxlwnDlr2Mm8JU LuqmFGrpRu1Hs81RoFfnicrOwwPZXby6gfGyCpP4286ZyrRXpOoI2wXJkQp+w6DZeJaR2CokFr5Ax WDSzTZ9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzNO-0000000BEc8-159l; Wed, 15 Jan 2025 09:07:50 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJg-0000000BDOD-3vjR for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:02 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5C22413DE; Wed, 15 Jan 2025 10:03:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931782; bh=mf5laTsJQS47wTWaPVq+HhwOLi61DaR3sotP+bSFleI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=wIjUOXoTrCAsZyIy6oVy/itUfwQu9oNqpBayUzZ+kYXDQRFzwAZN1uo0dQxq5ZjvO l/1S5T4qpNqtLdiuPHQ61LcoEqmOoOujugrnbMr4yoa7RzFNQHooG8YDFgySB4Ii4p GrdJKp0l25VnPxV5+grBzfXNGh4aBhF3SnQeYku8= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:32 +0200 Subject: [PATCH v2 03/10] drm/fourcc: Add DRM_FORMAT_Y8 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-3-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1945; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=mf5laTsJQS47wTWaPVq+HhwOLi61DaR3sotP+bSFleI=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n5zvpecihnBOCdSx1weKiME2DEAayx1A2jv fA/3PoFUBOJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+QAKCRD6PaqMvJYe 9QbID/9GekFdMW0H18lXJ9fm5qUiNHHc+Iyzp1+DxUB6NtlHy9niKCNSrBZWEd4r4z6qTOAbURi hwUMsuIp8nDWiNdX/XvLmGRTHzrGtyDtvVzodr3xfw5PVFGCqfzHvnpthMdYf2KhjzcBLTiUaA2 ovvdKHS3MqrgQh7fau3JIDk718kEM4a7yIcboLyzaNYMLtgj6HAPo5JKQyGuccP3AXFHLTzUOXt UUe0Rh56/dq7MDi/dIR1Ds+ynsFj5E8jmu39uUTUmQykEE7mDEBn8P5rxsXz48NNaBSeblQscoO 0kUnLH0xhWwmwACTJ9AZbL+FCfYxj01AX1TJN+ACY9K+DjPKUOWdBvvQGYk2RnA4OWdyIEmM9F2 NO2yD+SECjt5+cTx4VJ0/olpnmVSEgW3KzMefluX3QuzOVFNKDkRWG93is0FEKY0eEKE1qsbmEn uJI9NJzskJuYNTyJw7D5REmCHvd6Yr/7JdiDPINHhJuEgZornrYEX0tZ1bVyk5K3+F+5j8Mhlgt OSWALRQtm65G/lJgZ+1YJ4DW0KMXOJ1taHtWh+Rs0nmtk8uRfXst5RJSnvC9+JkZKcUhLTpT3oS TrABXctCqUs7Vla74JbQJTvrq3hHZbvTxDPciZCuh9VTRGHUVpQ7f8YxUiaELAS8NblSNiiyGMv aPv5VoocYqvqopw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010401_115963_6B9365ED X-CRM114-Status: GOOD ( 10.83 ) 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 Add greyscale Y8 format. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index adb2d44630ee..d721d9fdbe98 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -239,6 +239,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_YVU422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_YUV444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_YVU444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_Y8, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_NV12, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, { .format = DRM_FORMAT_NV21, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, { .format = DRM_FORMAT_NV16, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 2a00adcfb1ff..f79ee3b93f09 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -405,6 +405,9 @@ extern "C" { #define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ #define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ +/* Greyscale formats */ + +#define DRM_FORMAT_Y8 fourcc_code('G', 'R', 'E', 'Y') /* 8-bit Y-only */ /* * Format Modifiers: From patchwork Wed Jan 15 09:03:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940082 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 CFFECC02183 for ; Wed, 15 Jan 2025 09:10:34 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o95xFBwXv2K16n78vEEBZwWDKXr8OFOaYIkXl4h5P3s=; b=32kopB6a/r6VHVjg77EhwG14oY jZMr1nx/FTfHwD8ZD5XNco6nZ74fvwTXsaQUEyT4byIA4VxddCLqC3K/VhcRdS4nl+mzd3yycIF9V afa8w7Avz9wKT+J1u/Hm+6BSoFSTHBtZbzbfmOQTrBu5WoLofnCJjPsMTYezTTC+f0oJziFhYrW9j if8+IlwC7/In4z3r2QR1TN8UdatJE9onKhQkqj08q/yApeLcq2siiCc0Icc9FK8tb6Aj+wQbqYTB7 zgyrjbSS3x2RuNedxFS78MnfvjKLxK8xtfSQ5cKgkns2avG53/WVFFbBtty6otiO+e3LLktQTpce3 TeQnh41A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzPo-0000000BF6A-2F9T; Wed, 15 Jan 2025 09:10:20 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJh-0000000BDPE-3gdh for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:03 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 30B161590; Wed, 15 Jan 2025 10:03:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931782; bh=VEG1ALEFNM1F93BsCWl8qDBhs0YQBurl0cCXuVBUBZM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Dz8K2eou1/Hmp8fkP5yZ9WLrsdhDWJQdEikjqJ/0bMtz0Hd7kDvW7DcXSp5HOnaED AhYWbEvRu815egQAnJfeV2NSoKArAw/eYflW5ylgbZx0m3bLhS+Kz9ivsGRp8JUAdb fswd6KXe8gRdSv6BC1QZnSJv6ilocTTLoD5GyitA= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:33 +0200 Subject: [PATCH v2 04/10] drm/fourcc: Add DRM_FORMAT_Y10_LE32 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-4-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1426; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=VEG1ALEFNM1F93BsCWl8qDBhs0YQBurl0cCXuVBUBZM=; b=owEBbAKT/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n5CbgjNwvK+aJXP/A81+nliKeov42UbIZ04 zksUcVSn6KJAjIEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+QAKCRD6PaqMvJYe 9VODD/jKELuauUo6+tNfgmVIAphb+SlBc+FIJtENPBhIv/FE8bHncNbGR342JtxE4ANPfJaHadD AylETZIafLcM+2JhY7SKpDSlkz5j8zcap+cllezIXfc4T6qMZ3q8XU90ZGwfjbssxcF+ckjCZOd OxBxwjiAxT6R1HLKhand0bufwvBJhFflSD6L8H56GPKt7LA+EVcL88TZlOt13nLvk10ZvUAQ9zm cBeMrQEBRrTOhzxQrKlHSfHTiyAitqDXN7ac/7yJV5HWsPFCjar1zz3H4TWWayIOY0/wRgEIbjl J55EyzYPUcOZU0ZkcXs4XSGy0SBZ6XXcTrZDWhi+91p54ltc+fGZyYIkL1UxE3q5a4yGYeJQ9sn qDzC66Y1e2Bdbld3l5bXkFyI2oNKzXVSpFieaNho0dpbLOj8j5Xv6HnlqsFSGKs68uLabEPPgVL h7bGP8bjGsJHC0Gt3Rrw9M7P9YW/9xmzBGBxHLwDcwKEWZmUvlmQdZ3+SvhhBW9FW9FmYPrelgC ICVdpuiqfgZkbEGPbXdStxWAMF0Mg4rFBSLd9V20Db9vLBpDs9KhlmZaj9T38Gpe3V8w2shWX/4 q8OC81KlRh0oVV3cFqMPOBpdrBCazl+I+dcdn/0rk/UajGqZCV/ZqGr/nqoY2tfxlJf1SwW7uYZ YBgL8oW2RWgUW X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010402_058025_182129FB X-CRM114-Status: GOOD ( 10.42 ) 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 Add Y10_LE32, a 10 bit greyscale format, with 3 pixels packed into 32-bit container. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_fourcc.c | 4 ++++ include/uapi/drm/drm_fourcc.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index d721d9fdbe98..6048e0a191dc 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -327,6 +327,10 @@ const struct drm_format_info *__drm_format_info(u32 format) .num_planes = 2, .char_per_block = { 4, 8, 0 }, .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_Y10_LE32, .depth = 0, + .num_planes = 1, .char_per_block = { 4, 0, 0 }, + .block_w = { 3, 0, 0 }, .block_h = { 1, 0, 0 }, .hsub = 1, + .vsub = 1, .is_yuv = true }, }; unsigned int i; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index f79ee3b93f09..03be2aa40265 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -408,6 +408,7 @@ extern "C" { /* Greyscale formats */ #define DRM_FORMAT_Y8 fourcc_code('G', 'R', 'E', 'Y') /* 8-bit Y-only */ +#define DRM_FORMAT_Y10_LE32 fourcc_code('Y', 'P', 'A', '4') /* [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian */ /* * Format Modifiers: From patchwork Wed Jan 15 09:03:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940083 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 0958CC02180 for ; Wed, 15 Jan 2025 09:11:48 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WudddrwsRAeK5i5/asPqdQLX3Xhdqs1xktaqiWAVLxg=; b=lomWs1RXfCLsFiY4oUth38eUDc twvnwv03Dsr3YP7A63RMrzXbprYr2gHrpeajPHmAHyhISY9KEgfw/dC3NurECIoxYSPGphzS0a1sn 4gmw5eBYpggKZ/NlcokV7BQLR6yCD0efpwFR1TXU4S3lnfTd2Lt/UR+e+0W5w7mvkLaiGs5XfEP/i fMdV1CnGYp1V4W1w5ic6uj1p5usfFUam3MFNtD4gmCIMYXnuRxvlVk5h601kXhigUYiXR/HkZbE6W mjUyNcAsbAl8Xq3aAreFptSLMzZBSys6vDH24WF1oRwg1vjWvDtovRhag0BkBfF3sIO6wkrmSjmA7 F1pXSECA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzR2-0000000BFMS-0hi2; Wed, 15 Jan 2025 09:11:36 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJi-0000000BDPm-2UYs for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:03 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 07BAD1648; Wed, 15 Jan 2025 10:03:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931783; bh=o10kvymxI7IX4K5Z8GHR6ipSEBl5QcVhE5nldbyB7to=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i22h9XMlbpdvEfJ+x6cvhTAMH0V+LqNWNYqhQ4aZT8ZN7Bp6m+bJSWJdvOlHU06Fs cRvMZgHSNfoMBouxZkVjpY4xKiyML9PykHvaYZpQnFfymtZq4Djtd4BVzwZMOc7kMk uIFEPxfB3Tv5bNjQOGakFNlNuWampCkc8UeHv4M8= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:34 +0200 Subject: [PATCH v2 05/10] drm/fourcc: Add DRM_FORMAT_X403 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-5-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1661; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=o10kvymxI7IX4K5Z8GHR6ipSEBl5QcVhE5nldbyB7to=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n5u10I8/ET89g+YpawG+ouQvNRxumyCktET FZ38MFzHqmJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+QAKCRD6PaqMvJYe 9RTZD/9EbwnHoP44zKvHwBUeqyobpprWMF+SWOgeKgno+sWtGH4RQBDuxvyQEwZ1oNbORUx2BKp D7ZFkaJhcGmkR9wPsL3zFvQdnQxvjJPm1yy2wHZ+GHL2BTi+2lqDsWXF5Qbvq9xCTZPHnu0BWAk VmfPHs4v8Tce6v/U0uQ0MGT/z5F6dnEMepPXXFFWCUCk+4DAwarXtdrLUeVK7ho0ppmLBRXKrho f4L0dAOZHheKltFMApCzN+V+LZLKKP9ASXVAIqiYl6wjkzD5TKOMLYdV9iSAIDwaWalO+Ra/zTO E4e/gHHt9gEz+sTUl1D70jayVd6R3Be9hdbTU+0jI2TBl3EUgjw0vxyr4HTpIuoiSZ8+7VQPQ3F BEHpzH9gZL63EK/eBw+nDHHM5IbsjVSElnaOi513vE34gcv2o0lRLwrSSyIzDkHoBRTlBxHYKoe 0Nf34z5rj1Gku7jO4XlIkeyMFVOcjfmvARrQynEziejsOBLuSOwH1+PjOdSq613RxWX47sbMHXd AbRdKYs3e6KSMLF5K9mkRV0exgw53pfIvSnAHSt8PtnEiYLv5t6Bwzk2GWFvllB2ttSobHD838/ hLlLNwB1cUT/digBrq6NYQB+L7L27oJ04UJWgDeAa4hJCCDQWHI1LQcPdfbBm9TRSfrMwj4hYls ts0QV0Y+DyTWzug== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010402_783948_C3608238 X-CRM114-Status: GOOD ( 10.35 ) 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 Add X403, a 3 plane non-subsampled YCbCr format. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_fourcc.c | 4 ++++ include/uapi/drm/drm_fourcc.h | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 6048e0a191dc..219113b5924c 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -331,6 +331,10 @@ const struct drm_format_info *__drm_format_info(u32 format) .num_planes = 1, .char_per_block = { 4, 0, 0 }, .block_w = { 3, 0, 0 }, .block_h = { 1, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_X403, .depth = 0, + .num_planes = 3, .char_per_block = { 4, 4, 4 }, + .block_w = { 3, 3, 3 }, .block_h = { 1, 1, 1 }, + .hsub = 1, .vsub = 1, .is_yuv = true }, }; unsigned int i; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 03be2aa40265..a7a814a1472b 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -385,6 +385,14 @@ extern "C" { */ #define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1') +/* 3 plane non-subsampled (444) YCbCr + * 10 bpc, 30 bits per sample image data in a single contiguous buffer. + * index 0: Y plane, [31:0] x:Y2:Y1:Y0 [2:10:10:10] little endian + * index 1: Cb plane, [31:0] x:Cb2:Cb1:Cb0 [2:10:10:10] little endian + * index 2: Cr plane, [31:0] x:Cr2:Cr1:Cr0 [2:10:10:10] little endian + */ +#define DRM_FORMAT_X403 fourcc_code('X', '4', '0', '3') + /* * 3 plane YCbCr * index 0: Y plane, [7:0] Y From patchwork Wed Jan 15 09:03:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940084 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 7EEA1C02180 for ; Wed, 15 Jan 2025 09:13:04 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ekvc+8cenCQ1dET9iIyU3+lCvf2vHaYLTQpU/JOCA8k=; b=FQgGqItDLFEomlni7PaCozkn+8 xXmrmOwWGtcPx88cupiI7BsnvBQdNn63u7vbkFZdS5dddcytC56b/oydbzyWlgOxClNkaYSo9YmWv vnz8qGc2QcmJ8V/OgxyjNbIHPQJR63mmAr+IJeZMiR0B/vt5Dn/acaZZ+wHddaWzGUFmU/0fsfwU9 2xSls6WMh2yQtrm15UMUhbTFl+jzKQTGbnwJy5ZwuEdEiBMSlEVShwnXfPyQipDB+cGjmj6Yl9xiz VeIeATPNE926orzxnDaICnUhrgRo3FyYd/6r8EnKxkINhIRs3A5H3YGKJ4aI6CvlOW754ogPUijX8 Q0g/NMcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzSE-0000000BFTm-3WCO; Wed, 15 Jan 2025 09:12:50 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJj-0000000BDQ6-0V2E for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:04 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D75193AE0; Wed, 15 Jan 2025 10:03:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931784; bh=U6QTUkIufzSv6Der1HCIiREWkOAz1oZ9ohmvRY4oz/M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qbWIXVxqfI0rSpLfg9LhT8n2wol33AGBrBsRxYM4+ALBmQgVNyxjMaAf580Ndg8dp Oko2E380nMyDNLAlquADJNZehoDCGzjzNDxs+ohVfVdKL0k+5sZWfBFxEFReVumauS vU0sQeTkb+FngsSxYmc0/K6+2nL2CmqRsya22jdY= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:35 +0200 Subject: [PATCH v2 06/10] drm: xlnx: zynqmp: Use drm helpers when calculating buffer sizes MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-6-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1538; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=U6QTUkIufzSv6Der1HCIiREWkOAz1oZ9ohmvRY4oz/M=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n61oQAc0u1Ou7DXiuRvHRa07pTwm8/OOF+5 ybQ1ACqjZuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+gAKCRD6PaqMvJYe 9fMND/9xLlGCe1UCk64c66UReZZHQ1XVpQKfwWM0n7zWqRfUyo5j/LjlwihD2hvvVU+rlrAQhh0 M8LjxtXq/yrqj0mTPJEdIhW5LZkUns0q/KH3GNIlMM7FqB4pVoYP/d5vZ5VNyIA/8dgUUpHikbk YIYkBNCbhrH+5+Tr0au0qVe7qIeenLV3EvV4Zu8U+RtfdRF0IoNJ1U8INRVOgK2EHxCMknGW38r rSzqzPLwQhpfWkq46PuZpBg/4fR3RQ75P8W6KoicmbF9JViF++QFtEmCJzUuM8Wm56jGw6rKhK5 NrCehVppd0+2Um7qQeDs2HDIpd/iOP8HvWXqH94LJEF2RsOEg94FV0vFPdHge8igbNUkmACDZhl HPo301jB0S/K/Erpep5jUi8RlfFEN1eiyTm7N/CXDU2XBc3v5d26/V3h2c8RU7uSN9VSo9YWJio gzVRWf4VQwj+FUdMEf6Fgr+wFy2tkE2Jig/R1GmrMfexS56Of6BGcNvmufP3qrfS4GS/7gakbma wO2C8m5zL/zZYJ5ZGco4Gcwd522nVT55NKrVzrWvlt7dZ2zhHq2kH9xjy6OEavBUi21iCg11Pl+ LHjJ1y12orpkUWJtw41xa1Ozi/JG4gcYifRrP8Nz9+YXSA+1ZbismkBxDhsS36hDInxMlJaSHR7 e+hS2PX152nftAg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010403_306834_9796AAA5 X-CRM114-Status: GOOD ( 11.37 ) 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 Use drm helpers, drm_format_info_plane_width(), drm_format_info_plane_height() and drm_format_info_min_pitch() to calculate sizes for the DMA. This cleans up the code, but also makes it possible to support more complex formats (like XV15, XV20). Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 9368acf56eaf..57221575cbd6 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1154,16 +1154,18 @@ int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer, return 0; for (i = 0; i < info->num_planes; i++) { - unsigned int width = state->crtc_w / (i ? info->hsub : 1); - unsigned int height = state->crtc_h / (i ? info->vsub : 1); struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; struct dma_async_tx_descriptor *desc; + unsigned int width, height; dma_addr_t dma_addr; + width = drm_format_info_plane_width(info, state->crtc_w, i); + height = drm_format_info_plane_height(info, state->crtc_h, i); + dma_addr = drm_fb_dma_get_gem_addr(state->fb, state, i); dma->xt.numf = height; - dma->sgl.size = width * info->cpp[i]; + dma->sgl.size = drm_format_info_min_pitch(info, i, width); dma->sgl.icg = state->fb->pitches[i] - dma->sgl.size; dma->xt.src_start = dma_addr; dma->xt.frame_size = 1; From patchwork Wed Jan 15 09:03:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940085 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 762E0C02183 for ; Wed, 15 Jan 2025 09:14:19 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=k1IWz3ETVJRu4jvTxLCDECc3u2dAVno7sYm2CwsHz3o=; b=eioWLZ9SXd8l++E3w+YMh5awNj QwBjK6Gles0GBIyW0PTpEsdGYxog2bo4NSgKJWK6d+1VOhPtP+NPcsPb6JOpyoqRwdkjlKHxLRdWp yIvwcI9lh9eVqHZVRKJqH7+iM+6k0S3rYKQXFM6WcDIGUkSGOZk6FVkxEHLQ0pUCkccf4VQleMaz0 rcWmBd+eq3kC7ZGGRc/kt2WmZkaAdUqvoKQZfLZUYN33Y/W6y7mrN/aKJoPWeB2unQ7sxol+BhgmO lhVc0pf8HASAXbnEohr69iPChRK6vuflyAZSt0tOVx/8wszjPYWQDP6q6bDpR61x7lv/4cbKzEzCq Ake7DW6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzTS-0000000BFZm-1zNZ; Wed, 15 Jan 2025 09:14:06 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJj-0000000BDQv-40UF for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:05 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AC7C93B33; Wed, 15 Jan 2025 10:03:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931785; bh=3lV+l32vg2JpWZEq7vy7NUNpO/y6nBsRUh7Y4B6/+ho=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FZ8Jyj55RQ93WqJAAiPdlxbMXxgUwhO2i4D3Z61ZBkeFDsZEGicPJn6/5tzFDTc+9 1TUQFBqk2rRDRNJcnTCLlcUmIX9YOsU77lutn8H/VHKp1tynIMqs/evASQ/0cBLuUv zn9kin6qMoJOYmPcl2VGPvvOR8xe21bPbQ9R65fo= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:36 +0200 Subject: [PATCH v2 07/10] drm: xlnx: zynqmp: Add support for XV15 & XV20 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-7-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=936; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=3lV+l32vg2JpWZEq7vy7NUNpO/y6nBsRUh7Y4B6/+ho=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n66hQ9SWwHWE438qJQhC2mJUfR5g9T5WMjx tJLMQkt8eiJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+gAKCRD6PaqMvJYe 9U6JD/43ai4K/IWdQarREzPRDtpuhU3w7wcJMXYYN5J2kpQ+mrcMOq6C2dWMm+VBznkGtjMZSwA c/Iir9PPohmZO5n68MYt/axhq5Vtv7EbsMYxiCObXbFALD4jCihovEqtnlyKAB+Gemngjdr6+cM n8Juj8iP9Rxv07y2bsmSIYTXpk7yKqKioV6JZPAGQzUM+q2SOVKCQPezdaDVYfD+ck14/JrNS28 UofnGflMphGbr4tvc52C1nFWoe3h8C0daKdOkiCXAnDblQeakUragcV5guKzTkj9LyGYjYimubZ HnO0aLtEtpYw+mvnO4MaDRuPke5SHs1FYuGEwQg16Ih8yprvF55DELqaxUPpgH+y7AsaPaik9/T LD5fYEXzFUvQrbf376nrDFPbLhV2YiUHJaGkoiS/YG8yusfMghc3AAN1lXyJZiDhdtJcDjNrl1w gdWl4pEKVS6D708+W65GG8lGrETSty4vZDJkbUnuNjWacF2pOSwuxoBDfxocU2azbrT15pFgIo5 9WHSH2qv8ASY47IcMQvI3UvXuMu/0tZMSyW6CyqJP3gXsUyPjkhmeNf9xfAZpoCY3T4gen4VmjM 7MJ+/dKhGlmPTM3hT/BVLp2k28AM06PlU1QWzHk8tZ7Uh7zF06cGo+Kyn9y3GN67M75Og9HQs62 ME+8LWfSDcA3raQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010404_145536_62481CF4 X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. 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 Add support for XV15 & XV20 formats. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 57221575cbd6..3998754e367e 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -299,6 +299,16 @@ static const struct zynqmp_disp_format avbuf_vid_fmts[] = { .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_420, .swap = true, .sf = scaling_factors_888, + }, { + .drm_fmt = DRM_FORMAT_XV15, + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_420_10, + .swap = false, + .sf = scaling_factors_101010, + }, { + .drm_fmt = DRM_FORMAT_XV20, + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_10, + .swap = false, + .sf = scaling_factors_101010, }, }; From patchwork Wed Jan 15 09:03:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940088 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 0A1F0C02180 for ; Wed, 15 Jan 2025 09:15:37 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=exgdDonrVR2LwCxtcbRJ2e4ffwuwLMZJql3r1ltR1D8=; b=jSkbCmKgNmMJFBFUgOOf/x21p5 WKw0f3z8jQOaDb4Z5b75zc+YeyNvXWLJzEgR/jf9ltfF78m07HgDoQTefW7zNi9nMIP+z9CTOKwY8 xKCUNGfxNN2jhXCM/lBkCa7y01T9C6XSiJrmBtJnBK0lAZqmYHIWj1gWuMFT9fA6OYkrc3fJa8PmN c25B8CGy3aj/qZ0Pu8sbJjJkqiJSd0/5JRKezffO7r/1I/E0qDQof5LU2WTRYahosw/O7OL3Hp9lr KsjdRV70/MIKmYrYmY4MtKNwyPMTl9UlfMRnlxprJ6FOu9MY8sj6dhX0QiBnzUL/DZwZ/nj9EhO/b t8ALm5lQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzUg-0000000BFnT-0QNz; Wed, 15 Jan 2025 09:15:22 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJk-0000000BDRX-3C8e for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:05 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 82C233EEC; Wed, 15 Jan 2025 10:03:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931786; bh=vSNfl+dk45d5cm6nnQngiziPUpAD1SE0JXcPFtyqb6E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=noYiI5DAFQ6kPyO3/qVdw3HTWXDGdKEyFyz83owDgBSAKxh10Ii+5GZB5Igag/+2v yZp9rmVcyFn/stYtvzUoZtTXvlZwvgC/SdpIHuSF5kX35H0QufQ/N0MppSHDzIY6WP ASSCowLPVcLujeWHrlFqZMGF4+3p3GTNlsf/w9Rk= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:37 +0200 Subject: [PATCH v2 08/10] drm: xlnx: zynqmp: Add support for Y8 and Y10_LE32 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-8-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1966; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=vSNfl+dk45d5cm6nnQngiziPUpAD1SE0JXcPFtyqb6E=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n6RKceVGVDHfg+MYO+EE3OqKVDxw4mxlMrB yzt/Jj5WiqJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+gAKCRD6PaqMvJYe 9bSHD/4jmLy2w6nPu78ohwU4OdHwdovGAZ8LtpyIrZ9aOLc3qAbLLUCXwwA3hELlGG3jvUj7Mlg bvJknJuvbWfu5ekLhGAr/4R5ie/dt0dpKcEoe7ISN0MRxh13SHL/1oE1joCpgaAwdtJlJq8gyoJ ybGldR+PNsxvHASpvK4uGSL69+XLJp8/OyEjFN3ccwi417kUVJzushnPkM3pNQPdZSBY0yCYXoR v5JosH1dBNOT59MgfDiTWdtE2m42reAxa8Fdnzxba8TZdUO4p4ZyuG3ERUheH7nJZk7HRXSS44E PnY7Pe/9VkAg+XqpBVujWF1AnvUPL940E2Un0vs544YFs1cX4eTkxLubCnRc8bu9G55D2T5NX/e S/dfQDtSED6OIbf5FBKXVmM9Uz/GXUXXcnnhkwpQuRGu7z7ynPSQimS5SU1kXK+YWnCbqoGH33Z L5zzsZFNVfISUttrQKYkRJZ71D+zaDLIqUGv+rK//RJsARNw7zk15jLRyEnHm/fKzTq13iJ4zKr ESm4QHaytEGvmTmODaKJg6PM8FksqkQYoEOKIwWLwL/+Kv5TKACFUrql40zPC7CHO96PRoEI2dz mWFlK6l7FVYKy+YV1P+uLqSZztvK8OqGdtcwZr/wL/K9Q/5PCjB4CU2BaC0ftrAsIaAsKZcmi6/ tBkZdZu6xkOFzxw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010404_940077_55761E0F X-CRM114-Status: GOOD ( 12.98 ) 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 Add support for Y8 and Y10_LE32 formats. We also need to add new csc matrices for the y-only formats. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 3998754e367e..44cfee6a0e32 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -309,6 +309,16 @@ static const struct zynqmp_disp_format avbuf_vid_fmts[] = { .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV16CI_10, .swap = false, .sf = scaling_factors_101010, + }, { + .drm_fmt = DRM_FORMAT_Y8, + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_MONO, + .swap = false, + .sf = scaling_factors_888, + }, { + .drm_fmt = DRM_FORMAT_Y10_LE32, + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YONLY_10, + .swap = false, + .sf = scaling_factors_101010, }, }; @@ -699,6 +709,16 @@ static const u32 csc_sdtv_to_rgb_offsets[] = { 0x0, 0x1800, 0x1800 }; +static const u16 csc_sdtv_to_rgb_yonly_matrix[] = { + 0x0, 0x0, 0x1000, + 0x0, 0x0, 0x1000, + 0x0, 0x0, 0x1000, +}; + +static const u32 csc_sdtv_to_rgb_yonly_offsets[] = { + 0x1800, 0x1800, 0x0 +}; + /** * zynqmp_disp_blend_set_output_format - Set the output format of the blender * @disp: Display controller @@ -848,7 +868,11 @@ static void zynqmp_disp_blend_layer_enable(struct zynqmp_disp *disp, ZYNQMP_DISP_V_BLEND_LAYER_CONTROL(layer->id), val); - if (layer->drm_fmt->is_yuv) { + if (layer->drm_fmt->format == DRM_FORMAT_Y8 || + layer->drm_fmt->format == DRM_FORMAT_Y10_LE32) { + coeffs = csc_sdtv_to_rgb_yonly_matrix; + offsets = csc_sdtv_to_rgb_yonly_offsets; + } else if (layer->drm_fmt->is_yuv) { coeffs = csc_sdtv_to_rgb_matrix; offsets = csc_sdtv_to_rgb_offsets; } else { From patchwork Wed Jan 15 09:03:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940089 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 74A3BC02180 for ; Wed, 15 Jan 2025 09:16:50 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0iby7aHHCn3scQ8TuJ3LcajNFYLWULv0S+s03g11tAg=; b=2GgP4+KN9+TtpzYAKTzQhM6stY RbdionKaP1AspygbLH01IHCt6AZrNu4YSFZ1OTYHyUoLCktgGqX5ZAFZMzvV5ws61xJV+AkaAUjr9 jrKqRi9n8D8yVcbQybiOf7R1m09Wa0T2ax5e2L+UQny7kquuDN5s3cLfwpyYKoy/ohSrF4l6kn/Se fdctX2DGGozawrI+1JmDbIOhkJJe4DpcAnjqw/a4iVytkyURUyBUAmGTE1UgS0TN1u4I42uOYKcX5 vOQzHLjQm2JWd8Zv0yyE5XidH0vXGEkv2VU+RuZdHwA49Qa+dbLJ61K+UVde9LD2ZngoEGawW4oGS KQMDQu0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzVu-0000000BG1y-3EXM; Wed, 15 Jan 2025 09:16:38 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJl-0000000BDSP-2Suc for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:06 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 53EAF437A; Wed, 15 Jan 2025 10:03:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931787; bh=2kTYJooFMq+5La3iJTTLvA+HVNIvS8ojV7vTfwy1oII=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qFEjk+vNWnvlpIMP+JuyPYHxsLHww49Ev7/nBgpam8MTKdWNqrxOehqXGYB6LkXNS XVWs3N3Td2U86TntBQcm7JxKYZA0aT3TFZSKyN1A+Vq53EvUsA0HFLBUG8cW8k6ERw /w9jxNCc1XX5cmRaORj7nh9X7bqBLhgPb2xBFrbQ= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:38 +0200 Subject: [PATCH v2 09/10] drm: xlnx: zynqmp: Add support for X403 MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-9-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=766; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=2kTYJooFMq+5La3iJTTLvA+HVNIvS8ojV7vTfwy1oII=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n7rDWzvVthDhCLY3Y6GORczfioTlrLBnP+L KBPJ0Er9iuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+wAKCRD6PaqMvJYe 9XYFD/9BgsWoajurf28PxHK1BNO0U+5m6obei6KHLqmRelh7Hjy5bFR9oBQYxW1uTwHizBCD1Iu Sha686bPD6zgbkL43WOQyl9C/sJTXDSx/xGyN4CBhZKXoTCieKX9MLU8iAUcYHwguYQtxgvo402 Cg5hO3XQiMySCU9sspZQv3Ic/KoAPMOb7017KnGW0kwDiXzr48Acb2vJxL8xvlIHzRO1Y6gt0zE ZuW259sWnuOrrzJuUltd2wY1qHfgzoov1H423s4tFArOAKeh9amPsGhLxxV5YpI4XzCBs5G+Kfr wNstw12LKQmlJD/YC9dVdf0nGJatWOQjyoV+BCjrnZvB72zPOnX9+YaghWTGJ0eRVNBzjVKtIj9 iLJeZ4T79d1J75bJ7PEQ+63POUCcPX5NsglGEP4Kb5KV0rJeKHt4SFHFdgVSzOcsy0fTzgl1SrC C1rRYnOFwK20lr/kCxHeOn72c5DSnak5wej9fWYAWZrzksyGPV9R62VH+gPBOgVkIEMG2LJjJN2 WiP7JFmaojT7lD6wHvEmhrJnRbTP+gJlgLxSuUty5Y1rVKaY833m2opAkZraPlcCrvL86/R48Bg QL4hKuUbbL5i6P8p5SGxkyQzjpn0ykoq7e7eG3MEJgFS8hkgkJgvU6Bw11uEzmO5RXsZtYeGV+C qIxUKKjG0jacl9w== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010405_770860_B63ACDA0 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. 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 Add support for X403 format. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 44cfee6a0e32..622d1dfac42d 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -319,6 +319,11 @@ static const struct zynqmp_disp_format avbuf_vid_fmts[] = { .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YONLY_10, .swap = false, .sf = scaling_factors_101010, + }, { + .drm_fmt = DRM_FORMAT_X403, + .buf_fmt = ZYNQMP_DISP_AV_BUF_FMT_NL_VID_YV24_10, + .swap = false, + .sf = scaling_factors_101010, }, }; From patchwork Wed Jan 15 09:03:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13940090 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 C58CDC02185 for ; Wed, 15 Jan 2025 09:18:08 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cu94CIEGB7IrJA44pVbIQn3sn1KmIVV2LpHwQuetYEI=; b=YThv2+ksNWRGYT1YpT8Q8ECod9 5myPd/sGluGJIlnzGSr+3ehfQajmcSAH9HLrTEzfSNYyTu7eQYURC+8md6UD2mFlBqPNUmHJIonqT n88DB7D8HjFpb+xaNY8MCWU5TWxwsbF/j/49soQKqFZTNq2kqGqvQD9mRVbn9R8lEMfnn4yRqGuvU ho0Tkk5HhMwnP3hTrzCYt/y5jccPyqLzGW4Gh3T1E95a4WYtmoffSauKnAsmBJu9oxpJB4PPQr5Vh bxC+mypy6XbGn2VVzo3fl3geL+jyZHga7rZdRpytMq1mGyCrduOEH3YMwDlhJp1J5hkG9C8uN+39Z eQVCu7sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXzX8-0000000BGVF-21OC; Wed, 15 Jan 2025 09:17:54 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXzJm-0000000BDT4-1xr6 for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2025 09:04:07 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DC79437E; Wed, 15 Jan 2025 10:03:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736931787; bh=Z6AQhbg5I9MENjbzvyltnjwwjBTG37ZyGBUaHh8zGq8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sKbBplOexyMCfNjzCiYb+FzSMrHcL7QZoRJ+rXB/jBmhW3rFuRSQTbkLbTSmAui8+ M3FSZ80+8N0QOC24eXLSJSkREw4QQrp/lkZ4CrMG1YlJ5pEJbT9Clgp6GfEFkPhjkV rhT0VN+PkEtOdKUremC9gOS/3uUP8Q7lfI9JcEA8= From: Tomi Valkeinen Date: Wed, 15 Jan 2025 11:03:39 +0200 Subject: [PATCH v2 10/10] drm: xlnx: zynqmp: Fix max dma segment size MIME-Version: 1.0 Message-Id: <20250115-xilinx-formats-v2-10-160327ca652a@ideasonboard.com> References: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> In-Reply-To: <20250115-xilinx-formats-v2-0-160327ca652a@ideasonboard.com> To: Vishal Sagar , Anatoliy Klymenko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tomi Valkeinen , Sean Anderson X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=961; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=Z6AQhbg5I9MENjbzvyltnjwwjBTG37ZyGBUaHh8zGq8=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnh3n7xRoZJZWl72D8riAEsE7UvOq6P0tm4NoZW YPOZPEcQYWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ4d5+wAKCRD6PaqMvJYe 9QMFD/0br3w+rz945BiM/x6AeNOdcehdJyHBX5jHvxMrp8D0wyr5ccOjh+TAOghU+fPRTgUXIV9 iomCqsNWkjh8bfYoT+c0GR+iDgGzDrmmLap72Eu6oiotFsiNa25PdliptiX/uA2IWAA+UQbXlSN 2w4wV3P/O+uENr342ql6NQeAgZ6MAChXvJxro9u3648AUn1vzrR357eb16ACPp5YoYfmhQ6xpxL VMnLoaVJPBVgTwrVU+DdGGDgJ9ICH1/2A8Ln8YpDUnHtyFuF332Dtm6e3vvDOv6j12VXmxub63T M3VeeZARF8c7Dc8wCmyqphDQQTFiZ5QlNsf88NkEZ+Bk0su7aPH6vJqleepxCl2wbc/DmBEF+so sXVBciQJCg3gyWwls3BIHhNso3Ib7qB4Ev39sgnq1gljs6EYyh/W6RSZcsaMg4k9QIarxWoOYMR dvD6G+WGzNVT37ifdPJsHLtL3nR+9sIb4SwOGPPQMn03ruNJfe6kNCHMWjA6bj6uW8VyVO+P9FB NBsE/V1ZgcpNLtvzXyppUXvp8ZO3FaGQmmJmChZ9Ztw0m12ZRQ7IcDcVJ1bjrWggO3lGqfLPUH9 jqc9yMaRC694b82jpMczyoHJZp+h1BaHIILZAIZGfsVIX+2GgWom8AEC5qbQggcTHIt3EgVML5y rdSc7Ig0PHFysKQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250115_010406_673899_B8599B84 X-CRM114-Status: GOOD ( 10.39 ) 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 Fix "mapping sg segment longer than device claims to support" warning by setting the max segment size. Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem") Reviewed-by: Sean Anderson Tested-by: Sean Anderson Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index f5781939de9c..a25b22238e3d 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -231,6 +231,8 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) if (ret) return ret; + dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + /* Try the reserved memory. Proceed if there's none. */ of_reserved_mem_device_init(&pdev->dev);