From patchwork Thu Oct 19 21:21:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13429859 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 2708BC19F5C for ; Thu, 19 Oct 2023 21:22:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A325C10E555; Thu, 19 Oct 2023 21:22:51 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20620.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::620]) by gabe.freedesktop.org (Postfix) with ESMTPS id E86C310E543; Thu, 19 Oct 2023 21:22:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fbrQzSwLhNOXAAvuj0sMYgolGVcuepKQi5TUvU35hUMpIVKqgvDUPX/K8LrYDk7EoW0UpgP+XrHS4Qozqy/1ghrjjtlHP+qTy1C61tnUqZzqxbMl+KvXatUbabapLuCMkaHFUyoMXTxiWW7RI7HNPrSP2vm0lEzBlc2v9KJ/QUIWeP630vLKh33Xt/CE1/ka05GshvKHYB3d57ehefvFi6M/FJjrC0epUl3uK/7gyCi6p7xBhbn2aMekrN0wUGPzE4fvhKtjEpiocBUQQh2FtGGMNe26AJ+OkX13lajucjf/08a+MM2fkwPU0mUbcedM5SfebTnTSiGBwG+VYi2haw== 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=z7jEv3BTWUQxVPNi5abENN9M1I3utYtWgsVh/hURNjk=; b=e3imaIH1aob6hHHA4FQnKIL3ZzYnO5R18ArWPtQZ5ngBTiOSv2UqAVqwPjS0K9kgbkEZeNgfqKrUb2GvOwbXbdTTD26K+oIQFVxrBbYZ5sZXbXBgPNO0J5JdwHiCy387/HqN6eZDfkgoTm3Fu5qxZJPiixJzPIRR3SEWQFB0Z7v6VCzSHcJkZgpHBwrppROJW5mr/ec7u7yXU/cuUgbTK6dLYlO5N/MGh381repZ8LeqRIwyhzU6m+3MoA1YIXqMtBkyORccv4nqPID0fxKHiR09gen9YWD/BMVVhyxTKOoWb8l7CNiBi/TBrF2D50h/AkaTiGQAd0mh+kKXlYmEeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z7jEv3BTWUQxVPNi5abENN9M1I3utYtWgsVh/hURNjk=; b=WGL29CQHowPzgTf+zj2vGWY5/uN73eEIXXJWcaLIydDZSn105PfF/1zAxnkEeELqPZ6ytUGFbqP5Dd5X6Xhcd6mTGolsxEWQP3u+FZxDuGfAudzWuVawprFwZjff2w0MezjZooqY2I5y1OgEMu0MWx/fsIiDvRRm4baPHPVWi6E= Received: from BL1PR13CA0144.namprd13.prod.outlook.com (2603:10b6:208:2bb::29) by DM4PR12MB5037.namprd12.prod.outlook.com (2603:10b6:5:39a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Thu, 19 Oct 2023 21:22:40 +0000 Received: from BL6PEPF0001AB72.namprd02.prod.outlook.com (2603:10b6:208:2bb:cafe::80) by BL1PR13CA0144.outlook.office365.com (2603:10b6:208:2bb::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.8 via Frontend Transport; Thu, 19 Oct 2023 21:22:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BL6PEPF0001AB72.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Thu, 19 Oct 2023 21:22:40 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 19 Oct 2023 16:22:39 -0500 Received: from hwentlanrmb.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Thu, 19 Oct 2023 16:22:38 -0500 From: Harry Wentland To: Subject: [RFC PATCH v2 11/17] drm/colorop: Add NEXT property Date: Thu, 19 Oct 2023 17:21:27 -0400 Message-ID: <20231019212133.245155-12-harry.wentland@amd.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231019212133.245155-1-harry.wentland@amd.com> References: <20231019212133.245155-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB72:EE_|DM4PR12MB5037:EE_ X-MS-Office365-Filtering-Correlation-Id: 645f2902-a52d-480c-038a-08dbd0e98680 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 45cjFLSEuI+AlVSRXewh8w2U9UMs8InbsQTZswGsaG9TKPKU7J/krCVzM1T31/OptvilymnP/iT4rtrNOxinJ2Btjuq/05biLAVOSHMlvHG4XnjQlCBnD4qXJJBjQO3c7YNUEIF9lMhEm0Qhmwp5tIh1w20AfouHJR66/cC+Bz7GdjL8AawXegLBmCYUU+MbYsKR8r8fwTJPsff+RhHkNc2WEC8Rd0gknO2h8yYs6SYSLzGHHzSzyTdBigJ7REk8lmgbMGj1S2DgdGMgUDj15Bb5R7s1UMgdRIYqMDlHBLORnI2EtDFoOtW58AAMSNRfQHmhNxmxDQ0fQyG11B89t6h7v90D/yZcpurZ1pJfJZY3tPA6lh2fbJrfG5jRmmDZkr8A1cEPM6om7q8V0IiiulPv1r3wH90P1dgJchdWBDgMAWfbzNEu8MQk9mOoDIJzMN0iVgVlDt8ugrpjueWLSoSoiz2rjta1TnAxjJaQAXjFMS1K1h6mmE9q69zVSe/m4ShU8ZnWXCQ32GsDDlmi4tj91hVl7aFNOipDq2FFyiYR58IvkWCyX1hPlfeFo25c1139NI8mBK7ysgtBH90uMSHiLP4um2gEUMORTpJyMOdyKrflRNdjPSewNy7LZVZTQyiAaTB2SiwBa1JLPznaHkSk/wbnUnqHGBdKI6x1R66McZ51bARGsftLuuDwcLdTc8K5SeIR+889HwM8gJ2rR8sOAwhaDGI3Mx8jFeKHLIJH3YUDRXmh8/7n+VXPOW39TwryI5gUR5B1WRlX2JeMrA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(376002)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(82310400011)(36840700001)(46966006)(40470700004)(40460700003)(86362001)(2906002)(47076005)(7416002)(4326008)(36756003)(41300700001)(44832011)(8676002)(1076003)(82740400003)(26005)(7696005)(336012)(81166007)(426003)(356005)(36860700001)(2616005)(5660300002)(40480700001)(6666004)(478600001)(8936002)(70586007)(70206006)(54906003)(316002)(6916009)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 21:22:40.5238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 645f2902-a52d-480c-038a-08dbd0e98680 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB72.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5037 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha McIntosh , Liviu Dudau , Victoria Brekenfeld , =?utf-8?q?Michel_D=C3=A4nzer?= , Arthur Grillo , Sebastian Wick , Shashank Sharma , wayland-devel@lists.freedesktop.org, =?utf-8?q?Jonas_=C3=85dahl?= , Uma Shankar , Abhinav Kumar , Naseer Ahmed , Melissa Wen , Aleix Pol , Christopher Braga , Pekka Paalanen , Hector Martin , Xaver Hugl , Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We'll construct color pipelines out of drm_colorop by chaining them via the NEXT pointer. NEXT will point to the next drm_colorop in the pipeline, or by 0 if we're at the end of the pipeline. Signed-off-by: Harry Wentland Cc: Ville Syrjala Cc: Pekka Paalanen Cc: Simon Ser Cc: Harry Wentland Cc: Melissa Wen Cc: Jonas Ådahl Cc: Sebastian Wick Cc: Shashank Sharma Cc: Alexander Goins Cc: Joshua Ashton Cc: Michel Dänzer Cc: Aleix Pol Cc: Xaver Hugl Cc: Victoria Brekenfeld Cc: Sima Cc: Uma Shankar Cc: Naseer Ahmed Cc: Christopher Braga Cc: Abhinav Kumar Cc: Arthur Grillo Cc: Hector Martin Cc: Liviu Dudau Cc: Sasha McIntosh --- drivers/gpu/drm/drm_colorop.c | 27 +++++++++++++++++++++++++++ include/drm/drm_colorop.h | 12 ++++++++++++ 2 files changed, 39 insertions(+) diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c index ff6331fe5d5e..bc1250718baf 100644 --- a/drivers/gpu/drm/drm_colorop.c +++ b/drivers/gpu/drm/drm_colorop.c @@ -104,6 +104,15 @@ int drm_colorop_init(struct drm_device *dev, struct drm_colorop *colorop, colorop->curve_1d_type_property, 0); + prop = drm_property_create_object(dev, DRM_MODE_PROP_IMMUTABLE | DRM_MODE_PROP_ATOMIC, + "NEXT", DRM_MODE_OBJECT_COLOROP); + if (!prop) + return -ENOMEM; + colorop->next_property = prop; + drm_object_attach_property(&colorop->base, + colorop->next_property, + 0); + return ret; } EXPORT_SYMBOL(drm_colorop_init); @@ -262,3 +271,21 @@ const char *drm_get_colorop_curve_1d_type_name(enum drm_colorop_curve_1d_type ty return colorop_curve_1d_type_name[type]; } + +/** + * drm_colorop_set_next_property - sets the next pointer + * @colorop: drm colorop + * @next: next colorop + * + * Should be used when constructing the color pipeline + */ +void drm_colorop_set_next_property(struct drm_colorop *colorop, struct drm_colorop *next) +{ + if (!colorop->next_property) + return; + + drm_object_property_set_value(&colorop->base, + colorop->next_property, + next->base.id); +} +EXPORT_SYMBOL(drm_colorop_set_next_property); diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h index 69636f6752a0..1ddd0e65fe36 100644 --- a/include/drm/drm_colorop.h +++ b/include/drm/drm_colorop.h @@ -162,10 +162,20 @@ struct drm_colorop { */ struct drm_property *curve_1d_type_property; + /** + * @next_property + * + * Read-only property to next colorop in the pipeline + */ + struct drm_property *next_property; + }; #define obj_to_colorop(x) container_of(x, struct drm_colorop, base) + + + /** * drm_crtc_find - look up a Colorop object from its ID * @dev: DRM device @@ -212,5 +222,7 @@ static inline unsigned int drm_colorop_index(const struct drm_colorop *colorop) #define drm_for_each_colorop(colorop, dev) \ list_for_each_entry(colorop, &(dev)->mode_config.colorop_list, head) +void drm_colorop_set_next_property(struct drm_colorop *colorop, struct drm_colorop *next); + #endif /* __DRM_COLOROP_H__ */