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: 13059623 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 DEB11C433FE for ; Wed, 30 Nov 2022 09:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WonxG/f4oaoRXoY1sXBpnZ0V08EvzbjiOr9AbY5axbo=; b=zLsnQNogXpULia IH02tN05XY5EijL+tfhYZh0cVhp6zGYRSHE8dOPQzrqSrgSjCgIT8fV+bWeYGOwU8yjmtvUrrzhET EQxr20eF3dHCoMXYLzL5mtp+ZmZjprJm1VTND1G6YN1KXmY/2fW342o7os9/MdRrcOUPURP7+j6AN Yr3rfcVOkGzOBdjGon/AB7Dv9vfUo6YVv1qg0kEvezTTslOueJdaUaNj7WH2Vzlyd2guayAVk9Ol/ vhOQSbtu/Id2rcrFMc/QPVkEOSdzgvTpMBk0wXbVu+qK5XKtGbD20Scmkgo08gWHu58W2qBkbkp6t Mt/XPki8qdh9rEfUsBmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0JJG-00EyXh-JP; Wed, 30 Nov 2022 09:23:20 +0000 Received: from mail-bn8nam04on2062d.outbound.protection.outlook.com ([2a01:111:f400:7e8d::62d] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0JIc-00EyGv-Ie for linux-arm-kernel@lists.infradead.org; Wed, 30 Nov 2022 09:22:40 +0000 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/sMtKW1xzCBVoc6wNvuCVXgcyf9l8NcU5U6JIplzf7ieAmup0u6LoEUl/vh1YNFBkgQtwgXNLxgkKip7beB/Y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+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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221130_012238_725581_55C4A22C X-CRM114-Status: GOOD ( 15.00 ) 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 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