From 2dfd178dc05164d6d730f4b3649accc1ee1ee585 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 3 Feb 2016 16:53:25 +0100 Subject: [PATCH] drm/i915: Do not disable cxsr when crtc is disabled. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's safe to assume cxsr is already disabled when the crtc is off. This prevents an unclaimed register warning when the required power wells are not enabled. [ 262.864984] ------------[ cut here ]------------ [ 262.865025] WARNING: CPU: 1 PID: 6799 at drivers/gpu/drm/i915/intel_uncore.c:638 __unclaimed_reg_debug+0x68/0x80 [i915]() [ 262.865029] Unclaimed register detected before reading register 0x186500 [ 262.865032] Modules linked in: i915 intel_powerclamp [ 262.865057] CPU: 1 PID: 6799 Comm: kms_pipe_crc_ba Tainted: G U W 4.4.0-gfxbench+ #1 [ 262.865060] Hardware name: DN2820FYK, BIOS FYBYT10H.86A.0038.2014.0717.1455 07/17/2014 [ 262.865064] ffffffffa0338cf8 ffff88007448ba78 ffffffff813df90c ffff88007448bac0 [ 262.865071] ffff88007448bab0 ffffffff810746e1 0000000000186500 0000000000000001 [ 262.865077] 0000000000000001 ffff880074420000 0000000000000000 ffff88007448bb10 [ 262.865083] Call Trace: [ 262.865092] [] dump_stack+0x4e/0x82 [ 262.865098] [] warn_slowpath_common+0x81/0xc0 [ 262.865102] [] warn_slowpath_fmt+0x47/0x50 [ 262.865128] [] __unclaimed_reg_debug+0x68/0x80 [i915] [ 262.865154] [] vlv_read32+0x2de/0x370 [i915] [ 262.865173] [] intel_set_memory_cxsr+0x87/0x1a0 [i915] [ 262.865200] [] intel_pre_plane_update+0xb3/0xf0 [i915] [ 262.865228] [] intel_atomic_commit+0x3b5/0x17c0 [i915] [ 262.865234] [] ? drm_atomic_check_only+0x145/0x660 [ 262.865239] [] ? drm_atomic_set_crtc_for_connector+0x6a/0xe0 [ 262.865243] [] drm_atomic_commit+0x32/0x50 [ 262.865249] [] drm_atomic_helper_set_config+0x75/0xb0 [ 262.865253] [] drm_mode_set_config_internal+0x60/0x110 [ 262.865258] [] drm_mode_setcrtc+0x186/0x4f0 [ 262.865263] [] drm_ioctl+0x13d/0x590 [ 262.865267] [] ? drm_mode_setplane+0x1b0/0x1b0 [ 262.865273] [] do_vfs_ioctl+0x2fc/0x550 [ 262.865278] [] ? vm_munmap+0x4a/0x60 [ 262.865283] [] ? __fget_light+0x6a/0x90 [ 262.865287] [] SyS_ioctl+0x3c/0x70 [ 262.865292] [] entry_SYSCALL_64_fastpath+0x16/0x73 [ 262.865296] ---[ end trace 6387a0ad001bb39f ]--- Testcase: kms_flip.basic-flip-vs-wf_vblank Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93698 Signed-off-by: Maarten Lankhorst Link: http://patchwork.freedesktop.org/patch/msgid/1454514805-10595-4-git-send-email-maarten.lankhorst@linux.intel.com Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a7fa627f4c05..5bc9a364b04a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -4834,7 +4834,9 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state) if (pipe_config->disable_cxsr) { crtc->wm.cxsr_allowed = false; - intel_set_memory_cxsr(dev_priv, false); + + if (old_crtc_state->base.active) + intel_set_memory_cxsr(dev_priv, false); } if (!needs_modeset(&pipe_config->base) && pipe_config->wm_changed)