Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751245AbdGPEoK (ORCPT ); Sun, 16 Jul 2017 00:44:10 -0400 Received: from mout.gmx.net ([212.227.17.21]:49929 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbdGPEoI (ORCPT ); Sun, 16 Jul 2017 00:44:08 -0400 Message-ID: <1500180236.5334.7.camel@gmx.de> Subject: Re: [drm/nouveau] GeForce 8600 GT boot/suspend grumbling From: Mike Galbraith To: Ilia Mirkin Cc: "dri-devel@lists.freedesktop.org" , "nouveau@lists.freedesktop.org" , LKML Date: Sun, 16 Jul 2017 06:43:56 +0200 In-Reply-To: References: <1500097200.6712.17.camel@gmx.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:No5+OUBzCLb8CvsVWBeUct2tRMil0Xk7fcBBlMQaDNAUNu1ym54 79e3LBqHpuXEvhafFhNrdjrt/WGE9rw0FZA+BdzLvwelOOBHCUoEzXqlXu08YzlV+GiIv2Y 8+Z5VWge7reUdhzYGKqg8AAqcS9PkEqorUdZPIyefQUKQW2Ckf8s8tt1TZldXyiHO71m4p0 31Q2av7tFfeu7q+sDOKKQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:KkKg+Cf3LWQ=:7Ec/0ccSiBJOCsgl+SpbVK k3trn8CbjNoDf5azrkg91zJH3FAgmLg4rX+wtrWy8vf5ERRhtGombwa9t+P3dAH1tBDkdr9I+ M6Aiq9e2PfgLnL3XqiiUxdtd3hFsxIxP7wuzwABSRGlMAqMpSLDriaBrtauxwqboN1CRNtzmz o5kZB2HlcxYABWh2kYhxogPeOj0oyE3HxJmZtUODh189DrLF2rW6M+YsCTQOWHjHAw8ZQV+Rv j/yM4Z/m2xzLw7CQZXBZ4QfA2IFlpCgzU/E8jxaF9wqFITNlngULnAgkHlZz9Y5ccmWpvpngz JAmuUyBcIlhkubK/BEoYH47W4YYLsaRLg9r62SqnfDg158HaBVMkb/d8SqsI/SEOTMD0Qb6pO AhhsRd7KjVEWm9QW11JE+4R7dVpNwNSdTbRrRfrsONVBq7eXP8cs6dLJXg8XitA4d7muI4sOD XnsOYHHZEAnFqpD6+8b7Ce71CvHbQzPzm/WuLjQR4UrWJm+z7jHLpMo9rm2raAU9JRAwpD81L VH47yuPKWrJ2L34BtPBALtdVE7D5DF+663NIPFZMSf49XF6gF9YlyxrHcepxGLMTXtW73trLP jGHaSp10WP5YpVn6Qp/QJM+ZeW1Om8pRiwqisCIjNvOabcaz38EgHa2DxMO6cPM36O1p5hfrE D/c+APl56OfH9zRuFxLOwtNYAC/wGPeIfDP2p7vkmbsMiLKCrx6+POLRSChokCW4aGtLTgAd4 HawsYBHtbVgwK9eFGsnZDbxn0aP9uObQZJYGzDXibziKNo0Qhqquf7HCNL1AlzptaXRLsaybZ BPpq3xBQR+d9/32C10wUM1bMypdqfFMGWOlCjP+jg7mLhcUP80= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1968 Lines: 55 On Sat, 2017-07-15 at 14:52 -0400, Ilia Mirkin wrote: > > OK, so this issue appears to be that we're calling > drm_crtc_vblank_off() on a crtc for which vblank is already disabled. > My guess is that this happens because the crtc is disabled. > > Not sure what the proper check is to see if vblanks are already disabled... Seems so, the below shut up suspend for both 8600 GT and GTX 980. --- drivers/gpu/drm/drm_vblank.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -323,6 +323,14 @@ void drm_vblank_disable_and_save(struct spin_lock_irqsave(&dev->vblank_time_lock, irqflags); /* + * Always update the count and timestamp to maintain the + * appearance that the counter has been ticking all along until + * this time. This makes the count account for the entire time + * between drm_crtc_vblank_on() and drm_crtc_vblank_off(). + */ + drm_update_vblank_count(dev, pipe, false); + + /* * Only disable vblank interrupts if they're enabled. This avoids * calling the ->disable_vblank() operation in atomic context with the * hardware potentially runtime suspended. @@ -332,14 +340,6 @@ void drm_vblank_disable_and_save(struct vblank->enabled = false; } - /* - * Always update the count and timestamp to maintain the - * appearance that the counter has been ticking all along until - * this time. This makes the count account for the entire time - * between drm_crtc_vblank_on() and drm_crtc_vblank_off(). - */ - drm_update_vblank_count(dev, pipe, false); - spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); } @@ -605,7 +605,7 @@ bool drm_calc_vbltimestamp_from_scanoutp */ if (mode->crtc_clock == 0) { DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe); - WARN_ON_ONCE(drm_drv_uses_atomic_modeset(dev)); + WARN_ON_ONCE(drm_drv_uses_atomic_modeset(dev) && vblank->enabled); return false; }