[Intel-gfx] [PATCH 2/2]IGD: workaround i2c bus issue in gfx driver side

Shaohua Li shaohua.li at intel.com
Mon Mar 16 09:04:27 CET 2009


On Mon, 2009-03-16 at 15:25 +0800, Wang, Zhenyu Z wrote:
> On 2009.03.16 15:23:26 +0800, Li, Shaohua wrote:
> > On Mon, Mar 16, 2009 at 03:02:28PM +0800, Wang, Zhenyu Z wrote:
> > > On 2009.03.16 14:45:28 +0800, Shaohua Li wrote:
> > > > In IGD, DPCUNIT_CLOCK_GATE_DISABLE bit should be set, otherwise i2c
> > > > access will be wrong.
> > > > 
> > > > Signed-off-by: Shaohua Li <shaohua.li at intel.com>
> > > > ---
> > > >  src/i830_driver.c |    5 +++++
> > > >  1 file changed, 5 insertions(+)
> > > > 
> > > > Index: xf86_video_intel/src/i830_driver.c
> > > > ===================================================================
> > > > --- xf86_video_intel.orig/src/i830_driver.c
> > > > +++ xf86_video_intel/src/i830_driver.c
> > > > @@ -1057,6 +1057,11 @@ I830PreInitDDC(ScrnInfoPtr pScrn)
> > > >  	 pI830->ddc2 = FALSE;
> > > >        }
> > > >     }
> > > > +
> > > > +  if (IS_IGD(pI830)) {
> > > > +        /* Driver is using bit bashing for I2C, this bit should be set to 1 */
> > > > +        OUTREG(DSPCLK_GATE_D, INREG(DSPCLK_GATE_D) | DPCUNIT_CLOCK_GATE_DISABLE);
> > > > +    }
> > > >  }
> > > >  
> > > >  static void
> > > 
> > > Looks this should be in i830_init_clock_gating(), and KMS needs to be ported as well. 
> > i830_init_clock_gating() is called a little later. The bit must be set
> > before any I2C access.
> 
> ok, but it still needs to be added in i830_init_clock_gating() for VT switch right?
> I would suggest to call it before UMS init, as I think future chips might have more
> same problems too, that we can keep this info in one place. Ideas?
Ok, updated patch.

In IGD, DPCUNIT_CLOCK_GATE_DISABLE bit should be set, otherwise i2c
access will be wrong.

Signed-off-by: Shaohua Li <shaohua.li at intel.com>
---
 src/i830_driver.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: xf86_video_intel/src/i830_driver.c
===================================================================
--- xf86_video_intel.orig/src/i830_driver.c
+++ xf86_video_intel/src/i830_driver.c
@@ -998,6 +998,10 @@ i830_init_clock_gating(ScrnInfoPtr pScrn
     } else if (IS_I830(pI830)) {
 	OUTREG(DSPCLK_GATE_D, OVRUNIT_CLOCK_GATE_DISABLE);
     }
+    if (IS_IGD(pI830)) {
+        /* Driver is using bit bashing for I2C, this bit should be set to 1 */
+        OUTREG(DSPCLK_GATE_D, INREG(DSPCLK_GATE_D) | DPCUNIT_CLOCK_GATE_DISABLE);
+    }
 }
 
 static void
@@ -1057,6 +1061,11 @@ I830PreInitDDC(ScrnInfoPtr pScrn)
 	 pI830->ddc2 = FALSE;
       }
    }
+
+    if (IS_IGD(pI830)) {
+        /* Driver is using bit bashing for I2C, this bit should be set to 1 */
+        OUTREG(DSPCLK_GATE_D, INREG(DSPCLK_GATE_D) | DPCUNIT_CLOCK_GATE_DISABLE);
+    }
 }
 
 static void






More information about the Intel-gfx mailing list