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: 13026855 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 94A32FA373D for ; Tue, 1 Nov 2022 10:07:16 +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=lLB/RL3NiiFE0IfWVJjEXa7C90deymkNPqBT1Yh8T9M=; b=d1yZrDnPJcYD83 f0WuIQmx4BHvj0y9tpf8rMm9lWsHLlfzJYKmvbuE3gyGY8ArhPsntowGoALNELMEz3qswkjK1lcdR ws24GMfEzXDCtXV33mXa7hdanyUn7iYLwcRYEa7dXM1XBcdTdpzz4qohrixqvFM7VEd6N5QEO70sf WDq4V177WfVhqnTsIYHWpFLiTxPgb7VmVNXlsb0XKu08IZralkGt06uj2tHLfPafIxlGx6ktWzZRx znsv0aozynu6sQFuQj/Bc6lpqzcOCZg+tkcZb5FpKRPiQANRCgH5iXyRj0/eNFCxrivo5bAFSmYo2 dWahyYSn8ZMQYb4acwrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opo9p-003vfT-Bo; Tue, 01 Nov 2022 10:06:10 +0000 Received: from mail-dm6nam10on2064.outbound.protection.outlook.com ([40.107.93.64] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opo9a-003vSK-1Z for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 10:05:55 +0000 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+9hHzRfCLBSzdRvpul5xczRfqVcZbNri01jzqb9pPzPKHikSc2ZknedXCDtZSZL3VkPnxicwMi0Qrcl8GkSd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b8tImhEdNF9WUOvNyHpHniw2GR2t5M6w/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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221101_030554_122240_04E5C494 X-CRM114-Status: UNSURE ( 7.41 ) X-CRM114-Notice: Please train this message. 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" 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 */