Bug 17178

Summary: [GM45] VGA always connected after S3 resume
Product: xorg Reporter: joeyli.tw <joeyli.tw>
Component: Driver/intelAssignee: Wang Zhenyu <zhenyu.z.wang>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: high CC: jassmith, michael.fu, simonwang
Version: 7.3 (2007.09)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg log
none
xorg config
none
dmesg log
none
xrandr --verbose before S3 suspend
none
xrandr --verbose after S3 resume
none
run intel_reg_dumper before S3 suspend
none
run intel_reg_dumper after S3 resume
none
run intel_reg_dumper after S3 resume and xrandr
none
clear crt hotplug stat bit before detect
none
try crt hotplug detect twice none

Description joeyli.tw 2008-08-17 20:22:27 UTC
Created attachment 18333 [details]
Xorg log

external VGA monitor always connected after S3 resume

chipset: GM45
xf86-video-intel version: 2.4.0
xserver version: X.Org X Server 1.4.99.905 (1.5.0 RC 5)
kernel version: 2.6.25.9
Linux destribution: Linpus Linux 9.5
Machine model: Acer
Display connector: VGA

Reproduce steps:
a. login to X-window
b. open terminal window and press:
echo -n mem > /sys/power/state
c. press any key for S3 resume.
d. open terminal window and press:
xrandr
You will see the VGA port always is connected.
Comment 1 joeyli.tw 2008-08-17 20:24:28 UTC
Created attachment 18334 [details]
xorg config
Comment 2 joeyli.tw 2008-08-17 20:26:44 UTC
Created attachment 18335 [details]
dmesg log
Comment 3 joeyli.tw 2008-08-17 20:33:36 UTC
Created attachment 18336 [details]
xrandr --verbose before S3 suspend
Comment 4 joeyli.tw 2008-08-17 20:36:16 UTC
Created attachment 18337 [details]
xrandr --verbose after S3 resume
Comment 5 joeyli.tw 2008-08-17 20:38:23 UTC
Created attachment 18338 [details]
run intel_reg_dumper before S3 suspend
Comment 6 joeyli.tw 2008-08-17 20:39:19 UTC
Created attachment 18339 [details]
run intel_reg_dumper after S3 resume
Comment 7 joeyli.tw 2008-08-17 20:40:03 UTC
Created attachment 18340 [details]
run intel_reg_dumper after S3 resume and xrandr
Comment 8 joeyli.tw 2008-08-17 21:32:25 UTC
(In reply to comment #7)
> Created an attachment (id=18340) [details]
> run intel_reg_dumper after S3 resume and xrandr
> 

I have trace the intel driver:

/xf86-video-intel-2.4.0/src/i830_crt.c
static Bool
i830_crt_detect_hotplug(xf86OutputPtr output) {
......
    if ((INREG(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) ==
        CRT_HOTPLUG_MONITOR_COLOR)		
    {
        ErrorF ("[Linpus] i830_crt_detect_hotplug end!");
        return TRUE;
    } else {
        return FALSE;
    }
}

The result from this function is always TRUE after S3 resume.
And, I use intel_reg_dumper to monitor the PORT_HOTPLUG_STAT:

[root@localhost reg_dumper]# ./intel_reg_dumper | grep HOT
(II):      PORT_HOTPLUG_EN: 0x00000020
(II):    PORT_HOTPLUG_STAT: 0x00000b00

The value in PORT_HOTPLUG_STATE is always 0x00000b00 after S3 resume.
0x00000b00 is 101100000000, and I reference the proprobramer reference menual:

http://www.intellinuxgraphics.org/documentation.html
http://www.intellinuxgraphics.org/VOL_3_display_registers.pdf
Intel® 965 Express Chipset Family and Intel® G35 Express Chipset Graphics Controller PRM
Programmer’s Reference Manual (PRM)
Volume 3: Display Registers
Revision 1.0c

I found the CRT Hot Plug Detection Status (read-only) from P.96.
That is because 9:8 bits is  aalways 11 after S3 resume.
So i830_crt_detect_hotplug function will alwyas return TRUE.

But, Why?
Comment 9 joeyli.tw 2008-08-17 22:44:10 UTC
(In reply to comment #0)
> Created an attachment (id=18333) [details]
> Xorg config
> 
> external VGA monitor always connected after S3 resume
> 
> chipset: GM45
> xf86-video-intel version: 2.4.0
> xserver version: X.Org X Server 1.4.99.905 (1.5.0 RC 5)
> kernel version: 2.6.25.9
> Linux destribution: Linpus Linux 9.5
> Machine model: Acer

We install Fedora Core 9 and found  this issue was happen, too.
Comment 10 Gordon Jin 2008-08-18 01:45:08 UTC
The VGA port is always connected (physically) but not enabled, right?
Comment 11 joeyli.tw 2008-08-19 00:59:46 UTC
(In reply to comment #10)
> The VGA port is always connected (physically) but not enabled, right?
> 

Yes!
Before S3 suspend, everything is ok!
But after S3 resume, no matter VGA port was pluged in or not.
xrandr always return VGA connected.

PORT_HOTPLUG_STAT is a status register, who will setup it?
Driver or VBIOS?

And, I found a behavior:

After S3 resume, use intel_reg_dumper to monitor PORT_HOTPLUG_STAT, the value is 0x00000000.
But if I run xrandr, the value will be changed to 0x00000b00 immediately.
Comment 12 joeyli.tw 2008-09-08 05:11:05 UTC
I try the intel driver version 2.4.2, it still have this issue.

Comment 13 Wang Zhenyu 2008-09-08 18:02:39 UTC
Created attachment 18763 [details] [review]
clear crt hotplug stat bit before detect

Could you try if this patch helps?
Comment 14 joeyli.tw 2008-09-15 01:45:54 UTC
(In reply to comment #13)
> Created an attachment (id=18763) [details]
> clear crt hotplug stat bit before detect
> 
> Could you try if this patch helps?
> 


Thank your response.

But, 
I apply this patch to driver 2.4.2, and it didn't fix this issue.
Do you need me catch some kind of log?


Comment 15 Wang Zhenyu 2008-09-21 22:50:17 UTC
Created attachment 19082 [details] [review]
try crt hotplug detect twice

Could you try this instead?
Comment 16 Michael Fu 2008-09-25 20:31:51 UTC
ping response...
Comment 17 Jason Smith 2008-10-02 20:21:01 UTC
patch (which is now in git) does not resolve the issue.  I have it too.
Comment 18 joeyli.tw 2008-10-11 07:13:56 UTC
(In reply to comment #15)
> Created an attachment (id=19082) [details]
> try crt hotplug detect twice
> 
> Could you try this instead?
> 

Sorry! I forgot response to you.
This patch is still not fix this issue.
Comment 19 joeyli.tw 2008-10-11 07:17:07 UTC
(In reply to comment #16)
> ping response...
> 

May I help to trace this issue in intel driver?
If you can give me some hint about it.

Or, this is a bug from OEM hardware or VBIOS?

I have try many idel in intel driver, but cann't fix it.
I need more input information for this issue.


Comment 20 Gordon Jin 2008-10-25 05:58:08 UTC
*** Bug 18198 has been marked as a duplicate of this bug. ***
Comment 21 Wang Zhenyu 2008-11-06 17:13:56 UTC
Keith's patch on git master has fixed CRT detect on GM45.
Comment 22 joeyli.tw 2008-12-17 20:01:30 UTC
(In reply to comment #21)
> Keith's patch on git master has fixed CRT detect on GM45.
> 

Dear Wang:

Where can I find the Keith's patch? Is it included in Intel driver version  2.5.0?
That is because we have update to 2.5.0 driver, r,
and this driver still have this issue.
Comment 23 Wang Zhenyu 2008-12-17 20:33:37 UTC
Don't use 2.5.0, please try 2.6 -rc1 instead.
Comment 24 joeyli.tw 2008-12-22 01:19:20 UTC
(In reply to comment #23)
> Don't use 2.5.0, please try 2.6 -rc1 instead.
> 

Excuse me.

When I compiler the 2.6-rc1, I got a dri error.
Have any serial number for Keith's patch?
I want to find the patch and apply it to version
2.5 directly.

Thank you!
Comment 25 Wang Zhenyu 2008-12-22 01:26:27 UTC
commit 9942cfa6dcc70a09ea38f738b1e73e3f005080b9
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Nov 6 15:04:27 2008 -0800

    Use long crt hotplug activation time on GM45.
    
    The GM45 b-spec requires the use of the longer hotplug activation period,
    but does not require looping twice over the detection logic. With this
    patch, CRT detection appears solid on my GM45.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>


Sorry, I should have pasted this info earlier.
Comment 26 joeyli.tw 2008-12-23 02:07:21 UTC
(In reply to comment #25)
> commit 9942cfa6dcc70a09ea38f738b1e73e3f005080b9
> Author: Keith Packard <keithp@keithp.com>
> Date:   Thu Nov 6 15:04:27 2008 -0800
> 
>     Use long crt hotplug activation time on GM45.
> 
>     The GM45 b-spec requires the use of the longer hotplug activation period,
>     but does not require looping twice over the detection logic. With this
>     patch, CRT detection appears solid on my GM45.
> 
>     Signed-off-by: Keith Packard <keithp@keithp.com>
> 
> 
> Sorry, I should have pasted this info earlier.
> 

Thank you very much! This issue was fixed by this patch.

I found the patch and apply to 2..5.0 driver.
And we found the 2.5.1 driver already applied the path.

My I ask one question? Is The GM45 b-spec a open spec?
Where can I download it? From internet?
 
Comment 27 joeyli.tw 2008-12-31 05:05:57 UTC
(In reply to comment #26)
> (In reply to comment #25)
> > commit 9942cfa6dcc70a09ea38f738b1e73e3f005080b9
> > Author: Keith Packard <keithp@keithp.com>
> > Date:   Thu Nov 6 15:04:27 2008 -0800
> > 
> >     Use long crt hotplug activation time on GM45.
> > 
> >     The GM45 b-spec requires the use of the longer hotplug activation period,
> >     but does not require looping twice over the detection logic. With this
> >     patch, CRT detection appears solid on my GM45.
> > 
> >     Signed-off-by: Keith Packard <keithp@keithp.com>
> > 
> > 
> > Sorry, I should have pasted this info earlier.
> > 
> 
> Thank you very much! This issue was fixed by this patch.
> 
> I found the patch and apply to 2..5.0 driver.
> And we found the 2.5.1 driver already applied the path.
> 
> My I ask one question? Is The GM45 b-spec a open spec?
> Where can I download it? From internet?
> 
> 

(In reply to comment #25)
> commit 9942cfa6dcc70a09ea38f738b1e73e3f005080b9
> Author: Keith Packard <keithp@keithp.com>
> Date:   Thu Nov 6 15:04:27 2008 -0800
> 
>     Use long crt hotplug activation time on GM45.
> 
>     The GM45 b-spec requires the use of the longer hotplug activation period,
>     but does not require looping twice over the detection logic. With this
>     patch, CRT detection appears solid on my GM45.
> 
>     Signed-off-by: Keith Packard <keithp@keithp.com>
> 
> 
> Sorry, I should have pasted this info earlier.
> 

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.