diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-04-23 13:53:14 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-05-18 23:15:16 -0400 |
commit | 7e99a9b2b5386c0ea4234d2845932ff4ab8e4829 (patch) | |
tree | bdfeb4afdf4d8c3627352c3347a669656b68a497 /drivers/gpu/drm | |
parent | 07fee3d561eb7634b08e4362dc9c5c5708facd03 (diff) |
drm/nv50: fix monitor detection on certain chipsets
There appears to be some kind of switch on certain chips to control whether
the DP auxch or traditional i2c bus will be operational on a connector,
this commit hopefully fixes nouveau to do the right thing.
Likely only relevent on chips with DP outputs.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_i2c.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index 88583e7bf651..316a3c7e6eb4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c | |||
@@ -254,16 +254,27 @@ struct nouveau_i2c_chan * | |||
254 | nouveau_i2c_find(struct drm_device *dev, int index) | 254 | nouveau_i2c_find(struct drm_device *dev, int index) |
255 | { | 255 | { |
256 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 256 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
257 | struct nvbios *bios = &dev_priv->vbios; | 257 | struct dcb_i2c_entry *i2c = &dev_priv->vbios.dcb.i2c[index]; |
258 | 258 | ||
259 | if (index >= DCB_MAX_NUM_I2C_ENTRIES) | 259 | if (index >= DCB_MAX_NUM_I2C_ENTRIES) |
260 | return NULL; | 260 | return NULL; |
261 | 261 | ||
262 | if (!bios->dcb.i2c[index].chan) { | 262 | if (dev_priv->chipset >= NV_50 && (i2c->entry & 0x00000100)) { |
263 | if (nouveau_i2c_init(dev, &bios->dcb.i2c[index], index)) | 263 | uint32_t reg = 0xe500, val; |
264 | return NULL; | 264 | |
265 | if (i2c->port_type == 6) { | ||
266 | reg += i2c->read * 0x50; | ||
267 | val = 0x2002; | ||
268 | } else { | ||
269 | reg += ((i2c->entry & 0x1e00) >> 9) * 0x50; | ||
270 | val = 0xe001; | ||
271 | } | ||
272 | |||
273 | nv_wr32(dev, reg, (nv_rd32(dev, reg) & ~0xf003) | val); | ||
265 | } | 274 | } |
266 | 275 | ||
267 | return bios->dcb.i2c[index].chan; | 276 | if (!i2c->chan && nouveau_i2c_init(dev, i2c, index)) |
277 | return NULL; | ||
278 | return i2c->chan; | ||
268 | } | 279 | } |
269 | 280 | ||