From patchwork Fri Jul 6 09:16:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ayan Halder X-Patchwork-Id: 10511195 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 0C00760325 for ; Fri, 6 Jul 2018 09:16:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0082220000 for ; Fri, 6 Jul 2018 09:16:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E889022F3E; Fri, 6 Jul 2018 09:16:45 +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 77A7120000 for ; Fri, 6 Jul 2018 09:16:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D0A76EF95; Fri, 6 Jul 2018 09:16:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0617.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::617]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F8776EF92 for ; Fri, 6 Jul 2018 09:16:42 +0000 (UTC) Received: from e113505-lin.cambridge.arm.com (217.140.96.140) by VI1PR0801MB1391.eurprd08.prod.outlook.com (2603:10a6:800:3b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Fri, 6 Jul 2018 09:16:36 +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, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] drm/arm/malidp: Add modifier definitions for describing Arm Framebuffer Compression (AFBC). Date: Fri, 6 Jul 2018 10:16:25 +0100 Message-Id: <1530868585-11068-2-git-send-email-ayan.halder@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530868585-11068-1-git-send-email-ayan.halder@arm.com> References: <1530807905-18248-1-git-send-email-ayan.halder@arm.com> <1530868585-11068-1-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: VI1PR0601CA0032.eurprd06.prod.outlook.com (2603:10a6:800:1e::42) To VI1PR0801MB1391.eurprd08.prod.outlook.com (2603:10a6:800:3b::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9e3f0ad-2f7c-474b-49e1-08d5e3212d0a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR0801MB1391; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1391; 3:Pds0m3/Bx9nTheldB247DWhDiv7uIGZWkubp3MYaP2mnfoB5qDPvGcLXJl7CZGePwvQwXrQaqrb9E5O42zLeBLA0He/TNY1OXpsVbn80HgngDyo8tdNxU8tk/ZSwZzd0nkBtIttZo6LvhGkQyFlsav3dXhFvCtHIWIYuNVPZGsP/LOdJqEiUOT80c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UuiQ5vs3qkGPIKq4hW08NIhj6b9bxuHy7/mintx0/BBtgARy/HneiEhcViN++4Sgnkf9DBi9tqnR7Y86BVBrlfHXmDmIILKiiJiJSZvfJueKfuMbZ6dKPBp3hyW9qNWL1vcLdPbKbEjNr7tIIR4Jt/7PvtJOlLTnmVEmAsAwPYJyTq5q7ehJcN2/2WOLi++Df0ix3JZI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231291)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR0801MB1391; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1391; X-Forefront-PRVS: 0725D9E8D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(39860400002)(376002)(136003)(189003)(199004)(47776003)(66066001)(478600001)(6116002)(72206003)(52116002)(7696005)(51416003)(106356001)(3846002)(105586002)(2906002)(14444005)(6486002)(48376002)(50226002)(68736007)(6666003)(16586007)(316002)(8936002)(54906003)(26005)(16526019)(186003)(81156014)(8676002)(86362001)(97736004)(76176011)(305945005)(386003)(7736002)(5660300001)(11346002)(2616005)(956004)(25786009)(36756003)(476003)(50466002)(81166006)(446003)(486006)(4326008)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0801MB1391; 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; VI1PR0801MB1391; 23:Bg0Ebu/H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GR05/lLz1Zet8uEM6WJnxKwEUqdr9l+TWUaTZivxibySdKjK26fOwObApIR17I8jAH7uAsdIdjrf2fT9WXFxaKJAXlQIMUSG4JBiCe1dAhjyya9hHLZl1MMOZceu2TwBmYH/Fcg620bo7DcpgrcPNeYFHAd2pYmPd9P+JM4DMBQtt34f31Pd6Xl3gKA+LHUhakbyfnmNx+nc+I3kQ==; 5:Y0LZmpbOevcqoQCjSeeJDtgLBEaM1Hri4xPWkVTUWs6SfNfrT8P8No2PjWri9s+NVVvUJT4Syz7/4M/gema1xD2nt8hnyGqU/yjgjhrHvE585qvdQd8X4vVTZdoKyNXRawXsh8aewSePsJJv3VEaXCGFEPfttC84MakiSCeBpPA=; 24:dtcO5p7DKrJro8fKvDSA6paT1h6QntPyu/i/YUX39Kv48q4RJ1JD0s13R9nGgtPMCifH599bkNUtsoAIlS6sC0SyEpY5xMiMXT3ph/kkySw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1391; 7:jmP3+FtdmHT3UYwqVHRhG9dMCXuHkoQjwJXI+59v3wK2IYIrFirvvu1GzRZcAVFKQOWicifahUVwDuSjIBNMhWHaOqioTJkHDonrkTd0zc6ufGMlQgOVHVbp+2ZymvTJMBBU62LbhXeJOhAEXaEA4o9pz7RgpwfnL7Sq5fLdCCcROD/MBCiCO363+/fGJKhD5pJ0UKXFzbmBmOo9Wg1BRH8OU4oCUaiDLaozWfpq1MJHYIezrn/MnUiv5MYXOKYc X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 09:16:36.8064 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9e3f0ad-2f7c-474b-49e1-08d5e3212d0a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1391 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: Ayan Kumar Halder , Rosen Zhelev , nd@arm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Rosen Zhelev Signed-off-by: Ayan Kumar halder Reviewed-by: Brian Starkey Reviewed-by: Liviu Dudau Reviewed-by: James (Qian) Wang Acked-by: Maarten Lankhorst --- include/uapi/drm/drm_fourcc.h | 83 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index e04613d..af7e9ab 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/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