From patchwork Sun Oct 30 17:18:06 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: 13014 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1889538wru; Sun, 30 Oct 2022 10:23:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6cQPeeXV+LpaBn1ql5kpuzIxhZBY6iRAl2bN1L6EK1d5O23pkWNfsF1a/plSM1plJXiEvx X-Received: by 2002:a17:902:6a87:b0:181:c6c6:1d38 with SMTP id n7-20020a1709026a8700b00181c6c61d38mr10107004plk.74.1667150615811; Sun, 30 Oct 2022 10:23:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667150615; cv=pass; d=google.com; s=arc-20160816; b=RJY/jElkRcIjXcQtrw2rH4gUT+i4qcs361IprdKuoRl3mtOJWPF2qPbNO4MR7gcymC 4we0ItjSx1dO1dMAJU9X2dp5x9mDNIigwsjvdeIYSWzI7yn6fywPwA7PeK2zOg8p35Qh lovd8pyLjHc+imwwywAtwYmRfHEusABxHhm8IXbVaUo625Y+HkdSOIVnZ8CepxkZ4FNZ NIOx5B2Sja+Z4zeDtOMsY1Tvs4AwcLwZVdNSgZUCgLY06e1NyCoRcOEVFeSfWinRrG2k IxuRAMwenqAbL/ty1u2TnZdjmwKUwTyBOFUjkkFHEuSrqUxVD2gllzk/X6kHbGSPRylD 8UIA== 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=Ra/82IXfTj/xJPXlX8W3UboVngRt8xJLGHsw4zY0qQ4=; b=H5l2obpZtjsRHL1Jb7uxnfbfqzltz7YnDAXSNrR1F4zQUJjlAmRHAR/YdQHm48DE5N WZguTvmt01WYdfRdnAgF61gC+Ex/UCJXYkBLQsoTKurJMUW2+sTEphip+6aV+yaQh0sZ QhIkgCrC9U9IJsTK4iYAcXjTDVskMp+Jr7BgctkeofB8EiaVkHqS8w8YbadQ0WNGPdLa VQv6r253Pmk+vdIYm4SlteoFhrdpm3ZZbvPhYfHjB/y85N/jmqw+t8M8RhoXvapc8fJK mpS1hO7NY9k31XLGKyMz+TYHpMlK7vOtSpDr18MHuF/t0//+BHMw1Lw2Lv3tDTENJdwY FWQQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=V8g0IfOU; 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 p12-20020a17090a868c00b00213393ff173si4943782pjn.75.2022.10.30.10.23.22; Sun, 30 Oct 2022 10:23:35 -0700 (PDT) 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=V8g0IfOU; 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 S229828AbiJ3RTe (ORCPT + 99 others); Sun, 30 Oct 2022 13:19:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbiJ3RTd (ORCPT ); Sun, 30 Oct 2022 13:19:33 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 662F52BF0; Sun, 30 Oct 2022 10:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EPDi6P0yNNq5tEcaiJnZ6bHPOdoMR2d1qj4hSIWROPb2SX5pFsyFbZI9T57PTYkwlNF0/sDblfIG8k3Gw/7QUfXAa3nXkNVM7MBU5Fxc5xeN5vODefEd5zkTE4Vs9kS6hlpukIYZhVafXbJvPUESBIhNiR6ksARnzTlbwL/w5PqQM2Nf59v7XmvW5Hr2V6HkHmRvwwpMQ1TcOsOnkvHNPIr5LRuKB7ClLEhkBjdBQA18DPOfIG07ICDA8jmoRNMi+b/wpvyM9GukpvBol6Nungdm0Aof6TBgM0in6O23oUztjbOFHFdm9LQrLqgKSEI+7YTJoMxQizjXevWz7k8RFg== 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=Ra/82IXfTj/xJPXlX8W3UboVngRt8xJLGHsw4zY0qQ4=; b=fLo440TGGfOrifDEf/hPOp+8ZztF1KRaDGEzmc0tqzuPo/bmOSkf71RjnvHgEzxFGdpy3oui+ajsOTiBUfcoUAV7ACS3Y17okTy7YwBxQvdHmeU043dIAi5qi5PrhgiWZoQVryApXS0VYrY+xBroOwEBwlncV4rjB+/brFrBjdnUjgIPDPbXkUHYnZpXJqFBLd08g7VfOctnfawtRcfcU81J0Ax8G5nukWrVfr5+LlA5KMzqJwJojRnMiSl3+XuUy4+fC4ZZIx8HAqCDHS7h+AmqWFqsOdw8vn2bkxkqXHMb8I8To1ChURqDh0VBNOhSVaPf2TEsttTxuIjTxQdOxQ== 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=Ra/82IXfTj/xJPXlX8W3UboVngRt8xJLGHsw4zY0qQ4=; b=V8g0IfOUDFz2NNyXN7mTLwS9yFdd0qHT6REuJ7EfYmJAfbDOExPGfZ2YvVW2vyf1dgZjYhXqnklUA/YkUA5AEr+sxMp9tPEfiINDE3CSOPvxUkZw4AuA7mJ4+Le5+d9copQGSonQSi9eCroJ035Wp8TJrjDAzBTZF/wiA5xgq0s= 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 CH0PR03MB6113.namprd03.prod.outlook.com (2603:10b6:610:b8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.16; Sun, 30 Oct 2022 17:19:28 +0000 Received: from DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::a132:66d9:ed0f:e5c1]) by DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::a132:66d9:ed0f:e5c1%6]) with mapi id 15.20.5769.019; Sun, 30 Oct 2022 17:19:27 +0000 From: Hsia-Jun Li To: dri-devel@lists.freedesktop.org Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@vanguardiasur.com.ar, sakari.ailus@linux.intel.com, ribalda@chromium.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, sebastian.hesselbarth@gmail.com, jszhang@kernel.org, linux-arm-kernel@lists.infradead.org, laurent.pinchart@ideasonboard.com, nicolas@ndufresne.ca, helen.koike@collabora.com, "Hsia-Jun(Randy) Li" Subject: [PATCH v2 1/2] drm/fourcc: Add Synaptics VideoSmart tiled modifiers Date: Mon, 31 Oct 2022 01:18:06 +0800 Message-Id: <20221030171807.55837-2-randy.li@synaptics.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221030171807.55837-1-randy.li@synaptics.com> References: <20221030171807.55837-1-randy.li@synaptics.com> X-ClientProxiedBy: BYAPR05CA0010.namprd05.prod.outlook.com (2603:10b6:a03:c0::23) To DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR03MB5196:EE_|CH0PR03MB6113:EE_ X-MS-Office365-Filtering-Correlation-Id: 040d62d7-e54d-468e-0462-08daba9ae617 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0ML+bfyd/8K01Fcr+clqaIOr/T8qSwF5+Zf35KFnFD5cbnzrj9ZqOcF34wtBDS+muBddbo7NBd0/WEdurO21E3fLEbvy7vACvwhjT5At/ZcloFrN6V4TBqTNCvmJ+CFPP1EpxF60Ko1/7hbO6jTPExkWXc2H3VwqQo2aLZY+v/h6l1xF+6hE98bt1ejH1FmGnWJVW2+I+7ISrLBP6KOo/ABTvYTe6QEomJ6+K67DTRUYhXG6RjSdM525DFlUZDrMhABt4GVNxoHKfnDEk9MF6sV6AjyxjznMw80xhxS+C7yLAabKyWq9xG67SJpFEW+mPV+JWNvCXuPGS9k9msKyde4C1vVMfAdb40V/mZ27SdWhIyreA6yAvWvovZ48mUoIuhJa46xI65bLL+5vX2DlhFnWJMMM/MPQMdkCk/GmlVDMFo8AlgHWXhB0QbZf1MGNEOlM2D0IbZjhR1iDI57sUv++7xTxQUmz1CrQ3Ab+CkbGgiy7r2TCazQd995K/BhCCNSe6pa+AEnPQ8Q3WrQZWp1uTDVQqSta/iM++cR85ufFwHEgv9HA4UL5A9NUFEXegVRTTOv9WBbXVYqQ6rncpY+OxGSbKwxpiwnK3n2G56Z/YeCXMxsETDCbkqwaErXmR3s52D77n2EVxMck12G50Z0d1B5OCLYPug14A7r1sYHQV9GyLm2tIGR879H9FPA1hdAKr8S1mBWJJQWcTdyzOBIA1Srrl37hJNM6R7Ge6XqfhjxrqPXlLMyD+BBL6dOm 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)(376002)(39860400002)(366004)(346002)(136003)(396003)(451199015)(38350700002)(38100700002)(36756003)(8676002)(83380400001)(66946007)(66556008)(4326008)(66476007)(316002)(2906002)(41300700001)(86362001)(2616005)(6916009)(5660300002)(7416002)(8936002)(186003)(1076003)(6486002)(478600001)(6512007)(26005)(52116002)(6506007)(107886003)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dkRI0YFZUH9Y5p9eZE/BSENwwxCPDC5G/i9aDQHG9uhLZOAhHZ1Vmb+GUwT0MCPZIMcHQltPD5MZ9btsic/8xfXBEOp6+sdSrEEOfd2KAr1Pnow7dV2Y+XkC1WU9p1lGrsPLluVzYabj8sZeRn9vUoykj/tpLicdHqgk8x2d+qXqF+YMVt6VyKRvbkk/7nK9Y85SdghHJ2+iNR2ynJBds7lvSNBqcY915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4Us388RwBMGPzxwGnY3ltMg3JDPguFu4+joyzFrgq2b3aMHGmXadlKzAIQbGb6r6NAPs22zy52cVkS0ROravOs/VTV7fXy7zXRthyDyR1I9+oczMBiL64VPRGy7CDW5Tz8n2TdT5YPK+AXxunCQjfNUKvUclYqYqMd0gsjmioMKu3sQEF5ayhYcBRD1AyUSK2Fv3/vTAp6xIkBEhc+vujOXriVH9ilQ8WzIBG3HHDnn4nAl+guE9lReBiblUljVELHEA6hUcIKzYA22qIJaJ5hGvApsxto49 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 040d62d7-e54d-468e-0462-08daba9ae617 X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB5196.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2022 17:19:27.8406 (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: zsNvxx0fyN5HxqTVW5agweuB+T9nDJnCV4X0GuOqbF9P85v7fRgQ6nP0D2KwAvvyqNGgym4L3GtVsrr571MdOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB6113 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?1748134123954191183?= X-GMAIL-MSGID: =?utf-8?q?1748134123954191183?= From: "Hsia-Jun(Randy) Li" Memory Traffic Reduction(MTR) is a module in Synaptics VideoSmart platform could process lossless compression image and cache the tile memory line. 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. We would allocate the same size of memory for uncompressed and compressed luma and chroma data, while the compressed buffer would request two extra planes holding the metadata for the decompression. Signed-off-by: Hsia-Jun(Randy) Li --- include/uapi/drm/drm_fourcc.h | 75 +++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index bc056f2d537d..4b587a4694f7 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,80 @@ 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. When the compression is applied, it is possible + * that we would have two tile type in the GOT, these parameters can't + * tell the secondary tile type. + * + * Besides, an 8 size 4 bytes arrary (32 bytes) would be need to store + * some compression parameters for a compression meta data plane. + * + * 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 bytes, in GOTs. + * + * 31:28 v log2(vertical) of bytes, 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, (((f) & 0xff) | \ + (((m) & 0xff) << 8) | \ + (((p) & 0xf) << 16) | \ + (((g) & 0x1) << 16) | \ + (((h) & 0xf) << 24) | \ + (((v) & 0xf) << 28) | \ + (((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