vbva.c revision 4dfffd317fbef2019753944090bbbab9e53878fd
/** @file
* VirtualBox X11 Additions graphics driver 2D acceleration functions
*/
/*
* Copyright (C) 2006-2012 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/VBoxGuestLib.h>
#include "compiler.h"
#include "vboxvideo.h"
#ifdef XORG_7X
# include <stdlib.h>
#endif
/**************************************************************************
* Main functions *
**************************************************************************/
/**
* Callback function called by the X server to tell us about dirty
* rectangles in the video buffer.
*
* @param pScreen pointer to the information structure for the current
* screen
* @param iRects Number of dirty rectangles to update
* @param aRects Array of structures containing the coordinates of the
* rectangles
*/
{
int i;
unsigned j;
return;
{
/* Just continue quietly if VBVA is not currently active. */
if ( !pVBVA
continue;
for (i = 0; i < iRects; ++i)
{
continue;
#if 0
TRACE_LOG("display=%u, x=%d, y=%d, w=%d, h=%d\n",
#endif
{
sizeof(cmdHdr));
}
}
}
}
{
}
{
}
static HGSMIENV g_hgsmiEnv =
{
NULL,
};
/**
* Calculate the location in video RAM of and initialise the heap for guest to
* host messages. In the VirtualBox 4.3 and earlier Guest Additions this
* function creates the heap structures directly in guest video RAM, so it
* needs to be called whenever video RAM is (re-)set-up.
*/
{
int rc;
void *pvGuestHeapMemory;
VBoxHGSMIGetBaseMappingInfo(cbVRAM, &offVRAMBaseMapping, NULL, &offGuestHeapMemory, &cbGuestHeapMemory, NULL);
VBVXASSERT(RT_SUCCESS(rc), ("Failed to set up the guest-to-host message buffer heap, rc=%d\n", rc));
}
/** Callback to fill in the view structures */
static int
{
unsigned i;
for (i = 0; i < cViews; ++i)
{
pViews[i].u32ViewIndex = i;
pViews[i].u32ViewOffset = 0;
}
return VINF_SUCCESS;
}
/**
* Initialise VirtualBox's accelerated video extensions.
*
* @returns TRUE on success, FALSE on failure
*/
{
int rc = VINF_SUCCESS;
unsigned i;
{
TRACE_LOG("VBVA buffer offset for screen %u: 0x%lx\n", i,
}
TRACE_LOG("Maximum framebuffer size: %lu (0x%lx)\n",
vboxFillViewInfo, (void *)pVBox);
return TRUE;
}
{
return RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox->guestCtx, VBOX_VBVA_CONF32_MODE_HINT_REPORTING, &fModeHintReporting))
&& RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox->guestCtx, VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING, &fCursorReporting))
&& fCursorReporting == VINF_SUCCESS;
}
{
return RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox->guestCtx, VBOX_VBVA_CONF32_SCREEN_FLAGS, &fScreenFlags))
}
/**
* Inform VBox that we will supply it with dirty rectangle information
* and install the dirty rectangle handler.
*
* @returns TRUE for success, FALSE for failure
* @param pScrn Pointer to a structure describing the X screen in use
*/
{
unsigned i;
TRACE_ENTRY();
if (!vboxSetupVRAMVbva(pVBox))
return FALSE;
{
struct VBVABUFFER *pVBVA;
pVBVA, i))
}
#ifdef VBOXVIDEO_13
VBoxHGSMISendCapsInfo(&pVBox->guestCtx, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION);
#endif
return rc;
}
/**
* Inform VBox that we will stop supplying it with dirty rectangle
* information. This function is intended to be called when an X
* virtual terminal is disabled, or the X server is terminated.
*
* @returns TRUE for success, FALSE for failure
* @param pScrn Pointer to a structure describing the X screen in use
*/
void
{
int rc;
unsigned i;
TRACE_ENTRY();
}