How to set the screen resolution and gamma value?

Duncan 1i5t5.duncan at cox.net
Wed Jan 16 16:37:56 GMT 2013


Volker Wysk posted on Wed, 16 Jan 2013 15:18:38 +0100 as excerpted:

> Hello!
> 
> I've updated from KDE 4.4 to KDE 4.8.4, and now I can't set the screen's
> resolution any longer. There's only one choice: 1920*1440. With this,
> the screen flickers, especially when the background is bright. In
> addition, the font in the menu bars is so small, I can hardly read it.
> 
> "xrandr -q" yealds:
> 
>    xrandr: Failed to get size of gamma for output default Screen 0:
>    minimum 1920 x 1440, current 1920 x 1440, maximum 1920 x 1440 default
>    connected 1920x1440+0+0 0mm x 0mm
>       1920x1440       0.0*
> 
> In KDE 4.4 I was able to set the screen's resolution.

As both Kevin and Felix, I'll ask the distro, and if you changed version 
and/or what else was upgraded at the same time.

I don't remember where I read it, so don't remember whether it was a 
distro thing, or xorg, or kde, but something recently switched from using 
the old xorg resolution management to all (still xorg, but newer 
protocol) randr-based management.  Actually, it's likely that pretty much 
everyone is switching to randr right now, and I just happened to read it 
about one thing.

Which explains why you can't change resolution now, because xrandr, being 
a CLI interface to the same thing as krandrtray, is confirming that randr 
is only seeing the one resolution.

So the fix will be getting xorg and randr to see additional resolutions.

> A related problem is, that the gamma value of the screen can't be set
> any longer. In KDE 4.4, I've set it in /etc/X11/xorg.conf:
> 
> -------------------------------------------
> Section "InputDevice"
>         Identifier      "Generic Keyboard"
>         Driver          "kbd"
>         Option          "XkbRules"      "xorg"
>         Option          "XkbModel"      "pc105"
>         Option          "XkbLayout"     "de"
>         Option          "XkbVariant"    "nodeadkeys"
> EndSection
> 
> Section "InputDevice"
>         Identifier      "Configured Mouse"
>         Driver          "mouse"
> EndSection
> 
> Section "Device"
>         Identifier      "Configured Video Device"
> EndSection
> 
> Section "Monitor"
>         Identifier      "Configured Monitor"
>         Gamma 2.15
> 
> #       Größe des Bildschirms in Millimetern
>         DisplaySize 360 270
> EndSection
> 
> Section "Screen"
>         Identifier      "Default Screen"
>         Monitor         "Configured Monitor"
> EndSection -------------------------------------------
> 
> 
> This no longer works. In the system settings (Systemeinstellungen) I
> haven't found a control to set the gamma value.

As Felix said, xorg now detects most things automatically, and the only 
things you need to set are where it can't detect automatically, or where 
you want to override the defaults.

In keeping with that, xorg and most distros have switched to a multi-file 
arrangement, with each file having one or more sections.  These files are 
normally placed in /etc/X11/xorg.conf.d/ (or similar location depending 
on distro, but that's one of the default locations xorg checks).  A 
monolithic xorg.conf still works, but it's mainly for backward 
compatibility, now.

So I'd try with no xorg.conf first, then only add files and sections for 
settings (like XkbLayout in the above InputDevice section if needed, 
except that the new style uses InputClass sections, which work better 
with hotplugged devices like USB keyboards/mice, instead) that you want 
to override.

I'd suggest looking at the xorg.conf (5) manpage.  That should give you a 
good start on the new style.  In particular, you'll probably want to look 
at the InputClass, Monitor, and Device sections.

FWIW, here's some of my files.  Note that I'm running dual monitors, one 
hanging off of DVI-0, the other off of HDMI-0, so my setup is a bit more 
complex than most.  But both monitors are the same brand and model, so 
the same settings can apply to both.  (Here, I have symlinks to make 
typing easier, /etc/x -> X11 and /etc/x/conf -> xorg.conf.d, thus the 
path in my cats.):

$>>cat /etc/x/conf/jed.device.conf 
Section "Device"
        Identifier      "radeon"
        Driver          "Radeon"
        Option          "Monitor-DVI-0"         "d0"
        Option          "Monitor-HDMI-0"        "h0"
        Option          "Monitor-DisplayPort-0" "offdev.dp0"
        Option          "ColorTiling2D"
        Option          "SwapbuffersWait"       "Off"
        Option          "EXAVSync"              "Off"
EndSection

$>>cat /etc/x/conf/jed.screen.conf 
Section "Screen"
        Identifier      "s0"
        Device          "radeon"
        SubSection "Display"
                Virtual 3840    4320
        EndSubsection
EndSection

$>>cat /etc/x/conf/jed.input.conf 
Section "InputClass"
        Identifier      "trackball.accel"
        MatchDevicePath "/dev/input/event*"
        MatchIsPointer  "1"
        MatchProduct    "Logitech USB Receiver"
        Option          "AccelerationNumerator"         "31"
        Option          "AccelerationDenominator"       "10"
        Option          "AccelerationThreshold"         "0"
        Option          "AdaptiveDeceleration"          "2.5"
EndSection

#################################################################################
# ignored
Section "InputClass"
        Identifier      "offdev.mouse"
        MatchIsPointer  "1"
        MatchDevicePath "/dev/input/mouse*|/dev/input/mice"
        Option          "Ignore"
EndSection
Section "InputClass"
        Identifier      "offdev.alsa"
        MatchDevicePath "/dev/input/event*"
        MatchProduct    "HDA |HD-Audio"
        Option          "Ignore"
EndSection
Section "InputClass"
        Identifier      "offdev.spkr"
        MatchProduct    "PC Speaker"
        MatchDevicePath "/dev/input/event*"
        Option          "Ignore"
EndSection

$>>cat /etc/x/conf/jed.monitors.conf 
Section "Monitor"
        Identifier      "d0"
        Option          "above"         "h0"
        Gamma           1.1
        UseModes        "xmodes"
EndSection
Section "Monitor"
        Identifier      "h0"
        Gamma           1.1
        UseModes        "xmodes"
EndSection

#################################################################################
# ignored
Section "Monitor"
        Identifier      "offdev.dp0"
        Option          "Ignore"
EndSection

$>>cat /etc/x/conf/jed.modes.conf 
# ViewSonic     VX2250
# Specs         Min     Max
# Vert          50      75
# Horiz         24      82
# PxClk                 215

Section "Modes"
        Identifier      "xmodes"

        # from the cvt application

        # from http://old.koalateam.com/cgi-bin/nph-colas-modelines
        #ModeLin "name"         clock   width   x       x       x       
height  y       y   y#Refresh/notes
        ModeLine "1440x810"     124.44  1440    1504    1824    1952    
810     812     824 850      #75Hz 3/4 native
        ModeLine "1280x720"     98.49   1280    1336    1616    1728    
720     722     734 760      #75Hz 2/3 native
        ModeLine "1024x576"     65.04   1024    1072    1312    1408    
576     578     590 616      #75Hz
        ModeLine "960x540"      64.8    960     1024    1320    1440    
540     543     561 600      #75Hz 1/2 native
        ModeLine "800x450"      41.16   800     840     1040    1120    
450     452     464 490      #75Hz
        ModeLine "640x360"      26.88   640     672     832     896     
360     362     374 400      #75Hz 1/3 native

        # from http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
EndSection


(As you'll note, the modes section wrapped for posting.)

You'll likely need to setup a modes section with a few more modes as 
well, given that xrandr is reporting only one available.  You can look at 
the Xorg.0.log (probably located in in /var/log/) to see what xorg is 
detecting and why it's rejecting certain resolutions.

You'll note that for input, I'm only configuring devices to ignore (makes 
the log output easier to follow), and the customized acceleration on the 
one device.  They're auto-detected and just work, but I wanted a bit 
different acceleration, so that's what configured.

It's also worth noting that InputDevice sections are likely now ENTIRELY 
IGNORED, with hotplugging handling things.  So you MAY not need any 
InputDevice or InputClass sections AT ALL, especially if xorg is picking 
up the "de" layout on its own as well, as it may, if the proper 
environmental vars are set.

I suspect your monitor section is being ignored.  As you can see from 
mine, you point to it using an option in the Device section, now.  That 
would explain the Gamma setting not being picked up.  You'll also want a 
UseModes entry in the Monitor section, with a Modes section as well, 
where you can setup additional modes.  As you can see from the comments 
in mine, there's at least three ways to obtain reasonable modelines, the 
two webpages, and the cvt app.  As you can also see, I prefer the 
koalateam webpage for mine.  YMMV.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list