Bug 36221 - KMS with X1950 XT i2c error --> no ddc
Summary: KMS with X1950 XT i2c error --> no ddc
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Radeon (show other bugs)
Version: unspecified
Hardware: All All
: medium critical
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-13 13:41 UTC by revealed
Modified: 2011-04-30 08:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
vbios.rom (61.50 KB, application/octet-stream)
2011-04-13 13:41 UTC, revealed
no flags Details
Full dmesg containing the i2c error (64.33 KB, text/plain)
2011-04-13 13:43 UTC, revealed
no flags Details
lspci -vnn (11.89 KB, text/plain)
2011-04-14 09:23 UTC, revealed
no flags Details
possible fix (1.28 KB, patch)
2011-04-14 11:06 UTC, Alex Deucher
no flags Details | Splinter Review
better fix (2.34 KB, patch)
2011-04-14 14:03 UTC, Alex Deucher
no flags Details | Splinter Review
i2c-algo-bit.c from SuSE rpm; ?? (15.97 KB, patch)
2011-04-14 15:27 UTC, revealed
no flags Details | Splinter Review
2.6.37 patch (1.18 KB, patch)
2011-04-14 15:31 UTC, Alex Deucher
no flags Details | Splinter Review

Description revealed 2011-04-13 13:41:00 UTC
Hello!

This is the operating system and kernel:

cat /etc/SuSE-release
openSUSE 11.4 (i586)
VERSION = 11.4
CODENAME = Celadon

uname -rio
2.6.37.1-1.2-desktop i386 GNU/Linux


When trying to boot with Kernelmodesetting there is no DDC due to an i2c error resulting in a blank screen.

I was told in irc channel #radeon to open a bugreport and attache vbios.rom and dmesg of a boot with KMS enabled;

I hope you can help me out!

Many thanks for all your Help!

Greetings,

R
Comment 1 revealed 2011-04-13 13:41:58 UTC
Created attachment 45589 [details]
vbios.rom
Comment 2 revealed 2011-04-13 13:43:06 UTC
Created attachment 45590 [details]
Full dmesg containing the i2c error
Comment 3 revealed 2011-04-14 09:23:32 UTC
Created attachment 45615 [details]
lspci -vnn
Comment 4 Alex Deucher 2011-04-14 09:44:35 UTC
Does booting with:
i2c-algo-bit.bit_test=0
on the kernel command line in grub fix the issue?
Comment 5 revealed 2011-04-14 09:58:55 UTC
Yes :D

Computer boots up fine with this switch! Love that! :D

Is that fixable?

Many thanks!

Greetings,

R
Comment 6 Alex Deucher 2011-04-14 10:30:21 UTC
(In reply to comment #5)
> Yes :D
> 
> Computer boots up fine with this switch! Love that! :D
> 
> Is that fixable?

The default value for i2c-algo-bit.bit_test is 0.  For some reason Suse sets it to 1.  You can manually adjust it by editing the i2c_algo_bit entry in the files in /etc/modprobe.d/
Comment 7 revealed 2011-04-14 10:48:28 UTC
Ha!

So the problem seems to have existed due to my TV-Card:

cd /etc/modprobe.d/
disk@wild-thing:/etc/modprobe.d> grep i2c *
50-blacklist.conf:blacklist i2c-matroxfb
50-tv.conf:options i2c-algo-bit bit_test=1

Man!! :D I thank you so much! I dont know why this is enabled in 50-tv.conf;
I have a Hauppauge PVR 150. I dont know if this has to be enabled for it. But it is... 

Greetings,

R
Comment 8 revealed 2011-04-14 10:58:39 UTC
Sorry for doubleposting:

I added the option to menu.lst; As workaround. Thank you for the hint!

Also i tried commenting out the option in 50-tv.conf; And i removed the newly added bootparameter for a test. 

The issue came back in this constellation. So the value seems to be set as default.

Possible requirement for my TV-Card?

I can live with adding this as bootparameter to menu.lst

Many Thanks!
Comment 9 Alex Deucher 2011-04-14 11:05:36 UTC
(In reply to comment #8)
> Sorry for doubleposting:
> 
> I added the option to menu.lst; As workaround. Thank you for the hint!
> 
> Also i tried commenting out the option in 50-tv.conf; And i removed the newly
> added bootparameter for a test. 
> 
> The issue came back in this constellation. So the value seems to be set as
> default.

odd.  maybe your distro changed the default in their kernel source.

> 
> Possible requirement for my TV-Card?

No.  It's a debugging option for i2c.  You could potentially run into the same issue with another driver that uses i2c bit algo.
Comment 10 Alex Deucher 2011-04-14 11:06:31 UTC
Created attachment 45619 [details] [review]
possible fix

This patch should fix the issue.
Comment 11 Alex Deucher 2011-04-14 11:10:36 UTC
Leave this open until we get some feedback from Suse or the i2c people.
Comment 12 revealed 2011-04-14 11:14:14 UTC
Oh yes :)

Sorry! I have to also omit that i have an open bugreport at novell bugzilla since februar. I was getting few response. Thats the reason i opened this bugreport here.

I set that one in novel bugzilla to resolved.

https://bugzilla.novell.com/show_bug.cgi?id=669937 

I know this is a very unkind multiposting from me. I want to apologize for this.
I guess the report in novell bugzilla is unnecessary now?
Comment 13 Alex Deucher 2011-04-14 12:37:33 UTC
(In reply to comment #12)
> Oh yes :)
> 
> Sorry! I have to also omit that i have an open bugreport at novell bugzilla
> since februar. I was getting few response. Thats the reason i opened this
> bugreport here.
> 
> I set that one in novel bugzilla to resolved.
> 
> https://bugzilla.novell.com/show_bug.cgi?id=669937 
> 
> I know this is a very unkind multiposting from me. I want to apologize for
> this.

No worries :)

> I guess the report in novell bugzilla is unnecessary now?

Leave it open for now.  They might have some ideas why i2c-algo-bit.bit_test=1 is set by default.
Comment 14 revealed 2011-04-14 13:13:47 UTC
Ok. I am so happy at the moment having working desktop effects and such :D
Comment 15 Alex Deucher 2011-04-14 14:03:58 UTC
Created attachment 45633 [details] [review]
better fix

Is there any way you could test this patch?
Comment 16 revealed 2011-04-14 14:22:20 UTC
I would!

Do i have to edit the file in:
/usr/src/linux-2.6.37.1-1.2/drivers/i2c/algos/i2c-algo-bit.c

And make the i2c-algo-bit somehow? I cant remember properly if i can recompile a single module? I dont need to translate the whole kernel?

Can give me a hint?

Greetings,

R
Comment 17 Alex Deucher 2011-04-14 14:28:40 UTC
(In reply to comment #16)
> I would!
> 
> Do i have to edit the file in:
> /usr/src/linux-2.6.37.1-1.2/drivers/i2c/algos/i2c-algo-bit.c

yes, just download the patch into /usr/src/linux-2.6.37.1-1.2/ and run:
patch -p1 -i 0001-i2c-algo-bit-make-sure-to-call-pre-post_xfer-for-bit.patch

> 
> And make the i2c-algo-bit somehow? I cant remember properly if i can recompile
> a single module? I dont need to translate the whole kernel?
> 

from /usr/src/linux-2.6.37.1-1.2/ run:
make
make modules
make modules_install
make install
and select the new kernel in grub.
Comment 18 revealed 2011-04-14 14:34:47 UTC
Ok i will do but i have one question:

The last line to add from the diff looks different in my version:

My Version says:

     if (bit_test) {
                int ret = test_bus(bit_adap, adap->name);
                if (ret < 0)
                        return -ENODEV;
        }


Do i have to remove the 'int' too?

Many thanks!
Comment 19 Alex Deucher 2011-04-14 14:39:07 UTC
(In reply to comment #18)
> Ok i will do but i have one question:
> 
> The last line to add from the diff looks different in my version:
> 
> My Version says:
> 
>      if (bit_test) {
>                 int ret = test_bus(bit_adap, adap->name);
>                 if (ret < 0)
>                         return -ENODEV;
>         }
> 
> 
> Do i have to remove the 'int' too?
>

in your case keep it.  Change it to:
int ret = test_bus(adap, adap->name);
Comment 20 revealed 2011-04-14 14:41:15 UTC
done! 

Will proceed with steps from comment 17.

Greetings,
Comment 21 revealed 2011-04-14 14:44:09 UTC
I did:
make oldconfig

now i am running make?
Comment 22 revealed 2011-04-14 15:05:08 UTC
drivers/i2c/algos/i2c-algo-bit.c: In Funktion »test_bus«:
drivers/i2c/algos/i2c-algo-bit.c:237:28: Fehler: »adap« als andere Symbolart redeklariert
drivers/i2c/algos/i2c-algo-bit.c:235:47: Anmerkung: Vorherige Definition von »adap« war hier
drivers/i2c/algos/i2c-algo-bit.c:237:35: Fehler: »i2c_adap« undeclared (first use in this function)
drivers/i2c/algos/i2c-algo-bit.c:237:35: Anmerkung: each undeclared identifier is reported only once for each function it appears in
drivers/i2c/algos/i2c-algo-bit.c: In Funktion »i2c_bit_prepare_bus«:
drivers/i2c/algos/i2c-algo-bit.c:623:3: Warnung: Übergabe des Arguments 1 von »test_bus« von inkompatiblem Zeigertyp
drivers/i2c/algos/i2c-algo-bit.c:235:12: Anmerkung: expected »struct i2c_algo_bit_data *« but argument is of type »struct i2c_adapter *«
drivers/i2c/algos/i2c-algo-bit.c:620:28: Warnung: Variable »bit_adap« wird nicht verwendet
make[3]: *** [drivers/i2c/algos/i2c-algo-bit.o] Error 1
make[2]: *** [drivers/i2c/algos] Error 2
make[1]: *** [drivers/i2c] Error 2
make: *** [drivers] Fehler 2
Comment 23 revealed 2011-04-14 15:16:35 UTC
patch -p1 -i 0001-i2c-algo-bit-make-sure-to-call-pre-post_xfer-for-bit.patch
patching file drivers/i2c/algos/i2c-algo-bit.c
Hunk #1 FAILED at 232.
Hunk #2 FAILED at 297.
Hunk #3 FAILED at 607.
3 out of 3 hunks FAILED -- saving rejects to file drivers/i2c/algos/i2c-algo-bit.c.rej
Comment 24 revealed 2011-04-14 15:20:03 UTC
Starting new with the downloaded patch and the original file from SUSE rpm i get the following output in the rej. file when issuing the:
Patch command: (forget my last both postings, please).

--- drivers/i2c/algos/i2c-algo-bit.c
+++ drivers/i2c/algos/i2c-algo-bit.c
@@ -622,7 +637,7 @@
        int ret;
 
        if (bit_test) {
-               ret = test_bus(bit_adap, adap->name);
+               ret = test_bus(adap, adap->name);
                if (ret < 0)
                        return -ENODEV;
        }
drivers/i2c/algos/i2c-algo-bit.c.rej lines 1-11/11 (END) 

I guess there is something wrong with the patch?
Comment 25 revealed 2011-04-14 15:21:32 UTC
But if i run make with this file, i get:

 CC [M]  drivers/i2c/algos/i2c-algo-bit.o
drivers/i2c/algos/i2c-algo-bit.c: In Funktion »i2c_bit_prepare_bus«:
drivers/i2c/algos/i2c-algo-bit.c:623:3: Warnung: Übergabe des Arguments 1 von »test_bus« von inkompatiblem Zeigertyp
drivers/i2c/algos/i2c-algo-bit.c:235:12: Anmerkung: expected »struct i2c_adapter *« but argument is of type »struct i2c_algo_bit_data *«
  CC [M]  drivers/i2c/algos/i2c-algo-pca.o
  LD      drivers/i2c/busses/built-in.o

And it continues.
Comment 26 revealed 2011-04-14 15:27:06 UTC
Created attachment 45636 [details] [review]
i2c-algo-bit.c from SuSE rpm; ??
Comment 27 Alex Deucher 2011-04-14 15:31:11 UTC
Created attachment 45637 [details] [review]
2.6.37 patch

looks like the file changed slightly in newer kernels.  Try this patch.
Comment 28 revealed 2011-04-14 15:37:54 UTC
With this patch i get:

drivers/i2c/algos/i2c-algo-bit.c: In Funktion »i2c_bit_prepare_bus«:
drivers/i2c/algos/i2c-algo-bit.c:620:28: Warnung: Variable »bit_adap« wird nicht verwendet

--- Make continues???
Comment 29 revealed 2011-04-14 15:39:05 UTC
I am always patching a fresh copy of i2c-algo-bit.c from SuSE rpm; ?? Is this correct?
Comment 30 Alex Deucher 2011-04-14 16:05:09 UTC
(In reply to comment #28)
> With this patch i get:
> 
> drivers/i2c/algos/i2c-algo-bit.c: In Funktion »i2c_bit_prepare_bus«:
> drivers/i2c/algos/i2c-algo-bit.c:620:28: Warnung: Variable »bit_adap« wird
> nicht verwendet
> 
> --- Make continues???

you can ignore it or remove this line in i2c_bit_prepare_bus():
struct i2c_algo_bit_data *bit_adap = adap->algo_data;

It's just saying the variable is unused.
Comment 31 revealed 2011-04-14 16:06:56 UTC
So if i ignore this now, i can continue with:

make modules
make modules_install
make install
and select the new kernel in grub.

And it should work?

greetings,

R
Comment 32 Alex Deucher 2011-04-14 16:09:29 UTC
(In reply to comment #31)
> So if i ignore this now, i can continue with:
> 
> make modules
> make modules_install
> make install
> and select the new kernel in grub.
> 
> And it should work?

yes.  make sure you remove i2c-algo-bit.bit_test=0 from your grub config when testing it.
Comment 33 revealed 2011-04-14 16:11:04 UTC
Yes i will... make is still processing at net/xy ... i guess this will take some time.
Comment 34 revealed 2011-04-14 16:33:22 UTC
Will reboot and test now!
Comment 35 revealed 2011-04-14 16:38:08 UTC
Seems to work fine!

disk@wild-thing:~> grep command /var/log/boot.msg
<5>[    0.000000] Kernel command line: root=/dev/sdc6 resume=/dev/sdc5 splash=silent
disk@wild-thing:~> dmesg | grep i2c
[    8.316773] ivtv0: Reopen i2c bus for IR-blaster support
[    8.522473] cx25840 5-0044: cx25843-23 found @ 0x88 (ivtv i2c driver #0)
[    8.656997] tuner 5-0061: chip found @ 0xc2 (ivtv i2c driver #0)
[    8.889160] wm8775 5-001b: chip found @ 0x36 (ivtv i2c driver #0)
[   29.856130] input: i2c IR (Hauppauge WinTV PVR-150 as /devices/virtual/rc/rc0/input6
[   29.856207] rc0: i2c IR (Hauppauge WinTV PVR-150 as /devices/virtual/rc/rc0
[   29.856210] ir-kbd-i2c: i2c IR (Hauppauge WinTV PVR-150 detected at i2c-5/5-0071/ir0 [ivtv i2c driver #0]
disk@wild-thing:~> dmesg | grep drm
[    2.461044] [drm] Initialized drm 1.1.0 20060810
[    2.513747] [drm] radeon defaulting to kernel modesetting.
[    2.513801] [drm] radeon kernel modesetting enabled.
[    2.515575] [drm] initializing kernel modesetting (R580 0x1002:0x7240).
[    2.515685] [drm] register mmio base: 0xFF7F0000
[    2.515733] [drm] register mmio size: 65536
[    2.517031] [drm] Generation 2 PCI interface, using max accessible memory
[    2.517335] [drm] radeon: irq initialized.
[    2.517455] [drm] Detected VRAM RAM=512M, BAR=256M
[    2.517502] [drm] RAM width 256bits DDR
[    2.517739] [drm] radeon: 512M of VRAM memory ready
[    2.517786] [drm] radeon: 512M of GTT memory ready.
[    2.517845] [drm] GART: num cpu pages 131072, num gpu pages 131072
[    2.519502] [drm] radeon: 4 quad pipes, 1 z pipes initialized.
[    2.520495] [drm] PCIE GART of 512M enabled (table at 0x00040000).
[    2.520643] [drm] Loading R500 Microcode
[    2.522154] [drm] radeon: ring at 0x0000000020001000
[    2.522225] [drm] ring test succeeded in 3 usecs
[    2.522411] [drm] radeon: ib pool ready.
[    2.522519] [drm] ib test succeeded in 0 usecs
[    2.523408] [drm] Radeon Display Connectors
[    2.523456] [drm] Connector 0:
[    2.523502] [drm]   DVI-I
[    2.523568] [drm]   HPD2
[    2.523621] [drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
[    2.523709] [drm]   Encoders:
[    2.523762] [drm]     CRT1: INTERNAL_KLDSCP_DAC1
[    2.523809] [drm]     DFP3: INTERNAL_LVTM1
[    2.523874] [drm] Connector 1:
[    2.523926] [drm]   S-video
[    2.523972] [drm]   Encoders:
[    2.524050] [drm]     TV1: INTERNAL_KLDSCP_DAC2
[    2.524104] [drm] Connector 2:
[    2.524150] [drm]   DVI-I
[    2.524214] [drm]   HPD1
[    2.524267] [drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
[    2.524354] [drm]   Encoders:
[    2.524407] [drm]     CRT2: INTERNAL_KLDSCP_DAC2
[    2.524454] [drm]     DFP1: INTERNAL_KLDSCP_TMDS1
[    2.636077] [drm] Possible lm64 thermal controller at 0x18
[    2.636172] [drm] radeon: power management initialized
[    2.762666] [drm] fb mappable at 0xC00C0000
[    2.762722] [drm] vram apper at 0xC0000000
[    2.762775] [drm] size 9216000
[    2.762827] [drm] fb depth is 24
[    2.762879] [drm]    pitch is 7680
[    2.775905] fb0: radeondrmfb frame buffer device
[    2.775926] drm: registered panic notifier
[    2.775949] [drm] Initialized radeon 2.7.0 20080528 for 0000:01:00.0 on minor 0
Comment 36 Alex Deucher 2011-04-14 16:44:28 UTC
(In reply to comment #35)
> Seems to work fine!

Great!  thanks for testing.
Comment 37 revealed 2011-04-14 16:48:54 UTC
Whats next for me?

Can i run make clean all on /usr/src/linux-2x? And wait for an Update`?
Comment 38 Alex Deucher 2011-04-14 16:52:11 UTC
(In reply to comment #37)
> Whats next for me?
> 
> Can i run make clean all on /usr/src/linux-2x? And wait for an Update`?

I've sent the patch to the linux i2c list to be hopefully applied upstream.  It's up to the distros to pick up the patch in the meantime.
Comment 39 Alex Deucher 2011-04-14 16:53:01 UTC
(In reply to comment #38)
> (In reply to comment #37)
> > Whats next for me?
> > 
> > Can i run make clean all on /usr/src/linux-2x? And wait for an Update`?
> 
> I've sent the patch to the linux i2c list to be hopefully applied upstream. 
> It's up to the distros to pick up the patch in the meantime.

Or they can set i2c-algo-bit.bit_test=0 in the interim.
Comment 40 revealed 2011-04-14 16:58:21 UTC
wow ok. 

Then i will keep the patch and cleanup the source.

Many thanks for all your help. I will go to bed now. It is close to two o clock in the morning in my place.

Thank you very much once more :D
Comment 41 revealed 2011-04-30 03:45:31 UTC
Hello!

No problem anymore with 2.6.37.6-0.5-desktop i386 GNU/Linux

Many thanks for your Help! 

Greetings,

R
Comment 42 Alex Deucher 2011-04-30 08:17:24 UTC
The fix is upstream now.  Please reopen if it's still an issue.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.