From patchwork Tue Jul 17 17:13:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ayan Halder X-Patchwork-Id: 10530291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FEE460247 for ; Tue, 17 Jul 2018 17:53:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 603C326253 for ; Tue, 17 Jul 2018 17:53:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51112297CD; Tue, 17 Jul 2018 17:53:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B52B426253 for ; Tue, 17 Jul 2018 17:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=nzDImAAiYGBRx9vygju4UD+gIg+qg/SqdzfmNZoCgBQ=; b=s60GZcO6WKGF1B NsmuJgns0dHMlMQiMlS0CN8qaPsqJdMl7iJSAWhdyRZNyQJwJb1kGZSo47gzROYZo2xcnExZUavmi KPVXag03Jg8sPEIm2xl1CH+8eC1Ex7t+0xCBz+JVGNFm6qXcpfS8gsiUTv+GGWJzjCnrNf+G56l1o J3krBFZ/slbzLXobyUEkHOdUilHVqgNt//lqLMddGpqbNDAv/1Z8VXPJmmLJBiLCvoJGicEQ83ToJ J2Ral6q0FQHIFS5kX5hmTy8kpH5A4tlhcLzreCAbKU1VZFIrF7rTtqkUEoeP0vT4/5SRjvK1uRZPh m+cpkMx/u6DbMn3jn5aQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffU9x-0005XW-Fb; Tue, 17 Jul 2018 17:53:13 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffU9u-0005XE-IU; Tue, 17 Jul 2018 17:53:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RhhDzE/5b1+y3pegV6/YoPaBMZsKExuyB3nAf+PLdRk=; b=f19C/sbBg51+rRWSws65j759yJ 5HWEke8zwUJkeC/+J2pIk+QbLH5lJXeDmXK9bCcU257tcLkqfHo+ejCOBBI1lHWK4iVNPj9d6BC1w GMqPYc3kGBV7DR7iFcPhdvmGd9wI0Hiy6SkPPgaY7hFWkc8oQfWUjRNz5enUCcrlILhyKI+tIbNaM UWmKri+zA0unhu9xUKblD1xCq2QRr/UZ3pUPLP5g5UhJSAtsgj9us9QG8rcY0HsjZ0QS8dFxhptv1 0XbjbDZbTKrCqso7hW3itAw8jEDQz+nSU1ORB4LIcDnStjtUDDUvPSEP7wcdIFK1amlkefb5TV4NE //tKfdgw==; Received: from mail-eopbgr20045.outbound.protection.outlook.com ([40.107.2.45] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffTYM-0002OK-0J; Tue, 17 Jul 2018 17:14:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RhhDzE/5b1+y3pegV6/YoPaBMZsKExuyB3nAf+PLdRk=; b=dz+FIPG2wawyzb/uC2iw0icFJi3cQsvZvxB4p7Eo8wSMXSazFsbmAk5jsKW2ZiSQ3VYcAFhZZyt7xoj380oYW4eA5D97FWk5j/BotD2QUiJZCl0ubbQ9s3IXsr612Nq6KPheSSXF5PdLOcZUP80VmcPezTB4/k8M3UQtYjtWTWs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ayan.Halder@arm.com; Received: from e113505-lin.cambridge.arm.com (217.140.96.140) by AM5PR0801MB1377.eurprd08.prod.outlook.com (2603:10a6:203:1f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.19; Tue, 17 Jul 2018 17:14:04 +0000 From: Ayan Kumar Halder To: ayan.halder@arm.com, liviu.dudau@arm.com, brian.starkey@arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, intel-gfx@lists.freedesktop.org, hjc@rock-chips.com, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com, laurent.pinchart@ideasonboard.com, sre@kernel.org, bparrot@ti.com, peter.ujfalusi@ti.com, afd@ti.com, dri-devel@lists.freedesktop.org, maxime.ripard@bootlin.com, wens@csie.org, malidp@foss.arm.com Subject: [PATCH 1/5] drm/fourcc: Add is_yuv field to drm_format_info to denote if the format is yuv Date: Tue, 17 Jul 2018 18:13:42 +0100 Message-Id: <1531847626-22248-1-git-send-email-ayan.halder@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: MRXP264CA0012.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:15::24) To AM5PR0801MB1377.eurprd08.prod.outlook.com (2603:10a6:203:1f::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92d03d52-bab2-4b23-7a27-08d5ec08b3c7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1377; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1377; 3:smWZeQAtOFEfa68lgUWgTJCiFdJcVvBnjU7BWAByeVKwVvtvIj9kv4B4T2Ww9Zvzd5qHXS5w0muLpEeIIfdD/aNlnhFh0jF+0/bx0AE7HRyycWer1wXjihczFcBmuGcGzD7aSlb8G3qGebedCouRdcpQefU7Ufh+9M9DYXNSYjRtaYNK4PQxIb5kg3F4CvXgfHucWDhq2ffepaOp5MmyZV4OhO044AU4ZOErJsC3/IPc29qDZxZNnBwKLLM8uXlO; 25:FBT1/Ex8PWXVbSZZ51WKAZX/8c2xEyQAsmYuo9lh3HCbLH+2zIyK5X1bsaH97UoePYy2emKEd/IKOmgNksfi0KsXxj6FrRP2DgI4iVDel7N5q0epMYVu8NXoF71GmEDzgqC/skwmFD+9ligYVneFQTbCPSbWpzvv9GH8X+0ydldDlUd+d+Yyvi1RdvR8rxxsXdgDCUyDfe5wQeDSlnVY41uo37WfPE6sDDDz9nMwxJHJYyEAFZ6nQgocgYWLXQkygL6nzhf61M6/g+vyES25BARE2aU+403mLiYKsPM7aH/otcfwGOtnJ8/sNW9kO/3IrGSGxHOj4QY/CfGwMWsbBQ==; 31:Ts+ag+oM5MWFzCc2ABVOujwQgvhZiH3MpUVsb+Ra79qH8jA8BYI2BdCPz0i3qTAYrxF/LX85WhI9YEhaKkrJaxpp+3dleivWmsiS2FM7khSLB2jCP2V4tL4i3ndTLJCMGiAS0lqe90/ohh3TFzfS39d9ZQ4H6RHY5mCWXKQIxLePKAcu18u2e9rbyjD3DLamy0kcYTLggsWFgWtuVwUYE8dGfxcnJeX3je7lGUlCiiE= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1377: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1377; 20:OTY9udSqmLyZ5vw1TkqUCB5rLvD8VP/LVXY04S6f4alRSMNdeO2Rhfheo3dLoiJVZmEDHTIxVDuJs9M1Lpe/d0Cc1xikHVbASJesEwR7qhRemH//j60/vNpd3dq0jw282X6Nc1brWFVx1cW2mmbuid2z0RmR2JVJRD7kOg1TMDM=; 4:whkZbJzvmHfeQRYrGQDvJnrmq/2SiJKyXLKQV3ZlOMkffTn9p1KDLYGa/TLoeaXaDxoH9QIL7qPd+ARDPWv/IB5tkI70URYloE1psNvgtCGp0Qiol/z1oZPmWKmn84ptUYUcV6ab8nCPf+YgY55+q9mfhOE9Te0f20+uoKc+PztXnjQ4ZHRs0WJEiBowrykX3uetMMDi7b6SJIXXSRuc8qZYXtUR8wRJnNQjKO2NsB5D8ZjyLICaA2szjnh27ikShTAui8oUtoDYN7dxtepUd8lrX6WpG1yet5S2kVUT4DVYdhJAWEQbkO0HdfrjNbJb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AM5PR0801MB1377; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1377; X-Forefront-PRVS: 073631BD3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(39860400002)(136003)(199004)(189003)(7416002)(316002)(305945005)(36756003)(5660300001)(486006)(4326008)(50466002)(51416003)(48376002)(386003)(2906002)(52116002)(7696005)(476003)(53936002)(2616005)(6486002)(66066001)(3846002)(72206003)(68736007)(16586007)(478600001)(25786009)(956004)(105586002)(81156014)(8936002)(50226002)(26005)(86362001)(6116002)(47776003)(16526019)(8676002)(97736004)(81166006)(7736002)(6666003)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1377; H:e113505-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1377; 23:SwS2JNGb2VEBIEj2LlHYzhmmEz8tKDjYYsmoJHq?= =?us-ascii?Q?stT/3JfiSjq0EIQRUjj83IhLxktz6gA7JtrQBncLIzddluyQtd9xgGxVn81/?= =?us-ascii?Q?7L6UjibzxzGwBjKfEi2JcaMIocn7SjXX+Uhv4/zmB2ADmlo2nY16LV120785?= =?us-ascii?Q?mVYPOefNmXJ8260WMLhQLP7WT0GShymeqHAYR+JqBPMbcXsMwPYH/fZY9R6X?= =?us-ascii?Q?XRvxXlBqrzymZVdGScvWBiXUkNinPTzpDyCOByuMoEPve0+DRHX48pW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jQd56PCu+y2ZeBS3ClF64Yk=; 24:WrtvqqHiV/9Aiw8o8a0um1viUeWHbGcvBTuskc0vT3bLlH5ar1EIBg1Rz74LDqA3rXvyMzEY/X/k/4gjr9dYsOU7V4bWnkhx0K8rHvSDcuE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1377; 7:3T3xJ0IKl9/+9DJkGN1iX76W1ft1cn1ncBoS7TwrKduqrvaKHa583xWxgLJpZIuipen9ndi8cYMjQvAxHodvKivRLRhFAqaL61w/9mxF3ICOKHxJLyj29fExYbSjSyMSYaQpXT9e0YIyfnJGO1AiyGVzcwaXwiQ6aKNOnZ3p4qdAAwyJ1RhyX/feKj70e2spgDS0Ao28Wx4yLBIBPM5sl+ZkbWZhCedPi6Ztxk6KcF5tvAiEIXHOvVIMwAAysgkh X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2018 17:14:04.6818 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92d03d52-bab2-4b23-7a27-08d5ec08b3c7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1377 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180717_131422_205278_84C709F1 X-CRM114-Status: GOOD ( 11.87 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP A lot of drivers duplicate the function to check if a format is yuv or not. If we add a field (to denote whether the format is yuv or not) in the drm_format_info table, all the drivers can use this field and it will prevent duplication of similar logic. Signed-off-by: Ayan Kumar halder Reviewed-by: Brian Starkey Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_fourcc.c | 42 +++++++++++++++++++++--------------------- include/drm/drm_fourcc.h | 2 ++ 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 5ca6395..35c1e27 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -152,27 +152,27 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_RGBX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_BGRX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_YUV410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4 }, - { .format = DRM_FORMAT_YVU410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4 }, - { .format = DRM_FORMAT_YUV411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1 }, - { .format = DRM_FORMAT_YVU411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1 }, - { .format = DRM_FORMAT_YUV420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2 }, - { .format = DRM_FORMAT_YVU420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2 }, - { .format = DRM_FORMAT_YUV422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_YVU422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_YUV444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_YVU444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_NV12, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 }, - { .format = DRM_FORMAT_NV21, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 }, - { .format = DRM_FORMAT_NV16, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_NV61, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_NV24, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_NV42, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_YUYV, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_YVYU, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 }, - { .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_YUV410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4, .is_yuv = true }, + { .format = DRM_FORMAT_YVU410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4, .is_yuv = true }, + { .format = DRM_FORMAT_YUV411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_YVU411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_YUV420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_YVU420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_YUV422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .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_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 }, + { .format = DRM_FORMAT_NV61, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_NV24, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_NV42, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_YUYV, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_YVYU, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true }, }; unsigned int i; diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 3e86408..f9c1584 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -39,6 +39,7 @@ struct drm_mode_fb_cmd2; * @hsub: Horizontal chroma subsampling factor * @vsub: Vertical chroma subsampling factor * @has_alpha: Does the format embeds an alpha component? + * @is_yuv: Is it a YUV format? */ struct drm_format_info { u32 format; @@ -48,6 +49,7 @@ struct drm_format_info { u8 hsub; u8 vsub; bool has_alpha; + bool is_yuv; }; /**