Xorg config for 10-monitor.conf & 20-amdgpu.conf - setting refresh rate

-"Tearfree"
Based on xorg.conf(5) (just as in xorg.conf) there just isn't such an option. That raises the question where the OP in the Arch thread is getting that from.
I will remove the 'TearFree' line from my xorg config file.

-"What's interesting is that this example taken from the forum post above doesn't (1) specify amdgpu as the driver, and (2) no reference is made to the BusID parameter providing the PCI address."
The BusID, I have answered in my previous message. The OP's grahics card (here) is, speaking in FreeBSD relative terms, somewhat older than your iGPU; then in that situation the std choice is to use the Xorg default driver: modesetting(4):
- AMD Ryzen 9 7900: release date "Jan 14th, 2023"
- AMD Radeon RX 6700 XT: release date "Mar 18th, 2021"

For about a year ago IIRC, AMD CPUs (and their accompanying iGPU graphics), of a (Zen 4 (Raphael) generation) couldn't be made to work with FreeBSD graphcs drivers for -RELEASE versions. Now, on 15.0-RELEASE, we have drm66-kmod (in addition to drm-61-kmod) and with every new version it gets improved.
Yes, you said that the BusID parameter is probably not required as I only have one GPU in the system - the iGPU of the CPU.
As my iGPU is newer than the referenced OP's GPU where he needed to use the xorg 'modesetting' driver, I can instead use the 'amdgpu' driver.

Correct me if I'm wrong but these other drm drivers (drm61-kmod, drm66-kmod) refer to linux kernel version numbers from which the drm driver code was taken? drm66-kmod is the latest?

-"So how does it work? Is it implied due to the filename - 20-amdgpu.conf?
[...]
"
No, when the Xorg modesetting(4) is used (explicitly by you in your config specification, or implicitly when there is no Xorg driver being specified) the Xorg amdgpu(4) driver just is not used. However the DRM-KMS, as in kld_list="amdgpu" is used and in your case, for AMD graphics hardware is mandatory when you want to have your complete graphics stack comlete with accellerated graphics and using Kernel Mode Setting--as opposed to User Mode Setting =UMS. UMS is being replaced by KMS; UMS is only being used in somewhat rare cases for older hardware that need a legacy (UMS) graphics driver, an Xorg UMS can funtion without its DRM-KMS counterpart as specified in /etc/rc.conf by kld_list="< driver >"*
So if I understand correctly, despite the fact that I have explicitly stated to use the 'modesetting' driver in my xorg config file, this will ultimately use the 'amdgpu' driver specified in the kldlist="amdgpu" line within /etc/rc.conf?

-"UseDisplayDevice"
I don't see it mentioned in xorg.conf(5), probably isn't valid or hansn't any meaning for the modesetting(4) driver.
BTW, neither present in amdgpu(4). The question arises where the OP got that from (again).
Yes, it seems invalid now, so this is one that I can delete from my xorg config file.

-PreferredMode
Code:
    Modeline        "2560x1440_120"  488.40  2560 2608 2640 2750  1440 1466 1474 1480 +hsync -vsync
    Option          "PreferredMode" "2560x1440_120"
As is documented in xorg.conf(5):
Rich (BB code):
       Mode  "name"
          This is an optional multi-line entry that    can be used to provide
          definitions for video modes for the monitor.  
    [...]
        ModeLine     "name"    mode-description
          This  entry  is a    more compact version of    the Mode entry, and it
          also can be used to specify video    modes for the  monitor.      This
          is  a  single  line  format for specifying video modes.  In most
          cases this isn't necessary because  the  built-in     set  of  VESA
          standard modes will be sufficient.

          The  mode-description  is     in  four sections, the    first three of
          which are    mandatory.
   [...]
You have specified only one "Modeline", the preferred one is therefore implied; deleting
Option "PreferredMode" "2560x1440_120"
should make the reported "warning" go away and the result of your configuration should be the same.
The last tagged line by me (in bold and italics) is about the specific syntax of the Modeline. As you noticed (and have solved) the Xorg couldn't decode a valid config setting when the " (double quote) was missing in an essential place.
Ok, as you say, as I have a single modeline, it should be implied and therefore redundant, so can be removed.

My impression is that instead of specifying the 'modesetting' driver within the xorg config file and the system then using the 'amdgpu' specified within /etc/rc.conf, I should really directly reference the 'amdgpu' driver within said config file.

Do you agree?
 
Here is my current /usr/local/etc/X11/xorg.conf.d/20-amdgpu.conf:

Code:
root@freebsd:/usr/local/etc/X11/xorg.conf.d # cat 20-amdgpu.conf
Section "Monitor"
    Identifier      "Monitor0"
    ModelName       "Dell U2724D"
    Modeline        "2560x1440_120"  488.40  2560 2608 2640 2750  1440 1466 1474 1480 +hsync -vsync
    Option          "PreferredMode" "2560x1440_120"
    Option          "DPMS" "false"
EndSection

Section "Screen"
    Identifier      "Screen0"
    Device          "AMDGraphics"
    Monitor         "Monitor0"
    SubSection      "Display"
        Modes           "2560x1440_120"
    EndSubSection
EndSection

Section "Device"
    Identifier      "AMDGraphics"
    Driver          "modesetting"
    Option          "TearFree" "true"
    Option          "VariableRefresh" "true"
    Option          "AsyncFlipSecondaries" "false"
    Option          "UseDisplayDevice" "HDMI-A-0"
EndSection
root@freebsd:/usr/local/etc/X11/xorg.conf.d #
 
Here is the /var/log/Xorg.0.log file:

It is also attached as a file - if it is too long I can delete it and rely on the 'termbin' URL being readable.
It seems termbin URLs expire after a certain period of time and become unreadable (404), which is why I also attached it as a file.
I renamed the file by appending '.txt' so that I could upload the log file.
 

Attachments

I have amended the xorg config file to reflect the items addressed, so it now looks like:
Code:
root@freebsd:/usr/local/etc/X11/xorg.conf.d # cat 20-amdgpu.conf
Section "Monitor"
    Identifier      "Monitor0"
    ModelName       "Dell U2724D"
    Modeline        "2560x1440_120"  488.40  2560 2608 2640 2750  1440 1466 1474 1480 +hsync -vsync
#    Option          "PreferredMode" "2560x1440_120"
    Option          "DPMS" "false"
EndSection

Section "Screen"
    Identifier      "Screen0"
    Device          "AMDGraphics"
    Monitor         "Monitor0"
    SubSection      "Display"
        Modes           "2560x1440_120"
    EndSubSection
EndSection

Section "Device"
    Identifier      "AMDGraphics"
#    Driver          "modesetting"
    Driver          "amdgpu"
#    Option          "TearFree" "true"
    Option          "VariableRefresh" "true"
    Option          "AsyncFlipSecondaries" "false"
#    Option          "UseDisplayDevice" "HDMI-A-0"
EndSection
root@freebsd:/usr/local/etc/X11/xorg.conf.d #
 
Looking through this /var/log/Xorg.0.log, as far as I am concerned all looks good as far as I am aware - a few lines of interest are:
Note the address of the iGPU: 164e - we see this in a later message:
Code:
[    38.369] (--) PCI:*(18@0:0:0) 1002:164e:1462:7d77 rev 196, Mem @ 0xfce0000000/268435456, 0xfcf0000000/2097152, 0xf6600000/524288, I/O @ 0x0000e000/256, BIOS @ 0x????????/65536

Loading the Xorg amdgpu driver?:
Code:
[    38.373] (II) LoadModule: "amdgpu"
[    38.373] (II) Loading /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so
[    38.375] (II) Module amdgpu: vendor="X.Org Foundation"
[    38.375]     compiled for 1.21.1.20, module version = 22.0.0
[    38.375]     Module class: X.Org Video Driver
[    38.375]     ABI class: X.Org Video Driver, version 25.2
[    38.375] (II) AMDGPU: Driver for AMD Radeon:
    All GPUs supported by the amdgpu kernel driver

See 'ChipID' - it matches the iGPU address shown above (0x164e):
Code:
[    38.414] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    38.414] (==) AMDGPU(0): Depth 24, (--) framebuffer bpp 32
[    38.414] (II) AMDGPU(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)
[    38.414] (==) AMDGPU(0): Default visual is TrueColor
[    38.414] (**) AMDGPU(0): Option "VariableRefresh" "true"
[    38.414] (**) AMDGPU(0): Option "AsyncFlipSecondaries" "false"
[    38.414] (==) AMDGPU(0): RGB weight 888
[    38.414] (II) AMDGPU(0): Using 8 bits per RGB (8 bit DAC)
[    38.414] (--) AMDGPU(0): Chipset: "AMD Radeon Graphics" (ChipID = 0x164e)

Driver details mention 'raphael' - the name of the iGPU graphics built into the CPU, also note the 'TearFree' property (not recognised in previous config but that was using 'modesetting' driver). Also confirmation that HDMI-A-0 is using the 'Monitor0' section from our xorg config file:
Code:
[    38.550] (II) AMDGPU(0): glamor: Using OpenGL 4.6 context.
[    38.550] (II) AMDGPU(0): glamor X acceleration enabled on AMD Radeon Graphics (radeonsi, raphael_mendocino, LLVM 19.1.7, DRM 3.54, 15.0-RELEASE)
[    38.550] (II) AMDGPU(0): glamor detected, initialising EGL layer.
[    38.550] (==) AMDGPU(0): TearFree property default: auto
[    38.550] (**) AMDGPU(0): VariableRefresh: enabled
[    38.550] (**) AMDGPU(0): AsyncFlipSecondaries: disabled
[    38.550] (II) AMDGPU(0): KMS Pageflipping: enabled
[    38.551] (II) AMDGPU(0): Output HDMI-A-0 using monitor section Monitor0

Using the only specified modeline for the resolution and refresh rate required:
Code:
[    38.553] (II) AMDGPU(0): First detailed timing is preferred mode
...
[    38.554] (II) AMDGPU(0): Modeline "2560x1440_120"x120.0  488.40  2560 2608 2640 2750  1440 1466 1474 1480 +hsync -vsync (177.6 kHz UP)

Confirming connection, mode etc:
Code:
[    38.554] (II) AMDGPU(0): Output HDMI-A-0 connected
...
[    38.554] (II) AMDGPU(0): Using user preference for initial modes
[    38.554] (II) AMDGPU(0): Output HDMI-A-0 using initial mode 2560x1440_120 +0+0

Other stuff:
Code:
[    38.554] (II) AMDGPU(0): [DRI2] Setup complete
[    38.554] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[    38.554] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
[    38.554] (II) AMDGPU(0): Front buffer pitch: 10240 bytes
[    38.554] (II) AMDGPU(0): SYNC extension fences enabled
[    38.554] (II) AMDGPU(0): Present extension enabled
[    38.554] (==) AMDGPU(0): DRI3 enabled
[    38.554] (==) AMDGPU(0): Backing store enabled
[    38.554] (II) AMDGPU(0): Direct rendering enabled
[    38.567] (II) AMDGPU(0): Use GLAMOR acceleration.
[    38.567] (II) AMDGPU(0): Acceleration enabled
[    38.567] (==) AMDGPU(0): Silken mouse enabled
[    38.568] (II) AMDGPU(0): Set up textured video (glamor)

This seems to confirm that it is using the Xorg provided amdgpu driver (/usr/local/lib/xorg/modules/drivers/amdgpu_drv.so).

After boot, once temps settle, the CPU is 47.7C. This is a fully passively cooled system - no fans anywhere, ambient room temp is 21C.
If I watch a youtube video the CPU temp (with integrated GPU) is reading between about 50C and 52C which seems good.
From this it seems clear to me that video rendering is efficient and is therefore using the iGPU hardware directly for the rendering, and not using software rendering.
Previously when I was using the 'scfb' video driver the CPU temp was between about 60C and 80C when watching a youtube video, so this is a huge improvement! :)
 
I will see what erichans thinks of these last config changes and log output.

Questions I have are:
1. What is the difference between the default* amdgpu driver and the Xorg amdgpu driver?
2. Is it possible to select the default amdgpu instead of the Xorg amdgpu driver and would I want to? (do performance/capability differences exist?)
3. If so, how can one select the default amdgpu driver?

The Xorg amdgpu driver is: /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so

The default amdgpu driver is: I can't find it - not sure which file to look for.
Actually, when I searched I found the following:
/usr/ports/graphics/drm-66-kmod/work/stage/boot/modules/amdgpu.ko
and many amdgpu-related modules (amdgpu*.ko) in /boot/modules/

Other references found:
Code:
root@freebsd:/ # find / -name amdgpu.ko
/usr/ports/graphics/drm-66-kmod/work/stage/boot/modules/amdgpu.ko
/usr/ports/graphics/drm-66-kmod/work/drm-kmod-drm_v6.6.25_6/obj/usr/ports/graphics/drm-66-kmod/work/drm-kmod-drm_v6.6.25_6/amd/amdgpu/amdgpu.ko
/boot/modules/amdgpu.ko
root@freebsd:/ #

Taking a look at these various files we see:
Code:
root@freebsd:/ # ls -l /boot/modules/amdgpu.ko
-r--r--r--  1 root wheel 11647040 Dec 12 15:50 /boot/modules/amdgpu.ko

root@freebsd:/ # ls -l /usr/ports/graphics/drm-66-kmod/work/stage/boot/modules/amdgpu.ko
-r--r--r--  1 root wheel 11642944 Dec 10 19:08 /usr/ports/graphics/drm-66-kmod/work/stage/boot/modules/amdgpu.ko

root@freebsd:/ # ls -l /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so
-rwxr-xr-x  1 root wheel 145872 Dec  1 17:28 /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so
root@freebsd:/ #


---
* by 'default' I mean the driver coming from AMD.
 
Back
Top