From patchwork Thu Jul 26 18:49:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1245371 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 77ED7DFFCE for ; Thu, 26 Jul 2012 20:51:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CBA59E73D for ; Thu, 26 Jul 2012 13:51:14 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id D8A799E9D9 for ; Thu, 26 Jul 2012 12:57:36 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id dr1so1724773wgb.12 for ; Thu, 26 Jul 2012 12:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=q85kluxndoVIoeKTO3MWfTnlu6XoTkbHxARs7NYOynE=; b=Rc95/iXmwxVUsctTQL467WDXt8oMAockxh2rpfppA9fhNW+M9WK9+qwJCifRqys2pG pgysMK8bLqcr27BLmpfOFZOQCFrAun+Z09wzYWqJ8hjiPj6rt2hIZ1V0s9KyLDkdJF9T MH0OybNFh+/N/uKljAW9xEOspYjcj3dBKoJks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=q85kluxndoVIoeKTO3MWfTnlu6XoTkbHxARs7NYOynE=; b=emfyRohTv4IPeAyWUMGaa1ujenN7e8XtuP421KbwRom/QgLeEXnbaAoTQmGy42V3J/ k393i2pu8u3wz/VgAKT5VKlv7Yl4FTtUhaGGoaFmhL/KWSNCU5YwSC0LwhMiofSa1Btd UVDZI9nqbPW4pED82YwMTitFZM6eKJNxQOrK4pN43fdNhSdhmKhzXazVfGI3/D0iZGx0 n5gODvkXlBJRXc4gJiQWebGyRgK3tck1SXyF/ZDIKybUtBHaEnc/79q3eVNo96RF1QVV 7xP3mCpnGfV8GCRVPNm1NqdK//IPiX4+zp7MmCmn1tsfFZX4COc/ftFPiHawsP9OzxPB BJSg== Received: by 10.180.97.33 with SMTP id dx1mr75987wib.18.1343332656560; Thu, 26 Jul 2012 12:57:36 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id fr4sm391403wib.8.2012.07.26.12.57.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 12:57:35 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 26 Jul 2012 20:49:30 +0200 Message-Id: <1343328581-2324-66-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQn1smI6UyXzPS2PEZzrstgstsi9qVyotUuYHhqeO1HPQzqafp/KHYZ8275lMvCV5eKx7OyC Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 65/76] drm/i915: disable all crtcs at suspend time X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org We need this to avoid confusing the hw state readout code with the cpt pch plls at resume time: We'd read the new pipe state (which is disabled), but still believe that we have a life pll connected to that pipe (from before the suspend). Hence properly disable pipes to clear out all the residual state. This has the neat side-effect that we don't enable ports prematurely by restoring bogus state from the saved register values. Signed-Off-by: Daniel Vetter Conflicts: drivers/gpu/drm/i915/intel_drv.h --- drivers/gpu/drm/i915/i915_drv.c | 3 +++ drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++ drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 04149e0..06b4d9d 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -441,6 +441,9 @@ static int i915_drm_freeze(struct drm_device *dev) "GEM idle failed, resume might fail\n"); return error; } + + intel_modeset_disable(dev); + drm_irq_uninstall(dev); } diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 99f4e55..bd00dde 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3544,6 +3544,16 @@ static void intel_crtc_disable(struct drm_crtc *crtc) } } +void intel_modeset_disable(struct drm_device *dev) +{ + struct drm_crtc *crtc; + + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { + if (crtc->enabled) + intel_crtc_disable(crtc); + } +} + void intel_encoder_noop(struct drm_encoder *encoder) { } diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 24b23ed..995d5a0 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -450,6 +450,7 @@ struct intel_set_config { extern bool intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode, int x, int y, struct drm_framebuffer *old_fb); +extern void intel_modeset_disable(struct drm_device *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); extern void intel_crtc_update_dpms(struct drm_crtc *crtc); extern void intel_encoder_noop(struct drm_encoder *encoder);