setmode.c revision 953ff12b2acaead76951b9f24347b17d6d22b01b
* Linux Additions X11 graphics driver, mode setting * Copyright (C) 2006-2013 Oracle Corporation * This file is part of VirtualBox Open Source Edition (OSE), as * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. * -------------------------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * Except as contained in this notice, the name of Conectiva Linux shall * not be used in advertising or otherwise to promote the sale, use or other * dealings in this Software without prior written authorization from * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> /* We include <unistd.h> for Solaris below, and the ANSI C emulation layer * interferes with that. */ /* VGA hardware functions for setting and restoring text mode */ /** Clear the virtual framebuffer in VRAM. Optionally also clear up to the * size of a new framebuffer. Framebuffer sizes larger than available VRAM * be treated as zero and passed over. */ /* Assume 32BPP - this is just a sanity test. */ (
"cbOldSize or cbNewSize is too big.\n"));
/** Set a graphics mode. Poke any required values into registers, do an HGSMI * mode set and tell the host we support advanced graphics functions. TRACE_LOG(
"cDisplay=%u, cWidth=%u, cHeight=%u, x=%d, y=%d, fEnabled=%d, fConnected=%d, pFrameBuffer: { x0=%d, y0=%d, cWidth=%u, cHeight=%u, cBPP=%u }\n",
cDisplay,
cWidth,
cHeight, x, y,
fEnabled,
fConnected,
pFrameBuffer->
x0,
pFrameBuffer->
y0,
pFrameBuffer->
cWidth,
FatalError(
"Failed to update the input mapping.\n");
/** Tell the virtual mouse device about the new virtual desktop size. */