Bug 15766

Summary: [SDVO VGA] No picture on second monitor with dual-VGA configuration
Product: xorg Reporter: Aidan Dixon <aidan.dixon>
Component: Driver/intelAssignee: Hong Liu <hong.liu>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: aidan.dixon, nian.wu
Version: 7.3 (2007.09)Keywords: NEEDINFO
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg.conf
none
Output of xrandr -q --verbose
none
Xorg.log
none
New xorg.conf
none
New Xorg.log
none
New output from xrandr -q --verbose
none
Xorg.log (RedHat FC7, with modedebug=on)
none
Xorg.log (Ubuntu 8.10, with modedebug=on)
none
Xorg.log (ubuntu 8.10, xf86-video-intel-2.3.1, modedebug=on) none

Description Aidan Dixon 2008-04-30 03:40:28 UTC
Created attachment 16257 [details]
xorg.conf

OS: Ubuntu Linux 7.10 (Gutsy), Ubuntu Linux 8.10 (Hardy)
Hardware: Intel GME965.
Configuration: two monitors (flat-panel) connected to VGA and VGA-1 outputs, VGA-1 shows no picture but switches out of power-save mode.

VGA -> ViewSonic 1940w - shows picture
VGA-1 -> Dell FP193c - shows no picture
LVDS -> not connected.  (but xrandr says connected).
TV -> not connected.
SDVO is not available.

Xorg.log, xorg.conf and output of xrandr -q --verbose all attached.

Note that after X server is started, xrandr commands are executed as follow:

$ xrandr --output TV --off --output LVDS --off
$ xrandr --output VGA-1 --crtc 1 --below VGA --mode 1280x1024
Comment 1 Aidan Dixon 2008-04-30 03:41:51 UTC
Created attachment 16258 [details]
Output of xrandr -q --verbose
Comment 2 Aidan Dixon 2008-04-30 03:42:19 UTC
Created attachment 16259 [details]
Xorg.log
Comment 3 Aidan Dixon 2008-04-30 03:49:55 UTC
Updated OS
Bug logged as requested by Wu.Nian@intel.com

Various versions:
root@dpx117-atd:~# dpkg -l|grep xserver
ii  displayconfig-gtk                          0.3.10                        
ii  x11-xserver-utils                          7.3+2                         X 
ii  xserver-xorg                               1:7.3+10ubuntu10              the 
ii  xserver-xorg-core                          2:1.4.1~git20080131-1ubuntu9  Xorg 
ii  xserver-xorg-video-intel                   2:2.2.1-1ubuntu12             X.Org 
ii  libxrandr-dev                              2:1.2.2-1                     X11
ii  libxrandr2                                 2:1.2.2-1                     X11
ii  x11proto-randr-dev                         1.2.1-2                       X11
Comment 4 Gordon Jin 2008-04-30 23:51:05 UTC
>> LVDS -> not connected.  (but xrandr says connected).

Is this a laptop? LVDS means the local flat panel on the laptop.
If this machine really doesn't have this, you can add Option "Ignore"  "true" in the LVDS monitor section to explicitly disable it.

Please refer to http://www.intellinuxgraphics.org/dualhead.html for the xrandr and xorg.conf usage. Write only 1 screen instead of 2 in xorg.conf. 
Comment 5 Aidan Dixon 2008-05-01 03:22:04 UTC
Created attachment 16286 [details]
New xorg.conf

This board is not a lap-top (despite using the mobile chipset), merely a cut-price gaming board using Intel's long-lifetime embedded components.  So a flat-panel monitor may or may not be connected.  Customer's choice.

At any rate, xorg.conf has been rewritten as per URL given in previous comment with no change in result other than my not having to issue xrandr commands.  New version is attached.  New Xorg.log and xrandr output to follow.
Comment 6 Aidan Dixon 2008-05-01 03:23:06 UTC
Created attachment 16287 [details]
New Xorg.log

Added new Xorg.log.
Comment 7 Aidan Dixon 2008-05-01 03:24:41 UTC
Created attachment 16288 [details]
New output from xrandr -q --verbose

Updated output from xrandr -q --verbose after using new xorg.conf
Comment 8 Gordon Jin 2008-05-02 00:00:07 UTC
Things seems to be better, at least the log shows VGA-1 connected with pipeB now.

Hong/Nian, do you have further idea?
Comment 9 WuNian 2008-05-03 18:58:33 UTC
I have no idea. Please remove : "HorizSync" and "VertRefresh" in Monitor section. Driver can detect this info by itself.
And you can comments this line: 
Option		"Below" "ViewSonic Monitor"
to see if X can be up.
Comment 10 Hong Liu 2008-05-03 19:17:44 UTC
Would you please attach the xorg log with Option Modedebug turned on?
Comment 11 Gordon Jin 2008-05-06 18:15:36 UTC
decreasing priority as sdvo-vga is not a common hw.
Comment 12 Aidan Dixon 2008-05-07 03:40:03 UTC
I removed the monitor configuation directives as requested (VertRefresh, HorizSync etc.).  No problems with that.  Also removed the "Below" directive.  X starts fine and monitor on VGA-1 is configued but desktop is only size of first monitor.  xrandr command fixes no problem.
Comment 13 Aidan Dixon 2008-05-07 03:52:57 UTC
Created attachment 16409 [details]
Xorg.log (RedHat FC7, with modedebug=on)

Notes.  For various reasons I had to run this under FedoraCore7 (previous logs were against Ubuntu8.10.) as we are also trying to get the same setup working with the IEGD_8.0 drivers.  I will try to get a log from the Ubuntu install consistent with the previous ones.
Comment 14 Aidan Dixon 2008-05-07 03:56:05 UTC
Comment on attachment 16409 [details]
Xorg.log (RedHat FC7, with modedebug=on)

updated attachment data type.
Comment 15 Aidan Dixon 2008-05-07 04:39:23 UTC
Created attachment 16410 [details]
Xorg.log (Ubuntu 8.10, with modedebug=on)
Comment 16 Hong Liu 2008-05-08 01:18:14 UTC
So now the display is correct on VGA1 (sdvo-vga) output, but you can't get extended desktop? i.e. #xrandr --output VGA1 --right-of VGA not working?

Thanks,
Hong
Comment 17 Aidan Dixon 2008-05-08 02:51:18 UTC
Hi, Hong!

Yes, the display is *configured correctly*.  The outputs from xdpyinfo and xrandr as to the size of it are consistent with each other.   So in that sense, I DO have extended desktop.  It's just that the second monitor shows no picture, even though it comes out of power-save mode.

Thanks
Aidan. 
Comment 18 Aidan Dixon 2008-05-09 09:21:01 UTC
Just a minor comment on the xorg.conf and hardware configuration.  The channel VGA in the xrandr output and in the xorg.conf should be the on-board VGA output on the chipset.  The VGA-1 channel goes via a Chrontel CH7317A.

Let me know what else you need to know to look at this.

Regards,
-a.
Comment 19 Aidan Dixon 2008-05-14 05:17:55 UTC
Have finally got my git and build trees into manageable state.  Building the latest (v2.3.1) version of xf86-video-intel yields the same results. (I.e. second VGA monitor from CH7317 on SDVO-B comes out of power save but no picture is displayed.)

If you have any of you experts have tweaks or tests to suggest, let me know as I can now compile and test them.  This is a hot ticket for me (and my employer) so please give me some pointers.

Best regards...
Comment 20 Aidan Dixon 2008-05-14 07:34:37 UTC
I have just checked the signals from the VGA connectors on the board.  Both VGA and VGA-1 (via CH7317) outputs appear to be consistent with whatever picture is being generated, i.e. VSYNC, HSYNC and RGB seem sensible; but still no picture on VGA channel via SDVO and CH7317.  As soon as I switch to text mode (CTRL+ALT+F1 etc.) the text console picture does appear on BOTH monitors.

Best regards,
Comment 21 Hong Liu 2008-05-15 22:15:57 UTC
Please repost xorg log with the following patch applied and ModeDebug turned on.

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 2379127..1513ed2 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1616,6 +1616,8 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
     intel_output->pDDCBus = ddcbus;
     intel_output->dev_priv = dev_priv;
 
+    i830_sdvo_dump(pScrn);
+
     i830_sdvo_get_capabilities(output, &dev_priv->caps);
 
     if (dev_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
Comment 22 Aidan Dixon 2008-05-16 01:31:13 UTC
Created attachment 16571 [details]
Xorg.log (ubuntu 8.10, xf86-video-intel-2.3.1, modedebug=on)

i830_sdvo.c patched as per comment #21.
Best regards...
Comment 23 Hong Liu 2008-05-18 22:24:26 UTC
Would you please try the following patch to see if anything changed?

Thanks,
Hong


diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 2379127..9f76873 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -898,6 +898,11 @@ i830_sdvo_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 	sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
     }
 
+    if (adjusted_mode->Flags & V_PHSYNC)
+	sdvox |= 1 << 3;
+    if (adjusted_mode->Flags & V_PVSYNC)
+	sdvox |= 1 << 4;
+
     i830_sdvo_write_sdvox(output, sdvox);
 }
 
@@ -1616,6 +1621,8 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int output_device)
     intel_output->pDDCBus = ddcbus;
     intel_output->dev_priv = dev_priv;
 
+    i830_sdvo_dump(pScrn);
+
     i830_sdvo_get_capabilities(output, &dev_priv->caps);
 
     if (dev_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
Comment 24 Aidan Dixon 2008-05-19 02:43:08 UTC
Thanks Hong - relative success.   This seems to resolve the issue for modes where the monitor expects positive-going synchronization (+HSync and +VSync according to xrandr -q --verbose).

Comment 25 Hong Liu 2008-05-19 18:40:11 UTC
(In reply to comment #24)
> Thanks Hong - relative success.   This seems to resolve the issue for modes
> where the monitor expects positive-going synchronization (+HSync and +VSync
> according to xrandr -q --verbose).
> 

So still no picture on sdvo-vga? Or anything changed?
Comment 26 Aidan Dixon 2008-05-20 00:41:14 UTC
Sorry - will try to more clear in future.  Yes, I have picture on SDVO-VGA.  1280x1024@65hz.  It's fine and there are no problems there.

However... going through all the modes listed by xrandr -q --verbose, the only modes that work are those listed as +vsync and +hsync.  If the mode lists -vsync OR -hsync then no picture is displayed.

Thanks,
Aidan
Comment 27 Hong Liu 2008-05-28 00:06:20 UTC
Thanks for the explanation. Would you please try the following patch?


diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 2379127..076ef34 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -898,6 +898,9 @@ i830_sdvo_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 	sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
     }
 
+    if (IS_I965G(pI830) || IS_I965GM(pI830))
+	sdvox |= (1 << 3 | 1 << 4);
+
     i830_sdvo_write_sdvox(output, sdvox);
 }
 
Comment 28 Aidan Dixon 2008-05-28 01:55:14 UTC
Thanks, Hong!

The patch in comment #27 works for both +ve and -ve sync (horizontal and vertical).  I think that just about brings this issue to a close for me.

Many thanks for your help getting this working.
Best regards,
Aidan Dixon
Comment 29 Hong Liu 2008-06-04 18:46:39 UTC
Patch is committed beb72ae5aa053303f5cc419e9c9d7c6db964f160.
Comment 30 Florian Mickler 2012-02-01 13:13:28 UTC
A patch referencing this bug report has been merged in Linux v3.3-rc2:

commit ba68e086223a5f149f37bf8692c8cdbf1b0ba3ef
Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date:   Fri Jan 6 19:45:34 2012 -0200

    drm/i915/sdvo: always set positive sync polarity

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.