From patchwork Fri Sep 14 10:04:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayan Halder X-Patchwork-Id: 10600599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 985DB157B for ; Fri, 14 Sep 2018 10:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AF992AE88 for ; Fri, 14 Sep 2018 10:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F7032AEA6; Fri, 14 Sep 2018 10:05:15 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E06142AE88 for ; Fri, 14 Sep 2018 10:05:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39B036E824; Fri, 14 Sep 2018 10:05:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0047.outbound.protection.outlook.com [104.47.0.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 08F916E824 for ; Fri, 14 Sep 2018 10:05:11 +0000 (UTC) Received: from e113505-lin.cambridge.arm.com (217.140.106.49) by HE1PR0801MB1387.eurprd08.prod.outlook.com (2603:10a6:3:3a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Fri, 14 Sep 2018 10:05:05 +0000 From: Ayan Kumar Halder To: gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, ayan.halder@arm.com, liviu.dudau@arm.com, brian.starkey@arm.com Subject: [PATCH] libdrm: Add Arm Framebuffer Compression (AFBC) modifiers Date: Fri, 14 Sep 2018 11:04:56 +0100 Message-Id: <1536919496-24339-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.106.49] X-ClientProxiedBy: VI1PR0701CA0072.eurprd07.prod.outlook.com (2603:10a6:800:5f::34) To HE1PR0801MB1387.eurprd08.prod.outlook.com (2603:10a6:3:3a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1eeae3c-5db2-4391-5dc7-08d61a298c28 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB1387; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1387; 3:A5IllNhrCvhXxRqcSxrnuZEB/hioMTcmwCSlbBRKovUB6A8t76lL4S+MXdYh9LsuuB4YllJQX3bo/APfGhU9xeGUcRYsXrc4BDj2JQ8mTtSzjI2imebaR0MkslBP92rE8kOZroWD1SKhiX2jcJGAre3elvDmjZZs3p0lRtI+mJwy3fV2iwk7SjuWxEuBd3lUjnVQSUsQSyAQET2d8vPEMxD5eYpJ0Cpam6fcZGA0PYyG7+mHxDTAQbntmW9+XxUI; 25:22aGR+MCKaBh0FmBEyltsgmRzfKOc959rqxKNPYU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2uCcuVf6+GJ7lhA27g6dkXNG+F0Nm1khJB63jLZS0zSab3BKLgqU7vFzzX1s/V6qpb36d62HIGMPz/f1TlDlFJVBd7gqEleL7s9chsfOA5k4puhZM0qeDGQf5dCh6UW+GUCG6IelK6EdgUw4iZLh9v9I8v18KDuR0KQwwm7gCatsf0gqGjHwLIAs5X96SdpvmxrbX3zh91Ngv8RnpDC7xlIHKOqFWYcKE9oco++LQ9o7IZpgH9TsY5FTNZ+nEpDSZXvAjbSfJvY8HOfjjITN6fw2vuOkHRvEJVQDbk1VhOlac6vTwBsvypj95lfwPrHuvouuusZBe4jmNiRyAAwd7vz/Pyl09fwOC61SjtIoI2S2cY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(84791874153150)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699050); SRVR:HE1PR0801MB1387; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1387; X-Forefront-PRVS: 07954CC105 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(376002)(39860400002)(346002)(189003)(199004)(386003)(6636002)(5660300001)(53936002)(2906002)(47776003)(97736004)(81166006)(3846002)(81156014)(6666003)(8936002)(25786009)(50226002)(6116002)(106356001)(478600001)(26005)(72206003)(16526019)(14444005)(36756003)(186003)(52116002)(68736007)(51416003)(4326008)(7696005)(2616005)(105586002)(476003)(86362001)(486006)(48376002)(7736002)(1857600001)(50466002)(66066001)(305945005)(6486002)(316002)(16586007)(8676002)(956004); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0801MB1387; H:e113505-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1387; 23:ybImoPYnMaxf5OjwdHDv9kVA3jU5fvub7z+icm5?= lLWxMzr/EY0QgnG4zmNUgVRlDHwNtHakmlb+o1Cj7GK6Lz5tVJeZc1PKaAONhl8vttDp1QweYDCsRZic4eU+2WNMujPiVXtyyzfrhn8phRanPOvT1fBVMx72S/5UpghduDyNJlCUM5E6UjSaZBXWhe6tVjTSZK9ZtoQP/PLPHa206ZsjAx6DG4VNQ51q2qtFoBGLWD+0x6PYufJK9dDcbjco9WSNrXuGh+KyMq58NDQK2sM2aPhquhujI9FaVDi4oVbX11zGDXkkjgh/KlNw+TKbNtdFNL5KNsASBlKRnAC/0RBn1QRngSZaPqXAMY1ZCHzWmi7Lb3auYzaAyFAflFnL+GhzcvcYP24G5KCRJ+J0VrZWX+fKpX3HJNA+AEN6lXCDLzl9ZfDMVZJY1hs5CgcbunOV/ujNo6VbsqnjqDS9crJ3k5eWhFZ9F/Ato9CX5S8ZIiPyhFI40Ryon+YxYwzjRCiFWdwhWgZg90IkoGdJRhtWCheSFjtHb16LQxoutXeBzm4s7eKHbwo3ewGnqi6AiMSvxC8DzZS0i2e83gYLtWIy4iEQTbU0cRdKEIYsdzXOO08I8de5aMEYBLBOa//Arck6YhNo6Aq2MrjW9DnLXtsTZ+z+nalchtDv1nQPGCfU5gg+2tHJNM90J+PwqvAeLko19ZEAmCAaHlOil82mIf8yd7VAYjOm6z+R0A+uDMJcuYt0aOxleZXn4n7cWowPeyh3/VFJF6jfr/ZbK22tBqkEIo0HanP+l4q+C66Ha0y1eLKvTm+4mqA3iRLOJyk4uLQTtCwfzXMDXNsq+URKQd0gP3p3bdNKhnhcc4O3FxhN8PS0ZuaDzgBrI9A425jHcMLnRsunGdAkRBO1vMnbnIBoAq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8++Az/ehRURrf+qKVz4jEkpSzwgJss4zHqGq+an7FepqIRH23sFX9pxgpTKKk2ZXXvz5HyAg==; 5:Gf9KsjYYut/jn9SNKswkyA7dr10hO12GOcqJh3wZahfgzXXYnzdLq5jtP9cT5ZQKkuD+D1OxlC+kLyP4vxeftSVa/EidxJMgS+Qpw1il+ij4g5ntOTk9/rEpCbBhK0bydiDEajC1BgpeEYx4oUJDwfF6x60C0FeTddkFGZXV3Q0=; 7:zY1gRsc+xpyi0uK98Q6DwLTW24aCMysUptw8e0TWsXDP50d2pxHX5Zj6z9lIwCSkaaC7w5m01x72T4LxTti3cXuk0nxB4w+kVwhkDfxPp8X4zexxz6pvTi8fAlIjo2HE7/2NU3HA4AP/Cu51waHjlMV86uwcDtSXmXF8/XXjmk52e2A/p+WgfFU5cCUe9du/Dbey/8x0ZeLp5Xra7eR3voTFUJ3iMpkxBN4NzYFfI7MfaU4Jl1hXTsueitjkKI4H SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2018 10:05:05.9624 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1eeae3c-5db2-4391-5dc7-08d61a298c28 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1387 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP drm_fourcc.h file Generated using make headers_install. Generated from tree - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git branch - master commit - ce6058039bca7f1f11f1723549eec1bc069dcb28 Removed the 'SAND modifiers' part to commit only the AFBC specific code in drm_fourcc.h ie the changes introduced by the following commits were removed by git add -i :- e065a8dd30af703b4794dc740c0825ee12b92efd 14d9deeb273c2bf4ec256589adabd8df65395d36 Change-Id: If050c17779ba16f8f47adcd825e3e2300676c247 Signed-off-by: Ayan Kumar halder --- include/drm/drm_fourcc.h | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index e04613d..af7e9ab 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -183,6 +183,7 @@ extern "C" { #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 #define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06 #define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 +#define DRM_FORMAT_MOD_VENDOR_ARM 0x08 /* add more to the end as needed */ #define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) @@ -405,6 +406,88 @@ extern "C" { */ #define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) +/* + * Arm Framebuffer Compression (AFBC) modifiers + * + * AFBC is a proprietary lossless image compression protocol and format. + * It provides fine-grained random access and minimizes the amount of data + * transferred between IP blocks. + * + * AFBC has several features which may be supported and/or used, which are + * represented using bits in the modifier. Not all combinations are valid, + * and different devices or use-cases may support different combinations. + */ +#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) fourcc_mod_code(ARM, __afbc_mode) + +/* + * AFBC superblock size + * + * Indicates the superblock size(s) used for the AFBC buffer. The buffer + * size (in pixels) must be aligned to a multiple of the superblock size. + * Four lowest significant bits(LSBs) are reserved for block size. + */ +#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf +#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL) +#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL) + +/* + * AFBC lossless colorspace transform + * + * Indicates that the buffer makes use of the AFBC lossless colorspace + * transform. + */ +#define AFBC_FORMAT_MOD_YTR (1ULL << 4) + +/* + * AFBC block-split + * + * Indicates that the payload of each superblock is split. The second + * half of the payload is positioned at a predefined offset from the start + * of the superblock payload. + */ +#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5) + +/* + * AFBC sparse layout + * + * This flag indicates that the payload of each superblock must be stored at a + * predefined position relative to the other superblocks in the same AFBC + * buffer. This order is the same order used by the header buffer. In this mode + * each superblock is given the same amount of space as an uncompressed + * superblock of the particular format would require, rounding up to the next + * multiple of 128 bytes in size. + */ +#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6) + +/* + * AFBC copy-block restrict + * + * Buffers with this flag must obey the copy-block restriction. The restriction + * is such that there are no copy-blocks referring across the border of 8x8 + * blocks. For the subsampled data the 8x8 limitation is also subsampled. + */ +#define AFBC_FORMAT_MOD_CBR (1ULL << 7) + +/* + * AFBC tiled layout + * + * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all + * superblocks inside a tile are stored together in memory. 8x8 tiles are used + * for pixel formats up to and including 32 bpp while 4x4 tiles are used for + * larger bpp formats. The order between the tiles is scan line. + * When the tiled layout is used, the buffer size (in pixels) must be aligned + * to the tile size. + */ +#define AFBC_FORMAT_MOD_TILED (1ULL << 8) + +/* + * AFBC solid color blocks + * + * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth + * can be reduced if a whole superblock is a single color. + */ +#define AFBC_FORMAT_MOD_SC (1ULL << 9) + #if defined(__cplusplus) } #endif