Bug 37545 - Cannot disable LVDS after login
Summary: Cannot disable LVDS after login
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 08:42 UTC by Orion Poplawski
Modified: 2018-06-12 19:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Xorg log after xrandr run (43.09 KB, text/plain)
2011-05-24 09:54 UTC, Orion Poplawski
no flags Details
dmesg (59.70 KB, text/plain)
2011-05-24 09:54 UTC, Orion Poplawski
no flags Details
xrandr ouput (840 bytes, text/plain)
2011-05-24 09:58 UTC, Orion Poplawski
no flags Details
possible fix (1.60 KB, patch)
2011-05-26 16:04 UTC, Alex Deucher
no flags Details | Splinter Review
dmesg with drm.debug=4 (105.02 KB, text/plain)
2011-05-31 10:06 UTC, Orion Poplawski
no flags Details

Description Orion Poplawski 2011-05-24 08:42:12 UTC
Running Fedora 15 with:

xorg-x11-drv-ati-6.14.1-1.20110504gita6d2dba6.fc15.i686
xorg-x11-server-Xorg-1.10.1-14.fc15.i686

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY

kernel 2.6.38.6-27.fc15.i686

System is in a docking station with the lid closed but the system activates it anyways.  So after login I want to disable the LVDS output with:

xrandr --output LVDS --off

But at this point the external monitor goes into power save and Xorg.0.log shows:

[ 58797.212] (II) RADEON(0): Allocate new frame buffer 1600x1200 stride 1600
[ 58797.215] (EE) RADEON(0): failed to set mode: Invalid argument(II) RADEON(0): VRAM usage limit set to 6008K
Comment 1 Alex Deucher 2011-05-24 08:49:56 UTC
Please attach your xorg log, xrandr output, and dmesg output.
Comment 2 Orion Poplawski 2011-05-24 09:54:18 UTC
Created attachment 47103 [details]
Xorg log after xrandr run
Comment 3 Orion Poplawski 2011-05-24 09:54:48 UTC
Created attachment 47104 [details]
dmesg
Comment 4 Orion Poplawski 2011-05-24 09:58:13 UTC
Created attachment 47105 [details]
xrandr ouput
Comment 5 Alex Deucher 2011-05-24 10:35:37 UTC
The problem in this case is vram fragmentation.  When you start X, the driver allocates a buffer large enough for both dualhead (1024x768 + 1600x1200).  When you turn off the LVDS port, the driver tried to allocate a new 1600x1200 buffer for just the VGA monitor before freeing the previous dualhead allocation.  since there isn't enough VRAM available for both the dualhead allocation and the VGA only allocation, the modeset fails.

Does it work if you start X without tha VGA monitor connected?  Then connect it after you've started X, something like:
xrandr --output VGA-0 --off
xrandr --output VGA-0 --auto --pos 0x0
xrandr --output LVDS --off
Comment 6 Orion Poplawski 2011-05-24 11:18:17 UTC
That does succeed, although not really a workable solution.
Comment 7 Orion Poplawski 2011-05-26 15:15:18 UTC
Is there any way to tell X to not enable the LVDS output on startup?
Comment 8 Alex Deucher 2011-05-26 15:38:50 UTC
Section "Monitor"
        Identifier "LVDS"
        Option "Disable" "TRUE"
EndSection
Comment 9 Orion Poplawski 2011-05-26 15:41:39 UTC
Yeah, but I'm assuming that would still deactivate the LVDS output even if it was the only output available.  I need to conditionally deactivate it if the lid is closed.
Comment 10 Alex Deucher 2011-05-26 16:04:38 UTC
Created attachment 47201 [details] [review]
possible fix

Does this patch fix the issue?
Comment 11 Orion Poplawski 2011-05-27 09:01:55 UTC
No that doesn't help.  It appears that info->front_bo is non-null at that point, so your new code doesn't run.

Breakpoint 2, drmmode_xf86crtc_resize (scrn=0xa09a880, width=1600, height=1200)
    at drmmode_display.c:1288
1288            if (!info->front_bo) {
(gdb) print info->front_bo
$2 = (struct radeon_bo *) 0xa0a68d0

At this point the log has:
[   516.548] (II) RADEON(0): Allocate new frame buffer 1600x1200 stride 1600

The invalid argument error comes later.
Comment 12 Orion Poplawski 2011-05-27 09:11:00 UTC
The invalid argument error comes in this code:

1337            for (i = 0; i < xf86_config->num_crtc; i++) {
(gdb) 
1343                    drmmode_set_mode_major(crtc, &crtc->mode,

Interesting that at this point there is no fail handling - which must be why the VGA output dies and goes into power save.
Comment 13 Orion Poplawski 2011-05-31 10:06:22 UTC
Created attachment 47403 [details]
dmesg with drm.debug=4
Comment 14 Adam Jackson 2018-06-12 19:06:27 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.


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.