All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: don't clear pfit at startup any more
@ 2013-03-06 13:55 Daniel Vetter
  2013-03-19  9:53 ` Mika Kuoppala
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2013-03-06 13:55 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Mika Kuoppala

Since

commit 24a1f16de97c4cf0029d9acd04be06db32208726
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Fri Feb 8 16:35:37 2013 +0200

    drm/i915: disable shared panel fitter for pipe

We clear the single panel fitter when disabling the pipe it's attached to, so no
need to additionally clear it when there's no lvds port detected. Since that
alone isn't good enough e.g. when an external monitor is connected and the bios
uses the panel fitter on that output.

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 502cb28..8567506 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8318,10 +8318,6 @@ static void intel_setup_outputs(struct drm_device *dev)
 	bool has_lvds;
 
 	has_lvds = intel_lvds_init(dev);
-	if (!has_lvds && !HAS_PCH_SPLIT(dev)) {
-		/* disable the panel fitter on everything but LVDS */
-		I915_WRITE(PFIT_CONTROL, 0);
-	}
 
 	if (!(HAS_DDI(dev) && (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
 		intel_crt_init(dev);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: don't clear pfit at startup any more
  2013-03-06 13:55 [PATCH] drm/i915: don't clear pfit at startup any more Daniel Vetter
@ 2013-03-19  9:53 ` Mika Kuoppala
  2013-03-19 12:56   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Mika Kuoppala @ 2013-03-19  9:53 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Daniel Vetter <daniel.vetter@ffwll.ch> writes:

> Since
>
> commit 24a1f16de97c4cf0029d9acd04be06db32208726
> Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Date:   Fri Feb 8 16:35:37 2013 +0200
>
>     drm/i915: disable shared panel fitter for pipe
>
> We clear the single panel fitter when disabling the pipe it's attached to, so no
> need to additionally clear it when there's no lvds port detected. Since that
> alone isn't good enough e.g. when an external monitor is connected and the bios
> uses the panel fitter on that output.
>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_display.c |    4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 502cb28..8567506 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8318,10 +8318,6 @@ static void intel_setup_outputs(struct drm_device *dev)
>  	bool has_lvds;
>  
>  	has_lvds = intel_lvds_init(dev);

You can remove the has_lvds completely and change
the return value of intel_lvds_init to void.

-Mika

> -	if (!has_lvds && !HAS_PCH_SPLIT(dev)) {
> -		/* disable the panel fitter on everything but LVDS */
> -		I915_WRITE(PFIT_CONTROL, 0);
> -	}
>  
>  	if (!(HAS_DDI(dev) && (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
>  		intel_crt_init(dev);
> -- 
> 1.7.10.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] drm/i915: don't clear pfit at startup any more
  2013-03-19  9:53 ` Mika Kuoppala
@ 2013-03-19 12:56   ` Daniel Vetter
  2013-03-20 12:14     ` Mika Kuoppala
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2013-03-19 12:56 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Mika Kuoppala

Since

commit 24a1f16de97c4cf0029d9acd04be06db32208726
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Fri Feb 8 16:35:37 2013 +0200

    drm/i915: disable shared panel fitter for pipe

We clear the single panel fitter when disabling the pipe it's attached to, so no
need to additionally clear it when there's no lvds port detected. Since that
alone isn't good enough e.g. when an external monitor is connected and the bios
uses the panel fitter on that output.

v2: Remove the now unused has_lvds variable and drop the bool return
value from intel_lvds_init, both suggest by Mika Kuoppala.

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c |    7 +------
 drivers/gpu/drm/i915/intel_drv.h     |    2 +-
 drivers/gpu/drm/i915/intel_lvds.c    |   20 ++++++++++----------
 3 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f73fc3d..00f3d0b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8335,13 +8335,8 @@ static void intel_setup_outputs(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_encoder *encoder;
 	bool dpd_is_edp = false;
-	bool has_lvds;
 
-	has_lvds = intel_lvds_init(dev);
-	if (!has_lvds && !HAS_PCH_SPLIT(dev)) {
-		/* disable the panel fitter on everything but LVDS */
-		I915_WRITE(PFIT_CONTROL, 0);
-	}
+	intel_lvds_init(dev);
 
 	if (!(HAS_DDI(dev) && (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
 		intel_crt_init(dev);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index e6f84d0..9e29223 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -459,7 +459,7 @@ extern void intel_tv_init(struct drm_device *dev);
 extern void intel_mark_busy(struct drm_device *dev);
 extern void intel_mark_fb_busy(struct drm_i915_gem_object *obj);
 extern void intel_mark_idle(struct drm_device *dev);
-extern bool intel_lvds_init(struct drm_device *dev);
+extern void intel_lvds_init(struct drm_device *dev);
 extern bool intel_is_dual_link_lvds(struct drm_device *dev);
 extern void intel_dp_init(struct drm_device *dev, int output_reg,
 			  enum port port);
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 6ff145f..5eb74de 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -1037,7 +1037,7 @@ static bool intel_lvds_supported(struct drm_device *dev)
  * Create the connector, register the LVDS DDC bus, and try to figure out what
  * modes we can display on the LVDS panel (if present).
  */
-bool intel_lvds_init(struct drm_device *dev)
+void intel_lvds_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_lvds_encoder *lvds_encoder;
@@ -1055,35 +1055,35 @@ bool intel_lvds_init(struct drm_device *dev)
 	u8 pin;
 
 	if (!intel_lvds_supported(dev))
-		return false;
+		return;
 
 	/* Skip init on machines we know falsely report LVDS */
 	if (dmi_check_system(intel_no_lvds))
-		return false;
+		return;
 
 	pin = GMBUS_PORT_PANEL;
 	if (!lvds_is_present_in_vbt(dev, &pin)) {
 		DRM_DEBUG_KMS("LVDS is not present in VBT\n");
-		return false;
+		return;
 	}
 
 	if (HAS_PCH_SPLIT(dev)) {
 		if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
-			return false;
+			return;
 		if (dev_priv->edp.support) {
 			DRM_DEBUG_KMS("disable LVDS for eDP support\n");
-			return false;
+			return;
 		}
 	}
 
 	lvds_encoder = kzalloc(sizeof(struct intel_lvds_encoder), GFP_KERNEL);
 	if (!lvds_encoder)
-		return false;
+		return;
 
 	lvds_connector = kzalloc(sizeof(struct intel_lvds_connector), GFP_KERNEL);
 	if (!lvds_connector) {
 		kfree(lvds_encoder);
-		return false;
+		return;
 	}
 
 	lvds_encoder->attached_connector = lvds_connector;
@@ -1257,7 +1257,7 @@ out:
 	intel_panel_init(&intel_connector->panel, fixed_mode);
 	intel_panel_setup_backlight(connector);
 
-	return true;
+	return;
 
 failed:
 	DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
@@ -1267,5 +1267,5 @@ failed:
 		drm_mode_destroy(dev, fixed_mode);
 	kfree(lvds_encoder);
 	kfree(lvds_connector);
-	return false;
+	return;
 }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: don't clear pfit at startup any more
  2013-03-19 12:56   ` Daniel Vetter
@ 2013-03-20 12:14     ` Mika Kuoppala
  0 siblings, 0 replies; 4+ messages in thread
From: Mika Kuoppala @ 2013-03-20 12:14 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Daniel Vetter <daniel.vetter@ffwll.ch> writes:

> Since
>
> commit 24a1f16de97c4cf0029d9acd04be06db32208726
> Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Date:   Fri Feb 8 16:35:37 2013 +0200
>
>     drm/i915: disable shared panel fitter for pipe
>
> We clear the single panel fitter when disabling the pipe it's attached to, so no
> need to additionally clear it when there's no lvds port detected. Since that
> alone isn't good enough e.g. when an external monitor is connected and the bios
> uses the panel fitter on that output.
>
> v2: Remove the now unused has_lvds variable and drop the bool return
> value from intel_lvds_init, both suggest by Mika Kuoppala.
>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c |    7 +------
>  drivers/gpu/drm/i915/intel_drv.h     |    2 +-
>  drivers/gpu/drm/i915/intel_lvds.c    |   20 ++++++++++----------
>  3 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f73fc3d..00f3d0b 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8335,13 +8335,8 @@ static void intel_setup_outputs(struct drm_device *dev)
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_encoder *encoder;
>  	bool dpd_is_edp = false;
> -	bool has_lvds;
>  
> -	has_lvds = intel_lvds_init(dev);
> -	if (!has_lvds && !HAS_PCH_SPLIT(dev)) {
> -		/* disable the panel fitter on everything but LVDS */
> -		I915_WRITE(PFIT_CONTROL, 0);
> -	}
> +	intel_lvds_init(dev);
>  
>  	if (!(HAS_DDI(dev) && (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
>  		intel_crt_init(dev);
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index e6f84d0..9e29223 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -459,7 +459,7 @@ extern void intel_tv_init(struct drm_device *dev);
>  extern void intel_mark_busy(struct drm_device *dev);
>  extern void intel_mark_fb_busy(struct drm_i915_gem_object *obj);
>  extern void intel_mark_idle(struct drm_device *dev);
> -extern bool intel_lvds_init(struct drm_device *dev);
> +extern void intel_lvds_init(struct drm_device *dev);
>  extern bool intel_is_dual_link_lvds(struct drm_device *dev);
>  extern void intel_dp_init(struct drm_device *dev, int output_reg,
>  			  enum port port);
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index 6ff145f..5eb74de 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -1037,7 +1037,7 @@ static bool intel_lvds_supported(struct drm_device *dev)
>   * Create the connector, register the LVDS DDC bus, and try to figure out what
>   * modes we can display on the LVDS panel (if present).
>   */
> -bool intel_lvds_init(struct drm_device *dev)
> +void intel_lvds_init(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_lvds_encoder *lvds_encoder;
> @@ -1055,35 +1055,35 @@ bool intel_lvds_init(struct drm_device *dev)
>  	u8 pin;
>  
>  	if (!intel_lvds_supported(dev))
> -		return false;
> +		return;
>  
>  	/* Skip init on machines we know falsely report LVDS */
>  	if (dmi_check_system(intel_no_lvds))
> -		return false;
> +		return;
>  
>  	pin = GMBUS_PORT_PANEL;
>  	if (!lvds_is_present_in_vbt(dev, &pin)) {
>  		DRM_DEBUG_KMS("LVDS is not present in VBT\n");
> -		return false;
> +		return;
>  	}
>  
>  	if (HAS_PCH_SPLIT(dev)) {
>  		if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0)
> -			return false;
> +			return;
>  		if (dev_priv->edp.support) {
>  			DRM_DEBUG_KMS("disable LVDS for eDP support\n");
> -			return false;
> +			return;
>  		}
>  	}
>  
>  	lvds_encoder = kzalloc(sizeof(struct intel_lvds_encoder), GFP_KERNEL);
>  	if (!lvds_encoder)
> -		return false;
> +		return;
>  
>  	lvds_connector = kzalloc(sizeof(struct intel_lvds_connector), GFP_KERNEL);
>  	if (!lvds_connector) {
>  		kfree(lvds_encoder);
> -		return false;
> +		return;
>  	}
>  
>  	lvds_encoder->attached_connector = lvds_connector;
> @@ -1257,7 +1257,7 @@ out:
>  	intel_panel_init(&intel_connector->panel, fixed_mode);
>  	intel_panel_setup_backlight(connector);
>  
> -	return true;
> +	return;
>  
>  failed:
>  	DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
> @@ -1267,5 +1267,5 @@ failed:
>  		drm_mode_destroy(dev, fixed_mode);
>  	kfree(lvds_encoder);
>  	kfree(lvds_connector);
> -	return false;
> +	return;
>  }
> -- 
> 1.7.10.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-20 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-06 13:55 [PATCH] drm/i915: don't clear pfit at startup any more Daniel Vetter
2013-03-19  9:53 ` Mika Kuoppala
2013-03-19 12:56   ` Daniel Vetter
2013-03-20 12:14     ` Mika Kuoppala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.