From patchwork Tue Nov 6 20:24:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kazlauskas, Nicholas" X-Patchwork-Id: 10671361 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 CF89713AD for ; Tue, 6 Nov 2018 20:25:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C00802AA29 for ; Tue, 6 Nov 2018 20:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B396E2AAC1; Tue, 6 Nov 2018 20:25:07 +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 5CC4B2AA29 for ; Tue, 6 Nov 2018 20:24:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7098A6E41E; Tue, 6 Nov 2018 20:24:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-eopbgr810070.outbound.protection.outlook.com [40.107.81.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id E06416E414; Tue, 6 Nov 2018 20:24:42 +0000 (UTC) Received: from CY4PR1201CA0007.namprd12.prod.outlook.com (2603:10b6:910:16::17) 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.1294.25; Tue, 6 Nov 2018 20:24:41 +0000 Received: from DM3NAM03FT037.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::208) by CY4PR1201CA0007.outlook.office365.com (2603:10b6:910:16::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Tue, 6 Nov 2018 20:24:41 +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 DM3NAM03FT037.mail.protection.outlook.com (10.152.83.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.14 via Frontend Transport; Tue, 6 Nov 2018 20:24:40 +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; Tue, 6 Nov 2018 14:24:39 -0600 From: Nicholas Kazlauskas To: , Subject: [PATCH v6 1/5] drm: Add vrr_capable property to the drm connector Date: Tue, 6 Nov 2018 15:24:31 -0500 Message-ID: <20181106202435.23556-2-nicholas.kazlauskas@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106202435.23556-1-nicholas.kazlauskas@amd.com> References: <20181106202435.23556-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)(979002)(136003)(346002)(39860400002)(376002)(396003)(2980300002)(428003)(199004)(189003)(356004)(6666004)(8936002)(81166006)(8676002)(81156014)(186003)(77096007)(5024004)(14444005)(72206003)(50226002)(4326008)(11346002)(316002)(48376002)(50466002)(446003)(68736007)(2616005)(16586007)(26005)(7696005)(51416003)(478600001)(305945005)(476003)(47776003)(104016004)(2906002)(54906003)(110136005)(126002)(486006)(97736004)(44832011)(53936002)(76176011)(1076002)(53416004)(36756003)(336012)(5660300001)(105586002)(426003)(86362001)(106466001)(969003)(989001)(999001)(1009001)(1019001); 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; DM3NAM03FT037; 1:HbGAiwjMDAIec1/Z6eU22563qrLgCOT9KSy+XZtS4S0ibFlj4Gf8mmCdav6WSKm8kqwbmn2WXyblTmc3GdlmvPATwquw0dfwNdM/hjWb5gWJilTrAoh71mVCy/62ikKY X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35929ca6-b4dd-4e44-4946-08d64425e1b5 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 3:r7G5ee1Ij+cTLdEZ+Ffa9SES+ax6vz6zxKsTKrjgkvwqDTdUeBHKhAnahrgEZCXoWv6XnXG66aZfUDUfgm8yuEBqvR3yvODnWTd1AlsscI3k9FwzQJoLERidJm7QC200o0ow7a+wSDInvX4jPO0IiGkpAjTMeoPyQ/JT6uNVfd2JdZekhbfZFy3sRVBzMAFWKSq/qfx9n36Qa88qLGRP/P/xeotp1ciUAJ97O/RxiQzGy7w5uucKNo8LE+fheBNuCK0n32xFifZMbiTiEOapmifytmDaxqvbg5aJ0bn9Xj+0DK4B9uvscu8sUDM0PkS5N1brp3wSdP/ABWeg3vv5FOq/lC802uk/QUpDTdwKkXk=; 25:P7+QjeCzV73GGFvI8BRzwPqHInOWlWjEtC2gv5Pjj0lN/hZh4tI4gqE4nrOrVSDviESruvUJHmsql8DbmtCj6cYBinz327p4w/jZaNcQCfHAxfiMheQaqT1moDKCbj4Dyc6eohZ6gC4X2/H9b/A7YrWlgSrEKVWeBe4JUi9KX1weroDTkFLpmmN3Cos8hP0KXkV8jfDJ/rWBMs2rDNcEsBbn6QMp2m5N9PNRVNpXXbEAt8sGbcfPjoxAkNxgpIdwhCueEZGTx/WL1tmo1caAtNEoOa61GfmCZAWDqW9NmOALz0wD25Bn+gww7XcKtFa7FGr20M469TUkce8I0muGAg== X-MS-TrafficTypeDiagnostic: BY1PR12MB0423: X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 31:fdc262GlThk+2CbuXUBudvUgABaAszdAMwilMDXR048xblA+3IRhbRj1AIMdJ1ahByxANOcxE9EH3BfI+0YgVP5h9RE5ZA0HX2IM53hgasS9AuJfmHe15LmI5BsRq2BCHid1Fgg79gE+d664mJZb43ZQ3NgF0lElMT/tda20M4E3bkE5Kf0yIBcrB/vlzu38dNAEzN7iNKBi0VLIe0ez4QP+umCaxfYYgNFDlR5skS4=; 20:vHBdkKhyQXFT1jkMDvAtFaRBx+xcql2SydtjX5lmCrmlyoj04diPRvdhn8f8BeoKj76bNbKCxZ+TWhDekf9E07qEfBklif4y3oEamTUUHUmiVydr3BD9/1nsP7Tq8TcQWAuGRK88XjbiuTrKDBXm4DVlB4bzvJaMfRaA+W8rgpimsuOaLSXxyGh/KqJzicZBOmjNHUsUj/stSJfz8wjY+JMBJZ/pkKYlEqBE8clVopmA7UEvgnExB+bc3hiB31sowgjXgl5qtWl6EeF5l3SwlGVrfWWRfzWhy3INNGNTraToO2WrG+ExIkuAVD6nEUIotlgLSHBg5b895eBEyBsthZmVpJvvr0hU2bg8FDS84NKQAstv0yxvuPqY10f175iOxv8mNVP5ut736S7sXomRHHsPCXSLGcrBl44tRUdDsMLh/rZZ6eTA5JicTBI2/CD59c521PSydj28LH2QFpwy6N/UQ6jceA/Zh0Ao5LmFPWmE3lJuny3mmc/i/bAQqJnQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93003095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:BY1PR12MB0423; BCL:0; PCL:0; RULEID:; SRVR:BY1PR12MB0423; X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 4:gr5dQrOvjpz87lNysXfoIN9mFoocScDreU7F3bvwursCXc79XYBzIBgo7ED9apRkCg6ZnIn3DLNmkInZF3xYpTglo23vM73J6pTbTCInA2msDJWw21LcMgqW/FxTQyfRjz7S42HIcLf96dE4sWM5pUv6yiHyv5AlVRAwagWjz/kzTS+jLZHwA9ssL5zpl0Tf7JpjDiBr60WZOAmZRgd5z8eU9pYwlYuuQV7DuEGAsaxj2NrsMLBGxO91eB3k4Tuq5mMp2CE1UTIyXayINu4Vba293t2AuixOEcib1mSM4Hk9Sh0342X5OoKcmnj9puwT5r5YESFZ/CAGWXnLbMZvJQ== X-Forefront-PRVS: 0848C1A6AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR12MB0423; 23:xhfWty2sGmQ5WF8j00cEcHLZIJTiM27fn1daGBf4l?= ndvrsVh0zm/ganFDNej+neDbUQMSfeCn3BdMkmujV2eKsVYiRAVdr/2VECw8viTnEU+1uyiNgPOMLuEKBGv5djOhrutrAwOhJ3/FPkLblcLLmhtygtLrSo7BFLxF53JUw3ZF04WcKT70jREVxOuWM2UhO3gC+iiYWMvyz545DWVx64wuaynVJ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DWDb3kXKu+XKrM6lIqCTLXjQpjjREiVAz0A=; 7:T2qEDCdlaETbOkOBF5FVy8pVDnGANna4gmy5v4arXxEGAYQCZcovlVx1D4zEeT67SuLqyfjV7l9iSzR0WfsOX7t2YrhYimKy6/AtStJKnae+g+hH66ygcBuqPmG7H3k4lMRHmoHXRt9sXrgPwm6mgA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR12MB0423; 20:GfWZsLdahiwFij5UKy0xSpl7Qr3Pxdw26h3z118pCvTdmYJWH4n3+Zi2iC9eOpIDuqtOX6Jjlh1bGPKOAWNEEwxil1jRPTHIr9/TSG8L+1baY1Iby5aAP6+Yoc0HlOwq5eK5S82qL85NRe1qJSgEnKiBeIZ8O3M14k/elGV3LvTLQQr258vR5VllX775+VINhzK2t4ORB30HYWuNkWBec1XXfNfmT6vusO3cbrJMgfsSTB5VPoOmCpeKTccjnpl/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2018 20:24:40.8237 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35929ca6-b4dd-4e44-4946-08d64425e1b5 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: michel@daenzer.net, Nicholas Kazlauskas 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 Reviewed-by: Harry Wentland --- 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 4943cef178be..49290060ab7b 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1255,6 +1255,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. @@ -1583,6 +1614,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 9ccad6b062f2..4e6befff153b 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -959,6 +959,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(). @@ -1250,6 +1261,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); @@ -1266,6 +1279,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);