From patchwork Thu Jun 5 18:24:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 4308071 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5862E9F68F for ; Thu, 5 Jun 2014 18:27:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF15F2035C for ; Thu, 5 Jun 2014 18:27:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AFEA72034C for ; Thu, 5 Jun 2014 18:27:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AE806E9B8; Thu, 5 Jun 2014 11:27:52 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy3-pub.mail.unifiedlayer.com (gproxy3-pub.mail.unifiedlayer.com [69.89.30.42]) by gabe.freedesktop.org (Postfix) with SMTP id 71DF36E23C for ; Thu, 5 Jun 2014 11:27:50 -0700 (PDT) Received: (qmail 25308 invoked by uid 0); 5 Jun 2014 18:26:11 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy3.mail.unifiedlayer.com with SMTP; 5 Jun 2014 18:26:11 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by cmgw4 with id AiS41o00T2UhLwi01iS7ee; Thu, 05 Jun 2014 12:26:11 -0600 X-Authority-Analysis: v=2.1 cv=CpMsLBID c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=Be3HZA2PdCcA:10 a=3ROhxo7VqVMA:10 a=IkcTkHD0fZMA:10 a=TBVoxVdAAAAA:8 a=GhZ5P8ky69gA:10 a=noBwr2J6l1kA:10 a=pGLkceISAAAA:8 a=srmMj8ekOQ1otGSZeGIA:9 a=QEXdDO2ut3YA:10 a=MSl-tDqOz04A:10 a=rW6DTWptwo0A:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From; bh=CW7rljiMxI206da2QEiDZadcnSY8uo5DL4kbdiSf0y0=; b=XXmEPpMNkP7PAHxt2Pbvn8w4DnsXgkJedNwWnzJDJJYVuXWk0JKznS5ivVASO7UDGxtTp6krQfFMljvCjS7p9folMxNVNGAz2/bRT2DNjzxLAQ9L0EcFBxx+bhFokcOY; Received: from [67.161.37.189] (port=60655 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1WscMW-0001x8-39; Thu, 05 Jun 2014 12:26:04 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Thu, 5 Jun 2014 11:24:27 -0700 Message-Id: <1401992671-2548-1-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.8.3.2 MIME-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 1/5] drm/i915: preserve SSC if previously set v2 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some machines may have a broken VBT or no VBT at all, but we still want to use SSC there. So check for it and keep it enabled if we see it already on. Based on an earlier fix from Kristian. v2: honor modparam if set too (Daniel) read out at init time and store for panel_use_ssc() use (Jesse) Reported-by: Kristian Høgsberg Signed-off-by: Jesse Barnes --- drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 8631fb3..f57b752 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1404,6 +1404,8 @@ struct drm_i915_private { struct intel_opregion opregion; struct intel_vbt_data vbt; + bool bios_ssc; /* BIOS had SSC enabled at boot? */ + /* overlay */ struct intel_overlay *overlay; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b5cbb28..0e8c9bc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -5355,7 +5355,7 @@ static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv) { if (i915.panel_use_ssc >= 0) return i915.panel_use_ssc != 0; - return dev_priv->vbt.lvds_use_ssc + return (dev_priv->vbt.lvds_use_ssc || dev_priv->bios_ssc) && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE); } @@ -12478,6 +12478,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev, void intel_modeset_gem_init(struct drm_device *dev) { + struct drm_i915_private *dev_priv = dev->dev_private; struct drm_crtc *c; struct intel_framebuffer *fb; @@ -12485,6 +12486,14 @@ void intel_modeset_gem_init(struct drm_device *dev) intel_init_gt_powersave(dev); mutex_unlock(&dev->struct_mutex); + /* + * There may be no VBT; and if the BIOS enabled SSC we can + * just keep using it to avoid unnecessary flicker. + */ + if ((HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)) && + (I915_READ(PCH_DREF_CONTROL) & DREF_SSC1_ENABLE)) + dev_priv->bios_ssc = true; + intel_modeset_init_hw(dev); intel_setup_overlay(dev);