vboxvideo_dri.c revision e09acefb0842b81eb7651abaa88ddf715e5f9cdb
/** @file $Id$
*
* VirtualBox X11 Additions graphics driver, DRI support
*/
/*
* Copyright (C) 2006-2007 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.
* --------------------------------------------------------------------
*
* This code is based on:
*
* X11 TDFX driver, src/tdfx_dri.c
*
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* 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,
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) 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 NON-INFRINGEMENT.
* 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 SOFTWARE.
*
* Authors:
* Daryll Strauss <daryll@precisioninsight.com>
*/
#include "vboxvideo.h"
#ifndef PCIACCESS
# include "xf86Pci.h"
#endif
static Bool
static void
static void
static void
static void
static Bool
static Bool
static void
static void
static Bool
{
TRACE_ENTRY();
cConfigs);
if (!pConfigs)
{
"Disabling DRI: out of memory.\n");
}
{
{
}
{
}
else
}
if (rc)
{
TRACE_LOG("Calling GlxSetVisualConfigs\n");
}
return rc;
}
#if 0
static void
{
}
#endif
#if 0
static void
{
}
#endif
{
TRACE_ENTRY();
{
"DRI is only available in 16bpp or 32bpp graphics modes.\n");
}
/* Assertion */
if ( (pScrn->displayWidth == 0)
|| (pVBox->cbFramebuffer == 0))
{
}
/* Check that the GLX, DRI, and DRM modules have been loaded by testing for
* canonical symbols in each module, the way all existing _dri drivers do.
*/
if (rc)
{
TRACE_LOG("Checking symbols\n");
if ( !xf86LoaderCheckSymbol("GlxSetVisualConfigs")
|| !xf86LoaderCheckSymbol("drmAvailable")
|| !xf86LoaderCheckSymbol("DRIQueryVersion"))
{
"Disabling DRI due to missing server functionality.\n");
}
}
/* Check the DRI version */
if (rc)
{
TRACE_LOG("Checking DRI version\n");
{
"Disabling DRI due to a version mismatch between server and driver. Server version: %d.%d. Driver version: %d.%d\n",
}
}
if (rc)
{
TRACE_LOG("Creating DRIInfoRec\n");
pDRIInfo = DRICreateInfoRec();
if (!pDRIInfo)
{
"Disabling DRI: out of memory.\n");
}
else
}
if (rc)
{
/* These two are set in DRICreateInfoRec(). */
#ifdef PCIACCESS
#else
#endif
/* This can't be zero, as the server callocs this size and checks for
* non-NULL... */
TRACE_LOG("Calling DRIScreenInit\n");
if (!rc)
"DRIScreenInit failed, disabling DRI.\n");
}
{
"VBOXInitVisualConfigs failed, disabling DRI.\n");
}
/* Check the DRM version */
if (rc)
{
TRACE_LOG("Checking DRM version\n");
if (version)
{
{
"Bad DRM driver version %d.%d, expected version 1.0. Disabling DRI.\n",
}
}
}
/* Clean up on failure. */
if (!rc)
{
}
return rc;
}
{
}
void
{
if (pVBox->pVisualConfigs)
pVBox->cVisualConfigs = 0;
}
static Bool
{
return TRUE;
}
static void
{
}
{
return DRIFinishScreenInit(pScreen);
}
static void
{
}
static void
{
}
static void
{
}
/* Apparently the next two are just legacy. */
static Bool
{
return TRUE;
}
static Bool
{
return TRUE;
}
static void
{
}
static void
{
}