From patchwork Fri Oct 5 20:39:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kazlauskas, Nicholas" X-Patchwork-Id: 10628711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3623616B1 for ; Fri, 5 Oct 2018 20:40:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 249962993F for ; Fri, 5 Oct 2018 20:40:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1711D29941; Fri, 5 Oct 2018 20:40:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A124A2993F for ; Fri, 5 Oct 2018 20:40:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC2AE6E8D3; Fri, 5 Oct 2018 20:40:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0073.outbound.protection.outlook.com [104.47.41.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0A286E8D3; Fri, 5 Oct 2018 20:39:59 +0000 (UTC) Received: from DM3PR12CA0065.namprd12.prod.outlook.com (2603:10b6:0:56::33) by BY1PR12MB0423.namprd12.prod.outlook.com (2a01:111:e400:51b2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.25; Fri, 5 Oct 2018 20:39:57 +0000 Received: from DM3NAM03FT047.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::206) by DM3PR12CA0065.outlook.office365.com (2603:10b6:0:56::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1207.18 via Frontend Transport; Fri, 5 Oct 2018 20:39:57 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by DM3NAM03FT047.mail.protection.outlook.com (10.152.83.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1207.19 via Frontend Transport; Fri, 5 Oct 2018 20:39:57 +0000 Received: from kazbox.amd.com (10.180.168.240) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Fri, 5 Oct 2018 15:39:56 -0500 From: Nicholas Kazlauskas To: , Subject: [PATCH v3 1/4] drm: Add vrr_capable property to the drm connector Date: Fri, 5 Oct 2018 16:39:46 -0400 Message-ID: <20181005203949.6289-2-nicholas.kazlauskas@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005203949.6289-1-nicholas.kazlauskas@amd.com> References: <20181005203949.6289-1-nicholas.kazlauskas@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(136003)(396003)(2980300002)(428003)(199004)(189003)(105586002)(54906003)(446003)(186003)(5024004)(356003)(476003)(11346002)(6666003)(104016004)(68736007)(126002)(2616005)(305945005)(1076002)(36756003)(81156014)(5660300001)(50226002)(77096007)(8936002)(106466001)(14444005)(81166006)(47776003)(26005)(44832011)(2906002)(97736004)(336012)(76176011)(51416003)(4326008)(86362001)(426003)(53936002)(478600001)(53416004)(110136005)(16586007)(48376002)(72206003)(316002)(50466002)(486006)(7696005)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR12MB0423; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT047; 1:RdfCOGF5pEggkLBnECk903thXTVfWxyKpTtt7OsPt2q+wa/1Vb/wp8h9bRekpB9sGsxB1gRMNqe4iOyzNgRCv7roX4trI6K9OzP+WF05z2MMp25Sd4MsJz+ADPjmy+1o X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4716cdb-8670-49ea-51ae-08d62b02b6d0 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 3:a/vPXFtW/siUZuo0wsnQF+/X6nITsPHLPaRMcBvgi0jKTpbMZc1fjZYKtqGCjGolMArwz4aSTAGzM7BWZhbJdnN1Hc0UUCbqCPEqoKhEO7mQWWHhtZnhcuQ6wMJKkhxMg8gzgUFIhYX0LISoCfREL8S8zXEQtl1WIMAKDR0wtes8ZsoELYc1vEQCX1CDh87LEJeYppzbHdrh7Zw8Yik0IE9d6QBc75sDqhV1Z6roNlK0+EWmjglvivwZOyX5e85djnBgD1Ygc2YwRVpX3Pbb1QXfxu989A4vWzAxbj+GZIO71YdH3lQLUmEGdTSNyokMzd0Ok0g0npytqPMK9B7iByehMljtPBHGdJnN+rv7vzM=; 25:Ez721Scvr4RZ3yT57nU1x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0UByw37r1g9wJ5EXWqGu0Km9Ex8iqiHsTEZ6zl4Ia/mwuywFG1snlnQSrfT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231355)(944501410)(52105095)(93006095)(93003095)(10201501046)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:BY1PR12MB0423; BCL:0; PCL:0; RULEID:; SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 4:JIgHHjq/k6YNt4yJnv07+OvZGmXbqoI7a1mYohrMVFDcD+ntUjUQBVSAXtPOEMff6ipSRd8jI+iWqXkWUKT3h6+U9GXYjrAEKsl1NEmjBn9yRR1shlqDXjcKW1+FLAtmgliiLPekoZgwq31O2NHnlxZcGB3eEunFklt9iR4uxVhmI5dEXWVZzp8RLFEYAtjZeGUBDuVhWyNT9qsHZ5U+leJUpgHnNmJnEk1AHvMcvUSVFUV+wiDGFswFpuHiCT9SVu7LavtTbT2JCeHcv/lcPYdab8KnD6Nn/75TSq3TZfWsaKngje7fuS7Nc4XFfFZQ X-Forefront-PRVS: 0816F1D86E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR12MB0423; 23:ugcKamMBKtsNJ4NCgaeX2W7OIsD1eB9cy4tXjZjNB?= 1iTkNx7Uir1B3lr8ghIMMw5T1rlxQ+6h3MKj3aOt/6BpLJzwQw6p/mfx/lT7K6u8Y66sNVJGjP5cdP+SvmTDq05Qq7dM+EYCs65ANp5Hh0C2//Yodv6MsNv3FLo4nm1owMxePUHrT+NU9q3Vhfs7KCoMgpkb73tWrFRQbA78oRlW+RulS9zRmZ7R70VN+aoI238WuROoSQI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850aEobFNxDSzNqW4yVvLHnp/IkBIwgr+uxHXMbS9baHWBabiYNdIwp7Pa2OzX0tc/P/cLRDYnDGvIhn3t8po4sLrB2retAYeid7Oi8zUR84fpik3B+6yJahfOxoqtYcCCFxBB9bZQ6ba2D7eDnkRanhwRAdvdxd3UibT11PkJwVMku5981G12MnOS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 20:7TPzNgzzLaXa14T1oI7ve4wpOKI7hgTroTBoOGHEh0ToXIhTFXJ8FyJBnhv5/ioQyqXmAutGVEOkyO6Bc2Z/0/2FiYUfvh2KNEpcjltwE6RnGn/hmTqIM+P+oE0rcaRuouvKYkkgjSOHEz23tJ5xGckW+6zyzrh2nMfH22GGJlq1peYwk8F7YkjsdVVuq9QOxq4pizZhchgTUEQGRcH6QcjMyS1/6/d8o5sAw/fwR9yYp2udXRo/xbBznCU3dBT1 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2018 20:39:57.3100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4716cdb-8670-49ea-51ae-08d62b02b6d0 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB0423 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolai.haehnle@amd.com, michel@daenzer.net, Christian.Koenig@amd.com, manasi.d.navare@intel.com, Alexander.Deucher@amd.com, Nicholas Kazlauskas , Marek.Olsak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modern display hardware is capable of supporting variable refresh rates. This patch introduces the "vrr_capable" property on the connector to allow userspace to query support for variable refresh rates. Atomic drivers should attach this property to connectors that are capable of driving variable refresh rates using drm_connector_attach_vrr_capable_property(). The value should be updated based on driver and hardware capabiltiy by using drm_connector_set_vrr_capable_property(). Signed-off-by: Nicholas Kazlauskas Reviewed-by: Manasi Navare --- drivers/gpu/drm/drm_connector.c | 51 +++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 15 ++++++++++ 2 files changed, 66 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 1e40e5decbe9..3283703b9822 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1254,6 +1254,39 @@ int drm_mode_create_scaling_mode_property(struct drm_device *dev) } EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); +/** + * drm_connector_attach_vrr_capable_property - creates the + * vrr_capable property + * @connector: connector to create the vrr_capable property on. + * + * This is used by atomic drivers to add support for querying + * variable refresh rate capability for a connector. + * + * The value from &drm_connector_state.vrr_capable will reads + * + * Returns: + * Zero on success, negative errono on failure. + */ +int drm_connector_attach_vrr_capable_property( + struct drm_connector *connector) +{ + struct drm_device *dev = connector->dev; + struct drm_property *prop; + + if (!connector->vrr_capable_property) { + prop = drm_property_create_bool(dev, DRM_MODE_PROP_IMMUTABLE, + "vrr_capable"); + if (!prop) + return -ENOMEM; + + connector->vrr_capable_property = prop; + drm_object_attach_property(&connector->base, prop, 0); + } + + return 0; +} +EXPORT_SYMBOL(drm_connector_attach_vrr_capable_property); + /** * drm_connector_attach_scaling_mode_property - attach atomic scaling mode property * @connector: connector to attach scaling mode property on. @@ -1582,6 +1615,24 @@ void drm_connector_set_link_status_property(struct drm_connector *connector, } EXPORT_SYMBOL(drm_connector_set_link_status_property); +/** + * drm_connector_set_vrr_capable_property - sets the variable refresh rate + * capable property for a connector + * @connector: drm connector + * @capable: True if the connector is variable refresh rate capable + * + * Should be used by atomic drivers to update the indicated support for + * variable refresh rate over a connector. + */ +void drm_connector_set_vrr_capable_property( + struct drm_connector *connector, bool capable) +{ + return drm_object_property_set_value(&connector->base, + connector->vrr_capable_property, + capable); +} +EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); + /** * drm_connector_init_panel_orientation_property - * initialize the connecters panel_orientation property diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 91a877fa00cb..b2263005234a 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -910,6 +910,17 @@ struct drm_connector { */ struct drm_property *scaling_mode_property; + /** + * @vrr_capable_property: Optional property to help userspace + * query hardware support for variable refresh rate on a connector. + * connector. Drivers can add the property to a connector by + * calling drm_connector_attach_vrr_capable_property(). + * + * This should be updated only by calling + * drm_connector_set_vrr_capable_property(). + */ + struct drm_property *vrr_capable_property; + /** * @content_protection_property: DRM ENUM property for content * protection. See drm_connector_attach_content_protection_property(). @@ -1183,6 +1194,8 @@ int drm_mode_create_scaling_mode_property(struct drm_device *dev); int drm_connector_attach_content_type_property(struct drm_connector *dev); int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, u32 scaling_mode_mask); +int drm_connector_attach_vrr_capable_property( + struct drm_connector *connector); int drm_connector_attach_content_protection_property( struct drm_connector *connector); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); @@ -1199,6 +1212,8 @@ int drm_connector_update_edid_property(struct drm_connector *connector, const struct edid *edid); void drm_connector_set_link_status_property(struct drm_connector *connector, uint64_t link_status); +void drm_connector_set_vrr_capable_property( + struct drm_connector *connector, bool capable); int drm_connector_init_panel_orientation_property( struct drm_connector *connector, int width, int height);