1.\" 2.\" Copyright (c) 2017 The DragonFly Project. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in 12.\" the documentation and/or other materials provided with the 13.\" distribution. 14.\" 3. Neither the name of The DragonFly Project nor the names of its 15.\" contributors may be used to endorse or promote products derived 16.\" from this software without specific, prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 24.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 28.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.Dd May 30, 2017 32.Dt VGA_SWITCHEROO 4 33.Os 34.Sh NAME 35.Nm vga_switcheroo , 36.Nm apple_gmux 37.Nd support for Apple laptops with dual GPUs 38.Sh SYNOPSIS 39To enable support of dual GPUs in kernel, include the following 40line in the kernel configuration file: 41.Bd -ragged -offset indent 42.Cd "options VGA_SWITCHEROO" 43.Ed 44.Pp 45When the system has booted, load the apple_gmux 46driver before the native graphics drivers, for example 47.Xr i915 4 . 48.Pp 49Alternatively, you can put these two lines in 50.Xr rc.conf 5 : 51.Bd -literal -offset indent 52apple_gmux_load="YES" 53i915_load="YES" 54.Ed 55.Pp 56As a result, vga_switcheroo switches the gmux controller so that all 57output comes from the IGD. 58.Sh DESCRIPTION 59Apple MacBook Pro laptops have hybrid graphics, i.e.\& two GPUs, one being 60the integrated graphics device (IGD) and the other being the discrete 61graphics device (DIS), sometimes called the dedicated graphics device. 62Gmux is a microcontroller that controls the output of these GPUs. 63.Pp 64.Nm vga_switcheroo 65is the higher level module that facilitates switching between the two 66GPUs using the lower level 67.Nm apple_gmux 68driver. 69When the system boots and 70.Nm vga_switcheroo 71is enabled, 72.Nm apple_gmux 73registers with it. 74It then acts as a handler. 75The two graphics adapters will also detect the presence of 76.Nm vga_switcheroo 77and register as clients. 78.Sh IMPLEMENTATION NOTES 79In the current 80.Dx 81specific implementation, upon detecting the presence of 82.Nm apple_gmux , 83the Intel driver will call 84.Nm 85to switch the gmux so that all output comes from the IGD. 86Switching to DIS is not yet supported. 87.Sh HARDWARE 88Apple MacBook Pro laptops with dual GPUs. 89.Sh SEE ALSO 90.Xr i915 4 , 91.Xr rc.conf 5 92.Pp 93.Pa https://01.org/linuxgraphics/gfx-docs/drm/gpu/vga-switcheroo.html 94.Sh HISTORY 95The 96.Nm 97driver was added in 98.Dx 4.9 . 99.Sh AUTHORS 100The 101.Nm 102driver was ported to 103.Dx 104from linux 4.8 by 105.An Peeter Must . 106He also wrote this manual page. 107