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 May 20, 2016 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 radeonkms.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 radeonkms.ko Ta radeon Ta AMD/ATI Radeon 48.El 49.Pp 50In most cases 51.Xr Xorg 1 52will take care of loading the appropriate modules and it is not necessary to 53modify 54.Xr loader.conf 5 55or the kernel configuration to enable 56.Nm 57support. 58.Pp 59Newer versions of 60.Xr Xorg 1 , 61like the one from 62.Xr dports 7 , 63do a pretty good job of figuring out the right configuration on their own, 64so having no 65.Xr xorg.conf 5 66file at all is usually the best advice. 67If for some reason an 68.Xr xorg.conf 5 69is preferred, DRI must be enabled: 70.Bd -literal 71Section "DRI" 72 Group "video" 73 Mode 0660 74EndSection 75.Ed 76.Pp 77With KMS, DRI is always enabled since the 78.Nm 79is always required. 80.Pp 81To access 82.Pa /dev/dri/cardN 83devices user must be a member of the 84.Li video 85group. 86Users can be added to the 87.Li video 88group with 89.Xr pw 8 90groupmod option. 91.\".Pp 92.\"In order to use two graphics cards (an on-board and another 93.\"AGP/PCI/PCIe card) with DRI, a 94.\".Pa /dev/dri/card1 95.\"link to 96.\".Pa /dev/dri/card0 97.\"has to be created using 98.\".Xr devfsctl 8 . 99.Pp 100If 101.Xr Xorg 1 102acceleration fails to initialize with a 103.Dq contigmalloc_map: failed size... 104error in dmesg, the reserve of memory for DMA ran out early and should 105be increased to a sufficiently high value by setting the 106.Va vm.dma_reserved 107loader tunable. 108A read only 109.Xr sysctl 8 110variable of the same name is provided for obtaining its current value. 111.Sh LOADER TUNABLES 112Tunables can be set at the 113.Xr loader 8 114prompt before booting the kernel or stored in 115.Xr loader.conf 5 . 116.Bl -tag -width "xxxxxx" 117.It Va drm.debug 118Enable internal verbose debug messages, might slow down the machine. 119Debug categories are enabled by setting their bits: 120.Bl -tag -width "xxxxx" 121.It 0x001 122CORE - generic drm code 123.It 0x002 124DRIVER - vendor specific parts of the driver 125.It 0x004 126KMS - modesetting troubleshoot 127.It 0x008 128PRIME (no prime support) 129.It 0x010 130ATOMIC - atomic code used by i915 131.It 0x100 132PID - include pid number (useful in certain scenarios) 133.It 0x200 134FIOCTL - failed ioctls 135.It 0x400 136IOCTL - very spammy ioctl prints 137.It 0x800 138VBLANK - very spammy vblank prints 139.El 140.It Va drm.edid_firmware 141Load external EDID binary monitor data from a firmware module. 142Useful if the monitor is not sending an appropriate EDID block, if there 143is no video on the connected monitor or if there is a need to enforce 144custom video modes. 145Optionally, the connector name can be specified before the firmware name 146followed by a colon. 147For example: 148.Pp 149.Dl drm.edid_firmware="DVI-D-1:edidfw_repaired" 150.Pp 151Notes: 152.Nm 153and 154.Xr Xorg 1 155use different naming conventions for connector names. 156This tunable only applies for KMS drivers. 157.It Va drm.video.<connector> 158Can be used to set framebuffer parameters for drm(4) connector. 159Mode specifier format: 160.Pp 161.Dl <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] 162.Bl -tag -width "<refresh>" 163.It <xres> 164X resolution, e.g. 1920 165.It <yres> 166Y resolution, e.g. 1080 167.It M 168calculate timings using VESA CVT instead of table lookups 169.It R 170reduced blanking on digital monitors 171.It <bpp> 172color depth 173.It <refresh> 174refresh rate 175.It i 176calculate timings for interlaced mode 177.It m 178margins used in calculations 179.It e 180force enable output 181.It D 182same as e option, but force digital output on HDMI/DVI 183.It d 184force disable output 185.El 186.El 187.Sh SYSCTL VARIABLES 188A number of 189.Xr sysctl 8 190variables are available: 191.Bl -tag -width ".Va hw.dri.vblank_offdelay" 192.It Va hw.dri.debug 193If set, enables debugging output. 194.It Va hw.dri.vblank_offdelay 195Specifies the delay (in milliseconds) until the vblank 196interrupt is disabled again when it's no longer needed. 197(0 = never disable, negative value = disable immediately) 198.It Va hw.dri.%d.busid 199Indicates the location of the device on the PCI bus. 200The format is: 201.Pp 202.Dl [0000-ffff]:[00-ff]:[00-1f].[0-7] 203.It Va hw.dri.%d.modesetting 204Indicates if kernel mode setting 205.Dv ( DRIVER_MODESET 206feature) is set in the device driver. 207.El 208.Sh SEE ALSO 209.Xr Xorg 1 , 210.Xr i915kms 4 , 211.Xr radeonkms 4 , 212.Xr xorg.conf 5 213.Sh HISTORY 214DRM was first available for Linux. 215Subsequently Eric Anholt ported the DRM kernel modules to 216.Fx . 217.Sh CAVEATS 218Disable AIGLX if necessary 219.Pq Pa xorg.conf : 220.Bd -literal -offset indent 221Section "ServerFlags" 222 Option "AIGLX" "off" 223EndSection 224.\" 225.\"Section "Extensions" 226.\" Option "Composite" "Disable" 227.\"EndSection 228.Ed 229.Pp 230.Cd options DRM_DEBUG 231can slow DRI down a lot, disable it once 232.Nm 233works. 234