-description: This chapter describes how to install and configure Xorg on FreeBSD, which provides the open source X Window System used to provide a graphical environment
- device = 'Mobile 4 Series Chipset Integrated Graphics Controller'
+ device = 'Alder Lake-P GT2 [Iris Xe Graphics]'
class = display
- subclass = VGA
....
+Detailed instructions on installing and enabling these drivers
+are in the subsequent subsections.
+
[WARNING]
====
-If the graphics card is not supported by Intel(R), AMD(R) or NVIDIA(R) drivers, then VESA or SCFB modules should be used.
-VESA module must be used when booting in BIOS mode and SCFB module must be used when booting in UEFI mode.
+If the graphics processor is not supported by Intel(R), AMD(R),
+or NVIDIA(R) drivers, then SCFB or VESA modules should be used.
+SCFB module must be used when booting in UEFI mode.
+VESA module must be used when booting in BIOS mode.
This command can be used to check the booting mode:
@@ -183,25 +185,28 @@
[.programlisting]
....
-machdep.bootmethod: BIOS
+machdep.bootmethod: UEFI
....
====
[[x-configuration-intel]]
-=== Intel(R)
+=== Intel(R) Graphics
-Intel(R) Graphics refers to the class of graphics chips that are integrated on the same die as an Intel(R) CPU.
-Wikipedia offers link:https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units[a good overview of the variations and names used for generations of Intel HD Graphics].
+a range of kernel modules for use with Intel(R) Graphics.
+Recent versions of these modules can be used in conjunction
+with other graphics processors in PRIME with no special configuration.
-The package:graphics/drm-kmod[] package indirectly provides a range of kernel modules for use with Intel(R) Graphics cards.
-The Intel(R) driver can be installed by executing the following command:
+The Intel(R) Graphics driver can be installed
+by executing the following command:
[source,shell]
....
# pkg install drm-kmod
....
-Then add the module to `/etc/rc.conf` file, executing the following command:
+Then add the module to [.filename]#/etc/rc.conf# file,
+by executing the following command:
[source,shell]
....
@@ -209,27 +214,34 @@
....
[[x-configuration-amd]]
-=== AMD(R)
+=== AMD(R) Graphics
-The package:graphics/drm-kmod[] package indirectly provides a range of kernel modules for use with AMD(R) Graphics cards.
-The modules `amdgpu` and `radeonkms` can be used depending the generation of the hardware.
-The FreeBSD project maintains an link:https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix[AMD graphics support matrix to determine which driver must be used].
-Version 304 of the NVIDIA(R) graphics driver (package:x11/nvidia-driver-304[]) does not support xorg-server 1.20 or later.
-====
+The latest NVIDIA(R) Graphics driver can be installed
+by running the following command:
+
+[source,shell]
+....
+# pkg install nvidia-drm-kmod
+....
+
+To enable the driver, add the module to
+[.filename]#/etc/rc.conf# file, by executing the following command:
+
+[source,shell]
+....
+# sysrc kld_list+=nvidia-drm
+....
-The latest NVIDIA(R) driver can be installed by running the following command:
+This is the direct rendering crossref:glossary[glossary-kms,KMS] driver.
+
+Kernel modesetting is the option to set the graphics mode in the kernel.
+Enable it for subsequent boots with the following man:loader.conf[5]
+tunable:
[source,shell]
....
-# pkg install nvidia-driver
+hw.nvidiadrm.modeset="1'
....
-Then add the module to `/etc/rc.conf` file, executing the following command:
+Both PRIME and crossref:wayland[wayland-synopsis,Wayland]
+require kernel modesetting.
+Prior versions of the driver do not support Direct Rendering.
+Instead use the modesetting module,
+by executing the following command:
[source,shell]
....
# sysrc kld_list+=nvidia-modeset
....
-[WARNING]
-====
-The `nvidia` driver must be used if the packages package:x11/nvidia-driver-304[] or package:x11/nvidia-driver-340[] have been installed.
+If requiring Nvidia drivers prior to 390,
+note that they do not support kernel modesetting,
+and thus they must be used with the legacy man:sc[4] console driver,
+and a package:x11/xorg-server[] version prior to 1.20.
+
+Enable them in [.filename]#/etc/rc.conf# with the following command:
[source,shell]
....
# sysrc kld_list+=nvidia
....
-====
-[[x-config]]
-== Xorg Configuration
+[[x-overview]]
+== X Window System Overview
-Xorg supports most common video cards, keyboards, and pointing devices.
+The X Window System is the heritage
+graphical stack for UNIX(R) platforms,
+supporting the latest technologies
+while maintaining support for generations of applications.
+Applications, including the components of the desktop,
+are hosted by the man:Xorg[1] server.
+This system is network aware and its various components
+can interoperate across networks.
-[WARNING]
-====
-Video cards, monitors, and input devices are automatically detected and do not require any manual configuration.
-Do not create [.filename]#xorg.conf# or run a `Xorg -configure` step unless automatic configuration fails.
-====
+[[x-install]]
+== Installing The X.org Server
-[[x-config-files]]
-=== Configuration Files
+_**abstract**: The package:x11/xorg[X.org] server
+must be installed to host the crossref:desktop[desktop-synopsis,desktop].
+Users must be added to the `video` group to use it._
+
+Once a graphics driver is installed and enabled,
+the X.org server can be installed as a meta-package,
+or compiled locally with the ports tree.
-Xorg looks in several directories for configuration files.
-[.filename]#/usr/local/etc/X11/# is the *recommended* directory for these files on FreeBSD.
-Using this directory helps keep application files separate from operating system files.
+The full meta-package can be installed quickly
+but with fewer options for customization:
-[[x-config-files-single-or-multi]]
-=== Single or Multiple Files
+[source,shell]
+....
+# pkg install xorg
+....
+
+This installation results in the complete X Window System
+being installed, including a traditional window manager, man:twm[1],
+and surrounding traditional desktop suite.
+Most users will want to install and configure a
+contemporary crossref:desktop[desktop-synopsis,desktop] of their choice.
+
+The current user must be a member of the `video` group
+to run a graphical environment.
+To add a user to the `video` group, execute the following command:
-It is easier to use multiple files that each configure a specific setting than the traditional single [.filename]#xorg.conf#.
-These files are stored in the [.filename]#/usr/local/etc/X11/xorg.conf.d/# subdirectory.
+[source,shell]
+....
+# pw groupmod video -m username
+....
+
+To run the X Window System, use man:startx[1] from package:x11/xinit[],
+or install and configure a display manager
+to start a graphical login on boot.
[TIP]
====
-The traditional single [.filename]#xorg.conf# still works, but is neither as clear nor as flexible as multiple files in the [.filename]#/usr/local/etc/X11/xorg.conf.d/# subdirectory.
+A smaller version of the X Window System suitable for experienced users
+is available in package:x11/xorg-minimal[].
+Most of the documents, libraries, and applications will not be installed.
+Some applications require these additional components to function.
====
-[[x-config-video-cards]]
-=== Video Cards
+[[x-config]]
+== X.org Configuration
+
+_**abstract**: If the defaults for your monitor or input devices,
+are not satisfactory,
+crossref:desktop[desktop-synopsis,desktops]
+include GUIs for configuring them, or they can be configured manually._
+
+The X.org server supports most common graphics processors, monitors,
+and input devices.
+First, try the defaults.
+This subsection provides an overview of their configuration.
+
+[[x-config-files]]
+=== X.org Configuration Files
+
+Historically, the X.org server was configured with files in
+[.filename]#/usr/local/etc/X11/#.
+This is still supported for edge cases,
+but conflicts with dynamic autoconfiguration.
+
+Do not create configuration for the X.org server in
+[.filename]#xorg.conf#
+or run `Xorg -configure` unless automatic configuration fails.
+
+X.org server looks in several directories for configuration files.
+[.filename]#/usr/local/etc/X11/# is the *recommended* directory
+for these files on FreeBSD.
+Using this directory helps keep application files separate from
+operating system files.
+
+It is easier to use multiple files that each configure a
+specific setting than the traditional single [.filename]#xorg.conf#.
-.Select Intel(R) Video Driver and NVIDIA(R) Video Driver in a File
+.Select Intel(R) Graphics Driver and NVIDIA(R) Graphics Driver in a File
[example]
====
@@ -457,26 +582,32 @@
EndSection
Section "Device"
- Identifier "Card0"
- Driver "nvidia"
+ Identifier "Card1"
+ Driver "nvidia-modeset"
BusID "pci0:0:2:1"
EndSection
....
====
[[x-config-monitors]]
-=== Monitors
+=== Monitor Configuration
-Almost all monitors support the Extended Display Identification Data standard (`EDID`).
-Xorg uses `EDID` to communicate with the monitor and detect the supported resolutions and refresh rates.
-Then it selects the most appropriate combination of settings to use with that monitor.
+Almost all monitors support the Extended Display Identification Data
+standard (`EDID`).
+X.org uses `EDID` to communicate with the monitor
+and detect the supported resolutions and refresh rates.
+Then it selects the most appropriate combination of settings
+to use with that monitor.
-Other resolutions supported by the monitor can be chosen by setting the desired resolution in configuration files, or after the X server has been started with man:xrandr[1].
+Other resolutions supported by the monitor can be selected atomically
+after the X server has been started with man:xrandr[1],
+or in the X.org server configuration files.
[[x-config-monitors-xrandr]]
==== Using RandR (Resize and Rotate)
-Run man:xrandr[1] without any parameters to see a list of video outputs and detected monitor modes:
+Run man:xrandr[1] in an X session without any parameters
+to see a list of video outputs and detected monitor modes:
[source,shell]
....
@@ -517,9 +648,12 @@
DP-3 disconnected (normal left inverted right x axis y axis)
....
-This shows that the `VGA-1` output is being used to display a screen resolution of 1280x960 pixels at a refresh rate of about 60 Hz.
-The `LVDS-1` is being used as a secondary monitor to display a screen resolution of 1280x800 pixels at a refresh rate of about 60 Hz.
-Monitors are not attached to the `HDMI-1`, `HDMI-2`, `DP-1`, `DP-2` and `DP-3` connectors.
+This shows that the `VGA-1` output is being used to display
+a screen resolution of 1280x960 pixels at a refresh rate of about 60 Hz.
+The `LVDS-1` is being used as a secondary monitor to display
+a screen resolution of 1280x800 pixels at a refresh rate of about 60 Hz.
+Monitors are not attached to the `HDMI-1`, `HDMI-2`, `DP-1`, `DP-2`, and
+`DP-3` connectors.
Any of the other display modes can be selected with man:xrandr[1].
+ ↳ System keyboard multiplexer id=6 [slave keyboard (3)]
+ ↳ Power Button id=8 [slave keyboard (3)]
+ ↳ Sleep Button id=9 [slave keyboard (3)]
+ ↳ AT keyboard id=10 [slave keyboard (3)]
+....
+
+All settings supported by these devices are provided as properties,
+which can be listed and set atomically.
+Pointing devices have many configurable properties, keyboards usually need none.
+
+To customize your keyboard, take a look at man:setxkbmap[1].
+
+Once satisfied with your configuration, simply add the lines to your
+X initialization script such as [.filename]#~/.Xsession# or [.filename]#~/.xinitrc#.
+
+[[x-config-input-file]]
+==== Using X.org Configuration Files
-Xorg supports the vast majority of input devices via package:x11/libinput[].
[TIP]
====
-Some desktop environments (such as KDE Plasma) provide a graphical UI for setting these parameters.
+Some desktop environments (such as crossref:desktop[kde-environment,KDE Plasma]) provide a graphical UI for setting these parameters.
Check if this is the case before resorting to manual configuration editing.
====
[[x-config-input-keyboard-layout]]
-For example, to configure the keyboard layout:
+For example, to manually configure the X.org server for the keyboard layout:
.Setting a Keyboard Layout
[example]
@@ -586,53 +788,55 @@
====
[[x-fonts]]
-== Using Fonts in Xorg
+== Using Fonts in the X Window System
-The default fonts that ship with Xorg are less than ideal for typical desktop publishing applications.
-Large presentation fonts show up jagged and unprofessional looking, and small fonts are almost completely unintelligible.
-However, there are several free, high quality Type1 (PostScript(R)) fonts available which can be readily used with Xorg.
+_**abstract**: Additional fonts can be installed from the
+package:x11-fonts[] category or placed in [.filename]#~/.fonts#.
+They are available immediately to modern applications.
+Configuration for older applications is available and described as well._
-[[type1]]
-=== Type1 Fonts
+The X Window System provides the X FreeType interface library
+(man:Xft[3]) to render vector or outline fonts,
+as well as the traditional X Logical Font Description system
+maintaining compatibility with generations of applications and fonts.
-The URW font collection (package:x11-fonts/urwfonts[]) includes high quality versions of standard type1 fonts (Times Roman(TM), Helvetica(TM), Palatino(TM) and others).
-The Freefonts collection (package:x11-fonts/freefonts[]) includes many more fonts, but most of them are intended for use in graphics software such as the Gimp, and are not complete enough to serve as screen fonts.
-In addition, Xorg can be configured to use TrueType(R) fonts with a minimum of effort.
-For more details on this, see the man:X[7] manual page or crossref:x11[truetype, TrueType(R) Fonts].
+There are primarily two types of fonts users will be interested in:
-To install the above Type1 font collections from binary packages, run the following commands:
+* OpenType fonts or TrueType(R) fonts are for displaying on a screen.
+* Adobe(R) PostScript(R) Type 1 fonts are for printing to paper.
-[source,shell]
-....
-# pkg install urwfonts
-....
+These are both vector or outline fonts, there are also bitmap fonts.
-And likewise with the freefont or other collections.
-To have the X server detect these fonts, add an appropriate line to the X server configuration file ([.filename]#/usr/local/etc/X11/xorg.conf.d/90-fonts.conf#), which reads:
+The FreeBSD Ports Collection includes a wide and growing catalog
+of free, high quality fonts available for installation
+in the package:x11-fonts[] catagory.
-[.programlisting]
-....
-Section "Files"
- FontPath "/usr/local/share/fonts/urwfonts/"
-EndSection
-....
+System-wide font packages installed from the ports collection
+live in `[.filename]#/usr/local/share/fonts/#`.
+Fonts for a single user can be placed in `[.filename]#~/.fonts/#`,
+or `[.filename]#~/.local/share/fonts/#`.
-Alternatively, at the command line in the X session run:
+Fonts in either directory or subdirectories will be available
+for immediate use when the font information cache is rebuilt.
+To trigger this manually, issue:
[source,shell]
....
-% xset fp+ /usr/local/share/fonts/urwfonts
-% xset fp rehash
+% fc-cache
....
-This will work but will be lost when the X session is closed, unless it is added to the startup file ([.filename]#~/.xinitrc# for a normal `startx` session, or [.filename]#~/.xsession# when logging in through a graphical login manager like XDM).
-A third way is to use the new [.filename]#/usr/local/etc/fonts/local.conf# as
-demonstrated in crossref:x11[antialias, Anti-Aliased Fonts].
+Plenty of free, high quality fonts of both types are available in the
+ports tree which can be readily used with X Window System.
+This chapter provides a brief overview of both,
+as well as configuring the X FreeType interface.
+
+For more information about how to install and configure fonts on FreeBSD,
+please read the article link:{fonts}[Fonts and FreeBSD].
[[truetype]]
=== TrueType(R) Fonts
-Xorg has built in support for rendering TrueType(R) fonts.
+X.org has built in support for rendering TrueType(R) fonts.
There are two different modules that can enable this functionality.
The freetype module is used in this example because it is more consistent with the other font rendering back-ends.
To enable the freetype module just add the following line to the `"Module"` section of [.filename]#/usr/local/etc/X11/xorg.conf.d/90-fonts.conf#.
@@ -643,7 +847,7 @@
....
Now make a directory for the TrueType(R) fonts (for example, [.filename]#/usr/local/share/fonts/TrueType#) and copy all of the TrueType(R) fonts into this directory.
-Keep in mind that TrueType(R) fonts cannot be directly taken from an Apple(R) Mac(R); they must be in UNIX(R)/MS-DOS(R)/Windows(R) format for use by Xorg.
+Keep in mind that TrueType(R) fonts cannot be directly taken from an Apple(R) Mac(R); they must be in UNIX(R)/MS-DOS(R)/Windows(R) format for use by X.org.
Once the files have been copied into this directory, use mkfontscale to create a [.filename]#fonts.dir#, so that the X font renderer knows that these new files have been installed.
`mkfontscale` can be installed as a package:
@@ -661,7 +865,7 @@
....
Now add the TrueType(R) directory to the font path.
-This is just the same as described in crossref:x11[type1, Type1 Fonts]:
+This is just the same as described in <<type1>>:
[source,shell]
....
@@ -674,10 +878,45 @@
Now Gimp, LibreOffice, and all of the other X applications should now recognize the installed TrueType(R) fonts.
Extremely small fonts (as with text in a high resolution display on a web page) and extremely large fonts (within LibreOffice) will look much better now.
+[[type1]]
+=== Type1 Fonts
+
+The URW font collection (package:x11-fonts/urwfonts[]) includes high quality versions of standard type1 fonts (Times Roman(TM), Helvetica(TM), Palatino(TM) and others).
+The Freefonts collection (package:x11-fonts/freefonts[]) includes many more fonts, but most of them are intended for use in graphics software such as the Gimp, and are not complete enough to serve as screen fonts.
+
+To install the above Type1 font collections from binary packages, run the following commands:
+
+[source,shell]
+....
+# pkg install urwfonts
+....
+
+And likewise with the freefont or other collections.
+To have a manually configured X server detect these fonts, add an appropriate line to the X server configuration file ([.filename]#/usr/local/etc/X11/xorg.conf.d/90-fonts.conf#), which reads:
+
+[.programlisting]
+....
+Section "Files"
+ FontPath "/usr/local/share/fonts/urwfonts/"
+EndSection
+....
+
+Alternatively, at the command line in the X session run:
+
+[source,shell]
+....
+% xset fp+ /usr/local/share/fonts/urwfonts
+% xset fp rehash
+....
+
+This will work but will be lost when the X session is closed, unless it is added to the startup file ([.filename]#~/.xinitrc# for a normal `startx` session, or [.filename]#~/.xsession# when logging in through a graphical login manager like XDM).
+A third way is to use the new [.filename]#/usr/local/etc/fonts/local.conf# as demonstrated in <<antialias>>.
+
[[antialias]]
=== Anti-Aliased Fonts
-All fonts in Xorg that are found in [.filename]#/usr/local/share/fonts/# and [.filename]#~/.fonts/# are automatically made available for anti-aliasing to Xft-aware applications. Most recent applications are Xft-aware, including KDE, GNOME, and Firefox.
+All fonts in X.org that are found in [.filename]#/usr/local/share/fonts/# and [.filename]#~/.fonts/# are automatically made available for anti-aliasing to Xft-aware applications.
+Most recent applications are Xft-aware, including KDE, GNOME, and Firefox.
To control which fonts are anti-aliased, or to configure anti-aliasing properties, create (or edit, if it already exists) the file [.filename]#/usr/local/etc/fonts/local.conf#.
Several advanced features of the Xft font system can be tuned using this file; this section describes only some simple possibilities.
@@ -814,5 +1053,3 @@
====
Depending on the sort of display, `rgb` may need to be changed to `bgr`, `vrgb` or `vbgr`: experiment and see which works best.
====
-
-For more information about how to install and configure fonts on FreeBSD, please read the article link:{fonts}[Fonts and FreeBSD].