From patchwork Wed Nov 30 09:21:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsia-Jun Li X-Patchwork-Id: 27701 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp821531wrr; Wed, 30 Nov 2022 01:32:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rPDLMzjZIUH8YGeKnf9C0QimE3awxwfpE1+54STnIgGpn20Uh5OooYrQJfnBIM2Umeac+ X-Received: by 2002:aa7:dc0c:0:b0:461:6f87:20bb with SMTP id b12-20020aa7dc0c000000b004616f8720bbmr55056012edu.300.1669800774877; Wed, 30 Nov 2022 01:32:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669800774; cv=pass; d=google.com; s=arc-20160816; b=ihEeErZL5uKKSbg6lE0JV8lFBZtFHndann8L14otcUkkOmSnP3hjIve7VetCXLZ9cl qYTaQaUG8ZKCK7cqh4Gjp8FBL7fqMv8YvLUlwyy1taG2rywfcauGxOuSm4qohxli2bNd W0J8DEaqSSaw4ZyXPa6SB9c3nfqu+AyLvf4blv35yYGtTShqqNsYShz3ox+rQCoQTtns IdlqGHUtjLQINJfWpDVvWJu2RhOQfSLx1Ju4ejykVz9qmS0oTSoBzMRBnh+QfZ1O7Nld UCUky8ssNug8jYw9X5blHdw2Hj+p87vrWWEDcE88J2vVuvd+Y8C1h6F7GiPoh1j+YwUY mVHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IDe+Khwrk0Mx0SyEH631hwKJYvjz0f0UJCYJIIXhaUE=; b=w5PtwK5hFiaoxUh3pBEgSDXME9gy0B4bgHlEDtUNSg+JAzeMHDifBQ1JiRxLO/dPRl rJ8TPCgXxl3nQiDOKxuKZ6sxVTV5VPJmeLOmUXZdzd9SqcsRQ5g4uTch5zR9dsNnBlDP gz+rQtEc8AIq6Jk7aqynOHxSZEEyHW9klU3COTPkb5qFQEqnyOrddVKwAGwZbEaXb7Xk YwmgkHMcxPjNyYsA2HWdvfj343H1+/wah93r68CEM2MbYmDjjOuRjsBVGihpW0ZL6BxH rpAr+8SiOqo7lJO1oSonMDJcNPZ9M8m16WJ9iJ2vY3+79eCHXGqvVj6kfDy1sIi013KT AeFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=PhYMlYg6; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn12-20020a1709070d0c00b0078dcf11ccf7si875810ejc.802.2022.11.30.01.32.30; Wed, 30 Nov 2022 01:32:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=PhYMlYg6; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232868AbiK3JWm (ORCPT + 99 others); Wed, 30 Nov 2022 04:22:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232519AbiK3JWh (ORCPT ); Wed, 30 Nov 2022 04:22:37 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2087.outbound.protection.outlook.com [40.107.237.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C3465C7; Wed, 30 Nov 2022 01:22:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bu4t/AfmT1Ef3Q2eWyd5Jrp+EyPFQNIU9tRPc2RNvYoj+cjkGzBsp9FY8kaBi9A8V+59vluEPeIC+OBSDkdHXL/9NZEyqBlnCPsSOCeg8Nb0bdCAGEDVMJy0K1XvDv0+G5qvWkC1OqJQ7raoi1VF53hjeWSF+oPLMo/QTPk15ojrQhDPkE3wd/IBn/Eh6KuhoURhbadsflQveISpXXJ27QlIcB5nEpY9LcqfBH0OyUAzodycWw1nNFjL64a5XG4Uyua05a3Vgr+CUDEVw2h02+w7tr66+e1uIOXBqSnGDoo1pJww7yTa18TKsYX6e+qAFCI6C6YoUqte9JZx+Q9aFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IDe+Khwrk0Mx0SyEH631hwKJYvjz0f0UJCYJIIXhaUE=; b=YMEo+hOAwUC8375RFZC9dFGM8Rw880erWueAp5ew3bRYhy26glkXM/1x/T8EA2a2RESnRSyYAjLHc/XPmxGLJAjQSR+roQ80ptb8Q4VjWWMbk+nIPxgu76JiuT5QA9TvNH+ArbfMosbgonLVSrf/YhruGxu9UHc1wls72vE0Sg/S65LYiN6S/FWWEdXccqxcm8WInqhM+R61RqyoViHGIBPQ7f7Bq+GL5xOvX3aKlOUNv1TyRrrsVEmadG73Fj4Z+YlMc6ytwQfZFyTUGw3uFOKKcW0qBbRzXjfhS1LjpfJ9WkGaJEx3vM86O5KGTfjsntTGR7xk+xGkWlmuViLC6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IDe+Khwrk0Mx0SyEH631hwKJYvjz0f0UJCYJIIXhaUE=; b=PhYMlYg69obJDzcyUGwmaz/XcvsCCB0n+uHD2dnn+I0+yPDqVdjfqZQDzAsd3qhStZ3KsBLh3sLx2WuUHyXPviPXPtjIh3ztBsxCZzSEZdCO8FCdfYUp/dTFq3AaPnc0hzoPWC6Zj3yyhxjK4URh1DYihlFptjjWqb0fzgF2lw0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=synaptics.com; Received: from DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) by SJ0PR03MB5422.namprd03.prod.outlook.com (2603:10b6:a03:27b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Wed, 30 Nov 2022 09:22:32 +0000 Received: from DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::a132:66d9:ed0f:e5c1]) by DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::a132:66d9:ed0f:e5c1%5]) with mapi id 15.20.5857.023; Wed, 30 Nov 2022 09:22:31 +0000 From: Hsia-Jun Li To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, ayaka@soulik.info, sakari.ailus@linux.intel.com, ezequiel@vanguardiasur.com.ar, tzimmermann@suse.de, linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, tfiga@chromium.org, mripard@kernel.org, ribalda@chromium.org, maarten.lankhorst@linux.intel.com, linux-media@vger.kernel.org, sebastian.hesselbarth@gmail.com, helen.koike@collabora.com, nicolas@ndufresne.ca, linux-arm-kernel@lists.infradead.org, "Hsia-Jun(Randy) Li" Subject: [PATCH v5 1/2] drm/fourcc: Add Synaptics VideoSmart tiled modifiers Date: Wed, 30 Nov 2022 17:21:48 +0800 Message-Id: <20221130092149.102788-2-randy.li@synaptics.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221130092149.102788-1-randy.li@synaptics.com> References: <20221130092149.102788-1-randy.li@synaptics.com> X-ClientProxiedBy: SJ0PR05CA0142.namprd05.prod.outlook.com (2603:10b6:a03:33d::27) To DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR03MB5196:EE_|SJ0PR03MB5422:EE_ X-MS-Office365-Filtering-Correlation-Id: 394b1775-15f4-4219-2e59-08dad2b4686c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CXpzwpamuqMgI0SWw9LIsTvqc0jTC9Q/ECWDpC12FXg+nW5rf3XhIEZMTsTrv97qrP3d3y9O0Rlt0oQtxIvPPDvZqFtc+Dlcx01UZzgzwxlpaNVVstYPhWaTEHQf4wkI9UAmUNrxFYy009r/udoPijdA7MgSkRh/vesJtHLb+iYyD98qHl6qcMsULr30UyrWc1OxrwA4gFb4UHRv7wQ14/GkIOYPe0PC2VlakVGcmgHEdZJBYWeWrXLmQZhRtDvWiqQjMm0Wq3bhp2few9Pv4ZCw9OM7gUfi8RgP2wULw9qRnxytc3GZYn2xottEmWOACV44aQwqB03XJufvgNj4zi+ZRQCEczNfPZkR0wnBJTceswxAsOFYUZiamzSMWPXF1DvxuYUR3cXdtLm39Ezk7r9LYnSlVUCZ8nPyatPOh+Y4eHWZgrZO56n4wg7T4MQ9NplNc15fBXkdkgM1Czk9H34Dksjb7CZKUB0Z2kl4R4ud1vEvvCZF2kfD4Zo2uCy3IPUyuc3AbQHo38DZVFo+SWcbUudOJSOp5MZI5D/SJmjKh/JddxVr9su9E1da91q+lCKTOSUc9NKlvXLqm50QoEW1Dz5r+lruov48qWDRUZce1veWSTyxLVMBdTO2ceiGgG5tzyobEDX5xRvJckwQSvwRz2pAn6rHr7emVZ1HGmbxL5fI/Xh04+ZM7HofyKgA X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR03MB5196.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(346002)(376002)(366004)(396003)(136003)(451199015)(8936002)(52116002)(6506007)(4326008)(8676002)(66556008)(36756003)(66476007)(2616005)(41300700001)(2906002)(6916009)(66946007)(186003)(478600001)(1076003)(26005)(316002)(6512007)(86362001)(6486002)(5660300002)(7416002)(38350700002)(38100700002)(6666004)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vRX7TxGufvaPMrXFyO2ItvfJpBL4oCjLBrVhGh3U3Jhm1udLcjLMtiUXAyVgsRVtg4BMEk3BM703nPS+n5AzlTCPakGRrVD+OwMJ7Hzy0C/DjG0pRo3z/mUQGRcddBs+q12SQpWNac+ZEigkpltjlyhyGdxjsPTJyYMeF+GN5VUY0pbqRPGD3Z1+pCJqXIa0xd0R5q282MJ15zUXFpY6WsqWHHmNg7qBee36Bn0GeubdjqLOw3ueNhtqcVuYBc1QYlwDk3YuLmytodZNPV5HXQx/wVis2Rzviy5xlD6K0UKFbLi1WOkXV/sMtKW1xzCBVoc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0md3Q6ogBqfoHXeYpw4nf5xfZ24qPSd1XVtE6qVkWtmfEQSclYJn8xxNIrn7EwE2SOZos+q7efvZGyZE7P49nyTRvDyAvPVFqqxERdSPRjUsS6Wn1j9vox7e2OX5Fqq04z4xipBu68pOEjd04dorJyc1+enmFuQB0N3mvmEtF4H55fa5aJD1aY24j7crUxxx87Xzc X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 394b1775-15f4-4219-2e59-08dad2b4686c X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB5196.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2022 09:22:31.7193 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ug4CMYPpChM8FSTGvr0C4bOvMT4Q89cV9V6jH+w0bhDSiS5/4YjM/8prc8eiOmrH5n0Q0cSpuXkc3bxzCuhM2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5422 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750913017378115606?= X-GMAIL-MSGID: =?utf-8?q?1750913017378115606?= From: "Hsia-Jun(Randy) Li" Those modifiers only record the parameters would effort pixel layout or memory layout. Whether physical memory page mapping is used is not a part of format. Signed-off-by: Hsia-Jun(Randy) Li --- include/uapi/drm/drm_fourcc.h | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index bc056f2d537d..e0905f573f43 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -407,6 +407,7 @@ extern "C" { #define DRM_FORMAT_MOD_VENDOR_ARM 0x08 #define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09 #define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a +#define DRM_FORMAT_MOD_VENDOR_SYNAPTICS 0x0b /* add more to the end as needed */ @@ -1507,6 +1508,81 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) #define AMD_FMT_MOD_CLEAR(field) \ (~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT)) +/* + * Synaptics VideoSmart modifiers + * + * Tiles could be arranged in Groups of Tiles (GOTs), it is a small tile + * within a tile. GOT size and layout varies based on platform and + * performance concern. + * + * Besides, an 8 length 4 bytes arrary (32 bytes) would be need to store + * some compression parameters for a compression metadata plane. + * + * Further information can be found in + * Documentation/gpu/synaptics.rst + * + * Macro + * Bits Param Description + * ---- ----- ----------------------------------------------------------------- + * + * 7:0 f Scan direction description. + * + * 0 = Invalid + * 1 = V4, the scan would always start from vertical for 4 pixel + * then move back to the start pixel of the next horizontal + * direction. + * 2 = Reserved for future use. + * + * 15:8 m The times of pattern repeat in the right angle direction from + * the first scan direction. + * + * 19:16 p The padding bits after the whole scan, could be zero. + * + * 20:20 g GOT packing flag. + * + * 23:21 - Reserved for future use. Must be zero. + * + * 27:24 h log2(horizontal) of pixels, in GOTs. + * + * 31:28 v log2(vertical) of pixels, in GOTs. + * + * 35:32 - Reserved for future use. Must be zero. + * + * 36:36 c Compression flag. + * + * 55:37 - Reserved for future use. Must be zero. + * + */ + +#define DRM_FORMAT_MOD_SYNA_V4_TILED fourcc_mod_code(SYNAPTICS, 1) + +#define DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(f, m, p, g, h, v, c) \ + fourcc_mod_code(SYNAPTICS, ((__u64)((f) & 0xff) | \ + ((__u64)((m) & 0xff) << 8) | \ + ((__u64)((p) & 0xf) << 16) | \ + ((__u64)((g) & 0x1) << 20) | \ + ((__u64)((h) & 0xf) << 24) | \ + ((__u64)((v) & 0xf) << 28) | \ + ((__u64)((c) & 0x1) << 36))) + +#define DRM_FORMAT_MOD_SYNA_V4H1 \ + DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(1, 1, 0, 0, 0, 0, 0) + +#define DRM_FORMAT_MOD_SYNA_V4H3P8 \ + DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(1, 3, 8, 0, 0, 0, 0) + +#define DRM_FORMAT_MOD_SYNA_V4H1_64L4_COMPRESSED \ + DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(1, 1, 0, 1, 6, 2, 1) + +#define DRM_FORMAT_MOD_SYNA_V4H3P8_64L4_COMPRESSED \ + DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(1, 3, 8, 1, 6, 2, 1) + +#define DRM_FORMAT_MOD_SYNA_V4H1_128L128_COMPRESSED \ + DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(1, 1, 0, 1, 7, 7, 1) + +#define DRM_FORMAT_MOD_SYNA_V4H3P8_128L128_COMPRESSED \ + DRM_FORMAT_MOD_SYNA_MTR_LINEAR_2D(1, 3, 8, 1, 7, 7, 1) + #if defined(__cplusplus) } #endif