From patchwork Thu Oct 11 16:39:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kazlauskas, Nicholas" X-Patchwork-Id: 10636993 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 58C3269B3 for ; Thu, 11 Oct 2018 16:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B8712BC1A for ; Thu, 11 Oct 2018 16:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2883E2BC25; Thu, 11 Oct 2018 16:40:19 +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 AD6B92BC1A for ; Thu, 11 Oct 2018 16:40:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A17D6E3FD; Thu, 11 Oct 2018 16:40:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0045.outbound.protection.outlook.com [104.47.36.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5047B6E3FC; Thu, 11 Oct 2018 16:40:15 +0000 (UTC) Received: from DM3PR12CA0054.namprd12.prod.outlook.com (2603:10b6:0:56::22) by SN1PR12MB0750.namprd12.prod.outlook.com (2a01:111:e400:c45b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Thu, 11 Oct 2018 16:40:13 +0000 Received: from BY2NAM03FT022.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by DM3PR12CA0054.outlook.office365.com (2603:10b6:0:56::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1228.21 via Frontend Transport; Thu, 11 Oct 2018 16:40:13 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by BY2NAM03FT022.mail.protection.outlook.com (10.152.84.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1228.17 via Frontend Transport; Thu, 11 Oct 2018 16:40:12 +0000 Received: from kazbox.amd.com (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Thu, 11 Oct 2018 11:40:11 -0500 From: Nicholas Kazlauskas To: , Subject: [PATCH v4 1/4] drm: Add vrr_capable property to the drm connector Date: Thu, 11 Oct 2018 12:39:39 -0400 Message-ID: <20181011163942.28267-2-nicholas.kazlauskas@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181011163942.28267-1-nicholas.kazlauskas@amd.com> References: <20181011163942.28267-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)(376002)(346002)(136003)(396003)(2980300002)(428003)(199004)(189003)(51416003)(7696005)(16586007)(14444005)(5024004)(110136005)(316002)(1076002)(54906003)(356004)(26005)(36756003)(186003)(6666004)(76176011)(486006)(126002)(4326008)(426003)(50466002)(336012)(77096007)(446003)(2616005)(476003)(44832011)(50226002)(81156014)(86362001)(575784001)(5660300001)(53936002)(53416004)(478600001)(11346002)(106466001)(8676002)(72206003)(105586002)(48376002)(68736007)(2906002)(81166006)(305945005)(8936002)(104016004)(97736004)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0750; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT022; 1:4tj4tnegevARfR+aspqXBcmSlWkQQY/t3HujIOpiYJVEs6ZWYaWwpi+pAjwH2ZPfsIIWQ4K9geCFf5B7hExAEp+Megqt1waExkqZE0tBLKZoZRaY/dfbZfI1EV38Ds39 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4584d13-1703-46bc-7684-08d62f983749 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:SN1PR12MB0750; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0750; 3:/OaOeuTkwyesrL2+TH43DOHAbODVBvlCrInWoFeXCcuOUk1PHx/0/fPRATEHSxyYLoO+8Z4Cj37Q5qQmI9xXM/yHAiGGDQG3onqsqZTHnovHKwt+E0szf0cCK7PRjFasWj5x2a8nisr4BJACSkEtOtUGx7Bl2r0xgNNjDXJPF9I+qLCbVStZjBDnsi3Q452+aiA46n0TSLywKHM3Yftb9ygh64sv2Gas0TBwj5d5Ld6BbU+QjKEv2/6iDPegl20qh7n5Jr/70DutNg9K8iIOLbNDJstF0q2OVW4o2bnSyWNipI9N1B5pvSAqsu1ZUK7hrwRIPdc/KuKRovu5PSEtvBONCyrnqMKF+2+dGeHzEK8=; 25:RwEV0VhL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2Vbvuz4oAUGBtF2jt8gLirrHxUYqbB4ZE7G0uhLa0x2QfqoRkllM/kToNnN9IWzajHP4rp7NiOjyJlNaJLCGlu/6YxALp/Ia 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)(93006095)(93003095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051); SRVR:SN1PR12MB0750; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0750; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0750; 4:7UD6rx++qcnQn1sRCxUbRYE+NirH3VTwAQKpkQiBFvF14wRLgg92/TArfpdR6hQtE6X2fWSgSrdjFTbYzPQgqbAb3AEetuf+w3S4XGXWIE3LqqwPdFUNwThnGfXZUNHGdSH/7zx6pqPWlvEZPFB5sFYRCxaZN7MmDWQYnyTvVnWvO207YzpjFeNL1AfN8he8ypLnzMpo25L0wn7pQZmptGu8xdlKAxL8KuiBlb9b+PvYAM13AR4WiKv067o98caa4mpk+6z9A4D45o0CtF7oflScgc1+xC0Ye7V2GbYE8Wrb5kPN1+RnXrqv+xpz6IV8 X-Forefront-PRVS: 08220FA8D6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0750; 23:2zx6dgUpIJ8jy2VB41BjWvVZLE8Ifu619CT4D5YTP?= 8pRlS3/ERIw0ktic6FW6ymmxO1Zr8ZmAghWIuEdqmvEvaARJSyliUdz6XTEZKisnTt5PACJPGx5En4xME1zPjwRNWS0h5Iyj5i2XWEivugjNE+vzcr+jbBoUg9kl1BLEq62AfoDjz6E/NlNLN3xCQ3ATL1nekalgGyuRQkz/gECSwTCS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XTv2Ph8QKWOLvmEyQMiZn7Ur4YH12tQASLek7Qu2s7UVlFn3bL+//FzYFmuJYStj5Qg2LJZHaU4wPfJzmRzPVkPqTZzOUgfri+QmAKKad60Hjh5fDb58y/QDAF3iyof1rHmP50svQRaISNn+/FjeNJoaFJF8nnXUPo1NchGoOr8ZtgnqDal5jdgwzh3BphOzMkCcWQQ0V4tlsnmZaTGBhufHMxMC0M SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0750; 20:HSkb6PvrImz/ePGVtB61HqFXdN0BxDciNfnaVytcsdZXjmumGQ8MXIobLFy3xmLbe6yTFw2Pf6/UI85vcHFpz6AzEqjtyyokqjIuIDQotbFCXpuEH0OfYSddq4KFWws8+2hD/I08fohudqx2kLOwLXPdhXvnWnhDNm/71SY2/3Yb3aDuDsQa12CQ8083jXLprMOov89n2ybbcIJGCFl1IaXNJq2Q4/KF5JFdE2f2lPs0HS6AVt7zmTagaVsJRdLI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2018 16:40:12.6568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4584d13-1703-46bc-7684-08d62f983749 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0750 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: daniel.vetter@ffwll.ch, michel@daenzer.net, Nicholas Kazlauskas , manasi.d.navare@intel.com, Alexander.Deucher@amd.com, 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 --- drivers/gpu/drm/drm_connector.c | 49 +++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 15 ++++++++++ 2 files changed, 64 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 1e40e5decbe9..f0deeb7298d0 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1254,6 +1254,37 @@ 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. + * + * 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 +1613,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) +{ + 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);