public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Deepak S <deepak.s@intel.com>
Subject: [PATCH 6/9] drm/i915: Verify address field of PCBR register.
Date: Fri,  7 Feb 2014 18:37:04 -0200	[thread overview]
Message-ID: <1391805427-4576-7-git-send-email-rodrigo.vivi@gmail.com> (raw)
In-Reply-To: <1391805427-4576-1-git-send-email-rodrigo.vivi@gmail.com>

From: Deepak S <deepak.s@intel.com>

RC6 should be enabled only if the PCBR register is programmed properly
either BIOS or Gfx. This patches address the case where PCBR
allocation fails due buggy BIOS or due to stolen memory allocation
failed.

v2: Add #define for magic numbers (Daniel)

v3: Use VLV_PCBR_ADDR_SHIFT instead of MASK (Jani)

Signed-off-by: Deepak S <deepak.s@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 drivers/gpu/drm/i915/intel_pm.c | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index cc3ea04..41905ab 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -4987,6 +4987,7 @@
 #define GEN6_GT_GFX_RC6				0x138108
 #define GEN6_GT_GFX_RC6p			0x13810C
 #define GEN6_GT_GFX_RC6pp			0x138110
+#define VLV_PCBR_ADDR_SHIFT			12
 
 #define GEN6_PCODE_MAILBOX			0x138124
 #define   GEN6_PCODE_READY			(1<<31)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index f74d7f5..8caffb3 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3602,7 +3602,7 @@ static void valleyview_enable_rps(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_ring_buffer *ring;
-	u32 gtfifodbg, val, hw_max, hw_min, rc6_mode = 0;
+	u32 gtfifodbg, val, hw_max, hw_min, rc6_mode = 0, pcbr;
 	int i;
 
 	WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock));
@@ -3647,7 +3647,12 @@ static void valleyview_enable_rps(struct drm_device *dev)
 		   _MASKED_BIT_ENABLE(VLV_COUNT_RANGE_HIGH |
 				      VLV_MEDIA_RC6_COUNT_EN |
 				      VLV_RENDER_RC6_COUNT_EN));
-	if (intel_enable_rc6(dev) & INTEL_RC6_ENABLE)
+
+	/* Enable RC6 Only if the PCBR address is configured either by
+	 * BIOS or Gfx Driver */
+	pcbr = I915_READ(VLV_PCBR);
+	if (intel_enable_rc6(dev) & INTEL_RC6_ENABLE &&
+						(pcbr >> VLV_PCBR_ADDR_SHIFT))
 		rc6_mode = GEN7_RC_CTL_TO_MODE | VLV_RC_CTL_CTX_RST_PARALLEL;
 
 	intel_print_rc6_info(dev, rc6_mode);
-- 
1.8.3.1

  parent reply	other threads:[~2014-02-07 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 20:36 [PATCH 0/9] drm-intel-collector - update Rodrigo Vivi
2014-02-07 20:36 ` [PATCH 1/9] drm/i915: Propagate errors on failed PPGTT Rodrigo Vivi
2014-02-07 20:37 ` [PATCH 2/9] drm/i915: wrap crtc enable/disable Rodrigo Vivi
2014-02-07 20:37 ` [PATCH 3/9] drm/i915: make crtc enable/disable asynchronous Rodrigo Vivi
2014-03-03 23:18   ` Jesse Barnes
2014-02-07 20:37 ` [PATCH 4/9] drm/i915: Propagate PCI read/write errors during vga_set_state() Rodrigo Vivi
2014-02-10 10:35   ` Daniel Vetter
2014-02-07 20:37 ` [PATCH 5/9] drm/i915: Short-circuit no-op vga_set_state() Rodrigo Vivi
2014-02-10 10:36   ` Daniel Vetter
2014-02-07 20:37 ` Rodrigo Vivi [this message]
2014-02-07 20:37 ` [PATCH 7/9] drm/i915: Bring UP Power Wells before disabling RC6 Rodrigo Vivi
2014-02-07 20:37 ` [PATCH 8/9] drm/i915: Flush GPU rendering with a lockless wait during a pagefault Rodrigo Vivi
2014-02-10 15:52   ` Damien Lespiau
2014-02-10 17:32     ` Daniel Vetter
2014-02-07 20:37 ` [PATCH 9/9] drm/i915: PF CRC may not work on HSW Rodrigo Vivi
2014-02-10 10:43   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391805427-4576-7-git-send-email-rodrigo.vivi@gmail.com \
    --to=rodrigo.vivi@gmail.com \
    --cc=deepak.s@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox