Modesetting.cpp revision daf1b2aee694fc8aca9e056e825b3359170ecf37
/* $Id$ */
/** @file
* VirtualBox Video driver, common code - HGSMI initialisation and helper
* functions.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* 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.
*/
#include <VBox/VBoxVideoGuest.h>
#include <VBox/VBoxVideo.h>
#include <VBox/VBoxGuest.h>
/**
* Gets the count of virtual monitors attached to the guest via an HGSMI
* command
*
* @returns the right count on success or 1 on failure.
* @param pCtx the context containing the heap to use
*/
{
/* Query the configured number of displays. */
/* Host reported some bad value. Continue in the 1 screen mode. */
cDisplays = 1;
return cDisplays;
}
/**
* Tell the host about how VRAM is divided up between each screen via an HGSMI
* command. It is acceptable to specifiy identical data for each screen if
* they share a single framebuffer.
*
* @returns iprt status code, either VERR_NO_MEMORY or the status returned by
* @a pfnFill
* @param pCtx the context containing the heap to use
* @param u32Count the number of screens we are activating
* @param pfnFill a callback which initialises the VBVAINFOVIEW structures
* for all screens
* @param pvData context data for @a pfnFill
*/
void *pvData)
{
int rc;
/* Issue the screen info command. */
if (p)
{
if (RT_SUCCESS(rc))
VBoxHGSMIBufferSubmit (pCtx, p);
VBoxHGSMIBufferFree(pCtx, p);
}
else
rc = VERR_NO_MEMORY;
return rc;
}
/**
* Set a video mode using port registers. This must be done for the first
* screen before every HGSMI modeset and also works when HGSM is not enabled.
* @param cWidth the mode width
* @param cHeight the mode height
* @param cBPP the colour depth of the mode
* @param cx the horizontal panning offset
* @param cy the vertical panning offset
*/
{
/* set the mode characteristics */
/* enable the mode */
/* Panning registers */
/** @todo read from the port to see if the mode switch was successful */
}
/**
* Set a video mode via an HGSMI request. The views must have been
* initialised first using @a VBoxHGSMISendViewInfo and if the mode is being
* set on the first display then it must be set first using registers.
* @param cDisplay the screen number
* @param cOriginX the horizontal displacement relative to the first screen
* @param cOriginY the vertical displacement relative to the first screen
* @param offStart the offset of the visible area of the framebuffer
* relative to the framebuffer start
* @param cbPitch the offset in bytes between the starts of two adjecent
* scan lines in video RAM
* @param cWidth the mode width
* @param cHeight the mode height
* @param cBPP the colour depth of the mode
*/
{
/* Issue the screen info command. */
void *p = VBoxHGSMIBufferAlloc(pCtx,
sizeof (VBVAINFOSCREEN),
if (!p)
{
LogFunc(("HGSMIHeapAlloc failed\n"));
}
else
{
VBoxHGSMIBufferFree(pCtx, p);
}
}