From patchwork Tue Sep 11 16:13: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: 10595857 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 682C414BD for ; Tue, 11 Sep 2018 16:16:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56A47299B9 for ; Tue, 11 Sep 2018 16:16:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A869299DA; Tue, 11 Sep 2018 16:16: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 BC294299B9 for ; Tue, 11 Sep 2018 16:16:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6C126E3B7; Tue, 11 Sep 2018 16:16:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0070.outbound.protection.outlook.com [104.47.42.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F89A6E3B7; Tue, 11 Sep 2018 16:16:03 +0000 (UTC) Received: from SN1PR12CA0108.namprd12.prod.outlook.com (2603:10b6:802:21::43) by DM3PR12MB0746.namprd12.prod.outlook.com (2a01:111:e400:5984::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Tue, 11 Sep 2018 16:16:00 +0000 Received: from CO1NAM03FT047.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by SN1PR12CA0108.outlook.office365.com (2603:10b6:802:21::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1101.18 via Frontend Transport; Tue, 11 Sep 2018 16:16:00 +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 CO1NAM03FT047.mail.protection.outlook.com (10.152.81.48) 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:15:59 +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:15:58 -0500 From: Nicholas Kazlauskas To: , Subject: [PATCH 7/9] drm/amd/display: Replace FreeSync props with DRM VRR props Date: Tue, 11 Sep 2018 12:13:31 -0400 Message-ID: <20180911161333.5334-8-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)(979002)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(428003)(199004)(189003)(50226002)(106466001)(36756003)(336012)(478600001)(77096007)(26005)(186003)(486006)(426003)(126002)(446003)(11346002)(2616005)(104016004)(97736004)(476003)(50466002)(48376002)(51416003)(76176011)(8676002)(7696005)(44832011)(81166006)(81156014)(54906003)(356003)(4326008)(316002)(305945005)(47776003)(53936002)(217873002)(14444005)(5024004)(1076002)(110136005)(16586007)(2906002)(72206003)(53416004)(105586002)(8936002)(5660300001)(6666003)(68736007)(575784001)(86362001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0746; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT047; 1:xX+PUc2JPiNPQbs0J9VvEUAHE8V6ufZTUXJLILUj2vm2IoMXlkR3Mm7b88B2FGUA262vZfK7Vkqm7SE43Jd1gg76piEJods8UMyz5Civ7UfaXVh1j040Zy4veZyLRhby X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f16ea237-08db-48cc-53b8-08d61801dcaf X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:DM3PR12MB0746; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 3:5extwtadlFuguZnVBie87M+ep8VdqosUnktwvpsPx9uf82J1Lmz32bOpA9e1I6vZ0DOihygIftQUNXE/R8RzNmsOQwMDOu4hUgVxvugO3R8mnSqqy91tFb9sadrS3ujk33vnJU0Lt0DiJnoPQZPcq2J3I+guaERwjV4Qsse2ZvyDKMl61Bq20YHCAmuWYr0aNuJn/RVABACrgeCSLdxUEv2aqMEkNU712G7X872PwokVAr7Twsif2/i4+aMf8XEJr/QZtLmkXUlZXVTlI4u00OaFDQGosrvLaMBtTHhdGht3OpZmXQOkWnhleiZfkfmRYIrTQ65qEWHhtda+wSOF8AhaqWhX74dkXmwpj4fz2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c49uvmF4SRMw456dtevtp2W4QC4RmQLxh2Gts7eJF8D5Wc5NaLxVzNdczzwLUDZKvK3fNnJHwTgJzKrh592ipkF7wsFJmm3doAQdG6y X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(944501410)(52105095)(93006095)(93003095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699050); SRVR:DM3PR12MB0746; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0746; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 4:MB5Q9TNTVkwpFLFlc95DXthRCPHO4B3+mPPQdD9T3U3RsKtrRu8AA9GpZW67gPiQdyGxJvdHLd+IaMcj9CRNtKvutFXHD4NiARz5BEsSinrCygMQmRIiNkyqPtR73TGPKd0wAxlSKV4eYAnWDkCa1sQF2aUF/zBqCDFHVRoz/XXYWIw3DxSyK02HU1IP5cibX1hia3MLPHrEc/tzQ056hUCDcCUNQI64KggoJNbxqsfYNDRte58Te2YSe9fESr0+muokxm+vcuSYikVFAU4LBlKnRLghpx17cHOWjrPI8w3yUBAmTiO1YOO0ehnmeKnmNPC/2miYruNJ60vDi/hC+w== X-Forefront-PRVS: 0792DBEAD0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0746; 23:47njjTe3Dbmm/YUpfSW3huIZZJMkWjSNYcdJbC/EA?= bO+wcdcWJHEetdd//IFgvsopQAjJmRC4amUa3ITtYhVC68n0zhHwP1LtuHu+4Zcw7j8Yz1v91tdVi0M+gd5LsrXofPxHkNCKhDQncSllI9CeAXmavZzkk3nozeJuOIvY40ckiL1anGruZd1xBZrCjrIQRs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o/GoKmccuO4l3PgZsry4vIoVwcYG48XmJ/AWXJHK53AvCEpiXhdeGg4AsP31YiQaLzIrLf3qNivlgf8MVqdjBXBh/ijhjkq3VZw0QY=; 7:kKp7LmWbwR7h48xddxPudd6dUd4u9yxT+FMDlw5Y1yiatbOsAhMBsOMn3gp5wgwVeQc6NDvkNiF9lWePFZKEeKTDXfuY9y3iO2Kw4J4lw8+OK+y3Qx7O1xAZkmBZVlInxm4Ehp/I75gnCb50l5xq/fptR5ZmhpJhuw8bttdYWRaYctdEpnnitRLYE4sNXn7/YPhkxC65PbXnFMkiGlLM99Kqkh0O+eBhACyUHz5ksCdPC1h++ZCIVcmCgIr13z/1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 20:EqClSEambJh1XtWOl2Uh2uL1iYSMvD2I1r7lQTgQGIBX/tIpPwAl4KJj6P0yAkjjsigICHzxYWyWC1xLvZSYODd0Wb63QKIYBfKQOoh58aKsWaDv29ecmruBCouDU+lHLR3GZaX5Hv9A8V/Eg5DbI5J7gJzX1u34YvUG4zPdPnvZiPDQQSCEBhAMpRi5dasjgy4b89ZHTzIlFN2CNw6nsrRsZjdVQkltAp8PazLWJSv9J0qSueAUo2rsV1eh18Fs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 16:15:59.2577 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f16ea237-08db-48cc-53b8-08d61801dcaf 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: DM3PR12MB0746 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 DRM has built-in support for variable refresh properties on the connector and CRTC. Make use of these instead of the amdpgu specific freesync properties. The connector properties freesync and freesync_capable are replaced with variable_refresh_enabled and variable_refresh_capable. The CRTC property freesync_enable is replaced with the variable_refresh property. The old FreeSync properties are no longer accessible from userspace and the DRM properties should be instead for enabling/disabling variable refresh support. Change-Id: I7c8117c09282a938c87292402af39d22e4eb823b Signed-off-by: Nicholas Kazlauskas --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 50 +++++++------------ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 -- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 56598ed53123..d28bab0f4657 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1632,7 +1632,7 @@ static int amdgpu_notify_freesync(struct drm_device *dev, void *data, new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base); dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); - dm_new_crtc_state->freesync_enabled = enable; + dm_new_crtc_state->base.variable_refresh = enable; } ret = drm_atomic_commit(state); @@ -2541,7 +2541,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, update_stream_signal(stream); - if (dm_state && dm_state->freesync_capable) + if (dm_state && dm_state->base.variable_refresh_capable) stream->ignore_msa_timing_param = true; finish: if (sink && sink->sink_signal == SIGNAL_TYPE_VIRTUAL) @@ -2611,7 +2611,6 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc) state->adjust = cur->adjust; state->vrr_infopacket = cur->vrr_infopacket; - state->freesync_enabled = cur->freesync_enabled; /* TODO Duplicate dc_stream after objects are stream object is flattened */ @@ -2722,12 +2721,6 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, } else if (property == adev->mode_info.underscan_property) { dm_new_state->underscan_enable = val; ret = 0; - } else if (property == adev->mode_info.freesync_property) { - dm_new_state->freesync_enable = val; - ret = 0; - } else if (property == adev->mode_info.freesync_capable_property) { - dm_new_state->freesync_capable = val; - ret = 0; } return ret; @@ -2770,12 +2763,6 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, } else if (property == adev->mode_info.underscan_property) { *val = dm_state->underscan_enable; ret = 0; - } else if (property == adev->mode_info.freesync_property) { - *val = dm_state->freesync_enable; - ret = 0; - } else if (property == adev->mode_info.freesync_capable_property) { - *val = dm_state->freesync_capable; - ret = 0; } return ret; } @@ -2839,9 +2826,6 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector) __drm_atomic_helper_connector_duplicate_state(connector, &new_state->base); - new_state->freesync_capable = state->freesync_capable; - new_state->freesync_enable = state->freesync_enable; - return &new_state->base; } @@ -3602,10 +3586,8 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, if (connector_type == DRM_MODE_CONNECTOR_HDMIA || connector_type == DRM_MODE_CONNECTOR_DisplayPort) { - drm_object_attach_property(&aconnector->base.base, - adev->mode_info.freesync_property, 0); - drm_object_attach_property(&aconnector->base.base, - adev->mode_info.freesync_capable_property, 0); + drm_connector_attach_variable_refresh_properties( + &aconnector->base); } } @@ -4123,7 +4105,8 @@ static bool commit_planes_to_stream( stream_update->dst = dc_stream->dst; stream_update->out_transfer_func = dc_stream->out_transfer_func; - if (dm_new_crtc_state->freesync_enabled != dm_old_crtc_state->freesync_enabled) { + if (dm_new_crtc_state->base.variable_refresh != + dm_old_crtc_state->base.variable_refresh) { stream_update->vrr_infopacket = &dc_stream->vrr_infopacket; stream_update->adjust = &dc_stream->adjust; } @@ -4695,9 +4678,9 @@ void set_freesync_on_stream(struct amdgpu_display_manager *dm, struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(new_con_state->base.connector); - if (new_con_state->freesync_capable && - new_con_state->freesync_enable) { - config.state = new_crtc_state->freesync_enabled ? + if (new_con_state->base.variable_refresh_capable && + new_con_state->base.variable_refresh_enabled) { + config.state = new_crtc_state->base.variable_refresh ? VRR_STATE_ACTIVE_VARIABLE : VRR_STATE_INACTIVE; config.min_refresh_in_uhz = @@ -4800,7 +4783,8 @@ static int dm_update_crtcs_state(struct amdgpu_display_manager *dm, } } - if (dm_old_crtc_state->freesync_enabled != dm_new_crtc_state->freesync_enabled) + if (dm_old_crtc_state->base.variable_refresh != + dm_new_crtc_state->base.variable_refresh) new_crtc_state->mode_changed = true; if (!drm_atomic_crtc_needs_modeset(new_crtc_state)) @@ -5089,7 +5073,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, if (!drm_atomic_crtc_needs_modeset(new_crtc_state) && !new_crtc_state->color_mgmt_changed && - (dm_old_crtc_state->freesync_enabled == dm_new_crtc_state->freesync_enabled)) + (dm_old_crtc_state->base.variable_refresh == + dm_new_crtc_state->base.variable_refresh)) continue; if (!new_crtc_state->enable) @@ -5241,8 +5226,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, amdgpu_dm_connector->max_vfreq = 0; amdgpu_dm_connector->pixel_clock_mhz = 0; - dm_con_state->freesync_capable = false; - dm_con_state->freesync_enable = false; + dm_con_state->base.variable_refresh_capable = false; + return; } @@ -5266,7 +5251,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, amdgpu_dm_connector); } } - dm_con_state->freesync_capable = false; + dm_con_state->base.variable_refresh_capable = false; + if (edid_check_required == true && (edid->version > 1 || (edid->version == 1 && edid->revision > 1))) { for (i = 0; i < 4; i++) { @@ -5298,7 +5284,7 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq > 10) { - dm_con_state->freesync_capable = true; + dm_con_state->base.variable_refresh_capable = true; } } } diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index 85cfa2cbd8ec..451b06859379 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -195,7 +195,6 @@ struct dm_crtc_state { int crc_skip_count; bool crc_enabled; - bool freesync_enabled; struct dc_crtc_timing_adjust adjust; struct dc_info_packet vrr_infopacket; }; @@ -217,8 +216,6 @@ struct dm_connector_state { uint8_t underscan_vborder; uint8_t underscan_hborder; bool underscan_enable; - bool freesync_enable; - bool freesync_capable; }; #define to_dm_connector_state(x)\