Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] How to lock screen resolution?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Nov 29, 2012 7:48 am    Post subject: [SOLVED] How to lock screen resolution? Reply with quote

Hi, guys!
Can't fix a small problem.
The matter is sometimes I booting system with detached monitor. In this case on monitor attach I have a system that was booted in 800x600 mode. And I have to reboot to get native 1280x1024 mode. The same behavior with both nvidia and nouveau drivers. So I think this is Xorg issue. Is it possible to lock screen resolution regardless attached monitor on system boot or not?
Here is xorg.conf content:

Code:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 295.75  (buildmeister@swio-display-x86-rhel47-13)  Fri Aug 24 13:47:44 PDT 2012

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from data in "/etc/conf.d/gpm"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
        Modes       "1280x1024"
    EndSubSection
EndSection



Last edited by creaker on Fri Nov 30, 2012 8:08 am; edited 1 time in total
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Nov 29, 2012 10:13 am    Post subject: Reply with quote

I have three monitors on one graphics card and use xrandr to set the resolution after trying it with xorg.conf and failed.
I put
Code:
xrandr --some stuff

in the autostart-file and it works well. But my monitors are always attached so maybe you can write a small script like:
if monitor x then do that...
else that...
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Nov 29, 2012 11:18 am    Post subject: Reply with quote

xrandr tells: Can't open display. No matter which option was specified.
KRandrTray also doesn't helps: only 800x600 option is available when booting with monitor detached.
Unfortunately I am not familar bash scripting and can't write proper script
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Nov 29, 2012 11:31 am    Post subject: Reply with quote

are you executing xrandr in the CLI without starting the x-server simultaniously? what desktop do you have?

just to understand you right: you mean the resolution in the X-environment, not the resolution from booting till you are at the login prompt and CLI-only?

Quote:
Unfortunately I am not familar bash scripting and can't write proper script

At the moment I'm not familiar with it too, but in 3 weeks I have time to get into it seriously. I think the script would be very easy, so maybe someone else can write it for you...
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Nov 29, 2012 1:43 pm    Post subject: Reply with quote

yes, it is about a resolution when X and KDE loaded and desktop appears.
I tried to run xrandr in CLI as well as in kde .
Currently if I booted with disconnected monitor I have to perform killall kdm -> nvidia-xconfig -> log in as user -> startx to get my 1280x1024.
The main of these steps is nvidia-xconfig. Without it kde restarts at same 800x600. But nvidia-xconfig not changing xorg.conf, may be some other files are changing...
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Nov 29, 2012 2:17 pm    Post subject: Reply with quote

ok, unfortunately I don't know anything about nvidia-xconfig. On my desktop I've a ATI card, my laptop runs with nouveau. I've just read in the debian-wiki that nvidia-xonfig is not recommended and has a bug (from 2008, maybe it's not an issue anymore):

http://wiki.debian.org/NvidiaGraphicsDrivers#Using_nvidia-xconfig
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504692

I guess you've already tried to set standard resolution in the KDE system setting and if you put
Code:
xrandr -- some options

in a autostart file in KDE and this doesn't work I don't what to do then, so someone else have to step in... :)
(and plz post the output of /var/log/Xorg.0.log and your make.conf file)
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Nov 29, 2012 4:13 pm    Post subject: Reply with quote

I think it isn't a nvidia-xconfig bug. The same problem I have with nouveau driver.

xrandr -d :0 -s 1280x1024 fails every time with "Can't open screen" message.

And I've looked into Xorg.0.log. So what I found: if monitor attached, driver requests monitor for valid modes and switches into 1280x1024 (as written in xorg.conf). If monitor disconnected, request for valid modes fails and driver desides to switch into failsafe default mode.
I've tried to asign monitor identifier name this way:

Code:
Section "Monitor"
    Identifier     "LG L1953HR"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
        Modes       "1280x1024"
    EndSubSection
EndSection


And booted with disconnected monitor. Here a log from Xorg:

Code:
[    10.926] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[    10.926] (==) NVIDIA(0): RGB weight 888
[    10.926] (==) NVIDIA(0): Default visual is TrueColor
[    10.926] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[    10.926] (**) NVIDIA(0): Enabling 2D acceleration
[    11.356] (WW) NVIDIA(GPU-0): Unable to read EDID for display device CRT-1
[    11.360] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 550 Ti (GF116) at PCI:1:0:0 (GPU-0)
[    11.360] (--) NVIDIA(0): Memory: 1048576 kBytes
[    11.360] (--) NVIDIA(0): VideoBIOS: 70.26.3a.00.00
[    11.360] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[    11.360] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
[    11.362] (--) NVIDIA(0): Connected display device(s) on GeForce GTX 550 Ti at
[    11.362] (--) NVIDIA(0):     PCI:1:0:0
[    11.362] (--) NVIDIA(0):     CRT-1
[    11.362] (--) NVIDIA(0): CRT-1: 400.0 MHz maximum pixel clock
[    11.372] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display
[    11.372] (**) NVIDIA(0):     device CRT-1 (Using EDID frequencies has been enabled on
[    11.372] (**) NVIDIA(0):     all display devices.)
[    11.374] (II) NVIDIA(0): Assigned Display Device: CRT-1
[    11.374] (WW) NVIDIA(0): No valid modes for "1280x1024"; removing.
[    11.374] (WW) NVIDIA(0):
[    11.374] (WW) NVIDIA(0): Unable to validate any modes; falling back to the default mode
[    11.374] (WW) NVIDIA(0):     "nvidia-auto-select".
[    11.374] (WW) NVIDIA(0):
[    11.374] (II) NVIDIA(0): Validated modes:
[    11.374] (II) NVIDIA(0):     "nvidia-auto-select"
[    11.374] (II) NVIDIA(0): Virtual screen size determined to be 1024 x 768
[    11.406] (WW) NVIDIA(0): Unable to get display device CRT-1's EDID; cannot compute DPI
[    11.406] (WW) NVIDIA(0):     from CRT-1's EDID.
[    11.406] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default


1024x768 is a bit better, but any way it is not a native mode for my monitor.
Any idea on how to set this default failsafe mode to 1280x1024?
Back to top
View user's profile Send private message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Thu Nov 29, 2012 5:26 pm    Post subject: Reply with quote

for xrandr, try:
Code:
xrandr --output VGA-0 (or whatever your monitor is) --mode 1280x1024

the display option "d:0" didn't work in my system, maybe it works with this...

about the other thing I don't have any good idea.. it looks like the CRT-1 (this is the monitor that you sometimes disconnect?!) is set as the default monitor and if disconnected if fails into default fail safe mode, so set the "always connected monitor or laptop-monitor" as the default... Like I said I'm not really familiar with xorg.conf so I don't know how :)
to set the default failsafe mode to 1280x1024 (don't know how) would be less elegant...
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Nov 30, 2012 8:06 am    Post subject: Reply with quote

Finally, I got my native resolution.
I unsuccessfuly tried to modify nvidia-auto-select mode (change it to 1280x1024).
After that I found a way to pass EDID info to driver when monitor disconnected and unreachable for retrieving EDID.
I booted with monitor and get EDID info from NVidia-Xsettings utility and saves it as binary in /etc/X11/edid.bin file.
And added custom EDID option into xorg.conf.
Code:
Option         "CustomEDID" "CRT-1:/etc/X11/edid.bin"


So now driver get correct EDID info from file, no matter connected monitor or not.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum