Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3730588pxb; Mon, 24 Jan 2022 16:33:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5hW6H8a83x5w3zfT7poqamObJNWoEMkCyrEedrtm+3jecqT013UCdYXwDZClorybSdK2n X-Received: by 2002:a05:6a00:994:b0:4c9:d2a4:c5af with SMTP id u20-20020a056a00099400b004c9d2a4c5afmr5186440pfg.73.1643070836768; Mon, 24 Jan 2022 16:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070836; cv=none; d=google.com; s=arc-20160816; b=EVG2d090LJak8AnCsGofqfhBTknvf5y5rvz2b9cH6gQ91by4qnaTI2ISqBvdyaDk8h PhwrITa131UPOHzJ5KHqSKA9iErGRcqsMd3Bth3HT48Ul8tkAXG/v01cZ60VSyxRrjr8 BwzNM4v32Nnz4zfSA71JrnTNwJktp1op/TpKTPD/3+8teICiz6OsDuvh6etGe5KVV2PO ihfLRXxdZl+nm+ueqwseCn8kcyReWxhjv5TfVAhqMrEPty5F4sQhiYtH2iGBqjaU2nRc 5Vxm9ONsTc+qNgZA5wr/2ypTtZqG23JGHgQ68bEouOp5l6bmU37ySwY4Gce9c+imU09a O4ZQ== 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=QrFtbH6g38GGhTLubjiLXSZj1YxkS4DkbBe8v/vun4U=; b=YkPfh3QS2/qGBdi4Oz2pAW81vSMyN/DzNw1IAW6uDyTXla+zToTihQvnt09vApyT3r /Fer3vWvtMf1IeZ0kzI1KRdfX8vNoWhlp1YUJeCP33qT+2IlPiq1P5JI2Gxzl3+H4+Bm Am4MeCO1qhltTbWQWuYGDsI7uVVz0yKRUiBLNkcGm5qmbbKHmln1buy8/EqZ6bCMTdyd hRO16QLDBFb69yuQt8Bh1idpI0EFF8NShHviI5YMkXPDneMAHkObMnfxllyBjFN2xPuM j0qKSg+WCoYY/TKc8DAk/GHVIGvzvCAJGWE9wEEY+kqQRJ4D9KN5rzz2tT6N+w+eDBub O/JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="GqJIAN/6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si15211029pgh.832.2022.01.24.16.33.44; Mon, 24 Jan 2022 16:33:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="GqJIAN/6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3410677AbiAYA3o (ORCPT + 99 others); Mon, 24 Jan 2022 19:29:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2363445AbiAXXoc (ORCPT ); Mon, 24 Jan 2022 18:44:32 -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 2A77DC0BD117; Mon, 24 Jan 2022 13:39:19 -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 C3E73B8105C; Mon, 24 Jan 2022 21:39:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F36E4C340E4; Mon, 24 Jan 2022 21:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060357; bh=Tw+KMUhqIdOfNxHiKbccYBjOLfhTZO6kFMaB64mcMAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GqJIAN/6zzHF7gJSRrB67gVZimiKfE6tw6o5JChZzKH+VUDOsMKtyutwCDUOYMase /XwKmB2vX8Ld9N4xWfPMnYvBhZckjoIW9gcnxDIK/JyHHSX2TmPGftN6WK72JcPnk8 QQoWYH9BYFbqIHaZ+9CaCA28jraUkTpKj9cPfBok= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Deucher , Harry Wentland , Nicholas Kazlauskas Subject: [PATCH 5.16 0904/1039] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled Date: Mon, 24 Jan 2022 19:44:53 +0100 Message-Id: <20220124184155.680939976@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Kazlauskas commit 70897848730470cc477d5d89e6222c0f6a9ac173 upstream. [Why] PSR currently relies on the kernel's delayed vblank on/off mechanism as an implicit bufferring mechanism to prevent excessive entry/exit. Without this delay the user experience is impacted since it can take a few frames to enter/exit. [How] Only allow vblank disable immediate for DC when psr is not supported. Leave a TODO indicating that this support should be extended in the future to delay independent of the vblank interrupt. Fixes: 92020e81ddbeac ("drm/amdgpu/display: set vblank_disable_immediate for DC") Acked-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1598,9 +1598,6 @@ static int amdgpu_dm_init(struct amdgpu_ adev_to_drm(adev)->mode_config.cursor_width = adev->dm.dc->caps.max_cursor_size; adev_to_drm(adev)->mode_config.cursor_height = adev->dm.dc->caps.max_cursor_size; - /* Disable vblank IRQs aggressively for power-saving */ - adev_to_drm(adev)->vblank_disable_immediate = true; - if (drm_vblank_init(adev_to_drm(adev), adev->dm.display_indexes_num)) { DRM_ERROR( "amdgpu: failed to initialize sw for display support.\n"); @@ -4285,6 +4282,14 @@ static int amdgpu_dm_initialize_drm_devi } + /* + * 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)