[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 249636] Switching between external monitors fails (DVI/VGA crtc
From:       Tim Holy <holy () pcg ! wustl ! edu>
Date:       2010-09-10 14:54:35
Message-ID: 20100910145436.1B0FC64A70 () immanuel ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=249636


Tim Holy <holy@pcg.wustl.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |holy@pcg.wustl.edu




--- Comment #2 from Tim Holy <holy pcg wustl edu>  2010-09-10 16:54:33 ---
OK, I downloaded the source by doing this:
svn co
svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase/workspace/kcontrol/randr
(I hope that is the current code)
and that helped me discover kdebugdialog. I am not yet quite to the point where
I feel confident about supplying a patch, but I'm getting there... If you are
too busy to fix it yourself, I could try, but I would certainly appreciate some
guidance (see below).


I started out connected to my home monitor, then went into work, and at work I
ran systemsettings from the command line with the kdebugdialog output on for
systemsettings. Here was the output:
$ systemsettings &
[1] 8671
 systemsettings(8672)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to
open ksycoca from  "/var/tmp/kdecache-tim/ksycoca4"
Bus::open: Can not get ibus-daemon's address. 
IBusInputContext::createInputContext: no connection to ibus-daemon 
systemsettings(8672)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule:
Module not already loaded, loading module  "Size & Orientation"  from library 
"kcm_randr"  using symbol  "kcm_randr"
systemsettings(8672) RandRDisplay::RandRDisplay: Using XRANDR extension 1.2 or
greater.
systemsettings(8672) RandRDisplay::RandRDisplay: XRANDR error base:  164
systemsettings(8672) RandRScreen::loadSettings: Creating CRTC object for XID 0
("None")
systemsettings(8672) RandRScreen::loadSettings: Creating CRTC object for XID 79
systemsettings(8672) RandRCrtc::loadSettings: Querying information about CRTC
79
systemsettings(8672) RandRScreen::loadSettings: Creating CRTC object for XID 80
systemsettings(8672) RandRCrtc::loadSettings: Querying information about CRTC
80
systemsettings(8672) RandRScreen::loadSettings: Creating output object for XID
81
systemsettings(8672) RandROutput::queryOutputInfo: XID 81 is output "VGA-0"
(disconnected)
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 80 (enabled) on output
"VGA-0"
systemsettings(8672) RandROutput::queryOutputInfo: Possible CRTCs for output
"VGA-0" :
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 79
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 80
systemsettings(8672) RandRScreen::loadSettings: Creating output object for XID
82
systemsettings(8672) RandROutput::queryOutputInfo: XID 82 is output "LVDS"
(connected)
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 79 (enabled) on output
"LVDS"
systemsettings(8672) RandROutput::queryOutputInfo: Possible CRTCs for output
"LVDS" :
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 79
systemsettings(8672) RandROutput::queryOutputInfo: Current configuration for
output "LVDS" :
systemsettings(8672) RandROutput::queryOutputInfo:    - Refresh rate: 60.0197
systemsettings(8672) RandROutput::queryOutputInfo:    - Rect: QRect(0,0
1400x1050)
systemsettings(8672) RandROutput::queryOutputInfo:    - Rotation: 1
systemsettings(8672) RandRScreen::loadSettings: Creating output object for XID
83
systemsettings(8672) RandROutput::queryOutputInfo: XID 83 is output "DVI-0"
(connected)
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 0 (disabled) on output
"DVI-0"
systemsettings(8672) RandROutput::queryOutputInfo: Possible CRTCs for output
"DVI-0" :
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 79
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 80
systemsettings(8672) RandROutput::queryOutputInfo: Current configuration for
output "DVI-0" :
systemsettings(8672) RandROutput::queryOutputInfo:    - Refresh rate: 0
systemsettings(8672) RandROutput::queryOutputInfo:    - Rect: QRect(0,0 0x0)
systemsettings(8672) RandROutput::queryOutputInfo:    - Rotation: 1
systemsettings(8672)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule:
Module not already loaded, loading module  "Multiple Monitors"  from library 
"kcm_xinerama"  using symbol  "kcm_xinerama"
systemsettings(8672) KRandRModule::load: Loading KRandRModule...
systemsettings(8672) OutputConfig::load: Loading output configuration for
"VGA-0"
systemsettings(8672) OutputConfig::load: Loading output configuration for
"LVDS"
systemsettings(8672) RandRConfig::load: Output rect: QRect(0,0 1400x1050)
systemsettings(8672) OutputConfig::load: Loading output configuration for
"DVI-0"
systemsettings(8672) RandRConfig::load: Output rect: QRect(0,0 0x0)
systemsettings(8672) RandRConfig::apply: Applying settings...
systemsettings(8672) RandRConfig::apply: Normalizing positions by QPoint(0,0)
systemsettings(8672) RandRConfig::apply: Ignoring identical config for "LVDS"
systemsettings(8672) RandRConfig::apply: Output config for "DVI-0" :
  rect = QRect(0,0 1600x1200) , rot = 1 , rate = 60
systemsettings(8672) RandROutput::slotEnable: Attempting to enable "DVI-0"
systemsettings(8672) RandROutput::slotEnable: Attempting to enable "DVI-0"
systemsettings(8672) RandROutput::slotEnable: Attempting to enable "DVI-0"
systemsettings(8672) RandRScreen::applyProposed: Applying proposed changes for
screen 0 ...
systemsettings(8672) RandROutput::applyProposed: Applying proposed changes for
output "DVI-0" ...
systemsettings(8672) RandRScreen::applyProposed: Changes have been applied to
all outputs.
systemsettings(8672) RandRScreen::applyProposed: Changes canceled, reverting to
original setup.

(About the "Changes canceled": I did not click "revert" in a dialog, in fact it
never showed the dialog at all. Canceling appears to be instantaneous, and the
Apply button merely gets grayed out. Note in particular the 3 successive
messages, Attempting to enable "DVI-0".)

And after command-line intervention:
$ xrandr --output VGA-0 --off

systemsettings(8672)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule:
Module not already loaded, loading module  "Size & Orientation"  from library 
"kcm_randr"  using symbol  "kcm_randr"
systemsettings(8672) RandRDisplay::RandRDisplay: Using XRANDR extension 1.2 or
greater.
systemsettings(8672) RandRDisplay::RandRDisplay: XRANDR error base:  164
systemsettings(8672) RandRScreen::loadSettings: Creating CRTC object for XID 0
("None")
systemsettings(8672) RandRScreen::loadSettings: Creating CRTC object for XID 79
systemsettings(8672) RandRCrtc::loadSettings: Querying information about CRTC
79
systemsettings(8672) RandRScreen::loadSettings: Creating CRTC object for XID 80
systemsettings(8672) RandRCrtc::loadSettings: Querying information about CRTC
80
systemsettings(8672) RandRScreen::loadSettings: Creating output object for XID
81
systemsettings(8672) RandROutput::queryOutputInfo: XID 81 is output "VGA-0"
(disconnected)
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 0 (disabled) on output
"VGA-0"
systemsettings(8672) RandROutput::queryOutputInfo: Possible CRTCs for output
"VGA-0" :
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 79
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 80
systemsettings(8672) RandRScreen::loadSettings: Creating output object for XID
82
systemsettings(8672) RandROutput::queryOutputInfo: XID 82 is output "LVDS"
(connected)
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 79 (enabled) on output
"LVDS"
systemsettings(8672) RandROutput::queryOutputInfo: Possible CRTCs for output
"LVDS" :
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 79
systemsettings(8672) RandROutput::queryOutputInfo: Current configuration for
output "LVDS" :
systemsettings(8672) RandROutput::queryOutputInfo:    - Refresh rate: 60.0197
systemsettings(8672) RandROutput::queryOutputInfo:    - Rect: QRect(0,0
1400x1050)
systemsettings(8672) RandROutput::queryOutputInfo:    - Rotation: 1
systemsettings(8672) RandRScreen::loadSettings: Creating output object for XID
83
systemsettings(8672) RandROutput::queryOutputInfo: XID 83 is output "DVI-0"
(connected)
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 0 (disabled) on output
"DVI-0"
systemsettings(8672) RandROutput::queryOutputInfo: Possible CRTCs for output
"DVI-0" :
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 79
systemsettings(8672) RandROutput::queryOutputInfo:    - CRTC 80
systemsettings(8672) RandROutput::queryOutputInfo: Current configuration for
output "DVI-0" :
systemsettings(8672) RandROutput::queryOutputInfo:    - Refresh rate: 0
systemsettings(8672) RandROutput::queryOutputInfo:    - Rect: QRect(0,0 0x0)
systemsettings(8672) RandROutput::queryOutputInfo:    - Rotation: 1
systemsettings(8672)/kutils (KCModuleProxy) KCModuleProxyPrivate::loadModule:
Module not already loaded, loading module  "Multiple Monitors"  from library 
"kcm_xinerama"  using symbol  "kcm_xinerama"
systemsettings(8672) KRandRModule::load: Loading KRandRModule...
systemsettings(8672) OutputConfig::load: Loading output configuration for
"VGA-0"
systemsettings(8672) OutputConfig::load: Loading output configuration for
"LVDS"
systemsettings(8672) RandRConfig::load: Output rect: QRect(0,0 1400x1050)
systemsettings(8672) OutputConfig::load: Loading output configuration for
"DVI-0"
systemsettings(8672) RandRConfig::load: Output rect: QRect(0,0 0x0)
systemsettings(8672) RandRConfig::apply: Applying settings...
systemsettings(8672) RandRConfig::apply: Normalizing positions by QPoint(0,0)
systemsettings(8672) RandRConfig::apply: Ignoring identical config for "LVDS"
systemsettings(8672) RandRConfig::apply: Output config for "DVI-0" :
  rect = QRect(0,0 1600x1200) , rot = 1 , rate = 60
systemsettings(8672) RandROutput::slotEnable: Attempting to enable "DVI-0"
systemsettings(8672) RandROutput::setCrtc: Setting CRTC 80 (enabled) on output
"DVI-0"
systemsettings(8672) RandRScreen::applyProposed: Applying proposed changes for
screen 0 ...
systemsettings(8672) RandROutput::applyProposed: Applying proposed changes for
output "DVI-0" ...
systemsettings(8672) RandROutput::tryCrtc: Trying to change output "DVI-0" to
CRTC 80 ...
systemsettings(8672) RandRCrtc::applyProposed: Applying proposed changes for
CRTC 80 ...
systemsettings(8672) RandRCrtc::applyProposed:        Current Screen rect:
QRect(0,0 1400x1050)
systemsettings(8672) RandRCrtc::applyProposed:        Current CRTC rect:
QRect(0,0 0x0)
systemsettings(8672) RandRCrtc::applyProposed:        Current rotation: 1
systemsettings(8672) RandRCrtc::applyProposed:        Proposed CRTC rect:
QRect(0,0 1600x1200)
systemsettings(8672) RandRCrtc::applyProposed:        Proposed rotation: 1
systemsettings(8672) RandRCrtc::applyProposed:        Proposed refresh rate: 60
systemsettings(8672) RandRCrtc::applyProposed:        Enabled outputs:
systemsettings(8672) RandRCrtc::applyProposed:           - "DVI-0"
systemsettings(8672) RandRCrtc::applyProposed: Changes for CRTC 80 successfully
applied.
systemsettings(8672) OutputConfig::outputChanged: Output "DVI-0" changed. (
mask = "4" )
systemsettings(8672) OutputConfig::outputChanged: Output mode changed.
systemsettings(8672) RandROutput::tryCrtc: Changed output "DVI-0" to CRTC 80
systemsettings(8672) RandROutput::tryCrtc:    ( from old CRTC 80 )
systemsettings(8672) RandRScreen::applyProposed: Changes have been applied to
all outputs.

As far as I can tell, the problem must be that RandROutput::findEmptyCrtc()
fails to return an empty crtc, I'd guess because because
connectedOutputs().count() does not return 0 for CRTC 80---it's still enabled
for VGA-0 even though it was listed as "disconnected" by loadSettings().

So it seems something should be done to update the connectedOutputs list and
remove disconnected outputs before calling findEmptyCrtc; or, perhaps in
findEmptyCrtc, if it can't find a non-zero crtc to return, it could do a second
pass in which it checks for disconnected outputs. But the problem I see is
that, if I understand correctly, all this happens within the object handling
the DVI-0 output, and the problem is that it really needs to first get at the
output handling VGA-0 to disable it. So I'm not sure where I should patch the
problem.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic