From patchwork Tue Nov 1 10:04:46 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: 13614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2865276wru; Tue, 1 Nov 2022 03:19:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jZVuQCW1Kyan8KXIVmFUlaiSYpvUabsMSQItGxYx9Ek9TihGGekFyMsDXCyS89KSbb3B0 X-Received: by 2002:a17:90b:152:b0:213:dfd6:3e5e with SMTP id em18-20020a17090b015200b00213dfd63e5emr10143704pjb.229.1667297983082; Tue, 01 Nov 2022 03:19:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667297983; cv=pass; d=google.com; s=arc-20160816; b=Tn+sjRMSxlydPKv6adKme6t9gbnBs/4PbJUMgU0rGkunWa6hiq5thraSOBljcdewsi SPjMepLyTovKbOlDnNPfT075O/iGJpNC0mD/LFVwlsERZG5Lm5aHsJCV2Oli7vP+SbGu sWYlb9s5w3pDDDpGyNc6FdFzCpPnYmcykPk6zlf/RqwRRvXANaDwM5t+5KOJOn0VHNj4 8UcIUspd7yYdrnJ6A+cIhOh+IvyMVc3zpeyo/OTiHnuSMj41veu6bbYSmQeOTDbadH6h EnJv+CGgO7aPBETA2X2EqpBKKvufmgzWwjgKrz1OmexYMLLvRfC2UbAWDtxFpRovROBb P12w== 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=WLbFrOWEYWjaTOVaR/p2ZKNFdbel3IZbWaevVbsdCwo=; b=lhtD5lH31N6ksAXEdgPaOSdQkjOA1mJIyR9MEh7B1YCZb6MoaRWqGdgkZA5lFewOHp WyNOVK0cVVfSLRw5KpFC3cg7A2fI3as28bUT8uYuc0S0dGHsNrsJZfycxuk1jyv68cCV zOXImh4eGTB4zSsrAkT2wrInCQWuPEafZnF25w6bwxZlLRdHn0BgJ7vaSGezRF3xqCtE pDHOcEZvwWFfXQQaYig+Trdo9mR0foC+pAHlj0wNAG4Rs3SKol6pv0oVubatar6z9i76 Q0YyJdLQugOVe2+TVybyItEfEEgFJOpbhcQH4o4kU7qgiMSAsFaUoEWe+5H365tTijbO 7fgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=A9114vFY; 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 a2-20020a1709027d8200b0018659ff71d2si9813090plm.62.2022.11.01.03.19.28; Tue, 01 Nov 2022 03:19:43 -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=A9114vFY; 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 S230518AbiKAKF5 (ORCPT + 99 others); Tue, 1 Nov 2022 06:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiKAKFx (ORCPT ); Tue, 1 Nov 2022 06:05:53 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA368193D2; Tue, 1 Nov 2022 03:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mC8GAPdebjQIiJATMq2NyKe6p6Z4qsfCSf5r3El064eLuPbsoTFZnw51xrNdKeEd6SVr86szTPTfFu1t+xYmXkB9yViWuPD9gu0rP1E5t+a3jXIJtbK+kjs95yKbTxgiigPdj8CImeS81YzfGIZ05KeBCKMNR1f3vUg3t5/vUSubvlVHmtxXcWr6pI2q//W9Gf8iADyUiGsceJXhieQooruTPTWf668Z38mi7fwwAnx6n68JgqjrOGorQ37UfCUBqAGJCEPHQlNbFrfauuLr0dnhGHI5zSLc0eJlCCIWzSmdCeZCdNQxyzYOrA+3T4ZlB9k5yEnWhlcvgsiEnNKbPA== 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=WLbFrOWEYWjaTOVaR/p2ZKNFdbel3IZbWaevVbsdCwo=; b=hArLA82YgyuW81kmIpk+Uvr/tGYkQmOBahAgL9YNEkwbqlELsLfzk4J54kmc/SNYOuqjT9V/7eKGLEhpvI9zW00GiP4lgRsaONOxW0y/uTGhWXMCIVTB/6aEjHQ5tbn7xHUQuI6aocyPyUO59zdkTx5qHK4cFHcxUwRboOLLQnexSFqr7/rjk1JtXdD7/9T5iNV/y9ndqy6FBLkM3nOMzb67Stj1RdAJ1OlireYoxo0UqgB3p97BPC90qJuJt3sOX0J5PM0MJYME+4JYo11uHyhJUeIHfXuXfbxKuNeUMFE6cH+fB03Slr8a9LkBDAENGypG4q/dY7c4g34XiU/C3A== 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=WLbFrOWEYWjaTOVaR/p2ZKNFdbel3IZbWaevVbsdCwo=; b=A9114vFYm6bklPo4oWG1goZjrgwrAQ/3Y2KHdzLdTFp09Nl8grejhqotjr6lnahDesNX10NMMb5LGFnAXIAiT9RVFv/YExoIxjltazLd3Olijn59auzrNYCYTfPdh3L/tdVj7qdXbG+GENpVui+fQybZlSOjMK6ByHO7+n6x19k= 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 MW4PR03MB6362.namprd03.prod.outlook.com (2603:10b6:303:11d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Tue, 1 Nov 2022 10:05:51 +0000 Received: from DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::a132:66d9:ed0f:e5c1]) by DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::a132:66d9:ed0f:e5c1%7]) with mapi id 15.20.5769.021; Tue, 1 Nov 2022 10:05:51 +0000 From: Hsia-Jun Li To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, daniel@ffwll.ch, ezequiel@vanguardiasur.com.ar, helen.koike@collabora.com, hverkuil-cisco@xs4all.nl, jszhang@kernel.org, laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, maarten.lankhorst@linux.intel.com, mchehab@kernel.org, mripard@kernel.org, nicolas@ndufresne.ca, ribalda@chromium.org, sakari.ailus@linux.intel.com, sebastian.hesselbarth@gmail.com, tfiga@chromium.org, tzimmermann@suse.de, "Hsia-Jun(Randy) Li" Subject: [PATCH v3 2/4] media: videodev2.h: add pixel format modifiers Date: Tue, 1 Nov 2022 18:04:46 +0800 Message-Id: <20221101100448.66712-3-randy.li@synaptics.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221101100448.66712-1-randy.li@synaptics.com> References: <20221101100448.66712-1-randy.li@synaptics.com> X-ClientProxiedBy: PH0PR07CA0027.namprd07.prod.outlook.com (2603:10b6:510:5::32) To DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR03MB5196:EE_|MW4PR03MB6362:EE_ X-MS-Office365-Filtering-Correlation-Id: fbe8876a-776a-444b-52c3-08dabbf0a7d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H4SUqSfy3xre2VoMOqhxyjpdd9Yh3pk9dZQPsjBGLnj5Kosk5xq0ceuJCqSXpQzm5z7NTAoL8Npu9OqMYxB99v3ObJkA1Htgzb65ZLbrf1EeoXAqUnpP5qSFynHuRBCBjUh5JtDSLk1+gxkSftiuQXVOqCisKemG3DW+10uC5o9HoJiYNLY2jDxpDRHK24XhnB+6OM7FyRpapS9TYeb2DVGfG7C+erEDurRUsHd3hQ4Jl32syKPeYaSiWLKb3JDMb4OKcvRSmEflEuMYaSJqq7p3ueb5AqRdcyp7oTZ1seCe+v4aFVQyRp2vGcbFy4IniY96D0oBfe1wANogP4hriO2wGvEIjNWVik5sY3/EG6gCVsWSe8pUT+LHnSQQYHLAYy60ydA0FF/Lgdht8svTFLcgR76a7DSkR9bxVHv9C69ULVZ79Pg1ghJfMk9JAZ2CPvAvUZyjw7JudmEw+utOttOJ2VaNnnmNQwnbTPVogmMFZiWZ38f0F/VR53KMnHMdcErVMDtT1nJi+w/nbR+U2ErKWKXw1Km3OM4QF0Z6JSObwwGeRdvaYtcD46tfwaKqvXdj4cshQ3hiBJu/PVr42KIkUyF3FIpL29MgIfv/e8xFPdytyfFfYFpDxEfomn7irshqzDq917TJZ2luM6cpeOlxnxKQ4lHf8xvD1xaNP0hBwYn7Za1k8VXxb+fYRkVl0FW/xCy6gGb9Dk0yb72zFKrillggT2sWk6L9L0PQkLIdU26ZEh0YA/OhD4POu3jE 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)(346002)(39860400002)(396003)(136003)(366004)(451199015)(36756003)(478600001)(86362001)(6486002)(6506007)(66946007)(316002)(6916009)(66476007)(66556008)(107886003)(4326008)(8676002)(6666004)(52116002)(6512007)(8936002)(5660300002)(26005)(41300700001)(1076003)(2906002)(186003)(7416002)(2616005)(38350700002)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HbxwtuiiREkKfFQd4tCbaTI3X9JCeNhumQYX1Jov0UhwvM7cSVlaOpKCK79q5qmHWMe1sEPSlTSAKAFoK/1DplrUNDqcIHtT6gwmiWigXJz24AxrRFOuEFDJBXhtjMvLF39Iqy/p1aRiL8vxU3I83ogFRLDH8/2k7mbcGUFWudsBdsMbN9rExANGKq3BDyxzBGnUGckmTM1oaWfcPmGRJfRUoB6Q4A/z3tFaUb5OSuR+cCDHI8aGDv6MjbXtGRqtHF27K/646HBMLztS8OZP8xh2+9hHzRfCLBS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K99ouh5roet+4lSa268GXCueZ8OOv8hF+NVIJ79q9zJeQb2KBX6uMRpCAoNri4avPyVXrggCykl9b8tImhEdNF9WUOvNyHpHniw2GR2t5M6w/sUHEqYiCDyjKFu8EGQmxKe6Uq6980Bae8i3ohS47vVU9tmfKWPUeQ+A/Z0eaItVJBMFSPz+cATzxiuIkEbgrn50InQ6lSYJDamikBDEkGRw/kgwA2 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbe8876a-776a-444b-52c3-08dabbf0a7d5 X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB5196.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2022 10:05:51.1791 (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: nbV16mQ5ipMUr9n6weVeaN3UaUciPfTJSQqVK8nSP6366VvUQv4v3fYPUrwqR3c8DJfkOa0SEYusQU0x7A0YWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6362 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?1748288650270919642?= X-GMAIL-MSGID: =?utf-8?q?1748288650270919642?= From: "Hsia-Jun(Randy) Li" Signed-off-by: Hsia-Jun(Randy) Li --- include/uapi/linux/videodev2.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 29da1f4b4578..d00b2e9c0c54 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -816,6 +816,26 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001 #define V4L2_PIX_FMT_FLAG_SET_CSC 0x00000002 +/* + * F O R M A T M O D I F I E S + */ +/* Vendor Ids: */ +#define V4L2_PIX_FMT_RESERVED ((1ULL << 56) - 1) + +#define fourcc_mod_get_vendor(modifier) \ + (((modifier) >> 56) & 0xff) + +#define fourcc_mod_is_vendor(modifier, vendor) \ + (fourcc_mod_get_vendor(modifier) == V4L2_PIX_FMT_MOD_VENDOR_## vendor) + +#define fourcc_mod_code(vendor, val) \ + ((((__u64)V4L2_PIX_FMT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) + +/* Format Modifier tokens */ +#define V4L2_PIX_FMT_MOD_INVALID fourcc_mod_code(NONE, V4L2_PIX_FMT_RESERVED) +#define V4L2_PIX_FMT_MOD_LINEAR fourcc_mod_code(NONE, 0) + + /* * F O R M A T E N U M E R A T I O N */