Signed-off-by: Viktor Novotny <novik...@seznam.cz>
---
Hi,
I think I found a bug - my NV11 fails to init i2c ports and is then unable to 
read EDID.
It's because while i2c_table in nouveau_i2c.c:324 returns null for this card,
i2c is initialized anyway at line 341 and wrong i2c table format is then 
selected at line 350.
This patch fixes the problem on NV11 and was tested also on NV25. I hope no 
cards but those
with legacy i2c table have i2c table version set to 0.

Regards
        Viktor

 drivers/gpu/drm/nouveau/nouveau_i2c.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c 
b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index 820ae7f..57bcbc3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -344,14 +344,15 @@ nouveau_i2c_init(struct drm_device *dev)
                if (i2c[5]) legacy[0][1] = i2c[5];
                if (i2c[6]) legacy[1][0] = i2c[6];
                if (i2c[7]) legacy[1][1] = i2c[7];
+               version = 0;
        }
 
-       if (i2c && version >= 0x30) {
+       if (version >= 0x30) {
                entry     = i2c[1] + i2c;
                entries   = i2c[2];
                recordlen = i2c[3];
        } else
-       if (i2c) {
+       if (version > 0) {
                entry     = i2c;
                entries   = 16;
                recordlen = 4;
-- 
1.7.8.3

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to