You are not logged in.

#1 2020-11-21 11:34:34

karb94
Member
Registered: 2019-12-15
Posts: 7

[SOLVED] Set default resolution and refresh rate with xorg.conf

This is the output of xrandr

Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 16384 x 16384
DisplayPort-0 disconnected primary (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     99.95*+ 144.00   120.00    59.95
   3840x2160     60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1920x1200     99.95
   1920x1080    120.00   119.88    60.00    60.00    50.00    59.94
   1600x1200     99.95
   1680x1050     59.88
   1600x900      60.00
   1280x1024     75.02    60.02
   1440x900      99.95
   1280x800      59.91
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    60.00    59.94
DVI-D-0 disconnected (normal left inverted right x axis y axis)

As you can see the default refresh rate is 99.95 Hz. I want to set the default to 144.00. This xrandr command sets the resolution and refresh rate to the desired one:

xrandr --output HDMI-A-0 --mode 2560x1440 --rate 144

I would like to set my xorg.conf to do this automatically on startup (instead of placing the above command in .profile). My current xorg.conf is as follows:

/etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier "HDMI"
    Modeline "2560x1440_144.00"  808.75  2560 2792 3072 3584  1440 1443 1448 1568 -hsync +vsync
    Option "PreferredMode" "2560x1440_144.00"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "AMD" # e.g. Radeon, Intel, nvidia
    Monitor "HDMI"
    DefaultDepth 24
    SubSection "Display"
        Depth       24
        Modes       "2560x1440_144.00"
    EndSubSection
EndSection

/etc/X11/xorg.conf.d/20-amdgpu.conf

Section "Device"
     Identifier "AMD"
     Driver "amdgpu"
     Option "TearFree" "true"
     Option "HDMI-A-0" "HDMI"
EndSection

This does not set the refresh rate to 144 Hz. What am I doing wrong?

Last edited by karb94 (2020-11-22 21:21:10)

Offline

#2 2020-11-21 12:23:00

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,621

Re: [SOLVED] Set default resolution and refresh rate with xorg.conf

I'd suggest using different names then HDMI and AMD as they're to generic and used in many places in code already.
Descriptive entries like "aging fullhd monitor in computerroom" , "4k tvscreen in living room" , " my first (very expensive) amd videocard"  work better.

man xorg.conf wrote:

       With  RandR  1.2-enabled  drivers, monitor sections may be tied to specific outputs of the video card.  Using the name of the output
       defined by the video driver plus the identifier of a monitor section, one associates a monitor section with an output by  adding  an
       option to the Device section in the following format:

       Option "Monitor-outputname" "monitorsection"

       (for example, Option "Monitor-VGA" "VGA monitor" for a VGA output)

Try "Monitor-HDMI-1" or "Monitor-HDMI-A-0" (not sure which of those corresponds to outputname on your system)


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2020-11-21 22:04:58

karb94
Member
Registered: 2019-12-15
Posts: 7

Re: [SOLVED] Set default resolution and refresh rate with xorg.conf

Option "Monitor-outputname" "monitorsection"

Good catch. I wrote my files based on the example in the wiki so I wasn't aware that you had to prefix the outputname with "Monitor-" in the Option line. Unfortunately, this didn't completely solve the problem. Now when Xorg server is launched the screen goes black sad. These are the modified files:

/etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier "LG 27GL850 HDMI"
    Modeline "2560x1440_144.00"  808.75  2560 2792 3072 3584  1440 1443 1448 1568 -hsync +vsync
    Option "PreferredMode" "2560x1440_144.00"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "RX 580"
    Monitor "LG 27GL850 HDMI"
    DefaultDepth 24
    SubSection "Display"
        Depth       24
        Modes       "2560x1440_144.00"
    EndSubSection
EndSection

/etc/X11/xorg.conf.d/20-amdgpu.conf

Section "Device"
     Identifier "RX 580"
     Driver "amdgpu"
     Option "TearFree" "true"
     Option "Monitor-HDMI-A-0" "LG 27GL850 HDMI"
EndSection

Last edited by karb94 (2020-11-22 11:02:58)

Offline

#4 2020-11-22 13:02:42

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,621

Re: [SOLVED] Set default resolution and refresh rate with xorg.conf

Used names are much clearer now.

Many recent problems with graphics have been solved by configuring early KMS, see https://wiki.archlinux.org/index.php/Ke … _KMS_start

Once that's been configured reboot to ensure the amdgpou kernel module / card have been initialised successfully before X starts.
Post the xorg log* from that start.


* the location of xorg logs depends on how X is started, see ithttps://wiki.archlinux.org/index.php/Xorg#General


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2020-11-22 16:04:33

Ropid
Member
Registered: 2015-03-09
Posts: 898

Re: [SOLVED] Set default resolution and refresh rate with xorg.conf

Here's the config file I use to set default resolution with the AMD driver:

Section "Monitor"
    Identifier "DisplayPort-0"
    Modeline "2560x1440_144"  586.00  2560 2568 2600 2640  1440 1465 1473 1543 +hsync -vsync
    Option "PreferredMode" "2560x1440_144"
EndSection

This is the whole file, there's nothing else needed.

You have to customize the "Identifier" to the output name where your monitor is connected ("HDMI-A-0").

You have to customize the "Modeline" to your monitor's data. You can find the modeline values of your monitor in the Xorg log file. The driver lists the monitor's modelines there.

I can tell you right now that the modeline you currently tried using in your config file is not good. The "pixel clock" value is unusually high. Monitors today use a "reduced blank" modeline which can't be generated by the normal "cvt" tool for a 144Hz refresh. The normal "cvt" tool can only do 60Hz or 120Hz. There's a special "cvt12" tool in the AUR if you want to generate a 144Hz modeline yourself.

Last edited by Ropid (2020-11-22 16:19:45)

Offline

#6 2020-11-22 21:19:15

karb94
Member
Registered: 2019-12-15
Posts: 7

Re: [SOLVED] Set default resolution and refresh rate with xorg.conf

Ropid wrote:

I can tell you right now that the modeline you currently tried using in your config file is not good. The "pixel clock" value is unusually high. Monitors today use a "reduced blank" modeline which can't be generated by the normal "cvt" tool for a 144Hz refresh. The normal "cvt" tool can only do 60Hz or 120Hz. There's a special "cvt12" tool in the AUR if you want to generate a 144Hz modeline yourself.

That was it! I got my timings from cvt as suggested in the arch wiki but they were nowhere near the correct ones. I checked the Xorg log file and found the right values for 2560x1440 144Hz and everything works fine now. Out of curiosity, is this explained anywhere in the wiki?

Offline

Board footer

Powered by FluxBB