From patchwork Tue Sep 11 16:13:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kazlauskas, Nicholas" X-Patchwork-Id: 10595849 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 8595B112B for ; Tue, 11 Sep 2018 16:14:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 723B928F2A for ; Tue, 11 Sep 2018 16:14:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 641B729933; Tue, 11 Sep 2018 16:14:48 +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 5EFFD28F2A for ; Tue, 11 Sep 2018 16:14:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9895B6E3C1; Tue, 11 Sep 2018 16:14:45 +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-by2nam03on0044.outbound.protection.outlook.com [104.47.42.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 63A866E3C1; Tue, 11 Sep 2018 16:14:44 +0000 (UTC) Received: from DM5PR12CA0063.namprd12.prod.outlook.com (2603:10b6:3:103::25) by CY1PR12MB0744.namprd12.prod.outlook.com (2a01:111:e400:59d1::26) 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:14:42 +0000 Received: from CO1NAM03FT010.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by DM5PR12CA0063.outlook.office365.com (2603:10b6:3:103::25) 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:42 +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 CO1NAM03FT010.mail.protection.outlook.com (10.152.80.104) 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: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, 11 Sep 2018 11:14:39 -0500 From: Nicholas Kazlauskas To: , Subject: [PATCH 3/9] drm/amdgpu: fill in amdgpu_dm_remove_sink_from_freesync_module Date: Tue, 11 Sep 2018 12:13:27 -0400 Message-ID: <20180911161333.5334-4-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)(346002)(396003)(376002)(39860400002)(136003)(2980300002)(428003)(199004)(189003)(76176011)(6346003)(336012)(26005)(426003)(81156014)(186003)(72206003)(8936002)(81166006)(305945005)(53936002)(50226002)(478600001)(356003)(97736004)(77096007)(14444005)(446003)(11346002)(44832011)(486006)(86362001)(476003)(126002)(8676002)(2616005)(68736007)(36756003)(316002)(53416004)(6666003)(110136005)(2906002)(54906003)(16586007)(7696005)(4326008)(105586002)(51416003)(48376002)(5660300001)(47776003)(50466002)(1076002)(106466001)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0744; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT010; 1:WthFTMW7bBqmQIoyPvKh8Mde72CUi9gmYBQMYkx7eP/1mhtfr7MFUr8ixrACUHiISx0hysg3krEfUpbg/l8SnYGAMhuQejCkycv1oa5KTVVz1ahHZsk6wTAi4xdYugz7 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: deccd004-db41-434d-10c9-08d61801adc5 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0744; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0744; 3:CMGLwZb248V7TQ3aSjH3407s+pFOP0Z0e2+Tn+DGNa9l82HV7rJX9kcg/ukxi+NMFo/ha+pTwWJ+ypPyUCdwD0eYXMP2qprre7Bx0P1H1lq29c1AVhZJR8sD70ZGB6+OXEu8n8XYFyCo7f8Afmno/KhIq8ZEGJw5cipz/HqnxAzGCr2F6DyKqBol3Jp/m8Vpn14Ve3XQ9yYb2TAOg9UGEv31L0cXaTwQ9H+obYERLxFCnE1375HAnXGiuT7Kq7q5oeaE8PYNmLGZMCJmg6i7+5iNLbV5OqcDjIwK8gPb2YdAgyCLYoPGYEzKbOz8Zgo9jhb8shnXaH02sC+eFp6qlIcODjL+V0N9vlEH7Vynko4=; 25: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/3CZqZMJVYjqqKDiYK3GSGXnxx1ERi/ielzQdh/vSe1UCNKFrKzguGi2S8K6hl4Dr5eUOODkKYL6yPkKU6tMALRRRRC 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)(3231344)(944501410)(52105095)(3002001)(93006095)(93003095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699050); SRVR:CY1PR12MB0744; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0744; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0744; 4:RARX7MOG1OHu2yHOGCo7RoNovCcIhWDmMHdAiFWsK/KSANezPvCBOmZgsgtr4sQrYig+dw1HTQwqWSIs6J+VBlQ2+CIVaPTt4hCTcjjvqtCnHfkrjbPNkWz8XXaLY6zGemYHErmfp6t/9rIOpJVgcSQkRPc7aaC2EH+D7iG8D8TWJ5CTy1Aws9FLn2VdAtp3BeW5SDhXarvSm2YSadwJyctpkR2sR8HLqmXOBbjVR4XQv30q1zqeV7rqzXxtfJc1TBYBOt6PMOi7WQcifJADE1Qa1r3IfB8pB8+mAkeO1S7IbtO0VKUAuOdQ2hJWqeOe X-Forefront-PRVS: 0792DBEAD0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0744; 23:kAtSo7yEExJd3XHsBnyc9kV0YzKIJTyLsXQl7OgBS?= gWND4Vwr8VZpzFJLJN4NIMlVGkvxXCsgJTY1VnDi5iN+n9taS/E1jgTWSk4MpMSXurIjpg8gb9mq3oxvOW/p+dZiIB56U2fO62KNKVA+UXEDiMZZLjdeHfyksb+HMHrTEZo9WU9m7F+CvHm6UHkO0xkyyRKrufqTRk+asf3hPWW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/sSgqm4Cc0zquNEF2cWz6UcogaoriW9g6z3RIQmTH/bmwXHOo+qyjmjYaxsCeaKvZcsQERk10Z0xTeDXZrt9SfBwJik2bXZBmKWtWw1RVcWGP3TDRLaLgLNJEBGohWFg/uzRsoGl2t3yAQfVKN5vgPTelFfSiWviVf6wNgPUBQVckW3YTfbLF8Ra5tQGuWRK2D/wsw8vID1hfOv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0744; 20:0VN+eJxPgvkIo1Ka69WADAW8QD4fttzsLwYdhVOU80GLlEZ3WU8lqJdG/ZF4+TusrRZmW/f1szDLrtYf5S2Gk90Al1E2VpYfmhUgjoRPKW0kyNp7+yBQPPetBTkSjSzNn2QrexLEJ+nwrxBlU4p0tdTdp0jXH4f6Ybt0vz/+qDYw/U6geUal8MXGMdH2nvrxI8ckDdKUxRDqZvvInnz8dkKBgAS5WyT4/FG1x+8UO/o/yLSlpGNukCqssA9sG9jO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2018 16:14:40.4692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: deccd004-db41-434d-10c9-08d61801adc5 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: CY1PR12MB0744 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, Alex Deucher , Marek.Olsak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Harry Wentland Add code to tear down freesync modules when disabled. Signed-off-by: Harry Wentland Signed-off-by: Alex Deucher --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 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 af6adffba788..9dad505d132f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5230,19 +5230,37 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector, dm_con_state->freesync_capable = true; } } - - /* - * TODO figure out how to notify user-mode or DRM of freesync caps - * once we figure out how to deal with freesync in an upstreamable - * fashion - */ - } void amdgpu_dm_remove_sink_from_freesync_module(struct drm_connector *connector) { - /* - * TODO fill in once we figure out how to deal with freesync in - * an upstreamable fashion - */ + struct amdgpu_dm_connector *amdgpu_dm_connector = + to_amdgpu_dm_connector(connector); + struct dm_connector_state *dm_con_state; + struct drm_device *dev = connector->dev; + struct amdgpu_device *adev = dev->dev_private; + + if (!amdgpu_dm_connector->dc_sink || !adev->dm.freesync_module) { + DRM_ERROR("dc_sink NULL or no free_sync module.\n"); + return; + } + + if (!connector->state) { + DRM_ERROR("%s - Connector has no state", __func__); + return; + } + + dm_con_state = to_dm_connector_state(connector->state); + + amdgpu_dm_connector->min_vfreq = 0; + amdgpu_dm_connector->max_vfreq = 0; + amdgpu_dm_connector->pixel_clock_mhz = 0; + + memset(&amdgpu_dm_connector->caps, 0, sizeof(amdgpu_dm_connector->caps)); + + dm_con_state->freesync_capable = false; + + dm_con_state->user_enable.enable_for_gaming = false; + dm_con_state->user_enable.enable_for_static = false; + dm_con_state->user_enable.enable_for_video = false; }