2011-07-02 09:57:30 +01:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
s/Tungsten Graphics/VMware/
Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.
This was the sed script I used:
$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#
# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g
# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/
# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g
# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-01-17 16:27:50 +00:00
|
|
|
* Copyright 2008 VMware, Inc.
|
2011-07-02 09:57:30 +01:00
|
|
|
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
|
|
|
* Copyright 2010-2011 LunarG, Inc.
|
|
|
|
* 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,
|
|
|
|
* distribute, sub license, 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 (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 NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS 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 SOFTWARE.
|
|
|
|
*
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
2008-05-27 23:48:23 +01:00
|
|
|
/**
|
|
|
|
* Functions for choosing and opening/loading device drivers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2005-04-22 22:09:39 +01:00
|
|
|
#include <assert.h>
|
2008-05-28 22:50:58 +01:00
|
|
|
#include <string.h>
|
2005-04-22 22:09:39 +01:00
|
|
|
#include <stdio.h>
|
2008-05-28 19:56:36 +01:00
|
|
|
#include <stdlib.h>
|
2015-03-06 16:54:55 +00:00
|
|
|
#include "c11/threads.h"
|
2010-05-31 04:47:58 +01:00
|
|
|
|
2008-05-28 22:22:17 +01:00
|
|
|
#include "egldefines.h"
|
2005-04-22 22:09:39 +01:00
|
|
|
#include "egldisplay.h"
|
|
|
|
#include "egldriver.h"
|
2005-11-23 01:38:12 +00:00
|
|
|
#include "egllog.h"
|
2005-04-22 22:09:39 +01:00
|
|
|
|
2017-10-18 17:04:27 +01:00
|
|
|
#include "util/debug.h"
|
|
|
|
|
2020-07-31 00:38:41 +01:00
|
|
|
extern const _EGLDriver _eglDriver;
|
2011-01-07 08:30:08 +00:00
|
|
|
|
2011-01-12 16:27:45 +00:00
|
|
|
/**
|
2020-07-22 00:19:03 +01:00
|
|
|
* Initialize the display using the driver's function.
|
|
|
|
* If the initialisation fails, try again using only software rendering.
|
2011-01-12 16:27:45 +00:00
|
|
|
*/
|
2020-07-21 23:51:51 +01:00
|
|
|
bool
|
2020-07-22 00:19:03 +01:00
|
|
|
_eglInitializeDisplay(_EGLDisplay *disp)
|
2011-01-12 16:27:45 +00:00
|
|
|
{
|
2019-02-02 11:38:45 +00:00
|
|
|
assert(!disp->Initialized);
|
2010-07-04 08:55:12 +01:00
|
|
|
|
2011-01-12 16:27:45 +00:00
|
|
|
/* set options */
|
2019-02-02 11:38:45 +00:00
|
|
|
disp->Options.ForceSoftware =
|
2017-10-18 17:04:27 +01:00
|
|
|
env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
|
2019-10-31 07:29:55 +00:00
|
|
|
if (disp->Options.ForceSoftware)
|
|
|
|
_eglLog(_EGL_DEBUG, "Found 'LIBGL_ALWAYS_SOFTWARE' set, will use a CPU renderer");
|
2011-01-12 16:27:45 +00:00
|
|
|
|
2020-07-22 00:13:13 +01:00
|
|
|
if (_eglDriver.Initialize(&_eglDriver, disp)) {
|
|
|
|
disp->Driver = &_eglDriver;
|
2019-02-02 11:38:45 +00:00
|
|
|
disp->Initialized = EGL_TRUE;
|
2020-07-22 00:13:13 +01:00
|
|
|
return true;
|
2010-07-04 08:55:12 +01:00
|
|
|
}
|
|
|
|
|
2020-07-22 00:13:13 +01:00
|
|
|
if (disp->Options.ForceSoftware)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
disp->Options.ForceSoftware = EGL_TRUE;
|
|
|
|
if (!_eglDriver.Initialize(&_eglDriver, disp))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
disp->Driver = &_eglDriver;
|
|
|
|
disp->Initialized = EGL_TRUE;
|
|
|
|
return true;
|
2008-05-30 21:50:33 +01:00
|
|
|
}
|
|
|
|
|
2010-07-04 08:55:12 +01:00
|
|
|
__eglMustCastToProperFunctionPointerType
|
|
|
|
_eglGetDriverProc(const char *procname)
|
2010-05-13 21:06:29 +01:00
|
|
|
{
|
2020-07-22 00:09:56 +01:00
|
|
|
if (_eglDriver.GetProcAddress)
|
2020-07-22 00:06:05 +01:00
|
|
|
return _eglDriver.GetProcAddress(&_eglDriver, procname);
|
2010-05-13 21:06:29 +01:00
|
|
|
|
2017-08-28 16:23:58 +01:00
|
|
|
return NULL;
|
2010-07-04 08:55:12 +01:00
|
|
|
}
|