Bug 14570

Summary: [830M]dynamically plugging in a monitor and turning it on is broken
Product: xorg Reporter: Kristian Høgsberg <krh>
Component: Driver/intelAssignee: ykzhao <yakui.zhao>
Status: RESOLVED DUPLICATE QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: eich, mat, michael.fu, sndirsch
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Logfile when starting X with a monitor attached on VGA
none
Log from startup with no monitor attached
none
fix crtc remapping issue
none
xrandr output none

Description Kristian Høgsberg 2008-02-19 12:23:59 UTC
The commit

commit f79a585d57c61fbe9af5684a336918e1fe3e8416
Author: liuhong <liuhong@devlinux-hong.sh.intel.com>
Date:   Tue Feb 5 11:04:34 2008 +0800

    xf86-video-intel: fix ivch using wrong dvo register
    
    We use the wrong DVO output register for ivch which is used for DVO LVDS.
    Vbios enables DVOB and driver never touches it, so everything seems
    working correctly now.

breaks modesetting on my i830 x30 thinkpad and a i830 dell latitude c400.  For both laptops, the LFP comes up fine when X is started without an external monitor plugged in, but when X starts with a monitor connected (external VGA), the LFP comes up black.

Backing out the commit makes the mode setting work correctly, though dynamically plugging in a monitor and turning it on is broken in either case: I get "could not allocate crtc for output VGA".
Comment 1 Hong Liu 2008-02-19 18:44:33 UTC
(In reply to comment #0)
> the LFP comes up fine when X is started without an external
> monitor plugged in, but when X starts with a monitor connected (external VGA),
> the LFP comes up black.
> 

It seems some i830M machines use DVOA as the output register.
We will try to find if there is anyway to autodetect the output register.

> Backing out the commit makes the mode setting work correctly, though
> dynamically plugging in a monitor and turning it on is broken in either case: I
> get "could not allocate crtc for output VGA".
> 

This problem may be i830M specific, it can only connect VGA on PIPEB which may be occupied by LVDS.
Would you please attach xorg log with modedebug turned on (for the crt hotplug case)?
Comment 2 Michael Fu 2008-02-20 23:24:20 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > the LFP comes up fine when X is started without an external
> > monitor plugged in, but when X starts with a monitor connected (external VGA),
> > the LFP comes up black.
> > 
> 
> It seems some i830M machines use DVOA as the output register.
> We will try to find if there is anyway to autodetect the output register.

We will track this part in bug# 13722.

> 
> > Backing out the commit makes the mode setting work correctly, though
> > dynamically plugging in a monitor and turning it on is broken in either case: I
> > get "could not allocate crtc for output VGA".
> > 
> 
> This problem may be i830M specific, it can only connect VGA on PIPEB which may
> be occupied by LVDS.
> Would you please attach xorg log with modedebug turned on (for the crt hotplug
> case)?
> 
Kristian, response?

Comment 3 Kristian Høgsberg 2008-02-22 12:15:29 UTC
> > This problem may be i830M specific, it can only connect VGA on PIPEB which may
> > be occupied by LVDS.
> > Would you please attach xorg log with modedebug turned on (for the crt hotplug
> > case)?
> > 
> Kristian, response?

Oops sorry, missed the request for info.  I'm attaching the log when starting X with an monitor connected on VGA first. 

Comment 4 Kristian Høgsberg 2008-02-22 12:16:50 UTC
Created attachment 14508 [details]
Logfile when starting X with a monitor attached on VGA
Comment 5 Kristian Høgsberg 2008-02-22 12:20:21 UTC
Created attachment 14509 [details]
Log from startup with no monitor attached

After starting X, I plugged in a monitor and tried

  xrandr --output LVDS --crtc 1 --mode 1024x768

which make the screen blink and apparently moves the LVDS to crct 1, since now

  xrandr --output VGA --mode 1680x1050

works as expected.  The output from these commands should also be in the log for reference.
Comment 6 Hong Liu 2008-02-24 22:35:07 UTC
Created attachment 14549 [details] [review]
fix crtc remapping issue

The patch is aginst xrandr tool.

Thanks,
Hong
Comment 7 Kristian Høgsberg 2008-02-25 10:02:47 UTC
(In reply to comment #6)
> Created an attachment (id=14549) [details]
> fix crtc remapping issue
> 
> The patch is aginst xrandr tool.

That fixes it for me - thanks!

Kristian
Comment 8 Hong Liu 2008-03-11 01:47:45 UTC
Patch is committed as id 4dcc8ae1a6903434def1a2706f7c68ff9e2a17c4.
Comment 9 Matthias Hopf 2009-03-06 05:50:22 UTC
This patch breaks uncloning completely *again*.
Have to revert it, this needs different treatment.
Comment 10 Matthias Hopf 2009-03-06 05:58:43 UTC
Kristian, please post the output of 'xrandr --verbose'.


Check the output for VGA for 'CRTCs:'. The intel driver should only announce a single CRTC here (0 or 1, not both), which then has to be tied inside the driver to PIPE B.

If the driver doesn't do this, this cannot work with RandR. AFAICS the crtc allocation works correctly in xrandr.


Please check this ASAP, as we want to release a final 1.3 xrandr.
Comment 11 Kristian Høgsberg 2009-03-06 06:36:18 UTC
Created attachment 23586 [details]
xrandr output

output from xrandr --verbose on my thinpad x30.  i830, 1680x1050 monitor connected on vga.
Comment 12 Matthias Hopf 2009-03-06 06:42:27 UTC
VGA1 connected (normal left inverted right x axis y axis)
	CRTCs:      0 1


Apparently the intel driver advocates both CRTCs, while it can only drive VGA1 with PIPE B. If the driver wishes to NOT associate a CRTC with a PIPE in a fixed fashion, it has to deal with changing PIPE assignments on its own, which means that even the PIPE of a different CRTC might change underneath.

It sounds to me that having a fix associtation of a CRTC with a certain PIPE (e.g. CRTC 0 is always PIPE A, CRTC 1 always PIPE B) is the better approach for intel's architecture.


IMHO this is purely a driver issue. Hong, please check this. If it turns out we still need any changes in xrandr they'd better get in before we release 1.3.0 :-P
Comment 13 Wang Zhenyu 2009-07-29 23:59:33 UTC
Hong has left intel for a long time...this should reassign to someone else.
Comment 14 Michael Fu 2009-08-03 02:20:10 UTC
might be a dup of bug# 22247, in terms of clone logic. 

the LVDS here is DVO LVDS.
Comment 15 Michael Fu 2009-08-24 19:26:23 UTC
pls try the patch for bug# 22247 and reopen if it doesn't work for this bug.

*** This bug has been marked as a duplicate of bug 22247 ***

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.