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 November 29, 2015 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 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 "wheel" 73 Mode 0660 74EndSection 75.Ed 76.Pp 77With KMS, DRI is always enabled since the 78.Nm 79is always required. 80.\".Pp 81.\"In order to use two graphics cards (an on-board and another 82.\"AGP/PCI/PCIe card) with DRI, a 83.\".Pa /dev/dri/card1 84.\"link to 85.\".Pa /dev/dri/card0 86.\"has to be created using 87.\".Xr devfsctl 8 . 88.Pp 89If 90.Xr Xorg 1 91acceleration fails to initialize with a 92.Dq contigmalloc_map: failed size... 93error in dmesg, the reserve of memory for DMA ran out early and should 94be increased to a sufficiently high value by setting the 95.Va vm.dma_reserved 96loader tunable. 97A read only 98.Xr sysctl 8 99variable of the same name is provided for obtaining its current value. 100.Sh LOADER TUNABLES 101Tunables can be set at the 102.Xr loader 8 103prompt before booting the kernel or stored in 104.Xr loader.conf 5 . 105.Bl -tag -width "xxxxxx" 106.It Va drm.edid_firmware 107Load external EDID binary monitor data from firmware module. 108Useful if monitor is not sending appropiate EDID block, no video on 109connected monitor or there is a need to enforce custom video modes. 110Optionally, connector name can be specified before firmware name 111followed by colon, for example: 112.Pp 113.Dl drm.edid_firmware="DVI-D-1:edidfw_repaired" 114.Pp 115Notes: 116.Nm 117and 118.Xr Xorg 1 119use different naming conventions for connector names. 120This tunable only applies for KMS drivers. 121.It Va drm.video.<connector> 122Can be used to set framebuffer parameters for drm(4) connector. 123Mode specifier format: 124.Pp 125.Dl <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] 126.Bl -tag -width "<refresh>" 127.It <xres> 128X resolution, e.g. 1920 129.It <yres> 130Y resolution, e.g. 1080 131.It M 132calculate timings using VESA CVT instead of table lookups 133.It R 134reduced blanking on digital monitors 135.It <bpp> 136color depth 137.It <refresh> 138refresh rate 139.It i 140calculate timings for interlaced mode 141.It m 142margins used in calculations 143.It e 144force enable output 145.It D 146same as e option, but force digital output on HDMI/DVI 147.It d 148force disable output 149.El 150.El 151.Sh SYSCTL VARIABLES 152A number of 153.Xr sysctl 8 154variables are available: 155.Bl -tag -width ".Va hw.dri.vblank_offdelay" 156.It Va hw.dri.debug 157If set, enables debugging output. 158.It Va hw.dri.vblank_offdelay 159Specifies the delay (in milliseconds) until the vblank 160interrupt is disabled again when it's no longer needed. 161(0 = never disable, negative value = disable immediately) 162.It Va hw.dri.%d.busid 163Indicates the location of the device on the PCI bus. 164The format is: 165.Pp 166.Dl [0000-ffff]:[00-ff]:[00-1f].[0-7] 167.It Va hw.dri.%d.modesetting 168Indicates if kernel mode setting 169.Dv ( DRIVER_MODESET 170feature) is set in the device driver. 171.El 172.Sh SEE ALSO 173.Xr Xorg 1 , 174.Xr i915kms 4 , 175.Xr radeonkms 4 , 176.Xr xorg.conf 5 177.Sh HISTORY 178DRM was first available for Linux. 179Subsequently Eric Anholt ported the DRM kernel modules to 180.Fx . 181.Sh CAVEATS 182Disable AIGLX if necessary 183.Pq Pa xorg.conf : 184.Bd -literal -offset indent 185Section "ServerFlags" 186 Option "AIGLX" "off" 187EndSection 188.\" 189.\"Section "Extensions" 190.\" Option "Composite" "Disable" 191.\"EndSection 192.Ed 193.Pp 194.Cd options DRM_DEBUG 195can slow DRI down a lot, disable it once 196.Nm 197works. 198