Skip to contentSkip to conversation

drm/i915: simplify pipe checking

PATCH In review Eugeni Dodonov 3 participants 5 messages Jan 8, 2012 – Jan 17, 2012

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

PATCH 1/2 drm/i915: simplify pipe checking

This is also handled by i915_reg.h, so just reuse this trick to reduce universe enthropy.

---
 drivers/gpu/drm/i915/i915_suspend.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +2 -1
index 7886e4f..c0b945c 100644
@@ -28,6 +28,7 @@
 #include "drm.h"
 #include "i915_drm.h"
 #include "intel_drv.h"
+#include "i915_reg.h"
 
 static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 {
@@ -35,7 +36,7 @@ static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 	u32	dpll_reg;
 
 	if (HAS_PCH_SPLIT(dev))
-		dpll_reg = (pipe == PIPE_A) ? _PCH_DPLL_A : _PCH_DPLL_B;
+		dpll_reg = PCH_DPLL(pipe);
 	else
 		dpll_reg = (pipe == PIPE_A) ? _DPLL_A : _DPLL_B;
 
Signature · 1 line
1.7.8
#1 lore raw

PATCH 2/2 drm/i915: handle 3rd pipe

We don't need to check 3rd pipe specifically, as it shares PLL with some other one.

---
 drivers/gpu/drm/i915/i915_suspend.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +4 -0
index c0b945c..30d924f 100644
@@ -35,6 +35,10 @@ static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32	dpll_reg;
 
+	/* On IVB, 3rd pipe shares PLL with another one */
+	if (pipe > 1)
+		return false;
+
 	if (HAS_PCH_SPLIT(dev))
 		dpll_reg = PCH_DPLL(pipe);
 	else
Signature · 1 line
1.7.8
Reviewed-by on v1 1/2
#2 lore raw
In reply to Eugeni Dodonov

Eugeni Dodonov <[email protected]> (07/01/2012):

Quoted 2 lines

This is also handled by i915_reg.h, so just reuse this trick to reduce universe enthropy.

entropy.

Besides that:

Quoted 19 lines
---
 drivers/gpu/drm/i915/i915_suspend.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +1 -0
index 7886e4f..c0b945c 100644
@@ -28,6 +28,7 @@
 #include "drm.h"
 #include "i915_drm.h"
 #include "intel_drv.h"
+#include "i915_reg.h"
 
 static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 {

drivers/gpu/drm/i915/i915_suspend.c static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe) · line 42

Quoted 8 lines
drivers/gpu/drm/i915/i915_suspend.c +1 -1
@@ -35,7 +36,7 @@ static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 	u32	dpll_reg;
 
 	if (HAS_PCH_SPLIT(dev))
-		dpll_reg = (pipe == PIPE_A) ? _PCH_DPLL_A : _PCH_DPLL_B;
+		dpll_reg = PCH_DPLL(pipe);
 	else
 		dpll_reg = (pipe == PIPE_A) ? _DPLL_A : _DPLL_B;
 

Mraw,
KiBi.

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

#4 lore raw
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Cyril Brulebois

Eugeni Dodonov <[email protected]> (07/01/2012):

Quoted 2 lines

This is also handled by i915_reg.h, so just reuse this trick to reduce universe enthropy.

Quoted 7 lines
Quoted 5 lines

entropy.

Besides that:

Both patches queued for -next, thanks.

I've botched my cross-checking with Keith's -fixes, these two are already there. Dropped them from my queue.
-Daniel

Signature · 2 lines
Daniel Vetter
[email protected] - +41 (0) 79 364 57 48 - http://blog.ffwll.ch