From patchwork Wed Dec 4 09:31:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893464 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 60742E7716D for ; Wed, 4 Dec 2024 09:36:23 +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=R3/63yYiq4hsu89GJorjusDtFx9dgMRwYHYJqJytQf4=; b=hK660n+icQcnT0BHmLYykT6Een PtION0pj8I0PGOn0+6AzoBaAtj0iJMdFoRsxg1Jj+SGQW0vf9m73E23KaKFEcDSvA1H+i6kKT9Quy snLLxHXfktbwx6hR/kMxX9ydXRM86Sh5zNcf4nEn46aNqY0qUHHVJTwtqM+5dzxdnIuvfJ488mCvV Yw+ZW2Kpt6e+PlWqEhcSOMHxNeBLamngqGWDPRVbqpj0ufx6vpjr+3NYhmgo07sqAtQZPgzPpqghS 0azSptIj09JFmPp/Yf+Gpu100kmXxH0ZiZ4OJOyx4HN3DseWSyN/lSEjOVnLf3DPwnxYyf/ImG+jj p1RteD1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIlnk-0000000C4Fz-06GY; Wed, 04 Dec 2024 09:36:08 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljP-0000000C39z-45C4 for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:41 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 091189FC; Wed, 4 Dec 2024 10:31:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304666; bh=yyEyn4rhIqdMmRak4lQf+pKYkr0S+P4y5/aRt0CjZDo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=P4AHUURpDLAXSpjWAH/xWCkloWXEG8soupjlwQI8Tk8+0cpc3wbf38WNwT2LL5UYE 3mEXc0DTqMq3B0zioUXapCPGmO+BGNktreRyt37OyVInCD97pVqJObj0PUIJ6rj1kI sQmXDkvQoddlIJkMTmWNn48+r3SkYZaCleQ0nnpo= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:01 +0200 Subject: [PATCH 01/10] drm/fourcc: Add warning for bad bpp MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-1-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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=1047; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=yyEyn4rhIqdMmRak4lQf+pKYkr0S+P4y5/aRt0CjZDo=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFwjuDalmviB58VM3aWIBl9mLEZF4MBEs2ty FCH354qfrOJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcAAKCRD6PaqMvJYe 9TI8D/9epVIOmQ6mUczxxULoiWYF/+qqqE6uduUiFg9hjNn00T05QWqLOgU3AGXXj4cf2/FQAwu YZ3dXzeYwzRxeZK3AkMdF6GbHO8kId1C2kj+HONkTnF0avbPtPb15SXCs4N/xubiCNbNjozMVQQ xoE8XtmSQVe5vQ6GVa0AiqZHT82V9eWlqIIC3utxzWrDAKF38GnJoh0KNP0L9sy7t8/92xlQqni lw+zlmHZG/HtmkzECYrvmkWdaAOWNcNmkvtofJTcy3jjLHhgEGb5Q02U5yRoxXtO7OYkiAbSyRX /78KfP3YGhDWH+QjQaZYao1TF/P4pzZyKNFi4BmpnFve6YtRkuXZ8dZIXD6O44Tahq5BDrOdJV+ hp3U+lOc0bVkTzX2Slb9qSeK9n0Sk20wtlJWLgA4C7ikH/dVGj/VBP6qGcKF659sqlDVJbPWNjy v41sViFqjtxdvTAYN68NwOgQqVo/1+R6pbPNPeXU3JZ+vLIvSx1SIVCDpb08x6NgWQmcUch7tmM z3DxSTnt1oUN9nppSnpV1NIbDZeWQAccf6CHSMs5Tszc3M1pbsqck7R7QusCtxruGXkY9tUd9wR 8NLauOvprqRHCiNDzHbXAIm8a/6kRRaO/6ROPh+Zy1oxWkM+QqA2dqu1Bla6CrX+NncCm208FY6 xgK8OilUnNLKPlA== 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-20241204_013140_156620_DCC76DDE X-CRM114-Status: UNSURE ( 9.64 ) 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 drm_format_info_bpp() cannot be used for formats which do not have an integer bits-per-pixel. 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 Dec 4 09:31:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893465 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 E57C1E7716B for ; Wed, 4 Dec 2024 09:37:17 +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=UNGNFcxumnTDR2t5l7Qf8vZG4H UeaHfXIEDRIp2CHQuF0Y8zRZuYVyVBs376oWwqgMjyG8q/df6FKxWa8wmBrEM6PGLMvoQa8dU/Te3 0tAunnm9poFubTHqgqKQohQvEncdwETyq02N7pOf7ajzU53nKIPTw3YF8IjRXzYLV4BHZqObUbpsA A7VkRMw9j22Z43HneIcK/4dsObC85Iai447YqsS1sU43alJR++j9XOLN+K+Lf5hvN0io+Hpf3EqIa ghRxhoi9evSaKJ1MxMJCsv09xzFXLfgl6qO0yppOkx8rAOU6nFBaJmIhLvQZUULEbEUh7lhbN9ewn Scp2ey5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIloi-0000000C4Nu-2g1s; Wed, 04 Dec 2024 09:37:08 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljP-0000000C3A4-3sZy for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:41 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D0FA9D04; Wed, 4 Dec 2024 10:31:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304667; bh=peMIGVKca9OHRX4eHaZ33k92czm9ZLEx61OIc/CzyAk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sgkh/hbo+1oQIdM7sK+v4w9DWkMvUlJOm5YfM2/JhuozEP90D+c9zQzVHpWvwGnkG wT73i/ojeSG7lJCVyMezvwOG5t0/K63AfKUpq05bjBV7BD7rEHAiIM+0170uLblAN4 vDEPmRVrUxAxjLVu4eE3xXa9e7YTtWPv8Qv4GI30= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:02 +0200 Subject: [PATCH 02/10] drm/fourcc: Add DRM_FORMAT_XV15/XV20 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-2-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFxDMJy/fau9ZhZE6C1fmlBiltK0edBoJ3UU mM5THZMKxSJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcQAKCRD6PaqMvJYe 9eqsD/9nwEgBVcelDlJSTUQjZ+yFPXnwbDTC1zSiPTYqJSH6NMwyISuymVOOHH9ulimx5u5ITQ9 6PtkqsFdw29eI84O5okM/Aq/I7Rwa8m05UAbInBIUANVMojgImxJH77ylHRft/F+X9X6+CWPd1i m+2Cf5ZCygODIC+5G/E+0ZZ6xKRy4do6+ikLcHYSL4OHWtNiJOsaCgWZn5/D2SpA6eKQvNbIIMp sv4eSg5Jgrwzu0814tEVy2sDIry675eTsQTWayxhvO/z2i8QQakZPmnrbO771avLCru0rEOi+ir VU9gh7ualCSu0yktTJwqBpVwqKbmCaaOzNHjQC+kQoPgkcnYBiK/3S3jOZAjE6Um4viGLpgMgYl nhWMA7N0ozdbpTjciO0Q8+52U5KG2sGc+GFgIu0klYkcYtVl1VFeA0GvfeWNv1jsQWcNp2DpGDN 9T+JrV2s9Ba5Jc/BDuyudSvJp3nKgavTEm3bdKlI4XX1xvBBjmAL2Be9xLyYSuYwBjLjdn8vtT7 43e4Tf4eCEn+vfSZwbUMYFT/Y0eCsem42NkeI2OV8GExervcGbwA5T/rX946ol8SD+Zt8r9ID48 J1XwD9DexvMzQZypdjLwDsICiWbcQSmt8au/PRoC1bCg4Ci1foMRBgU0HYsXOiAXYmWuxERPzkr f0ORg1uKcan3L0A== 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-20241204_013140_094596_0BA0505A X-CRM114-Status: GOOD ( 10.69 ) 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 Dec 4 09:31:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893462 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 3F7A6E7716B for ; Wed, 4 Dec 2024 09:34: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=OTEmncciocPRgY7H5fUjlRkCt48qMFTt++Vy8wJxvVM=; b=wvvr3+cxxxiUFEqqhp0h+WzuUe /gA7F4158HvhY4k4NBMV1p5MH12/qZlNV4XiWjz+iPzsenoXcEqpZGQUhAdON/9Wjx//VtEpxjcZg bqPxG1HpI4kNZE0E5fLVGL1EcykGKBFqf31d2J8uaCbth2XCOP97as/nuZaLXDd9q9IqnxDzlu1NV 4gi9AA/eiG/jG5kp0gJbPkH3DcIo8Oy2qhJL/kmvL4H8cpCC8TgMPOe16SrUGDnOfesE+ynDPfYZ/ pPW0pD1w5uV2kDdPbXxfpSENr0dGS25h+GI+sHw3cmGL8Tt1QEbjjHuas96XKCgBNnyoCAIJP/EMz WrYMiJPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIllm-0000000C3um-2yGf; Wed, 04 Dec 2024 09:34: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 1tIljP-0000000C3AW-1Ckh for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:40 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ACA63DEE; Wed, 4 Dec 2024 10:31:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304668; bh=mf5laTsJQS47wTWaPVq+HhwOLi61DaR3sotP+bSFleI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rWV7ej8LRxgfU4fQzjfjsnnXR2NMCQ54lY7nGsqN4c1hphabbMwOTSNt/FcdmV/0w OGS7INU9dIdLxQ+/Uz8sIQ3qllY7Z1p7lGQptlCdAUX8aRA4xIl+QuOi5PR9BXtkRt pKOfE0Tc2KGd4oVygcwpv/3nHuY6CpTAagzQ/jMA= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:03 +0200 Subject: [PATCH 03/10] drm/fourcc: Add DRM_FORMAT_Y8 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-3-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFx5mhGi5W/bP9q7RWzGo74Wt3wQPeJI3sXs pd+jiz3RpWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcQAKCRD6PaqMvJYe 9Ug4D/9/xafVOLqBEJNEOZO++iwGGQbir+uOuNgAOupEdeGsu/bOQE1jhMkTIb5n3TIX52m7iJR +Pas60kZO0b06oJYChe9UfseN9KRYxxsvBZQB+gsCVOqcsjkzA4Pfidcs03dALo0UQo7DoUQuGP hBZmoPE/EqK9ksBOou5G83MaL7WtmvBO7Fxt1u7FAxax7G/BeC6N4c5dF/agavqy5dEKyIkiCQc NYofRWTmN1JSQt7fqa8G/KkDVPujWas60MEMQQTsaP2CYwLUEg4vX+AIMTcnPvNNp+KkwFAzzlP D5ijZlcZzyNscMEAj0owMRgVyu8beiCCuQOeu0md7MdUYdKxsBkJ4xRsAbC2Zh2+Y+NGvK/ow+I M9PiEG1Zi97S5VXxim9vovlSCCFCVOrYk9L2bbfW9rHNqzIbprzSDOe1w+zuWqKxVyO7NG6eU9p p+FnWlfDbpx4tn4vbaaDB0Tax3uGpHu7ypNAFcZeYPJ/DoSHjdz1D9iFgbHz3o3mPt0BfIRd4CH BwziywRHllqoGwlLgqTTFUC7rMbODDyoIS0RO/T+Vel39EFnNbdX1lKvjFscUh2n872UFTONB8j bsf0opYv86Zq7ieo1ZLZfjoZk7zWtik/O+DVG9ovdNzuD9qdcPzFhNFSmM+nGa2d9UD5b43UEt+ Td6hcK6BXfAKE+w== 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-20241204_013139_491317_3B75739B X-CRM114-Status: GOOD ( 10.66 ) 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 Dec 4 09:31:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893466 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 11391E7716D for ; Wed, 4 Dec 2024 09:38:21 +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=/JflIOn7XEQvSOSHDYwbiDsChzg3ONPsFai+LG7dj4w=; b=kOnBgbsm8vg9dTyq5h7cW57K/a m44b4ahyVCXM1aIwud6CkeNN78Jy+5i5TxtheGyMhhFOSkwHEMhKGiMKAy0DlMw9K0E7gG5W47uTK Pae4xmlvFvI92pth7Os1vF75BuzWao5MAWaZvwPOlnalMM6P94bsqXO37gNiJU1DGsYbXtXTzgEHS vBRVqoA1dOJ595I+aI4OtrwThQYKLBpt9GLDbZf2y4zYWP5srNuDOyNRQRGL06R1kjFiU+2wlKdyz C0lRbP4l3H0FnmJLT54+LDkBIHAicQhSpZ3G3xheRSpuktY/l3wc4DUZyTLm/3LumrBK2YiQhrUKi ha+eCTvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIlph-0000000C4Yx-0xRU; Wed, 04 Dec 2024 09:38:09 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljQ-0000000C3Aa-05ng for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:42 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 839C510B6; Wed, 4 Dec 2024 10:31:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304669; bh=sCHJvD8U07JxBtUqGM5UTqa2HW6hh4J/lkYVcIDy00M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JspZ0/akMHxSwdhbHvSstkWmh2oHp33qfJL4qjpX+Vc8N5fPGe0NmZoPjZBwbDXAf 75q9cZBDEXOClhSc3CVUP92BEqXj7qTY1uxXR63aoXp3124HREp4S3eXMgWayO7zK2 KZo3MiRtK+vkmyF8/gLD7p91MQxak6Tp64HT6MVE= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:04 +0200 Subject: [PATCH 04/10] drm/fourcc: Add DRM_FORMAT_Y10_LE32 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-4-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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=sCHJvD8U07JxBtUqGM5UTqa2HW6hh4J/lkYVcIDy00M=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFyTNQ/7HzSBX/EC8mTWm7YSE/vU4Lw4pSWT 4Raqs09XIWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcgAKCRD6PaqMvJYe 9YlvD/9mxwXHhjhOyZPLo0JLVNL09O+45LWilOlM1+aDdyyT6erkNa1MdNa2WqBTQIQKxtpH4eT iZ0aWa5Gaq7AQk0dgTTjWiW8UjXtIsZdaTqHBQDaP664PV/po8134LYP/8vHm1zrM7coNSx5Vag IQAudHBGh6dDP/wRCw46xFaZcHbuJl/wpPLL/IxDzjk5iuZy4PjlcXPxoyLezp5AmGGdX5ZoXz6 kfwi8qKWYFxxnvtgu5CJD83+q+tlzdkXdVs4b2ar1k+pylpUn8S187Rdivcc4fYFdFEdJZ+4Kkj H0dvQ3JBZGOPacXK9wF1SA+4VZ+w/BrIVTigfQVUD0HQyh8I4gfeW5BengMAERkQTNwFNDhAkHe ZFfedIUasMu8bBozv9dCpTritRZvrcY8eIper0tD0QuLErRM1JkEWr2lgC4fa6eokPUFU2M+a/F uAQgfQSr3mpweN14W4aQFIgWEYSA9plCP2IzhjmvULQOdDApLngpb91uEcFc2Vx0MpiGQ4ggPiB WFYZLMgaBa8O1W3lGAg7WX7rzoWzMCIUj6557NyrCbi6LGTJ2Sb8/xtKwKEZvpEvRYBu0EyLD+O C6a+AQ+W7vTe6tGMCZF8mxo+1A4TxE9QSbitxafvhravvdnosC+9wEZcu0tQpD4pGyYPzqqYU4x 29PongQDkMspvNQ== 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-20241204_013140_200232_B7A6532B X-CRM114-Status: GOOD ( 10.24 ) 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..82f255eb3d1b 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', '1', '0', 'P') /* [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian */ /* * Format Modifiers: From patchwork Wed Dec 4 09:31:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893471 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 3C1CFE7716B for ; Wed, 4 Dec 2024 09:41:21 +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=efhjXff3MTCg53zAY/hGo5Xt5ge+TUQAtT63IqeZhA0=; b=D2Y307S4yQ9jg87P3qlElpbJ4m dx3o27YZavuzBs2rLAbnIBA4Fw3ov1KMokVnfudKyRFxzqUWzXvij2lsmwMY4w/kDheMgykLcygQR MAFzFZO6y+lonnjFwmia88DfbiYiav7gz1XjYeOHRsowdkjWygiojtp9Y02HZNUv9J3HxxsfXn3Ku oxXvNi70UGWnqumzdRuI7NOPxMgMRWN437hxWhL6kfJbkE/SG6aBMWcp0aUYdRDQ5e6qXnL5Pjf5Y hyP8B+av85VtaAHNAelsHSMXz0TDrzsC0oJUWsgbV+C/B/hf6DNvQf0svAx1zzRgfhR24egoVCoEx oiKKcPBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIlsd-0000000C5Bh-0MId; Wed, 04 Dec 2024 09:41:11 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljS-0000000C3DY-31M4 for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:44 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 592F0157E; Wed, 4 Dec 2024 10:31:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304670; bh=tvMPrDZtee9n82xo6aNU/4PQa7v5HzHr3u2kPTARj3M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YAimj7nzYQULQeidimnqh3H3OPPk/X99/EMoCvnDiFLidzDItFEYHZbVbX0VArFps 7uDFveL75r5hx2mN2ZOC97wliYMGHVzJ/wcXexxGbOGK/YYGoMpAJ8bdy/VzCPISto YhbxPp3AxhXPgYCifSZt3FBPagnoPcwO2JcgW27k= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:05 +0200 Subject: [PATCH 05/10] drm/fourcc: Add DRM_FORMAT_X403 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-5-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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=tvMPrDZtee9n82xo6aNU/4PQa7v5HzHr3u2kPTARj3M=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFygysXkOjEMoy40hXOyiyvyWv/rkOZmGJNZ oS6zZYKsiWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcgAKCRD6PaqMvJYe 9VIsD/oDLZF8H/FHcv6f7SUf7QmryZogfPRwUG0h3yAwM9HymRrbzwpDheUYCDmQkOzBb4oYwJs 2q1htt2fXMOufdXbAGCJA3+rBT/6Pf2+4xPWNFVAyxWT3Qox8wk2/c1zfBHZxsioLumpDTzkwBu PGCAckYPjkyFCwXprXI4wj0B7NLdBULLhMz1Cj4JADP/+eaDnBw//4J+9zxC+yQE2/YdUw6Pga1 vu1MPBu8r/Q/IBUt3aRA1GvBj6G8vKdf5p+V0CA3P5GjzvIDDIDm2if3aL6647BAu8KOoyu7MX5 Qlamz+P/RYbp6dgeehWMx9uG3ZEEWbpmdtWmvIN8jFiM15idLIEWGabXmE7Pf/79p4ReLQTPkcL N0sjALOu1mbgRE6zzcqGyjrSXYAot7Ly2ZJDbG43iKCVU1TF+wP/qgrheLxpFqbk63yfQE/zYzt JLosv0gW5Iu1RUvPMxgPhdTZNLKLr93//BuS2tEa0KAL0tITqOUR4r4GYU1oiLXWoHtCmthfLd+ /agfnhD/NKGO4uG6mV4NZct/35xzPKRD0FSWJTqIdQHFE79A+0dCVJNLlRjMME+Js5PRxLret0P 0C2RdfCXaLEbw0K58Cu7W+fTFf0tcFrPEhIEc+gr432jLgF9yA8wZXJsxfzOPhlciq/6nkbe4Sn /tZS6FaumK2qzgw== 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-20241204_013142_919413_0741342A X-CRM114-Status: GOOD ( 10.17 ) 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 82f255eb3d1b..097904407617 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 Dec 4 09:31:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893470 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 7D10EE7716B for ; Wed, 4 Dec 2024 09:40:21 +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=4tCPBYbHwuGq0Tkm9TCMflLtGy jLmF9Eg+iOLlx4jgVyom5LCFn5nJNLDBZKHhSOBa2EZFCEX9N2ijh5oFNNeJlxPUIDLiK0i1+yAF1 k5vRAGHEDY6xpplWFbZAS/9WW6jVmuIaaq6e1DFgay3CFYMmZJWn53eRxDjCuDzmLD2dbatd03Wmx 7AbPXEqndtZWVnN3aCngdviYlGjQJnSy6CjYFv4k245Ge5RH/KW08aYYxp840Kfvk4OrQLS7gUSd/ lNcEMZlChxLBwXbEHDlimH4gpIof7rryPfGsYlTmliwCRdwSXVy6OVPmjeUloWwH6y4UqlJF2VR9A HC15+2tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIlre-0000000C52N-1kOC; Wed, 04 Dec 2024 09:40:10 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljR-0000000C3D6-3N2f for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:43 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2E5821777; Wed, 4 Dec 2024 10:31:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304670; bh=U6QTUkIufzSv6Der1HCIiREWkOAz1oZ9ohmvRY4oz/M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Mc4oHyuPgD4K/IfPe6NHCgWC207drjwEG+JQiZQ9McZ3nEWjMqJLjo1TBTj7rgD16 2ZrwRXv1N8H3fQR1Z+pow4KIrD9fhjyKvgW24zdc3Gc44ekUDmjBTfNTxJKgS4vn9R UGGvlWbIULykqed+aw6Cy9m1huQUTwiXYJf55//s= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:06 +0200 Subject: [PATCH 06/10] drm: xlnx: zynqmp: Use drm helpers when calculating buffer sizes MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-6-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFy79MMoDUVsXk8BQh85+BryRfdcRAV9crjs qgbEFlI6WKJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcgAKCRD6PaqMvJYe 9VxmD/9QtDmSP+T3o7qMEixYCKxToSlOiHuiSJ+dUhWFA/DdJKFo80oh5drUKrH2Cf/cQfe9B8H N0z5F7KqNPJf5D9+ss5NFjsfw7MNkD/948R6gWVrEWmHr0g2v1EyuStLGvgEt0+/aeTQD4zVFYJ V4T9GeBav7YbeUZHnntcZ9tbneDn21JBL5dYMISMLGGbzB+oNWvwuZ2VgGXFG3qc6Gvi8hhlved 6iNyUa6/ScW6IAWjCW/YI9siTx/1lQ/uyn4NsPqskCKEPKEaznfenWfzlFyQ96JuGYLXtGQFpWU 0ljJsUxv7mOvl7BJvj5+5eMFm2Unn7Ejsj2Clq4Z46HH0TQVirUGapDfaLHYBNkD4LsQs2OSdPu hLEK+JM1v0zIVG+BSfQoiWs9rbDJ94UN55qzLCXOIkbqSlzWYKDf9tNV+fhahh/rgqhCIdz8Ceh X71goBIlsNX0g35lNU/M5HwTl0V5T33HptWu8VYMYqDTMmJsPGt+kc2xzFx7vEA/CGv3itBKzX0 Tmqxw4/bjtra6yC206bf2Re/eUKvZhWplJWxv2JBeApGqkMP9+87uuU2qpPABOPsFORcF8vVqKT 8uVGNCIUK4kAzo4UB6wfyvNbIVnJs0WdgQBbVaw5EFSm8kUmGnk6Ca5Xshqyc6OAUmzV3EdhVDD dyd7mhFQk6sP7xA== 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-20241204_013142_015724_C1F1865C X-CRM114-Status: GOOD ( 10.61 ) 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 Dec 4 09:31:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893469 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 AA204E7716D for ; Wed, 4 Dec 2024 09:39:18 +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=MfLdpEkfUEc388dVlo1ZhQicRV 7kZlSIz3H6wqLPriznaNIihCu7xP2zQoWfbRkIQWLhq/mXG7JeAbwV/lkRJ7xyb+AxwOCQhSKXOIp eX1ZHC9U7B7wi9nc2Og7GMfOW6eSgS5bpPf0y7JFfZCwt3AMm/PsHp9WdjvLACdmDXis9FPcr0RuH cArPf5SvlApWPx3QCj3fP7hGFGcZNiyAfIaQSmqYTLKe4w7V/KJQUgEfAI2bmMzWNyQ73fGRw1hgW XFwC2J9UdnZ5IfWmX43UXtllJgRoHtyiJGAow2j39zCNsvqQxZZekWh8uOzcQXTxKk39ElE2SXvyL cYKQqcDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIlqf-0000000C4pK-3T4v; Wed, 04 Dec 2024 09:39:09 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljR-0000000C3D7-3VmW for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:43 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 03527191D; Wed, 4 Dec 2024 10:31:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304671; bh=3lV+l32vg2JpWZEq7vy7NUNpO/y6nBsRUh7Y4B6/+ho=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hZCffjL17efrhE31XcvGHz/zF4lxvQy6/t4T7uOmwErvEgyhCmHUfXIKR4erT+emb gV7cHOvHipDHn2/ronbTjJfCIMYmyMuU6ThdTIe027j1pifcE8E97t2w7RbKYJDeJn LseGz6WcV/9yKd3xlb6ei/TmtiMZKCGZst3ulZv0= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:07 +0200 Subject: [PATCH 07/10] drm: xlnx: zynqmp: Add support for XV15 & XV20 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-7-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFzjIte6iQJAwvU70HmuJG4CLSFQXDQ7PflQ LjDIRZ+McqJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcwAKCRD6PaqMvJYe 9Ym4EACofxnUMNc2FyeEumCCakl0p5SAvqleYke9a+UAr3s2faA6SnucTFcG6cNwqOOHuHqwWAx a5zLZPUq7MqEb2a1gZ2YxQiF4/UfWqKUH5/rj/WTwoeCgSs41VrDUWbNYljYRpk5TcN2JbQKM1v HEa/Q7LANLrOuy5mbomCCPxIvTqCyiW71spixx3VzcSuRiaPdFd6pwN0Yv6FIXpzA4dvomn5jQv h4godXykGa7q2nehS4tOCLX3fRhZ8Ji+63koTpvaOihiljnTzEBqVKecX9QlYWUZw70jZ9V9/jT 36RC6D56hkGEalOfedPHlwZsPyeZ2h9icpLZC0Y8z65Yz4inMigZ0pB79Es7l0f5fAetPN3OiUF Kj+68mE1bGn3ZPkg86li9Y/depPts1yyiM8Gd6/4/sv6tHK4NF/Xd3Ttswtsc6KjkjrbxTfyO6F QFbVElrEMA70YTiAiQUQTI4JIe6qy9La8V/7DCaovp0Fq+u/dKIOKpwjHb/R4UxtODR9agF/ZJN C7cBZAbYkefjDfOs84rBBaz88iQK1XJMVB1azYJpIUZFMIxgWuiE8Q8CIP2yuYkMl4NnevKsYYG vsv1rjPwqcFlcVhPyF2uK9DKLBIa1PvUx06inUT2bpl2v4NK9Bwu9Tb9bV7EAAYy4kNyx7sR3Vc gjg/ZHe+xxv2aag== 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-20241204_013142_053496_79372C3A X-CRM114-Status: UNSURE ( 9.22 ) 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 Dec 4 09:31:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893472 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 DA838E7716D for ; Wed, 4 Dec 2024 09:42:25 +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=R8jFBOXfxF9qzP7G5Zm7aEXHc0 tZ1luGuVzmEdDQRx7m1SQFzf6NmpOrMKa/5Yhf6PDNGHYba1mcTfaAu++sMu2BTxd76o+U9VRBuv/ 4R9WaoCSOoekYLjoPEt9M1hRyhbfgFBolxabQl3baIWn+Q21YISBYFvvqiQPzfAeU0ADivMNhWr1a v4UDaVOkEr5xzLKhuto8BeKHaORVL0tdQdlczMePYoJFgOwjAuXFe5xPjC2dC0s6+O6gBwhTsdgnL T9zoFKVmEbtuPr7MOA5Dqvtq67hMuNKS46oHRbYxmF/T3W2Hh6Il+s1xUCP2BREU20wTZ2UyADSRY eQ0eFvzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIltb-0000000C5PR-2zml; Wed, 04 Dec 2024 09:42:11 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljS-0000000C3DN-04uU for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:44 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D15961BAE; Wed, 4 Dec 2024 10:31:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304672; bh=vSNfl+dk45d5cm6nnQngiziPUpAD1SE0JXcPFtyqb6E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hTxi8s/9pGX0RXDCw/5wUmsbDZLdcqEyGbq2h2eXYvHIuwhXnetvc+UDTJlMbLi9z kvO0/Sx6VpkBORWhthm/DS9KznquwO3G4hmnZ8Mp/Hk1z2OCVfS9nyKgn5J02fXpwm 3BwBSoRP6Q0gStzLTzQWtKtnjS9+GM8xel3UbEGw= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:08 +0200 Subject: [PATCH 08/10] drm: xlnx: zynqmp: Add support for Y8 and Y10_LE32 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-8-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFz7vKwL/JknjDOTrW3yKdDoVLc847EBOBYe fqlqXtBeuKJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcwAKCRD6PaqMvJYe 9VFqEACObI98inSgLPDGEREQkqyBJlHdMI9Vu8S1Oj9irzsyK1xj6RQKZc6BzdeH8EnxxAMjQWn hn5ydfZYeY36La7UAH/xFjB+vQCgD/Y8aHXotS5BEFD7Rimhu3936ldJ+OH0rsIHNM+QS2FZj4n GnJMwRRiXqUfoVE4fS/XwCriSG5RtVUO/aQLUJtOrT1p3dM4Jh3MpHjFRV+EJrt9TjT+i2km55i il0V9bRmQUmTD+20wN4BcDb4aBGJF4vxPam5sGCcTwwdImsXMdtkXDw9xlbOJKoDsM7FMTnXg6T yZakjwN4i5ePrHhZU43VlL67jpIqvMCQsFk4o0tnAeigZ9I83LeIcxYRp6jbPjSmG++jT3wt+C0 ktCspNfd325GPImrY0vhYvxLfkBzOSg5mC53H15zEEHmQ0KJJnxPx9FkZFsAPmOL1+JQGCjXczD m0vco/6XsEQcuV9yjbRIkbUZ+z24zBTsTZfzP8UQk6LAHAn493Q4tgK7hEg3MngzF2oNPyq2tc5 5yyj9jk6V9w57i3OyhqbuvruA8X+YTVR8Z834itz0bZYOMa0hSknuGC8hvRCEdly/eK/Id19vb7 fH9lPEHJV8NKBHcfzNPVtQ3BR3w13UUk4eKWi6THPQc1+eR1H9N6lkwAn1jUgiVGBxlG5CniiIC VZevhcWbSVN7OZw== 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-20241204_013142_218764_09576140 X-CRM114-Status: GOOD ( 12.69 ) 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 Dec 4 09:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893475 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 9638DE7716D for ; Wed, 4 Dec 2024 09:45:36 +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=VV2gsDH+zl6FF4UI+5ThlGOqTl eHZR1vDYv+Bv37kiR3IGTyW2TLz/215ZDRzUJ7ATXSfyA1IOEjNnzKgIMssgJOlvXkWaxFEUhiuZg 07fMKNh7npTZ5gfEyPKCfXGllzMG7dDrcfh2Dzs+YFgSit3BPFMmrQ2cyxaNcFGnKXYbXsbWWvHd8 EA1Hw//zjA87ItzeMbWhUwqEUHDCp2J3GG3WcR6l0XZf/2ylnd/y/TGzZ4zWX6cfhKkJxt7PUr8IM O9ChbCTX+Q4RpFzqDDDT4BcnFLcrCnfmWjSooOEDiXTBwyCOajIuQ9BfaZt9lvc7I+HjxykCEiUsA vNMPmF+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIlwg-0000000C64T-3e0r; Wed, 04 Dec 2024 09:45: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 1tIlpO-0000000C4Wd-3nst for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:37:52 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A8C311D29; Wed, 4 Dec 2024 10:31:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304673; bh=2kTYJooFMq+5La3iJTTLvA+HVNIvS8ojV7vTfwy1oII=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GNF4xzmL3MleQEFQGtbFiYw1E8RrIuwS3XhQ3Q9gzd1Y2lJS6CNJV2i5TeYutv8R1 kch/wEjHrwmk/z0/+FXj/6QWOqvq6FoFjE3rv5zkXnxdUGCHp4uXYUdY+1Ipo/eY4m FsqJhx4S7ddmZ1Rg8vCnnRAAjLQzgQlecYZijKlY= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:09 +0200 Subject: [PATCH 09/10] drm: xlnx: zynqmp: Add support for X403 MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-9-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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/ZANAwAIAfo9qoy8lh71AcsmYgBnUCFzs5fjsix/w/yAKDDiwajcNiOFWZyKW3aKm VY6shZfH3WJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhcwAKCRD6PaqMvJYe 9cKND/wMV/dSG+TgZCNtmwg4MqMJVd8JugsFWyt+4GwifiFA57W2Utez9VYn3Hf4CrQJ9RnMnL6 IZzkMV48OZ4g2u7xYpQ7myK/fd2l9SMOc916mhweowFlsQMKaruqmYdU57Hm68e4fXSMYTcq8S9 L8lo7MzYjNZ+sag+vN0gPC+7KJ1f7WYosn79zy6vRgixgJkrAsAqbDCg6kGABq832rcwy9jknSs xLTs8GHzn08WIIFkPlAR0XyBWL59qoq8lMrugpHPYZB4KZjCsgivOVfFWCZW+AVo1tDloLWvCjq tVhU9moaDnvF01XNjU0CIj3tVm6F57Olk0iQhWPzITqoxvLtfmiYK+SM7iS7KypIGpeJcCqjOhc M/iqtLdeenC4fEnVCQ8vo5e1SJA/X8HrA9g35iLT+tedpcG5nAW0ZiGC4eSCjuEkfWpfGcn9Dq+ po2HPfU/eUx12RHQjc/5tmD0eNOApTnWzmnYLy9ErI3aym2aNupGuM7KAQzqc4J1MRUxvfSkM1g tMSyubS1BDzZHprfKzH6dmlm46u4KsEjnTZQ1mHvXrLZ67XlaTYYKlOHpQA16xQpCy1Ys/hgNxB tS3oydwDbYYuWgVwkKIXnusmHmblbozCa/r5AHLjC8iv0n7vRuxVWOe0rOGqIHRKKJE5eqwcQKq bEv3UWQM+MkCkQQ== 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-20241204_013751_078494_A8A87636 X-CRM114-Status: UNSURE ( 9.48 ) 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 Dec 4 09:31:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13893473 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 C3181E7716B for ; Wed, 4 Dec 2024 09:43:20 +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=6sQ+fR4FfIWhsJMfIC7796/e67iybBGY2Yyhy3s0xVM=; b=uA21kRn3F9404/7Gpx6K9+Gl1L WJbn7xJHHonl2w5Wex8uhHTZ7feRxaEy0h6dI/nQhRsa+7ApfnMJOPcN63cXYmhBw85bdcGv9k1MD BS0UjLScKhXAYLNQdwlGUUaGL2Cr4vz2RUwmqkG9bNBhY4mtqTGCoEkFD5Bo7J8mj1jReuWKTNAaI lC1Tw+KVeOZ9BtXGe4vxMl9L4sFy3kXPqru2aT2Q/bBWdQOi4kv6OAD5mMvx+xE6f3w2QInozfR0E 5qvRVXTB8ASjjSBCe6+0zdWf4McHV38zRZZoMYRb5Ud3ENJXQpeLHpUeiRwKMuoJqK+JYdqtalqBq UQJrzI0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tIluZ-0000000C5Xq-1MtQ; Wed, 04 Dec 2024 09:43:11 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIljT-0000000C3EL-0Pl9 for linux-arm-kernel@lists.infradead.org; Wed, 04 Dec 2024 09:31:44 +0000 Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 80E4A4D4; Wed, 4 Dec 2024 10:31:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733304674; bh=3gLGxW2HVXpkPQ5AFOvirBqMHKf9n4CAMSQ7dIjYRdc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ERHyhezwQJQSY6qmbamAteHL38TD59NbuSoPylS+hX0amw7ud1DENxnW669cRcxOY xJ4AZUV5/KdKiYxE6h5sLIVymbD8Q3JeMJBFP7XB4fNoON/pMbNHYaMMNO5wN1/9WA 6U6rJhOQCJCjr+yDdtrtDYmLleby8B19RCMDW6yc= From: Tomi Valkeinen Date: Wed, 04 Dec 2024 11:31:10 +0200 Subject: [PATCH 10/10] drm: xlnx: zynqmp: Fix max dma segment size MIME-Version: 1.0 Message-Id: <20241204-xilinx-formats-v1-10-0bf2c5147db1@ideasonboard.com> References: <20241204-xilinx-formats-v1-0-0bf2c5147db1@ideasonboard.com> In-Reply-To: <20241204-xilinx-formats-v1-0-0bf2c5147db1@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=764; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=3gLGxW2HVXpkPQ5AFOvirBqMHKf9n4CAMSQ7dIjYRdc=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnUCF0ZBts/F3Q3/nmyZ3acCAUk/Z9QNIzpazk9 2p+d0+xOBqJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1AhdAAKCRD6PaqMvJYe 9dTzD/4264e5H9nuI6cbErkz9dOv3nzTmuYcoJ/vwyiVHnu3c8oBYbQVe/fwBR7vsyAptznjqaW m2MydIEztef4OKL/JdUmXfogn29iHkdT8G40q85rHxFRNX3yhMFgWt/MfYtMUcx1WPHGO8sNmVi UZ+uT3uBqd43EHBnRW1k9xVXgRryZrZqlGza0o1kAARG27GW4k309oIT9TpzhIhkbGSFy6T+5y5 zCyJQ/fpr5YJ2P4j4lcQ1xfx+0bOMOwRdPOeSBNn5JmBcBAe/eZIyi3torKvRNJrDNROqucq/fb 80wub34XYvF4GGjxiTd3v25ZHN51SGczWZEDmVYp34o13Gq1kmq+98ReAU9FO/+OQvsjZpXQijH YROOL8y00upWzXM3eqtRZLJ2OeE/Rsas1BjUqy8ikJLR2dXErDrLZs+FN2nykdRU3eKUwX/liBw 3KcpQsL6cyKruROnYb0uGBQACBom+mJO1Ot8/c8M3vlM1/AQldZlP7YZK4+Muwo6xGHcBufYyJW xVrhvgw+Kq47O8Au+Dd5iY+dlmGMBRQl1DGU9T/MRdZgnm4U8eCU8M7usEyCxvC7Jo4Bj/VLE5j FE1lLM7dVNEpOoOkVbI26XvBZ+mBRJt+jVPr9RpFppcMTFYpXWPG3KE4w0gW+L9EPNbswnojw2e S3M31bU/5fkpoLg== 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-20241204_013143_358907_C108BC4B X-CRM114-Status: GOOD ( 10.09 ) 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. 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);