diff mbox

[7/9] drm/i915: Improve assert_planes_disabled()

Message ID 1370342947-20757-8-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä June 4, 2013, 10:49 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Ever since gen4 primary planes were fixed to pipes.

And for gen2-3, don't check plane B if it doesn't exist.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Rodrigo Vivi June 5, 2013, 7:33 p.m. UTC | #1
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

On Tue, Jun 4, 2013 at 7:49 AM,  <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Ever since gen4 primary planes were fixed to pipes.
>
> And for gen2-3, don't check plane B if it doesn't exist.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e928a54..9c89ddf 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1102,12 +1102,13 @@ static void assert_plane(struct drm_i915_private *dev_priv,
>  static void assert_planes_disabled(struct drm_i915_private *dev_priv,
>                                    enum pipe pipe)
>  {
> +       struct drm_device *dev = dev_priv->dev;
>         int reg, i;
>         u32 val;
>         int cur_pipe;
>
> -       /* Planes are fixed to pipes on ILK+ */
> -       if (HAS_PCH_SPLIT(dev_priv->dev) || IS_VALLEYVIEW(dev_priv->dev)) {
> +       /* Primary planes are fixed to pipes on gen4+ */
> +       if (INTEL_INFO(dev)->gen >= 4) {
>                 reg = DSPCNTR(pipe);
>                 val = I915_READ(reg);
>                 WARN((val & DISPLAY_PLANE_ENABLE),
> @@ -1117,7 +1118,7 @@ static void assert_planes_disabled(struct drm_i915_private *dev_priv,
>         }
>
>         /* Need to check both planes against the pipe */
> -       for (i = 0; i < 2; i++) {
> +       for (i = 0; i < INTEL_INFO(dev)->num_pipes; i++) {
>                 reg = DSPCNTR(i);
>                 val = I915_READ(reg);
>                 cur_pipe = (val & DISPPLANE_SEL_PIPE_MASK) >>
> --
> 1.8.1.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e928a54..9c89ddf 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1102,12 +1102,13 @@  static void assert_plane(struct drm_i915_private *dev_priv,
 static void assert_planes_disabled(struct drm_i915_private *dev_priv,
 				   enum pipe pipe)
 {
+	struct drm_device *dev = dev_priv->dev;
 	int reg, i;
 	u32 val;
 	int cur_pipe;
 
-	/* Planes are fixed to pipes on ILK+ */
-	if (HAS_PCH_SPLIT(dev_priv->dev) || IS_VALLEYVIEW(dev_priv->dev)) {
+	/* Primary planes are fixed to pipes on gen4+ */
+	if (INTEL_INFO(dev)->gen >= 4) {
 		reg = DSPCNTR(pipe);
 		val = I915_READ(reg);
 		WARN((val & DISPLAY_PLANE_ENABLE),
@@ -1117,7 +1118,7 @@  static void assert_planes_disabled(struct drm_i915_private *dev_priv,
 	}
 
 	/* Need to check both planes against the pipe */
-	for (i = 0; i < 2; i++) {
+	for (i = 0; i < INTEL_INFO(dev)->num_pipes; i++) {
 		reg = DSPCNTR(i);
 		val = I915_READ(reg);
 		cur_pipe = (val & DISPPLANE_SEL_PIPE_MASK) >>