Bug 18393 - Failed to detect monitor connection
Summary: Failed to detect monitor connection
Status: RESOLVED WONTFIX
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/radeonhd (show other bugs)
Version: git
Hardware: Other FreeBSD
: medium normal
Assignee: Egbert Eich
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-05 11:57 UTC by Jung-uk Kim
Modified: 2011-11-07 15:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
verbose log with git version (59.04 KB, text/plain)
2008-11-05 11:57 UTC, Jung-uk Kim
no flags Details
workaround for both RandR and non-RandR (1.61 KB, patch)
2008-11-05 11:59 UTC, Jung-uk Kim
no flags Details | Splinter Review
verbose log with the workaround (RandR) (77.70 KB, text/plain)
2008-11-05 12:01 UTC, Jung-uk Kim
no flags Details
verbose log with the workaround (non-RandR) (70.19 KB, text/plain)
2008-11-05 12:03 UTC, Jung-uk Kim
no flags Details
A hack to make rhd_conntest working on my box (1006 bytes, patch)
2008-11-11 15:11 UTC, Jung-uk Kim
no flags Details | Splinter Review
VGA option ROM for HDMI port (58.50 KB, application/octet-stream)
2008-11-17 10:13 UTC, Jung-uk Kim
no flags Details
VGA option ROM for DVI port (58.50 KB, application/octet-stream)
2008-11-17 10:14 UTC, Jung-uk Kim
no flags Details
verbose log with ATOM BIOS and HDMI port (123.33 KB, text/plain)
2008-11-17 10:16 UTC, Jung-uk Kim
no flags Details
verbose log with ATOM BIOS and DVI port (121.83 KB, text/plain)
2008-11-17 10:16 UTC, Jung-uk Kim
no flags Details
Fix. (468 bytes, patch)
2008-11-24 12:36 UTC, Egbert Eich
no flags Details | Splinter Review
A patch that works reliably for me. (1.83 KB, patch)
2008-11-24 14:50 UTC, Jung-uk Kim
no flags Details | Splinter Review

Description Jung-uk Kim 2008-11-05 11:57:06 UTC
Created attachment 20080 [details]
verbose log with git version

Motherboard: Foxconn A7GM-S (RS780)

Sense() always fails to detected VGA monitor and HPD for HDMI port always succeeds.
Comment 1 Jung-uk Kim 2008-11-05 11:59:45 UTC
Created attachment 20081 [details] [review]
workaround for both RandR and non-RandR

This patch lets me start X server on VGA monitor.
Comment 2 Jung-uk Kim 2008-11-05 12:01:48 UTC
Created attachment 20082 [details]
verbose log with the workaround (RandR)
Comment 3 Jung-uk Kim 2008-11-05 12:03:18 UTC
Created attachment 20083 [details]
verbose log with the workaround (non-RandR)
Comment 4 Egbert Eich 2008-11-10 14:22:15 UTC
Kim, I'm a little reluctant to do something like the first patch as this is the first time we are running into this issue.
I would prefer to find out why sensing isn't working for you.
Could you please run rhd_conntest, for the case of
a. nothing connected
b. VGA connected
c. DVI connected
This may get us some information on what's going on.
Thanks!

A note on the side: the change to rhd_randr.c should not matter. There is a set of brackets missing, but this should be irrelevant, too.
Comment 5 Jung-uk Kim 2008-11-11 15:09:33 UTC
(In reply to comment #4)
> Kim, I'm a little reluctant to do something like the first patch as this is the
> first time we are running into this issue.
> I would prefer to find out why sensing isn't working for you.
> Could you please run rhd_conntest, for the case of
> a. nothing connected
> b. VGA connected
> c. DVI connected

Please note the rhd_conntest only works for Linux with procfs or sysfs because libpci does not fill sizes.  I had to hack rhd_conntest.c to do it.  Also note that I do not have DVI monitor to test.

a. nothing connected
rhd_conntest: v1.2.3, git branch master, commit 680f05ac + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 

b. VGA connected
rhd_conntest: v1.2.3, git branch master, commit 680f05ac + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0

> This may get us some information on what's going on.
> Thanks!
> 
> A note on the side: the change to rhd_randr.c should not matter. There is a set
> of brackets missing, but this should be irrelevant, too.

I know but it was confusing because of the indentation. ;-)

Thanks!
Comment 6 Jung-uk Kim 2008-11-11 15:11:42 UTC
Created attachment 20230 [details] [review]
A hack to make rhd_conntest working on my box
Comment 7 SEanS 2008-11-13 04:59:49 UTC
I am a i386 and amd64 FBD 7.0 & 7.1 guy and can only report  "b" on all with
two MSI-4870 cards.

Hope this helps you/us.

SEanS


2008/11/10 <bugzilla-daemon@freedesktop.org>

> http://bugs.freedesktop.org/show_bug.cgi?id=18393
>
>
>
>
>
> --- Comment #4 from Egbert Eich <eich@pdx.freedesktop.org>  2008-11-10
> 14:22:15 PST ---
> Kim, I'm a little reluctant to do something like the first patch as this is
> the
> first time we are running into this issue.
> I would prefer to find out why sensing isn't working for you.
> Could you please run rhd_conntest, for the case of
> a. nothing connected
> b. VGA connected
> c. DVI connected
> This may get us some information on what's going on.
> Thanks!
>
> A note on the side: the change to rhd_randr.c should not matter. There is a
> set
> of brackets missing, but this should be irrelevant, too.
>
>
> --
> Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the QA contact for the bug.
> _______________________________________________
> xorg-team mailing list
> xorg-team@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-team
> --
> To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org<radeonhd%2Bunsubscribe@opensuse.org>
> For additional commands, e-mail: radeonhd+help@opensuse.org<radeonhd%2Bhelp@opensuse.org>
>
>
Comment 8 Egbert Eich 2008-11-16 04:45:34 UTC
Kim, 
a. on FreeBSD you don't get the sizes filled in when you call pci_fill_info() with   PCI_FILL_SIZES? bummer! I agree that this call needs to be added and we also need some fallback if the sizes are not filled in. So your rhd_conntest fix looks ok.
I may probably wrap things with '#if defined (__FreeBSD__)' for now.
b. Could you switch to use AtomBIOS and see if load detection works there?
If it does i need to have a look at your BIOS.
To do this please add the option: 
    Option "UseAtomBIOS" "yes"
to the device section of your xorg.conf and create a logverbose 7 log for the output.
I'm going to mark HPD as broken for your chip for now.
c.
>> A note on the side: the change to rhd_randr.c should not matter. There is a set
>> of brackets missing, but this should be irrelevant, too.
>
>I know but it was confusing because of the indentation. ;-)
Right. Saw that, should be fixed now :)

Thanks for hanging in so patiently :)
Comment 9 Jung-uk Kim 2008-11-17 10:11:14 UTC
(In reply to comment #8)
> Kim, 
> a. on FreeBSD you don't get the sizes filled in when you call pci_fill_info()
> with   PCI_FILL_SIZES? bummer! I agree that this call needs to be added and we
> also need some fallback if the sizes are not filled in. So your rhd_conntest
> fix looks ok.
> I may probably wrap things with '#if defined (__FreeBSD__)' for now.

I see that you already checked it in.  Thanks.  However, I believe it is more like this:

@@ -547,7 +547,7 @@ MapBar(struct pci_dev *device, int ioBar, int devMem)
 
     pci_fill_info(device, PCI_FILL_BASES | PCI_FILL_SIZES);
     if (!device->base_addr[ioBar]
-#if !defined (__FreeBSD__)
+#if defined (__linux__)
        || !device->size[ioBar]
 #endif
        )

or you don't want to check at all because only Linux with procfs or sysfs fills it up by default, as I said.  For other platforms, libpci does/can not fill the sizes according to libpci sources.

> b. Could you switch to use AtomBIOS and see if load detection works there?
> If it does i need to have a look at your BIOS.
> To do this please add the option: 
>     Option "UseAtomBIOS" "yes"
> to the device section of your xorg.conf and create a logverbose 7 log for the
> output.

Yes, it does.  However, it fails to restore previous text mode when it exits.  I will attach two ROMs, one for HDMI and one for DVI.  This board has both HDMI and DVI ports and one of them can be selected from BIOS.  By selecting the option, corresponding VGA ROM is loaded when BIOS is POST'ed.

> I'm going to mark HPD as broken for your chip for now.

I see you also checked it in.  Thanks, the HPD is properly black-listed for both HDMI and DVI cases.

> c.
> >> A note on the side: the change to rhd_randr.c should not matter. There is a set
> >> of brackets missing, but this should be irrelevant, too.
> >
> >I know but it was confusing because of the indentation. ;-)
> Right. Saw that, should be fixed now :)

:-)

> Thanks for hanging in so patiently :)

Thank YOU for listening to my whining. ;-)
Comment 10 Jung-uk Kim 2008-11-17 10:13:42 UTC
Created attachment 20381 [details]
VGA option ROM for HDMI port
Comment 11 Jung-uk Kim 2008-11-17 10:14:22 UTC
Created attachment 20382 [details]
VGA option ROM for DVI port
Comment 12 Jung-uk Kim 2008-11-17 10:16:07 UTC
Created attachment 20383 [details]
verbose log with ATOM BIOS and HDMI port
Comment 13 Jung-uk Kim 2008-11-17 10:16:39 UTC
Created attachment 20384 [details]
verbose log with ATOM BIOS and DVI port
Comment 14 Jung-uk Kim 2008-11-17 10:23:46 UTC
Please note the last two logs are taken without your quirk entry and my hacks to reduce diff against previous logs that I posted.
Comment 15 Egbert Eich 2008-11-24 12:36:55 UTC
Created attachment 20561 [details] [review]
Fix.

This fix makes load detection on DCE3.x hardware more reliable for me.
Kim, could you please test this fix?
Currently it's for rhd_conntest only. Please check if it prints out the monitor attached to the DAC correctly.
If it helps please check if reducing the usleep value to 50 also works.
Thanks!
Comment 16 Jung-uk Kim 2008-11-24 13:47:33 UTC
Hmm, interesting.  I tried it with different values but nothing worked reliably for me.  However, I did the following instead:

@@ -854,6 +854,20 @@ RV620DACLoadDetect(void *map, Bool tv, int dac)
     usleep(32);
 
     ret = RegRead(map, offset + RV620_DACA_AUTODETECT_STATUS);
+    if (!tv && !(ret & 0x111)) {
+       CARD32 prev = ret & 0x111;
+       int retries;
+       for (retries = 1; retries <= 10 ; retries++) {
+           usleep(32);
+           ret = RegRead(map, offset + RV620_DACA_AUTODETECT_STATUS);
+           if (prev != (ret & 0x111)) {
+#if 1
+               fprintf(stderr, "DAC%i: ret = 0x%x retries = %d\n", dac, ret, retries);
+#endif
+               break;
+           }
+       }
+    }
 
     RegWrite(map, offset + RV620_DACA_AUTODETECT_CONTROL, DetectControl);
     RegWrite(map, offset + RV620_DACA_CONTROL1, Control1);


And it works!

hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
DAC0: ret = 0x1010011 retries = 7
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
DAC0: ret = 0x1000011 retries = 3
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
DAC0: ret = 0x1000011 retries = 2
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
DAC0: ret = 0x1000011 retries = 2
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
DAC0: ret = 0x1000011 retries = 7
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 01:05:00
rhd_conntest: v1.2.3, git branch master, commit dc81290f + changes
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
DAC0: ret = 0x1000011 retries = 5
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0

Can this be a reasonable workaround?

Thanks!
Comment 17 Jung-uk Kim 2008-11-24 14:50:50 UTC
Created attachment 20564 [details] [review]
A patch that works reliably for me.
Comment 18 Egbert Eich 2008-11-25 01:45:30 UTC
Kim, it could be a valid workaround. 
With the autodetection logic  Could you check if the values are oscillating by printing them for every retry?
Have you tried to enable the wait algorithm at the beginning of the function by changing the #if 0 to an #if 1?
Comment 19 Jung-uk Kim 2008-11-26 09:12:34 UTC
(In reply to comment #18)
> Kim, it could be a valid workaround.

Great.

> With the autodetection logic  Could you check if the values are oscillating by
> printing them for every retry?

It always returns 0 until it gets the right value.

> Have you tried to enable the wait algorithm at the beginning of the function by
> changing the #if 0 to an #if 1?

I just tried it but it didn't make a difference.
Comment 21 Egbert Eich 2009-10-28 02:17:38 UTC
Kim, thanks for hanging in there and checking! I'm sorry it took so long :(
Comment 22 Jung-uk Kim 2009-10-30 08:55:06 UTC
I guess I spoke too soon.  I rebuilt the driver and it still shows the problem.  It turned out the my hack was in my local tree. :-(

To be sure, I rebuilt it from 1.3.0 source + the patch (DACSenseRV620_MethB):

hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_DACA
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_NONE 
hammer# ./rhd_conntest 1:5:0
rhd_conntest: v1.3.0, dist of git branch master, commit 8cbff7bf
Found card: ATI Technologies Inc - Radeon HD 3200 Graphics
Checking connectors on 0x9610, 0x105B, 0x0E0F  (@01:05:00):
  Load Detection: RHD_OUTPUT_NONE 
  HotPlug: RHD_HPD_0 RHD_HPD_2
  DDC: RHD_DDC_0

You see there is one success out of ten tries.  If I comment out the method A, it never works, i.e., I tried method B about 100 times but never succeeded.

Please also note the DDC was not probed some times.

Sorry for the noise.

Jung-uk Kim
Comment 23 Jeremy Huddleston Sequoia 2011-10-16 15:59:19 UTC
Does this issue occur with the preferred ati driver (xf86-vide-ati)?  If so, please move this to the Driver/Radeon component.  

Development of radeonhd has pretty much halted and development focus is on the ati driver.  Please see http://www.x.org/wiki/radeonhd

If the issue does not exist in the ati driver (or if there is no response to this message), this bug will be closed as WONTFIX unless someone contributes a patch.
Comment 24 Jeremy Huddleston Sequoia 2011-11-07 15:10:16 UTC
Closing due to lack of response.  Please reopen and move to the Driver/Radeon 
component if this issue persists with xf86-video-ati


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.