1.\" $NetBSD: drm.4,v 1.7 2009/05/12 08:16:46 wiz Exp $ 2.\" 3.\" Copyright (c) 2007 Thomas Klausner 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd June 18, 2022 27.Dt DRM 4 28.Os 29.Sh NAME 30.Nm drm 31.Nd Direct Rendering Manager (DRI kernel support) 32.Sh DESCRIPTION 33The 34.Tn Direct Rendering Manager 35is part of the 36.Tn Direct Rendering Infrastructure 37(see 38.Pa http://dri.freedesktop.org/ ) 39for supporting video acceleration. 40.Pp 41The 42.Nm 43drivers provide support for the following chipsets: 44.Bl -column -offset indent ".Pa radeon.ko" ".Sy Kernel Option" ".Sy Chipset" 45.It Sy Module Ta Sy "Kernel option" Ta Sy Chipset 46.It Pa i915.ko Ta i915 Ta Intel i915, i945, i965, G3x, G4x 47.It Pa radeon.ko Ta radeon Ta AMD/ATI Radeon 48.It Pa amdgpu.ko Ta n/a Ta newer AMD chipsets 49.El 50.Pp 51In most cases 52.Xr Xorg 1 53will take care of loading the appropriate modules and it is not necessary to 54modify 55.Xr loader.conf 5 56or the kernel configuration to enable 57.Nm 58support. 59.Pp 60Newer versions of 61.Xr Xorg 1 , 62like the one from 63.Xr dports 7 , 64do a pretty good job of figuring out the right configuration on their own, 65so having no 66.Xr xorg.conf 5 67file at all is usually the best advice. 68If for some reason an 69.Xr xorg.conf 5 70is preferred, DRI must be enabled: 71.Bd -literal 72Section "DRI" 73 Group "video" 74 Mode 0660 75EndSection 76.Ed 77.Pp 78With KMS, DRI is always enabled since the 79.Nm 80is always required. 81.Pp 82To access 83.Pa /dev/dri/cardN 84devices user must be a member of the 85.Li video 86group. 87Users can be added to the 88.Li video 89group with 90.Xr pw 8 91groupmod option. 92.\".Pp 93.\"In order to use two graphics cards (an on-board and another 94.\"AGP/PCI/PCIe card) with DRI, a 95.\".Pa /dev/dri/card1 96.\"link to 97.\".Pa /dev/dri/card0 98.\"has to be created using 99.\".Xr devfsctl 8 . 100.Pp 101If 102.Xr Xorg 1 103acceleration fails to initialize with a 104.Dq contigmalloc_map: failed size... 105error in dmesg, the reserve of memory for DMA ran out early and should 106be increased to a sufficiently high value by setting the 107.Va vm.dma_reserved 108loader tunable. 109A read only 110.Xr sysctl 8 111variable of the same name is provided for obtaining its current value. 112.Sh LOADER TUNABLES 113Tunables can be set at the 114.Xr loader 8 115prompt before booting the kernel or stored in 116.Xr loader.conf 5 . 117.Bl -tag -width "xxxxxx" 118.It Va drm.debug 119Enable internal verbose debug messages, might slow down the machine. 120Debug categories are enabled by setting their bits: 121.Bl -tag -width "xxxxx" 122.It 0x001 123CORE - generic drm code 124.It 0x002 125DRIVER - vendor specific parts of the driver 126.It 0x004 127KMS - modesetting troubleshoot 128.It 0x008 129PRIME (no prime support) 130.It 0x010 131ATOMIC - atomic code used by i915 132.It 0x100 133PID - include pid number (useful in certain scenarios) 134.It 0x200 135FIOCTL - failed ioctls 136.It 0x400 137IOCTL - very spammy ioctl prints 138.It 0x800 139VBLANK - very spammy vblank prints 140.El 141.It Va drm.edid_firmware 142Load external EDID binary monitor data from a firmware module. 143Useful if the monitor is not sending an appropriate EDID block, if there 144is no video on the connected monitor or if there is a need to enforce 145custom video modes. 146Optionally, the connector name can be specified before the firmware name 147followed by a colon. 148For example: 149.Pp 150.Dl drm.edid_firmware="DVI-D-1:edidfw_repaired" 151.Pp 152Notes: 153.Nm 154and 155.Xr Xorg 1 156use different naming conventions for connector names. 157This tunable only applies for KMS drivers. 158.It Va drm.video.<connector> 159Can be used to set framebuffer parameters for drm(4) connector. 160Mode specifier format: 161.Pp 162.Dl <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] 163.Bl -tag -width "<refresh>" 164.It <xres> 165X resolution, e.g. 1920 166.It <yres> 167Y resolution, e.g. 1080 168.It M 169calculate timings using VESA CVT instead of table lookups 170.It R 171reduced blanking on digital monitors 172.It <bpp> 173color depth 174.It <refresh> 175refresh rate 176.It i 177calculate timings for interlaced mode 178.It m 179margins used in calculations 180.It e 181force enable output 182.It D 183same as e option, but force digital output on HDMI/DVI 184.It d 185force disable output 186.El 187.El 188.Sh SYSCTL VARIABLES 189A number of 190.Xr sysctl 8 191variables are available: 192.Bl -tag -width ".Va hw.dri.vblank_offdelay" 193.It Va hw.dri.debug 194If set, enables debugging output. 195.It Va hw.dri.vblank_offdelay 196Specifies the delay (in milliseconds) until the vblank 197interrupt is disabled again when it's no longer needed. 198(0 = never disable, negative value = disable immediately) 199.It Va hw.dri.%d.busid 200Indicates the location of the device on the PCI bus. 201The format is: 202.Pp 203.Dl [0000-ffff]:[00-ff]:[00-1f].[0-7] 204.It Va hw.dri.%d.modesetting 205Indicates if kernel mode setting 206.Dv ( DRIVER_MODESET 207feature) is set in the device driver. 208.El 209.Sh SEE ALSO 210.Xr Xorg 1 , 211.Xr amdgpu 4 , 212.Xr i915 4 , 213.Xr radeon 4 , 214.Xr xorg.conf 5 215.Sh HISTORY 216DRM was first available for Linux. 217Subsequently Eric Anholt ported the DRM kernel modules to 218.Fx . 219.Sh CAVEATS 220Disable AIGLX if necessary 221.Pq Pa xorg.conf : 222.Bd -literal -offset indent 223Section "ServerFlags" 224 Option "AIGLX" "off" 225EndSection 226.\" 227.\"Section "Extensions" 228.\" Option "Composite" "Disable" 229.\"EndSection 230.Ed 231.Pp 232.Cd options DRM_DEBUG 233can slow DRI down a lot, disable it once 234.Nm 235works. 236