From patchwork Tue Sep 11 16:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kazlauskas, Nicholas" X-Patchwork-Id: 10595847 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 ABE2014BD for ; Tue, 11 Sep 2018 16:14:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A0EF28EF9 for ; Tue, 11 Sep 2018 16:14:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E29B28F5A; Tue, 11 Sep 2018 16:14:26 +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 8403C28F2A for ; Tue, 11 Sep 2018 16:14:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E0986E3BF; Tue, 11 Sep 2018 16:14:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690070.outbound.protection.outlook.com [40.107.69.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED3336E3BE; Tue, 11 Sep 2018 16:14:22 +0000 (UTC) Received: from DM3PR12CA0086.namprd12.prod.outlook.com (2603:10b6:0:57::30) by BN4PR12MB0738.namprd12.prod.outlook.com (2a01:111:e400:59bc::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Tue, 11 Sep 2018 16:14:20 +0000 Received: from CO1NAM03FT036.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by DM3PR12CA0086.outlook.office365.com (2603:10b6:0:57::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.15 via Frontend Transport; Tue, 11 Sep 2018 16:14:20 +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 CO1NAM03FT036.mail.protection.outlook.com (10.152.80.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1143.11 via Frontend Transport; Tue, 11 Sep 2018 16:14:19 +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, 11 Sep 2018 11:14:18 -0500 From: Nicholas Kazlauskas To: , Subject: [PATCH 2/9] drm: Add variable refresh property to DRM CRTC Date: Tue, 11 Sep 2018 12:13:26 -0400 Message-ID: <20180911161333.5334-3-nicholas.kazlauskas@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180911161333.5334-1-nicholas.kazlauskas@amd.com> References: <20180911161333.5334-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)(136003)(396003)(376002)(2970300002)(428003)(199004)(189003)(11346002)(126002)(2906002)(305945005)(16586007)(104016004)(336012)(426003)(5660300001)(47776003)(50226002)(316002)(5024004)(110136005)(36756003)(6666003)(14444005)(54906003)(356003)(4326008)(105586002)(81166006)(68736007)(81156014)(76176011)(86362001)(575784001)(44832011)(8936002)(7696005)(1076002)(51416003)(8676002)(2616005)(476003)(446003)(48376002)(97736004)(106466001)(486006)(72206003)(77096007)(478600001)(53936002)(53416004)(26005)(186003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0738; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:3; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT036; 1:PXAP7vDMRfUsMU5rQXJBvPGv1uJP6yOHQJRdhsnn06Fl90S7fMFVQKIQUM0x0ITNuv4KMq1l1KXUVXZCWwKQ2RoWjkV92ItLNYviTVao7c6EEa33qrfRGMjZ9PJ4KvUo X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36f5ed60-8d91-44b2-89ad-08d61801a0f5 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BN4PR12MB0738; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0738; 3:3V8yQa37CVwakYKMDJWhIdsMDp+n8d851d8Qv4HIDJ8zTFe30Rm9apHsATSvbWIS1m1e2ZvwEcibxEx8coU5xIriCRFfzfZ1hld/kP0XVtcMwx7seqpTAgoiCBYB4SWkr5/vBOzaixzrHbzIl4Vr3ts4ccZ5jCh7fn6cjTnf8yF6r/6wGOiX/B8dWTJ1IEkYxKZvNSfJPxY5//aoVCYiK+P05ZBmHKvfi8MSfriwNGWFMaQUGfGxp476jw+143eHCfyJa1vHb11huCsgbOSxi147t8q8uXAHJHaYvHeq+uO745eG9mAkXN8WVi3yu1zMAfQblh0bMEyC8PavBwC64yk8FQimKXkjOE1yFYAE/dk=; 25:iy8wD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UI6sH+a6V/aEvd0vhFI3Ra9GBP3+ZrTGZIWcyjBps/4zY4bbAHKxF89mspkwRgUb61gIYnpWmGVZPpqj5DdbsifVvEsR 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)(3231311)(944501410)(52105095)(93006095)(93003095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:BN4PR12MB0738; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0738; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0738; 4:rX8j38BguaUTNfMaCN3IMafu1CqnCHLRrfNXBmAKIuZWismb1yfe2guxoiSIBFGpn+Hn4k+5ikxIA5UBs49PS5ao11Ee8iJpNljMicuoXiEn1zpn6HxiLLLEPTnlaKAMgF/BwhMuZwOOD2RCNhRKzDUJD/NHBezv7Cvr758NOrH68fGq6D5SJjsYT4m/UBRx5T3H+98Tfuj6AhDmBNdTN1e3rl5YXpSAOcTKGPlbDs3kVJmX0b8Ztep+4orOOQbQvvjr+bxxJ2QKEEkwFwwsRhQBAAQHXVmEwmmDo3SHyjfEeAymUhUaRTS7eodBu/wf X-Forefront-PRVS: 0792DBEAD0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR12MB0738; 23:j4rbOVwGH8O0rWn0pjrqC+3jg56KRcnklaZNkQqtN?= s4fVbCA55URiKdU/h/OKub/35hCQEQrVFs3Zh7h3VmsQkaoOngc1BQd3WMTnnUeVTvKxJZ07UM1FK5atJ4yViIq3Lp9MbQ0qSj2mCk1xW3a2J2kA5+PYziCJZpDpn5pU6hIQw9BGVFQtg/d7ATdN9K8OieNd8bl6EXPYSheNTEeTFc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6BVdiJNf5vEq3bJHEZk2pj/4CFpwxam0WZss1D2/DV4YLZL8+0IqQvztO1n0GfbQn67Y5uXKl63xJpuBOXY1danQ6OUDfD8uU4t57M9/qkplDjTrgGwZ6/H1wxGy/ur9vC3ahjw6D+V5HnPatkWbacQtD4t2rfObRS/WlCWnKnyvzXBRyX8ubkqdmSgjakZAGtmD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0738; 20:NLPbwNXnUE+GH0zktK45J0cjdtkVGa8HtXI2FXv9lAHFstXsarjn8+MtbipIKMSbIfE7SRwMhM46E258fXtXfkQgOHCx2UE+jUenEKa+5oeaIYdcLYdPBuIMSRpAtDRjRJvNKq7N/qzBBT8/84PWI7Ya97kihbVMo6SpRTVjyjN34H+jtaGcqIwEQkIayB4O8LFtz9jomYRFaA+dnFNbeveYTsoRfaUwrG61x4AoavWgSIoCSciWRzXQQzLGkPDO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 16:14:19.0546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36f5ed60-8d91-44b2-89ad-08d61801a0f5 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: BN4PR12MB0738 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 Variable refresh rate algorithms have typically been enabled only when the display is covered by a single source of content. This patch introduces a new default CRTC property that helps hint to the driver when the CRTC composition is suitable for variable refresh rate algorithms. Userspace can set this property dynamically as the composition changes. Whether the variable refresh rate algorithms are active will still depend on the CRTC being suitable and the connector being capable and enabled by the user for variable refresh rate support. It is worth noting that while the property is atomic it isn't filtered from legacy userspace queries. This allows for Xorg userspace drivers to implement support in non-atomic setups. Change-Id: I5a5044f48fc68fcdbcfaa5141e83b44747d7116b Signed-off-by: Nicholas Kazlauskas --- drivers/gpu/drm/drm_atomic.c | 6 ++++++ drivers/gpu/drm/drm_atomic_helper.c | 1 + drivers/gpu/drm/drm_crtc.c | 2 ++ drivers/gpu/drm/drm_mode_config.c | 6 ++++++ include/drm/drm_crtc.h | 13 +++++++++++++ include/drm/drm_mode_config.h | 8 ++++++++ 6 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 2f89ab0fac87..46c50c1f267b 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -553,6 +553,10 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, ret = drm_atomic_set_mode_prop_for_crtc(state, mode); drm_property_blob_put(mode); return ret; + } else if (property == config->prop_variable_refresh) { + if (state->variable_refresh != val) + state->variable_refresh_changed = true; + state->variable_refresh = val; } else if (property == config->degamma_lut_property) { ret = drm_atomic_replace_property_blob_from_id(dev, &state->degamma_lut, @@ -627,6 +631,8 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc, *val = state->active; else if (property == config->prop_mode_id) *val = (state->mode_blob) ? state->mode_blob->base.id : 0; + else if (property == config->prop_variable_refresh) + *val = state->variable_refresh; else if (property == config->degamma_lut_property) *val = (state->degamma_lut) ? state->degamma_lut->base.id : 0; else if (property == config->ctm_property) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 2c23a48482da..dd01ab041eff 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -3472,6 +3472,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc, state->planes_changed = false; state->connectors_changed = false; state->color_mgmt_changed = false; + state->variable_refresh_changed = false; state->zpos_changed = false; state->commit = NULL; state->event = NULL; diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index bae43938c8f6..f18b60ce7599 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -337,6 +337,8 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, drm_object_attach_property(&crtc->base, config->prop_mode_id, 0); drm_object_attach_property(&crtc->base, config->prop_out_fence_ptr, 0); + drm_object_attach_property(&crtc->base, + config->prop_variable_refresh, 0); } return 0; diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 21e353bd3948..5847ac1e88c1 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -311,6 +311,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev) return -ENOMEM; dev->mode_config.prop_mode_id = prop; + prop = drm_property_create_bool(dev, 0, + "VARIABLE_REFRESH"); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_variable_refresh = prop; + prop = drm_property_create(dev, DRM_MODE_PROP_BLOB, "DEGAMMA_LUT", 0); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index b21437bc95bf..32b77f18ce6d 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -168,6 +168,12 @@ struct drm_crtc_state { * drivers to steer the atomic commit control flow. */ bool color_mgmt_changed : 1; + /** + * @variable_refresh_changed: Variable refresh support has changed + * on the CRTC. Used by the atomic helpers and drivers to steer the + * atomic commit control flow. + */ + bool variable_refresh_changed : 1; /** * @no_vblank: @@ -290,6 +296,13 @@ struct drm_crtc_state { */ u32 pageflip_flags; + /** + * @variable_refresh: + * + * Indicates whether the CRTC is suitable for variable refresh rate. + */ + bool variable_refresh; + /** * @event: * diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index a0b202e1d69a..9039dee49c83 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -639,6 +639,14 @@ struct drm_mode_config { * connectors must be of and active must be set to disabled, too. */ struct drm_property *prop_mode_id; + /** + * @prop_variable_refresh: Default atomic CRTC property to indicate + * whether the CRTC is suitable for variable refresh rate support. + * + * This is only an indication of support, not whether variable + * refresh is active on the CRTC. + */ + struct drm_property *prop_variable_refresh; /** * @dvi_i_subconnector_property: Optional DVI-I property to