From patchwork Wed Jul 11 14:28:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1184251 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 6299BDF25A for ; Wed, 11 Jul 2012 16:28:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5062FA0EAF for ; Wed, 11 Jul 2012 09:28:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 5562F9E8A8 for ; Wed, 11 Jul 2012 08:36:46 -0700 (PDT) Received: by mail-wi0-f171.google.com with SMTP id hq4so3953871wib.12 for ; Wed, 11 Jul 2012 08:36:46 -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=4ey4btIcFb57/mhpQo+Ofrk1yfLFdDsK+XJs428YUOU=; b=P/aNQ0ceJbxh0s69WwyWS4yPc9BBSaebtxJhKjnQkRoGGOmuxe0fqA+r55e/stJXaf cOILtXAdC84U9BaRI1bGWSIarDVi6pGwCAsS+h/s+MSl7Wmp5vCP39fI2EUsBNN+qcz6 50UayzmfOEm1fi0TFJuVL/j4q1Llieqatege8= 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=4ey4btIcFb57/mhpQo+Ofrk1yfLFdDsK+XJs428YUOU=; b=lGCTkXSuhnuxhMZZIsPPzPYE9CdrenHIEwAR4SUNxxeF8n39aek/fGP9EyaiRn0Gyl cyvwumNnydmkZievzFlmClKURnz80fikcsLtL0QN1v6qYGb9mrT056jwQFo9/bPeahUZ +ANBeEZK1dmFfMnvOzlFuPwi3SZk76i8Bfdr5QqYYPmm1pZsaDTdEpFGdVxrnSZnLbNJ rXBNog94jZkCuYGivP1taUc8M+ieH0ZCuF/CgwUeyz/XDGJRux0jO58ZRx3u4qHjO84I g4DG8zgsI9eAY6KLP+1luwAKirj9zscBl7zFsmHamocCLRoNfd93B8nAW7gkM8xUC9zf hRHA== Received: by 10.216.211.209 with SMTP id w59mr20319055weo.160.1342021006103; Wed, 11 Jul 2012 08:36:46 -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 bc2sm5777080wib.0.2012.07.11.08.36.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 08:36:45 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 11 Jul 2012 16:28:53 +0200 Message-Id: <1342016944-23395-71-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1342016944-23395-1-git-send-email-daniel.vetter@ffwll.ch> References: <1342016944-23395-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQmQrKRyuYL9XiLiHtqIyFnZAAyIl1Bi9SDaR8FYcbUfOAy0WBujBzL+GGrZQUfKDJ9arQYA Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 70/81] 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 --- 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(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 92011b1..daa0ccc 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 45db3e7..0975ec3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3533,6 +3533,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 e457109..f95919b 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -421,6 +421,7 @@ extern bool intel_crtc_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);