vboxvideo_dri2.c revision ed82223f8f7be1435bf9b203a0ee4fbdfc856dc8
/** @file $Id: vboxvideo_dri2.c$
*
* VirtualBox X11 Additions graphics driver, DRI2 support
*/
/*
* Copyright (C) 2006-2013 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 "vboxvideo.h"
#include <xf86drm.h>
#include <drm.h>
#include <dri2.h>
#include <fcntl.h>
#include <unistd.h>
{
}
unsigned int cAttachment,
unsigned int cFormat)
{
}
{
}
/* We need to pass a constant path string to the screen initialisation function.
* The format is hard-coded in "drmOpen" in libdrm, and libdrm contains a
* comment to say that open should be done manually in future and not using
* "drmOpen", so we will do it manually but also hard-coding the format. The
* maximum minor number (15) is also hard-coded. */
const char *devicePaths[] =
{
};
/** As long as we are using our fake DRI driver inside of Mesa, we only want
* to implement the minimum here to make Mesa load it. Notably we just set
* "DRI2Info.fd" to -1 as we do not need authentication to work. */
{
unsigned i;
for (i = 0; i < RT_ELEMENTS(devicePaths); ++i)
{
if (fd >= 0)
{
if ( pVersion
{
/* Keep the driver open and hope that the path won't change. */
break;
}
}
}
if (!DRI2Info.deviceName)
return FALSE;
}
{
}