summaryrefslogtreecommitdiff
path: root/src/i830_sdvo.c
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2009-04-24 10:55:09 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2009-04-24 10:55:09 +0800
commit106e4b44c5af6552cbd079c4ec34def9dcfb168a (patch)
tree39755db469a466d3d7e7f1a3ecd3f43d3696d32a /src/i830_sdvo.c
parent8f64837e56b2de0fb8a9100d1a844fd3f18d751c (diff)
SDVO: switch bus once for i2c transfer
Before sdvo try to get edid by i2c bus, it must do switch control bus to ddc active state from sdvo only state. However if current state has been ddc active state, redundant switch operation in our driver will cause error- "Unable to write to SDVOCTRL_E for SDVOB Slave 0x70". The patch will do switch control bus only one time during whole edid transmission. It has fixed bug #19937 Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Tested-by: Ma Ling <ling.ma@intel.com> Signed-off-by: Ma Ling <ling.ma@intel.com>
Diffstat (limited to 'src/i830_sdvo.c')
-rw-r--r--src/i830_sdvo.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index a291824b..a4c9120e 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -114,6 +114,9 @@ struct i830_sdvo_priv {
/* Default 0 for full RGB range 0-255, 1 is for RGB range 16-235 */
uint32_t broadcast_rgb;
+ /** This flag means if we should switch ddc bus before next i2c Start */
+ Bool ddc_bus_switch;
+
/** State for save/restore */
/** @{ */
int save_sdvo_mult;
@@ -1403,7 +1406,10 @@ i830_sdvo_ddc_i2c_start(I2CBusPtr b, int timeout)
I2CBusPtr i2cbus = intel_output->pI2CBus;
struct i830_sdvo_priv *dev_priv = intel_output->dev_priv;
- i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus);
+ if (dev_priv->ddc_bus_switch) {
+ i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus);
+ dev_priv->ddc_bus_switch = FALSE;
+ }
return i2cbus->I2CStart(i2cbus, timeout);
}
@@ -1414,11 +1420,13 @@ i830_sdvo_ddc_i2c_stop(I2CDevPtr d)
xf86OutputPtr output = d->pI2CBus->DriverPrivate.ptr;
I830OutputPrivatePtr intel_output = output->driver_private;
I2CBusPtr i2cbus = intel_output->pI2CBus, savebus;
+ struct i830_sdvo_priv *dev_priv = intel_output->dev_priv;
savebus = d->pI2CBus;
d->pI2CBus = i2cbus;
i2cbus->I2CStop(d);
d->pI2CBus = savebus;
+ dev_priv->ddc_bus_switch = TRUE;
}
/**
@@ -1721,7 +1729,6 @@ i830_sdvo_detect(xf86OutputPtr output)
{
xf86MonPtr edid_mon;
/* Check EDID in DVI-I case */
- i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus);
edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
if (edid_mon && !DIGITAL(edid_mon->features.input_type)) {
xfree(edid_mon);
@@ -2199,6 +2206,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
ddcbus->I2CStop = i830_sdvo_ddc_i2c_stop;
ddcbus->I2CAddress = i830_sdvo_ddc_i2c_address;
ddcbus->DriverPrivate.ptr = output;
+ dev_priv->ddc_bus_switch = TRUE;
if (!xf86I2CBusInit(ddcbus))
{