.\" $NetBSD: drm.4,v 1.7 2009/05/12 08:16:46 wiz Exp $ .\" .\" Copyright (c) 2007 Thomas Klausner .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd June 18, 2022 .Dt DRM 4 .Os .Sh NAME .Nm drm .Nd Direct Rendering Manager (DRI kernel support) .Sh DESCRIPTION The .Tn Direct Rendering Manager is part of the .Tn Direct Rendering Infrastructure (see .Pa http://dri.freedesktop.org/ ) for supporting video acceleration. .Pp The .Nm drivers provide support for the following chipsets: .Bl -column -offset indent ".Pa radeon.ko" ".Sy Kernel Option" ".Sy Chipset" .It Sy Module Ta Sy "Kernel option" Ta Sy Chipset .It Pa i915.ko Ta i915 Ta Intel i915, i945, i965, G3x, G4x .It Pa radeon.ko Ta radeon Ta AMD/ATI Radeon .It Pa amdgpu.ko Ta n/a Ta newer AMD chipsets .El .Pp In most cases .Xr Xorg 1 will take care of loading the appropriate modules and it is not necessary to modify .Xr loader.conf 5 or the kernel configuration to enable .Nm support. .Pp Newer versions of .Xr Xorg 1 , like the one from .Xr dports 7 , do a pretty good job of figuring out the right configuration on their own, so having no .Xr xorg.conf 5 file at all is usually the best advice. If for some reason an .Xr xorg.conf 5 is preferred, DRI must be enabled: .Bd -literal Section "DRI" Group "video" Mode 0660 EndSection .Ed .Pp With KMS, DRI is always enabled since the .Nm is always required. .Pp To access .Pa /dev/dri/cardN devices user must be a member of the .Li video group. Users can be added to the .Li video group with .Xr pw 8 groupmod option. .\".Pp .\"In order to use two graphics cards (an on-board and another .\"AGP/PCI/PCIe card) with DRI, a .\".Pa /dev/dri/card1 .\"link to .\".Pa /dev/dri/card0 .\"has to be created using .\".Xr devfsctl 8 . .Pp If .Xr Xorg 1 acceleration fails to initialize with a .Dq contigmalloc_map: failed size... error in dmesg, the reserve of memory for DMA ran out early and should be increased to a sufficiently high value by setting the .Va vm.dma_reserved loader tunable. A read only .Xr sysctl 8 variable of the same name is provided for obtaining its current value. .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" .It Va drm.debug Enable internal verbose debug messages, might slow down the machine. Debug categories are enabled by setting their bits: .Bl -tag -width "xxxxx" .It 0x001 CORE - generic drm code .It 0x002 DRIVER - vendor specific parts of the driver .It 0x004 KMS - modesetting troubleshoot .It 0x008 PRIME (no prime support) .It 0x010 ATOMIC - atomic code used by i915 .It 0x100 PID - include pid number (useful in certain scenarios) .It 0x200 FIOCTL - failed ioctls .It 0x400 IOCTL - very spammy ioctl prints .It 0x800 VBLANK - very spammy vblank prints .El .It Va drm.edid_firmware Load external EDID binary monitor data from a firmware module. Useful if the monitor is not sending an appropriate EDID block, if there is no video on the connected monitor or if there is a need to enforce custom video modes. Optionally, the connector name can be specified before the firmware name followed by a colon. For example: .Pp .Dl drm.edid_firmware="DVI-D-1:edidfw_repaired" .Pp Notes: .Nm and .Xr Xorg 1 use different naming conventions for connector names. This tunable only applies for KMS drivers. .It Va drm.video. Can be used to set framebuffer parameters for drm(4) connector. Mode specifier format: .Pp .Dl x[M][R][-][@][i][m][eDd] .Bl -tag -width "" .It X resolution, e.g. 1920 .It Y resolution, e.g. 1080 .It M calculate timings using VESA CVT instead of table lookups .It R reduced blanking on digital monitors .It color depth .It refresh rate .It i calculate timings for interlaced mode .It m margins used in calculations .It e force enable output .It D same as e option, but force digital output on HDMI/DVI .It d force disable output .El .El .Sh SYSCTL VARIABLES A number of .Xr sysctl 8 variables are available: .Bl -tag -width ".Va hw.dri.vblank_offdelay" .It Va hw.dri.debug If set, enables debugging output. .It Va hw.dri.vblank_offdelay Specifies the delay (in milliseconds) until the vblank interrupt is disabled again when it's no longer needed. (0 = never disable, negative value = disable immediately) .It Va hw.dri.%d.busid Indicates the location of the device on the PCI bus. The format is: .Pp .Dl [0000-ffff]:[00-ff]:[00-1f].[0-7] .It Va hw.dri.%d.modesetting Indicates if kernel mode setting .Dv ( DRIVER_MODESET feature) is set in the device driver. .El .Sh SEE ALSO .Xr Xorg 1 , .Xr amdgpu 4 , .Xr i915 4 , .Xr radeon 4 , .Xr xorg.conf 5 .Sh HISTORY DRM was first available for Linux. Subsequently Eric Anholt ported the DRM kernel modules to .Fx . .Sh CAVEATS Disable AIGLX if necessary .Pq Pa xorg.conf : .Bd -literal -offset indent Section "ServerFlags" Option "AIGLX" "off" EndSection .\" .\"Section "Extensions" .\" Option "Composite" "Disable" .\"EndSection .Ed .Pp .Cd options DRM_DEBUG can slow DRI down a lot, disable it once .Nm works.