diff mbox

Find bugs in i915 driver

Message ID D908B1B9E708C047A32444772B58AE88212DC1@SHSMSX101.ccr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xu, Anhua July 31, 2012, 2:29 a.m. UTC
Hi, I found some bugs in i915 driver when reviewing intel_display.c The parameter passed-in for function hdmi/adpa/lvds_pipe_enabled() are not coherent with functions' definition. 
This is the patch. 

Thanks
Eric


commit 9128c5c29649a1eea4e7db9282d0aa57e4885ba8
Author: Xu Anhua <anhua.xu@intel.com>
Date:   Mon Jul 30 20:59:48 2012 +0800

    i915: fix wrong parameter sequence when calling
    	  hdmi/adpa/lvds_pipe_enabled()
    
    When calling hdmi/adpa/lvds_pipe_enabled(),make the
    parameters passed-in coherent with function definitions

Comments

Chris Wilson July 31, 2012, 7:57 a.m. UTC | #1
On Tue, 31 Jul 2012 02:29:01 +0000, "Xu, Anhua" <anhua.xu@intel.com> wrote:
> Hi, I found some bugs in i915 driver when reviewing intel_display.c The parameter passed-in for function hdmi/adpa/lvds_pipe_enabled() are not coherent with functions' definition. 
> This is the patch. 

Patch looks good, you might want to mention that the regression was
introduced with commit 1519b9956eb4b4180fa3f47c73341463cdcfaa37.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f615976..5fc8c8d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1383,7 +1383,7 @@  static void assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv,
 				     enum pipe pipe, int reg)
 {
 	u32 val = I915_READ(reg);
-	WARN(hdmi_pipe_enabled(dev_priv, val, pipe),
+	WARN(hdmi_pipe_enabled(dev_priv, pipe, val),
 	     "PCH HDMI (0x%08x) enabled on transcoder %c, should be disabled\n",
 	     reg, pipe_name(pipe));
 
@@ -1403,13 +1403,13 @@  static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
 
 	reg = PCH_ADPA;
 	val = I915_READ(reg);
-	WARN(adpa_pipe_enabled(dev_priv, val, pipe),
+	WARN(adpa_pipe_enabled(dev_priv, pipe, val),
 	     "PCH VGA enabled on transcoder %c, should be disabled\n",
 	     pipe_name(pipe));
 
 	reg = PCH_LVDS;
 	val = I915_READ(reg);
-	WARN(lvds_pipe_enabled(dev_priv, val, pipe),
+	WARN(lvds_pipe_enabled(dev_priv, pipe, val),
 	     "PCH LVDS enabled on transcoder %c, should be disabled\n",
 	     pipe_name(pipe));
 
@@ -1871,7 +1871,7 @@  static void disable_pch_hdmi(struct drm_i915_private *dev_priv,
 			     enum pipe pipe, int reg)
 {
 	u32 val = I915_READ(reg);
-	if (hdmi_pipe_enabled(dev_priv, val, pipe)) {
+	if (hdmi_pipe_enabled(dev_priv, pipe, val)) {
 		DRM_DEBUG_KMS("Disabling pch HDMI %x on pipe %d\n",
 			      reg, pipe);
 		I915_WRITE(reg, val & ~PORT_ENABLE);
@@ -1893,12 +1893,12 @@  static void intel_disable_pch_ports(struct drm_i915_private *dev_priv,
 
 	reg = PCH_ADPA;
 	val = I915_READ(reg);
-	if (adpa_pipe_enabled(dev_priv, val, pipe))
+	if (adpa_pipe_enabled(dev_priv, pipe, val))
 		I915_WRITE(reg, val & ~ADPA_DAC_ENABLE);
 
 	reg = PCH_LVDS;
 	val = I915_READ(reg);
-	if (lvds_pipe_enabled(dev_priv, val, pipe)) {
+	if (lvds_pipe_enabled(dev_priv, pipe, val)) {
 		DRM_DEBUG_KMS("disable lvds on pipe %d val 0x%08x\n", pipe, val);
 		I915_WRITE(reg, val & ~LVDS_PORT_EN);
 		POSTING_READ(reg);