Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3112156pxm; Mon, 28 Feb 2022 12:15:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLZDhM5oEqZ/Pz4pemh4JQnPNdqfM/cvjwUjOo1Jlut1c4t/pREqhzVZm+RqRPo6KSZBvf X-Received: by 2002:a63:5d0a:0:b0:377:1ad7:5be1 with SMTP id r10-20020a635d0a000000b003771ad75be1mr14738112pgb.576.1646079339347; Mon, 28 Feb 2022 12:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079339; cv=none; d=google.com; s=arc-20160816; b=v9x2kjNKMdBB03huLozuKsL+YDLMcTlEAW14Su/I9gVx85jUke7fI8P/WjJNZBMGtC LvrQRv4DJrRl2MK6+mlZRL3Kr9OBTzSUNyTnbBPHOcyK5RGXKWgnKiCDGWUL2GIZYHdV fuo4a7UkxHUWlDgoDkaPVYqaRYRa+n4rpM6xi4axB5L9YXpZxji8RGLl/b/ri4A6QcLK 9qpKeYPEEYOZWss2n68oCSsnBw7W4mHNc1gIKl6VqD29iBbcqra/coK9IOrFtFVGbtdt 9pd+OBiSOk1LH08uyCW2rvK4W9n6QSNhlUEt4QDOT1QdOER+2M4Xncq4WROm+nOJ8bhg t5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XE423LpUToXvLU23RCDgh+/Jxn46kcb00IrSUTAhpAk=; b=iHJf5Qb67lhZiOWmK+vNbSRhZ/5LjqqLW5Fhx6gdMjPuTY1VtMKN0cbRXE6bKISZhM Kkb3XznAj5fY0Y/tDzeWwo21ajkeNSDAtQFd5gxitIyKGusvrvJc9KkyiRycPfWDhXPL RIvs9KMTLMuoBhiyfulx3d6xtbk+ITT3LGEIuqiz1ETxq0XIsdSD7tK8OyVj+m705ijp Ie3NgEZHvP83q9h69BN6U/9FzmFt1BxR6zoGc6X5SxO893O1U2sQH8RSvGiTlE0sZhIR F5GegIkF9SZ2v3GnJrHsFEaZ/CL9ETQG7EcPggEwGQZ9+Nr0At+BWgVKspzjbqVZXs0x 7Pyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z6+2wbuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a23-20020a17090a8c1700b001bc40adffb1si401973pjo.4.2022.02.28.12.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:15:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z6+2wbuf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 442C5172270; Mon, 28 Feb 2022 11:37:53 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234825AbiB1SGg (ORCPT + 99 others); Mon, 28 Feb 2022 13:06:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239453AbiB1SB5 (ORCPT ); Mon, 28 Feb 2022 13:01:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EFDF9BAD5; Mon, 28 Feb 2022 09:45:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 859CFB81085; Mon, 28 Feb 2022 17:45:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA73DC340E7; Mon, 28 Feb 2022 17:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070347; bh=uW5lP9Jlu1qgQDuB/8Sam5qo0Jjx9pzRygNq0AAbrZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6+2wbufnX6eyk9EwLnUUJAKfOC4jPqw/9goBY9pBMY/H1MHzEdLQF6Qz0iPAdwe5 roFVmMm/7RlXXTdJIA2zLs/LAH8n5bpxHesXOw1a2pC87IfwTQuVinXnDWxLs4rUt9 RA8jlboUMcfGeZ36WgoCwGPtxK4p+ff0gI+aumxg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harry Wentland , =?UTF-8?q?Michel=20D=C3=A4nzer?= , Alex Deucher Subject: [PATCH 5.16 076/164] drm/amd/display: For vblank_disable_immediate, check PSR is really used Date: Mon, 28 Feb 2022 18:23:58 +0100 Message-Id: <20220228172406.930512356@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michel Dänzer commit 4d22336f903930eb94588b939c310743a3640276 upstream. Even if PSR is allowed for a present GPU, there might be no eDP link which supports PSR. Fixes: 708978487304 ("drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled") Reviewed-by: Harry Wentland Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4232,6 +4232,9 @@ static int amdgpu_dm_initialize_drm_devi } #endif + /* Disable vblank IRQs aggressively for power-saving. */ + adev_to_drm(adev)->vblank_disable_immediate = true; + /* loops over all connectors on the board */ for (i = 0; i < link_cnt; i++) { struct dc_link *link = NULL; @@ -4277,19 +4280,17 @@ static int amdgpu_dm_initialize_drm_devi update_connector_ext_caps(aconnector); if (psr_feature_enabled) amdgpu_dm_set_psr_caps(link); + + /* TODO: Fix vblank control helpers to delay PSR entry to allow this when + * PSR is also supported. + */ + if (link->psr_settings.psr_feature_enabled) + adev_to_drm(adev)->vblank_disable_immediate = false; } } - /* - * Disable vblank IRQs aggressively for power-saving. - * - * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR - * is also supported. - */ - adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled; - /* Software is initialized. Now we can register interrupt handlers. */ switch (adev->asic_type) { #if defined(CONFIG_DRM_AMD_DC_SI)