Skip to contentSkip to conversation

drm/i915: enable CxSR and FBC on Sandybridge

PATCH In review Yuanhan Liu 3 participants 6 messages Dec 15, 2010 – Dec 16, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover drm/i915: enable CxSR and FBC on Sandybridge

Hi,

This two patches enable self refresh and frame buffer compression on Sandybridge.

FYI, with my test, enable CxSR would save about 0.7W, while enable FBC would save about 0.1~0.2W.

Thanks.
Yuanhan Liu

--
Yuanhan Liu (2):
drm/i915: Add self-refresh support on Sandybridge drm/i915: Add frame buffer compression on Sandybridge

 drivers/gpu/drm/i915/i915_debugfs.c  |    2 +-
 drivers/gpu/drm/i915/i915_dma.c      |    4 +-
 drivers/gpu/drm/i915/i915_drv.c      |    1 +
 drivers/gpu/drm/i915/i915_reg.h      |   58 ++++++
 drivers/gpu/drm/i915/intel_display.c |  315 +++++++++++++++++++++++++++++++++-
 5 files changed, 376 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/2 drm/i915: Add self-refresh support on Sandybridge

Add the support of memory self-refresh on Sandybridge, which is now support 3 levels of watermarks and the source of the latency values for watermarks has changed.

On Sandybridge, the LP0 WM value is not hardcoded any more. All the latency value is now should be extracted from MCHBAR SSKPD register. And the MCHBAR base address is changed, too.

For the WM values, if any calculated watermark values is larger than the maximum value that can be programmed into the associated watermark register, that watermark must be disabled.

---
 drivers/gpu/drm/i915/i915_debugfs.c  |    2 +-
 drivers/gpu/drm/i915/i915_reg.h      |   46 +++++
 drivers/gpu/drm/i915/intel_display.c |  307 ++++++++++++++++++++++++++++++++++
 3 files changed, 354 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 2282199..864e75d 100644
@@ -933,7 +933,7 @@ static int i915_sr_status(struct seq_file *m, void *unused)
 	drm_i915_private_t *dev_priv = dev->dev_private;
 	bool sr_enabled = false;
 
-	if (IS_GEN5(dev))
+	if (HAS_PCH_SPLIT(dev))
 		sr_enabled = I915_READ(WM1_LP_ILK) & WM1_LP_SR_EN;
 	else if (IS_CRESTLINE(dev) || IS_I945G(dev) || IS_I945GM(dev))
 		sr_enabled = I915_READ(FW_BLC_SELF) & FW_BLC_SELF_EN;
drivers/gpu/drm/i915/i915_reg.h +46 -0

70 lines not on this page · raw message

drivers/gpu/drm/i915/intel_display.c +307 -0

331 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 2/2 drm/i915: Add frame buffer compression on Sandybridge

In reply to Yuanhan Liu

Add frame buffer compression on Sandybridge. The method is similar to Ironlake, except that two new registers of type GTTMMADR must be written with the right fence info.

---
 drivers/gpu/drm/i915/i915_dma.c      |    4 ++--
 drivers/gpu/drm/i915/i915_drv.c      |    1 +
 drivers/gpu/drm/i915/i915_reg.h      |   12 ++++++++++++
 drivers/gpu/drm/i915/intel_display.c |    8 +++++++-
 4 files changed, 22 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_dma.c +2 -2
index e9fb895..3f7b203 100644
@@ -1078,7 +1078,7 @@ static void i915_setup_compression(struct drm_device *dev, int size)
 	if (!cfb_base)
 		goto err_fb;
 
-	if (!(IS_GM45(dev) || IS_IRONLAKE_M(dev))) {
+	if (!(IS_GM45(dev) || HAS_PCH_SPLIT(dev))) {
 		compressed_llb = drm_mm_search_free(&dev_priv->mm.stolen,
 						    4096, 4096, 0);
 		if (compressed_llb)
@@ -1096,7 +1096,7 @@ static void i915_setup_compression(struct drm_device *dev, int size)
 
 	intel_disable_fbc(dev);
 	dev_priv->compressed_fb = compressed_fb;
-	if (IS_IRONLAKE_M(dev))
+	if (HAS_PCH_SPLIT(dev))
 		I915_WRITE(ILK_DPFC_CB_BASE, compressed_fb->start);
 	else if (IS_GM45(dev)) {
 		I915_WRITE(DPFC_CB_BASE, compressed_fb->start);
drivers/gpu/drm/i915/i915_drv.c +1 -0
index 5f20cd9..bdb29b2 100644
@@ -165,6 +165,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {
 static const struct intel_device_info intel_sandybridge_m_info = {
 	.gen = 6, .is_mobile = 1,
 	.need_gfx_hws = 1, .has_hotplug = 1,
+	.has_fbc = 1,
 	.has_bsd_ring = 1,
 	.has_blt_ring = 1,
 };
drivers/gpu/drm/i915/i915_reg.h +12 -0
index 5bba63a..811aeb4 100644
@@ -599,6 +599,18 @@
 #define   ILK_PABSTRETCH_DIS 	(1<<21)
 
 
+/* 
+ * Framebuffer compression for Sandybridge
+ *
+ * The following two registers are of type GTTMMADR
+ */
+#define SNB_DPFC_CTL_SA		0x100100
+#define   SNB_CPU_FENCE_ENABLE	(1<<29)
+#define DPFC_CPU_FENCE_OFFSET	0x100104
+
+
+
+
 /*
  * GPIO regs
  */
drivers/gpu/drm/i915/intel_display.c +7 -1
index 59a6d89..9887172 100644
@@ -1264,6 +1264,12 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 	/* enable it... */
 	I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl | DPFC_CTL_EN);
 
+	if (IS_GEN6(dev)) {
+		I915_WRITE(SNB_DPFC_CTL_SA, 
+				SNB_CPU_FENCE_ENABLE | dev_priv->cfb_fence);
+		I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y);
+	}
+
 	DRM_DEBUG_KMS("enabled fbc on plane %d\n", intel_crtc->plane);
 }
 
@@ -6426,7 +6432,7 @@ static void intel_init_display(struct drm_device *dev)
 		dev_priv->display.dpms = i9xx_crtc_dpms;
 
 	if (I915_HAS_FBC(dev)) {
-		if (IS_IRONLAKE_M(dev)) {
+		if (HAS_PCH_SPLIT(dev)) {
 			dev_priv->display.fbc_enabled = ironlake_fbc_enabled;
 			dev_priv->display.enable_fbc = ironlake_enable_fbc;
 			dev_priv->display.disable_fbc = ironlake_disable_fbc;
Signature · 1 line
1.7.2.3
#3 lore raw
In reply to Yuanhan Liu
Quoted 7 lines · Yuanhan Liu

Hi,

This two patches enable self refresh and frame buffer compression on Sandybridge.

FYI, with my test, enable CxSR would save about 0.7W, while enable FBC would save about 0.1~0.2W.

Do you have some numbers comparable to
https://bugs.freedesktop.org/show_bug.cgi?id=31588 ?
I'm interested to know if, first, we are able to reproduce those numbers and, secondly, if we've started to narrow the 3W gap for enabling a pipe between the Windows driver and ourselves.

The patches themselves look good. A minor bit of code duplication that we could possibly eliminate in the first...
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#4 lore raw
Quoted 6 lines · Chris Wilson
Quoted 5 lines · Yuanhan Liu

Hi,

This two patches enable self refresh and frame buffer compression on Sandybridge.

Quoted 7 lines
Quoted 2 lines

FYI, with my test, enable CxSR would save about 0.7W, while enable FBC would save about 0.1~0.2W.

Do you have some numbers comparable to
https://bugs.freedesktop.org/show_bug.cgi?id=31588 ?
I'm interested to know if, first, we are able to reproduce those numbers and,

Will update it at bugzilla soon.

Quoted 2 lines

secondly, if we've started to narrow the 3W gap for enabling a pipe between the Windows driver and ourselves.

This two patches mostly save just about 1W;)

Thanks.
Yuanhan Liu

#5 lore raw
Quoted 15 lines · Yuanhan Liu
Quoted 6 lines · Chris Wilson
Quoted 5 lines · Yuanhan Liu

Hi,

This two patches enable self refresh and frame buffer compression on Sandybridge.

Quoted 7 lines
Quoted 2 lines

FYI, with my test, enable CxSR would save about 0.7W, while enable FBC would save about 0.1~0.2W.

Do you have some numbers comparable to
https://bugs.freedesktop.org/show_bug.cgi?id=31588 ?
I'm interested to know if, first, we are able to reproduce those numbers and,

Quoted 7 lines

Will update it at bugzilla soon.

Quoted 2 lines

secondly, if we've started to narrow the 3W gap for enabling a pipe between the Windows driver and ourselves.

This two patches mostly save just about 1W;)

Based on experience from previous generation, it's pretty much that number, and another 1W idle power can be saved from Render-C. those are pretty much the HW power saving feature we can leverage now.

Another feature called DPST which basically adjust backlight based on color histogram can't be open sourced. Not sure if it's enabled in the windows test environment in bug# 31588.

Quoted 9 lines

Thanks.
Yuanhan Liu

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx