From patchwork Fri Apr 23 15:17:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Jackson X-Patchwork-Id: 94691 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3NFHv1Q011835 for ; Fri, 23 Apr 2010 15:18:33 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 276829F648; Fri, 23 Apr 2010 08:17:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 575399F606 for ; Fri, 23 Apr 2010 08:17:52 -0700 (PDT) Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3NFHpYH024483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Apr 2010 11:17:51 -0400 Received: from localhost.localdomain (ihatethathostname.lab.bos.redhat.com [10.16.43.238]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3NFHm8K014835 for ; Fri, 23 Apr 2010 11:17:50 -0400 From: Adam Jackson To: intel-gfx@lists.freedesktop.org Date: Fri, 23 Apr 2010 11:17:40 -0400 Message-Id: <1272035862-19447-3-git-send-email-ajax@redhat.com> In-Reply-To: <1272035862-19447-1-git-send-email-ajax@redhat.com> References: <1272035862-19447-1-git-send-email-ajax@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Subject: [Intel-gfx] [PATCH 2/4] drm/i915: Push an fbc disable across suspend X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 23 Apr 2010 15:18:33 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 01e91ea..412bade 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -233,6 +233,9 @@ static int i915_drm_freeze(struct drm_device *dev) drm_irq_uninstall(dev); } + dev_priv->fbc_disabled_for_suspend = intel_fbc_enabled(dev); + intel_disable_fbc(dev); + i915_save_state(dev); intel_opregion_free(dev, 1); @@ -276,6 +279,16 @@ static int i915_drm_thaw(struct drm_device *dev) i915_restore_state(dev); + if (dev_priv->fbc_disabled_for_suspend) { + struct drm_crtc *crtc; + + /* XXX might not be the plane we compressed at suspend; meh */ + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) + intel_enable_fbc(crtc, 500); + + dev_priv->fbc_disabled_for_suspend = false; + } + intel_opregion_init(dev, 1); /* KMS EnterVT equivalent */ diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 3a19cb4..e9e8c4a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -341,6 +341,7 @@ typedef struct drm_i915_private { /* Register state */ bool modeset_on_lid; + bool fbc_disabled_for_suspend; u8 saveLBB; u32 saveDSPACNTR; u32 saveDSPBCNTR; diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 60a5800..81cdfb4 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -707,10 +707,8 @@ void i915_restore_display(struct drm_device *dev) /* only restore FBC info on the platform that supports FBC*/ if (I915_HAS_FBC(dev)) { if (IS_GM45(dev)) { - g4x_disable_fbc(dev); I915_WRITE(DPFC_CB_BASE, dev_priv->saveDPFC_CB_BASE); } else { - i8xx_disable_fbc(dev); I915_WRITE(FBC_CFB_BASE, dev_priv->saveFBC_CFB_BASE); I915_WRITE(FBC_LL_BASE, dev_priv->saveFBC_LL_BASE); I915_WRITE(FBC_CONTROL2, dev_priv->saveFBC_CONTROL2);