Xorg config for Dell Precision 7540 dual Intel and AMD Graphics Cards

I am writing this because after a few installs, this may help someone else who has this specific laptop. This guide applies to FreeBSD 14/15. Really, the main issues to be aware of have to do with the dual AMD/Intel graphics cards. Otherwise the install works fine with a few weird quirks depending on your graphical setup.
My graphic cards are:
Code:
AMD Lexa XT [Radeon PRO WX 320]
Intel CoffeeLake-H GT2 [UHD Graphics 630]


If there is no X config, it will not start, saying you MUST specify the BusIDs. So hopefully, if someone has this issue, this helps them.

Code:
Section "ServerLayout"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
    ModulePath   "/usr/local/lib/xorg/modules"
    FontPath     "/usr/local/share/fonts/misc/"
    FontPath     "/usr/local/share/fonts/TTF/"
    FontPath     "/usr/local/share/fonts/OTF/"
    FontPath     "/usr/local/share/fonts/Type1/"
    FontPath     "/usr/local/share/fonts/100dpi/"
    FontPath     "/usr/local/share/fonts/75dpi/"
    FontPath     "catalogue:/usr/local/etc/X11/fontpath.d"
EndSection

Section "Module"
    Load  "glx"
EndSection

Section "InputDevice"
    Identifier  "Keyboard0"
    Driver      "kbd"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/sysmouse"
    Option        "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
    Identifier   "Monitor0"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection

Section "Monitor"
    Identifier   "Monitor1"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"               # [<bool>]
        #Option     "kmsdev"                 # <str>
        #Option     "ShadowFB"               # [<bool>]
        #Option     "AccelMethod"            # <str>
        #Option     "PageFlip"               # [<bool>]
        #Option     "ZaphodHeads"            # <str>
        #Option     "DoubleShadow"           # [<bool>]
        #Option     "Atomic"                 # [<bool>]
        #Option     "VariableRefresh"        # [<bool>]
        #Option     "UseGammaLUT"            # [<bool>]
        #Option     "AsyncFlipSecondaries"     # [<bool>]
    Identifier  "Card0"
    Driver      "modesetting"
    BusID       "PCI:0:2:0"
EndSection

Section "Device"
    Identifier  "Card1"
    Driver      "amdgpu"
    BusID       "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
    SubSection "Display"
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device     "Card1"
    Monitor    "Monitor1"
    SubSection "Display"
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection
 
I wonder if something like this would work (would auto-detect the driver to the right device based on auto-detect for Intel/AMD vs hard-coding BusID)? Depending on where the displays are wired, Intel's driver might need to be modesetting instead, or one or the other might benefit from TearFree:

Code:
Section "OutputClass"
    Identifier "Intel Graphics"
    MatchDriver "i915"
    Driver "intel"
    Option "TearFree" "0"
EndSection

Section "OutputClass"
    Identifier "AMD Graphics"
    MatchDriver "amdgpu"
    Driver "amdgpu"
    Option "TearFree" "1"
EndSection
 
I have not tried TearFree. I remember having what you suggested with specifying intel and amdgpu, however IIRC certain things would not work (such as linux-brave or wine). It has been a bit since I have tried, and I have not tried it in FreeBSD 15. I just used the same config because it seems to work well. I will try TearFree and see how that works.
 
I still have to use this xorg.conf on FreeBSD 15.

Starting xorg with no config does not work. Still asks for BusIDs. I have tried numerous other configs, but it only works if you have the BusIDs.

Wayland works fine, but if you need anything with Xwayland, you need xorg to work.
 
Maybe ?

kld_list="i915kms"
kld_list="amdgpu"

Code:
Section "Device"
    Identifier "IntelGraphics"
    Driver     "i915kms"
    BusID      "PCI:0:2:0"
EndSection

Section "Device"
    Identifier "AMDGraphics"
    Driver     "amdgpu"
    BusID      "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "AMDGraphics" # Primary
EndSection
 
I have them both defined in one line
kld_list="amdgpu i915kms"

What I have noticed is the following:

I do not run sddm etc. It boots directly to console. If I do not load any display drivers, output only shows on my laptop's screen, no output via HDMI.

If I load amdgpu first, output does not come out my laptop's display. It only comes out via its HDMI port. (I can see the previous console messages on my laptop's screen but no new text is displayed). However, via X/wayland I can use both displays (except in KDE. XFCE/wayfire I can use both).

If I load i915kms first, it will NOT use my HDMI but will display output only my laptop's display. I cannot use my HDMI display. KDE/XFCE/Wayfire do not see the HDMI display.

This seems to be more than just a thing with Xorg.
 
I understand that. What I am saying is the following:

If I do not load any modules (amdgpu or i915kms), output stays on laptop screen. However no X will ever start (as expected).

If I load amdgpu first, output changes to HDMI, and no longer on laptop screen. However, xorg/wayland show both laptop and HDMI output and work as expected.

If I load i915kms first, output stays on laptop screen. However, when using X or wayland, neither show HDMI as an available output (for example, xrandr only shows one screen, the laptop).

As long as I load amdgpu first, I am fine if I have an HDMI output attached. If I have no HDMI output attached, I must load i915kms first.

My original post was only saying that I cannot use X at all unless I created that xorg.conf manually, which as of 15.0-RELEASE-p5 is still true.
 
Back
Top