Compare commits

..

38 Commits

Author SHA1 Message Date
Ian Romanick
1585c234e0 Major rip-up of internal function insertion interface. The old
_glapi_add_entrypoint has been replaced by a new routine called
_glapi_add_dispatch.  This new routine dynamically assignes dispatch offsets
to functions added.  This allows IHVs to add support for extension functions
that do not have assigned dispatch offsets.

It also means that a driver has no idea what offset will be assigned to a
function.  The vast majority of the changes in this commit account for that.
An additional table, driDispatchRemapTable, is added.  Functions not in the
Linux OpenGL ABI (i.e., anything not in GL 1.2 + ARB_multitexture) has a
fixed offset in this new table.  The entry in this table specifies the
offset in of the function in the real dispatch table.

The internal interface was also bumped from version 20050725 to 20050727.

This has been tested with various programs in progs/demos on:

radeon (Radeon Mobility M6)
r128 (Rage 128 Pro)
mga (G400)
2005-07-28 00:29:51 +00:00
Ian Romanick
9f23a3a1bf Fix SPARC assembly for 64-bit
- The test for whether or not we're building for 64-bit is '#ifdef __arch64__'.
 This appears to be correct on both Linux and Solaris.

- The test for Solaris is now '#if defined(SVR4) || defined(__SVR4) ||
defined(__svr4__)'.  GCC 3.4.0 has all three defined on Solaris 9.

- Enables assembly language clip routines.

- Fixes to make GLSL code build on Solaris.

- Update gl_SPARC_asm.py.
2005-07-28 00:11:10 +00:00
Philippe Houdoin
3e36986e5a This precious BeOS include file was lost since some released MesaLibs. Fixed. ;-) 2005-07-27 19:56:33 +00:00
Roland Scheidegger
67d94e5a86 test for the proper drm version, at least 1.17 is required 2005-07-27 18:21:34 +00:00
Alan Hourihane
a7df74ea02 typo 2005-07-26 23:09:50 +00:00
Alan Hourihane
36d6e9df16 support GLX_DIRECT_COLOR in 1.4.0 2005-07-26 23:06:10 +00:00
Ian Romanick
ab7c6ffadc Remove the last remnants of GLX_BUILT_IN_XMESA. This allows the removal of
the evil, ugly GLX_PREFIX macro as well.
2005-07-26 22:53:38 +00:00
Alan Hourihane
1361398600 Bump the required ddx to 1.4.0 as drmAddress has been removed so that 32/64bit
combinations work.
2005-07-26 21:53:16 +00:00
Ian Romanick
5c6fd3dd4c No, really, get rid of all the remaining references to DRI_USE_NEW_INTERFACE.
A couple other remnants of the old interfaces hit the dust too.  Thanks
Jon. :)
2005-07-26 05:57:24 +00:00
Ian Romanick
a08d8a095c Quote $(CC) and $(CXX) so that 'CC=ccache gcc' and 'CXX=ccache g++' will
work again.
2005-07-26 05:55:56 +00:00
Ian Romanick
5f1ba3e21b Fixes the glXGetProcAddress portion of the interface. Most of the functions
that are currently obtained via glXGetProcAddress and all of the XF86DRI
functions are replaced with a funciton table.  This table will be passed to
__driCreateNewScreen.

One of the functions in the table is getProcAddress.  This allows some
loaders to expose functionality not in all loaders.  This will be immediatly
used for glxEnableExtension (formerly known to drivers as
__glXScrEnableExtension).  libGL (and in the future libglx) expose this
function so that drivers can enable GLX extensions.  libEGL should exposed
eglEnableExtension to enable EGL extensions.  The same function cannot be
used for both because the extensions have different names and (possibly)
different semantics.  Drivers can optionally use one, both, or neither.

The key parts are in the __DRIinterfaceMethodsRec structure in
dri_interface.h.  A pointer to one of these structures is passed into
__driCreateNewScreen.  Because of this, the version of the API is bumped to
20050725.  Since the previous version(s) were never in a release, their
existance is erased.

I was actually a little surprised by how much code this cuts from the
drivers.  A lot of glXGetProcAddress calls disappear, and a lot of
version checks go with them.  Nice.

The one thing I'm not sure of is removing __glXInitialize.  For some
reason that function was in the glXGetProcAddress table, but *nothing*
in the Mesa tree used it.  Did something with DRI conf. use this
function?  It seems odd...
2005-07-26 02:44:01 +00:00
Brian Paul
1201348a33 improve comments about win[0..3] values (bug 2554) 2005-07-26 01:04:53 +00:00
Brian Paul
800c72ae61 Fix bug 1858 - array subscript out of range in gamma driver.
Set ctx->Const.MaxTextureLevels = GAMMA_TEX_MAXLEVELS = 12
Remove bogus WRITE(level 12).
Max gamma texture size is 2kx2k  (note: 2k = 1 << (MaxLevels - 1))
2005-07-26 00:10:53 +00:00
Brian Paul
7c1ab40898 Add license/copyright.
Add -h/--help option for usage.
Minor clean-ups.
2005-07-25 23:49:50 +00:00
Brian Paul
8dcc6736ab Added -linker option to mklib, used to specify a particular program for
linking, if relevant.
Updated Makefiles to use -linker option instead of setting CC, CXX env vars.
2005-07-25 22:59:58 +00:00
Ian Romanick
e9dbe58b8b Gut a few more dead bits. Replace uses of the CreateNewScreenFunc typedef
(from glxclient.h) with PFNCREATENEWSCREEN (from dri_interface.h).

Remove the prototype for __driCreateScreen and fix the prototype for
__driCreateNewScreen (append the API version) in dri_interface.h.
2005-07-24 07:38:23 +00:00
Ian Romanick
c39bf5e273 All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allows
1,402 lines of code to be removed from Mesa (drivers and libGL).  The
big winner is dri_util.c.

Primary changes are:

1. Remove all "deprecated" entry-points from the various structures in
dri_interface.h.

2. Rename the remaining fields to removed "version numbers."  So,
bindContext3 becomes bindContext.  Functions with "New" in the name
(e.g., CreateNewContext) were *not* changed, but that is an option.
Having "New" in the name is less annoying to me than having "3" in the name.

3. Remove all compatibility code that handles cases where the driver or
the loader is too old to support the latest interfaces.

4. Append the API version to the __driCreateNewScreen function name.
This is currently done by hand.  In the future (i.e., the next time we
make an incompatible change to the interface) we'll want to come up with
a better way to do this.  This prevents old loaders from being able to load
new (incompatible) drivers.

5. Bump the API version to 20050722.  All drivers (by way of dri_util.c)
require this version.

6. All drivers are *required* to expose GLX_SGIX_fbconfig and
GLX_OML_swap_method (or the moral equivalents).  Support for these
functions in implicit in the use of the "new" interface.

7. Some cases still exist that need to be compiled differently in a loader
or core Mesa versus in a driver.  These are identified by the define
IN_DRI_DRIVER.
2005-07-24 06:29:14 +00:00
Adam Jackson
7d40d230fa Add two aliases for some PointParameters entrypoints for libglx compatibility.
Doing this here rather than on the GLX side since the X monolith hasn't had
Mesa 6.3 imported yet.

idr, I know this is touching a generated file, but I haven't figured out what
needs changing in the generator scripts to make this change happen.  If you
could add that I'd appreciate it.
2005-07-23 02:09:58 +00:00
Brian Paul
3e2419a7cc Break the long list of MAIN_FILES and DEMO_FILES into subgroups.
rm/touch the depend files when making tarballs so they don't include
RedHat-specific paths (bug 3842).
2005-07-22 15:52:46 +00:00
Jouk Jansen
70cf1f0cf8 ----------------------------------------------------------------------
Committing in .

 _mesa_sprintf crashes on OpenVMS -> replaced it by the OS-supplied sprintf

 Modified Files:
 	Mesa/src/mesa/drivers/x11/fakeglx.c
 ----------------------------------------------------------------------
2005-07-22 09:30:54 +00:00
Brian Paul
60a6a0eb51 some GLuint idx -> GLint idx changes 2005-07-22 02:55:36 +00:00
Brian Paul
fea5a428e9 added vp negative addressing bug fix 2005-07-22 02:54:14 +00:00
Brian Paul
61e694f270 Make the vertex program source register Index field a signed int since
relative addressing can be negative.
Change some GLuint indexes to GLint in the t_vp_build.c file.
Added PROGRAM_UNDEFINED token for initializing the register File field to
avoid a gcc 4.0 warning.
2005-07-22 02:53:38 +00:00
Brian Paul
db251d72c8 bump version to 6.3.1 2005-07-21 18:46:49 +00:00
Brian Paul
7a37189adc 6.3.1 updates 2005-07-21 18:45:54 +00:00
Brian Paul
f87bb14b0b updated with DRI building instructions 2005-07-21 18:45:44 +00:00
Brian Paul
dff11bb9a8 bump version to 6.3.1 and include DRI/GLX files in tarballs 2005-07-21 18:44:52 +00:00
Brian Paul
98b06bcbeb make i810PrintSetupFlags() static, first param const 2005-07-21 18:11:24 +00:00
Brian Paul
7b5c506c0e first 6.3.1 bug fixes 2005-07-21 15:58:16 +00:00
Brian Paul
7cf480e6fe s/2004/2005/ 2005-07-21 15:57:29 +00:00
Brian Paul
951dbf08e7 check for FEATURE_EXT_framebuffer_object to enable EXT_framebuffer_object 2005-07-21 15:48:39 +00:00
Brian Paul
49e74989c3 remove ^M chars, disable shading language extensions 2005-07-21 15:41:56 +00:00
Eric Anholt
3e8efc3753 Clean up warnings in r300 code by making some symbols static, adding prototypes
for others, and being cleaner with types in fragment/vertex program structures.
One warning in r300_shader.c is still concerning.
2005-07-20 23:24:55 +00:00
Eric Anholt
aeb0ee771b Connect the r300 bits up to the build. 2005-07-20 22:08:06 +00:00
Eric Anholt
6ae76788a7 Add some missing defines, copied from linux-dri. 2005-07-20 22:07:29 +00:00
Eric Anholt
e98494d0a4 Forced commit to note repocopy from r300.sf.net CVS. 2005-07-20 21:35:27 +00:00
Brian Paul
18014525a1 fix some URLs 2005-07-20 18:25:01 +00:00
Brian Paul
2276679c53 added md5 checksums for 6.3 2005-07-20 18:20:45 +00:00
126 changed files with 6195 additions and 23039 deletions

175
Makefile
View File

@@ -133,11 +133,11 @@ ultrix-gcc:
# Rules for making release tarballs
DIRECTORY = Mesa-6.3
LIB_NAME = MesaLib-6.3
DEMO_NAME = MesaDemos-6.3
DIRECTORY = Mesa-6.3.1
LIB_NAME = MesaLib-6.3.1
DEMO_NAME = MesaDemos-6.3.1
LIB_FILES = \
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/descrip.mms \
$(DIRECTORY)/mms-config. \
@@ -173,6 +173,7 @@ LIB_FILES = \
$(DIRECTORY)/include/GL/xmesa.h \
$(DIRECTORY)/include/GL/xmesa_x.h \
$(DIRECTORY)/include/GL/xmesa_xf86.h \
$(DIRECTORY)/include/GLView.h \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/descrip.mms \
$(DIRECTORY)/src/mesa/Makefile* \
@@ -237,37 +238,6 @@ LIB_FILES = \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/descrip.mms \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
$(DIRECTORY)/src/glu/sgi/descrip.mms \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
$(DIRECTORY)/src/glu/sgi/libtess/README \
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch] \
$(DIRECTORY)/src/glu/mesa/README[12] \
$(DIRECTORY)/src/glu/mesa/Makefile* \
$(DIRECTORY)/src/glu/mesa/descrip.mms \
$(DIRECTORY)/src/glu/mesa/mms_depend \
$(DIRECTORY)/src/glu/mesa/*.def \
$(DIRECTORY)/src/glu/mesa/depend \
$(DIRECTORY)/src/glu/mesa/*.[ch] \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/depend \
$(DIRECTORY)/progs/Makefile \
$(DIRECTORY)/progs/util/README \
$(DIRECTORY)/progs/util/*.[ch] \
@@ -287,27 +257,61 @@ LIB_FILES = \
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/*.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/x11/Makefile \
$(DIRECTORY)/src/glx/x11/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/dri_client/imports/*.h \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/*/depend \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/descrip.mms \
$(DIRECTORY)/src/glut/glx/mms_depend \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile \
$(DIRECTORY)/src/glut/dos/*.[ch] \
$(DIRECTORY)/src/glut/dos/Makefile.DJ \
$(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \
$(DIRECTORY)/src/glut/ggi/*.[ch] \
$(DIRECTORY)/src/glut/ggi/Makefile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/descrip.mms \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
$(DIRECTORY)/src/glu/sgi/descrip.mms \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
$(DIRECTORY)/src/glu/sgi/libtess/README \
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
MESA_GLU_FILES = \
$(DIRECTORY)/src/glu/mesa/README[12] \
$(DIRECTORY)/src/glu/mesa/Makefile* \
$(DIRECTORY)/src/glu/mesa/descrip.mms \
$(DIRECTORY)/src/glu/mesa/mms_depend \
$(DIRECTORY)/src/glu/mesa/*.def \
$(DIRECTORY)/src/glu/mesa/depend \
$(DIRECTORY)/src/glu/mesa/*.[ch]
DEMO_FILES = \
GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/depend
PROG_FILES = \
$(DIRECTORY)/progs/beos/*.cpp \
$(DIRECTORY)/progs/beos/Makefile \
$(DIRECTORY)/progs/images/*.rgb \
@@ -338,64 +342,83 @@ DEMO_FILES = \
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj \
$(DIRECTORY)/windows/VC7/progs/progs.sln
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/descrip.mms \
$(DIRECTORY)/src/glut/glx/mms_depend \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile \
$(DIRECTORY)/src/glut/dos/*.[ch] \
$(DIRECTORY)/src/glut/dos/Makefile.DJ \
$(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \
$(DIRECTORY)/src/glut/ggi/*.[ch] \
$(DIRECTORY)/src/glut/ggi/Makefile
DRI_FILES = \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/mini/*.[ch] \
$(DIRECTORY)/src/glx/mini/example.miniglx.conf \
$(DIRECTORY)/src/glx/mini/NOTES \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/dri_client/imports/*.h \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/*/depend \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES)
DEMO_FILES = $(PROG_FILES) $(GLUT_FILES)
# Everything for new a Mesa release:
tarballs: lib_gz demo_gz lib_bz2 demo_bz2 lib_zip demo_zip md5
tarballs: rm_depend lib_gz demo_gz lib_bz2 demo_bz2 lib_zip demo_zip md5
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
lib_gz:
rm -f configs/current ; \
cd .. ; \
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
demo_gz:
cd .. ; \
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) $(GLUT_FILES) ; \
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
gzip $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
lib_bz2:
rm -f configs/current ; \
cd .. ; \
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
demo_bz2:
cd .. ; \
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) $(GLUT_FILES) ; \
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
bzip2 $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
lib_zip:
rm -f configs/current ; \
-rm $(LIB_NAME).zip ; \
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -r $(LIB_NAME).zip $(LIB_FILES) ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
demo_zip:
-rm $(DEMO_NAME).zip ; \
rm -f $(DEMO_NAME).zip ; \
cd .. ; \
zip -r $(DEMO_NAME).zip $(DEMO_FILES) $(GLUT_FILES) ; \
zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \
mv $(DEMO_NAME).zip $(DIRECTORY)
md5:

240
bin/mklib
View File

@@ -1,38 +1,53 @@
#!/bin/sh
# Make a shared library.
# Basically do a switch/case depending on the OS and make a shared (or static)
# library conforming to that OS.
# This script should be useful for projects other than Mesa.
# Improvements/fixes are welcome.
# Usage:
# mklib [options] objects ...
# Options:
# -o LIBRARY specifies the name of resulting library
# ("-o GL" for example, might result in "libGL.so" being made)
# -major N specifies major version number (default is 1)
# -minor N specifies minor version number (default is 0)
# -patch N specifies patch version number (default is 0)
# -lLIBRARY specifies a dependency on LIBRARY
# -LDIR search in DIR for library dependencies
# -cplusplus link with C++ runtime
# -static make a static library (default is dynamic/shared)
# -install DIR move resulting library file(s) to DIR
# -arch ARCH override using `uname` to determine architecture
# -archopt OPT specify an extra achitecture-specific option OPT
# -noprefix don't prefix library name with "lib" or any suffix
# -exports FILE only export the symbols listed in FILE
# Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
#
# The library name should just be "GL" or "GLU", etc. The 'lib' prefix
# will be added here if needed, as well as the ".so" or ".a" suffix,
# etc (unless the -noprefix option is used).
# 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, sublicense,
# 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:
#
# objects should be: foo.o bar.o etc.o
#
# Environment variables recognized:
# CC C compiler command
# CXX C++ compiler command
# The above copyright notice and this permission notice 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
# BRIAN PAUL 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.
function usage()
{
echo 'Usage: mklib [options] objects'
echo 'Create a shared library from object files.'
echo ' -o LIBRARY specifies the name of the resulting library, without'
echo ' the leading "lib" or any suffix.'
echo ' (eg: "-o GL" might result in "libGL.so" being made)'
echo ' -major N specifies major version number (default is 1)'
echo ' -minor N specifies minor version number (default is 0)'
echo ' -patch N specifies patch version number (default is 0)'
echo ' -lLIBRARY specifies a dependency on LIBRARY'
echo ' -LDIR search in DIR for library dependencies'
echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
echo ' Not observed on all systems at this time.'
echo ' -cplusplus link with C++ runtime'
echo ' -static make a static library (default is dynamic/shared)'
echo ' -install DIR put resulting library file(s) in DIR'
echo ' -arch ARCH override using `uname` to determine host system'
echo ' -archopt OPT specify an extra achitecture-specific option OPT'
echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
echo ' -exports FILE only export the symbols listed in FILE'
echo ' -h, --help display this information and exit'
}
#
@@ -43,6 +58,7 @@ MAJOR=1
MINOR=0
PATCH=""
DEPS=""
LINK=""
CPLUSPLUS=0
STATIC=0
INSTALLDIR="."
@@ -58,26 +74,74 @@ EXPORTS=""
while true
do
case $1 in
'-o') shift 1; LIBNAME=$1;;
'-major') shift 1; MAJOR=$1;;
'-minor') shift 1; MINOR=$1;;
'-patch') shift 1; PATCH=$1;;
-l*) DEPS="$DEPS $1";;
-L*) DEPS="$DEPS $1";;
'-cplusplus') CPLUSPLUS=1;;
'-static') STATIC=1;;
'-install') shift 1; INSTALLDIR=$1;;
'-arch') shift 1; ARCH=$1;;
'-archopt') shift 1; ARCHOPT=$1;;
'-noprefix') NOPREFIX=1;;
'-exports') shift 1; EXPORTS=$1;;
-*) echo "mklib: Unknown option: " $1 ; exit 1;;
*) break
'-h' | '--help')
usage;
exit 1
;;
'-o')
shift 1;
LIBNAME=$1
;;
'-major')
shift 1;
MAJOR=$1
;;
'-minor')
shift 1;
MINOR=$1
;;
'-patch')
shift 1;
PATCH=$1
;;
'-linker')
shift 1;
LINK=$1
;;
-l*)
DEPS="$DEPS $1"
;;
-L*)
DEPS="$DEPS $1"
;;
'-cplusplus')
CPLUSPLUS=1
;;
'-static')
STATIC=1
;;
'-install')
shift 1;
INSTALLDIR=$1
;;
'-arch')
shift 1;
ARCH=$1
;;
'-archopt')
shift 1;
ARCHOPT=$1
;;
'-noprefix')
NOPREFIX=1
;;
'-exports')
shift 1;
EXPORTS=$1
;;
-*)
echo "mklib: Unknown option: " $1 ;
exit 1
;;
*)
# This should be the first object file, stop parsing
break
esac
shift 1
done
OBJECTS=$@
if [ ${ARCH} = "auto" ] ; then
ARCH=`uname`
fi
@@ -120,12 +184,13 @@ case $ARCH in
'Linux' | 'OpenBSD')
# we assume gcc
# Set default compilers if env vars not set
if [ "x$CXX" = "x" ] ; then
CXX=g++
fi
if [ "x$CC" = "x" ] ; then
CC=gcc
if [ "x$LINK" = "x" ] ; then
# -linker was not specified so set default link command now
if [ $CPLUSPLUS = 1 ] ; then
LINK=g++
else
LINK=gcc
fi
fi
if [ $NOPREFIX = 1 ] ; then
@@ -133,13 +198,7 @@ case $ARCH in
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
#OPTS="-shared -Wl,-soname,${LIBNAME}" # soname???
OPTS="-shared"
if [ $CPLUSPLUS = 1 ] ; then
LINK=$CXX
else
LINK=$CC
fi
rm -f ${LIBNAME}
# make lib
${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
# finish up
@@ -190,12 +249,6 @@ case $ARCH in
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}.so.${VERSION}
if [ $CPLUSPLUS = 1 ] ; then
LINK=$CXX
else
LINK=$CC
fi
# rm any old libs
rm -f ${LIBNAME}.so.${VERSION}
rm -f ${LIBNAME}.so.${MAJOR}
@@ -224,41 +277,25 @@ case $ARCH in
echo "mklib: Making SunOS shared library: " ${LIBNAME}
# XXX OPTS for gcc should be -shared, but that doesn't work.
# Using -G does work though.
if [ $CPLUSPLUS = 1 ] ; then
# determine linker and options for C++ code
if [ "x${CXX}" = "xg++" ] ; then
# use g++
LINK="g++"
OPTS="-G"
elif [ "x${CXX}" = "xCC" ] ; then
# use Sun CC
LINK="CC"
OPTS="-G"
elif [ "x${CXX}" = "xc++" ] ; then
# use Sun c++
LINK="c++"
OPTS="-G"
elif [ `which c++` ] ; then
# use Sun c++
LINK="c++"
OPTS="-G"
elif [ `type g++` ] ; then
# use g++
LINK="g++"
OPTS="-G"
OPTS="-G"
if [ "x$LINK" = "x" ] ; then
# -linker was not specified, choose default linker now
if [ $CPLUSPLUS = 1 ] ; then
# determine linker and options for C++ code
if [ `which c++` ] ; then
# use Sun c++
LINK="c++"
elif [ `type g++` ] ; then
# use g++
LINK="g++"
else
echo "mklib: warning: can't find C++ comiler, trying CC."
LINK="CC"
fi
else
echo "mklib: warning: can't find C++ comiler, trying CC."
LINK="CC"
OPTS="-G"
# use native Sun linker for C code
LINK="ld"
fi
elif [ "x${CC}" = "xgcc" ] ; then
# use gcc for linking
LINK="gcc"
OPTS="-G"
else
# use native Sun linker
LINK="ld"
OPTS="-G"
fi
echo "mklib: linker is" ${LINK} ${OPTS}
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
@@ -317,6 +354,8 @@ case $ARCH in
FINAL_LIBS=${LIBNAME}
else
LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
# XXX we should run 'file' on the first object file to determine
# if it's o32, n32 or 64 format, as we do for Linux above.
if [ $ARCHOPT = "64" ] ; then
# 64-bit ABI
OPTS="-64 -shared -all"
@@ -425,10 +464,12 @@ case $ARCH in
VERSION="${MAJOR}.${MINOR}"
LIBNAME="lib${LIBNAME}.so"
echo "mklib: Making OSF/1 shared library: " ${LIBNAME}
if [ $CPLUSPLUS = 1 ] ; then
LINK=$CXX
else
LINK=$CC
if [ "x$LINK" = "x" ] ; then
if [ $CPLUSPLUS = 1 ] ; then
LINK=cxx
else
LINK=cc
fi
fi
rm -f ${LIBNAME}.${VERSION}
${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
@@ -477,6 +518,7 @@ case $ARCH in
echo "mklib: Making BeOS shared library: " ${LIBNAME}
gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}"
mimeset -f "${LIBNAME}"
# XXX remove the Mesa3D stuff here since mklib isn't mesa-specific.
setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!"
fi
FINAL_LIBS=${LIBNAME}
@@ -498,6 +540,8 @@ case $ARCH in
'icc')
# Intel C compiler
# This should get merged into the Linux code, above, since this isn't
# really a different architecture.
LIBNAME="lib${LIBNAME}" # prefix with "lib"
if [ $STATIC = 1 ] ; then
@@ -615,7 +659,7 @@ case $ARCH in
ar rv ${LIBNAME} ${OBJECTS}
FINAL_LIBS="${LIBNAME}"
else
LIBNAME="lib${LIBNAME}.so" # prefix with "lib"
LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
echo "mklib: Making shared library for example arch: " ${LIBNAME}
ld -o ${LIBNAME} ${OBJECTS} ${DEPS}
FINAL_LIBS="${LIBNAME}"

View File

@@ -8,7 +8,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=6
MESA_MINOR=3
MESA_TINY=0
MESA_TINY=1
# external projects
DRM_SOURCE_PATH=$(TOP)/../drm

View File

@@ -13,7 +13,7 @@ OPT_FLAGS = -O
EXPAT_INCLUDES = -I/usr/local/include
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
DEFINES = -DDRI_NEW_INTERFACE_ONLY
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \
-ffast-math $(X11_INCLUDES)
CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
@@ -38,6 +38,6 @@ DRM_SOURCE_PATH=$(TOP)/../drm
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon tdfx \
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis

View File

@@ -22,7 +22,7 @@ ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
@@ -49,5 +49,5 @@ WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb

View File

@@ -11,20 +11,21 @@ CXX = g++
WARN_FLAGS = -Wall -Wundef
OPT_FLAGS = -O3 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC -DIN_DRI_DRIVER
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
ASM_SOURCES =
ASM_SOURCES =
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR) -lEGL -l$(GL_LIB)

View File

@@ -1,29 +1,7 @@
# Configuration for linux-solo-ia64: Linux DRI hardware drivers for fbdev
include $(TOP)/configs/default
include $(TOP)/configs/linux-solo
CONFIG_NAME = linux-solo-ia64
# Compiler and flags
CC = gcc
CXX = g++
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DDRM_USE_MALLOC
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx/mini glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx
DRI_DIRS = fb mach64 mga r128 r200 radeon sis tdfx unichrome

View File

@@ -7,10 +7,24 @@ CONFIG_NAME = linux-sparc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
CXXFLAGS = -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE
WARN_FLAGS = -Wall
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
GLUT_CFLAGS = -fexceptions
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
EXTRA_LIB_PATH=-L/usr/X11R6/lib
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11

View File

@@ -4,18 +4,32 @@ include $(TOP)/configs/default
CONFIG_NAME = sunos5-gcc
ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API)
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -I/usr/openwin/include -fPIC -fomit-frame-pointer -D_REENTRANT -DUSE_XSHM -DUSE_SPARC_ASM
CXXFLAGS = -O3 -I/usr/openwin/include -fPIC -fomit-frame-pointer -D_REENTRANT -DUSE_SPARC_ASM
WARN_FLAGS = -Wall
OPT_FLAGS = -O3 -g -fomit-frame-pointer -pipe
PIC_FLAGS = -fPIC
ARCH_FLAGS ?=
DEFINES = -D_REENTRANT -DUSE_XSHM
ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API)
ASM_FLAGS = -DUSE_SPARC_ASM
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math -I/usr/openwin/include
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
-I/usr/openwin/include
GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/openwin/lib
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXi -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -1,7 +1,7 @@
Mesa 6.3 release notes
July 20, 2004
July 20, 2005
PLEASE READ!!!!
@@ -112,4 +112,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.3,v 3.12 2005/07/20 18:07:11 brianp Exp $
$Id: RELNOTES-6.3,v 3.13 2005/07/21 15:57:29 brianp Exp $

49
docs/RELNOTES-6.3.1 Normal file
View File

@@ -0,0 +1,49 @@
Mesa 6.3.1 release notes
July XX, 2005
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.2) designate stable releases.
DRI drivers
-----------
This release includes the DRI drivers and GLX code for hardware rendering.
Bug fixes
---------
Bugs fixed in 6.3.1 are listed in the VERSIONS file.
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.5
DJGPP implements OpenGL 1.5
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.5
Allegro needs updating
D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.3.1,v 3.1 2005/07/21 18:45:54 brianp Exp $

View File

@@ -1314,7 +1314,7 @@ Mesa Version History
- bug reports should to go bugzilla.freedesktop.org
6.3 July 20, 2004
6.3 July 20, 2005
New:
- GL_EXT_framebuffer_object extension
- GL_ARB_draw_buffers extension
@@ -1350,3 +1350,12 @@ Mesa Version History
- Removed bad XTranslateCoordinates call when rendering to Pixmaps
- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- fixed a few Darwin compilation problems
6.3.1 July XX, 2005
New:
- The distribution now includes the DRI drivers and GLX code
Bug fixes:
- GL_ARB_vertex/fragment_shader were mistakenly listed in the
extensions string
- negative relative addressing in vertex programs was broken

View File

@@ -21,53 +21,77 @@
<a name="unix-x11">
<H2>1. Unix/X11 Compilation and Installation</H1>
<p>
Mesa uses a rather conventional Makefile system.
A GNU autoconf/automake system used to be included, but was discarded
in Mesa 5.1 because:
</p>
<ul>
<li>It seldom worked on IRIX, Solaris, AIX, etc.
<li>It was very compilicated
<li>Nobody maintained it
<li>libtool was just too weird
</ul>
<p>
If someone strongly feels that Mesa should have a autoconf/automake
system and wants to contribute one and maintain it, we'll consider
adding it again.
</p>
<p>
In Mesa 6.1 we modified the conventional Makefile system.
Instead of specifying all the various system configurations in the
Make-config file, there's a directory named <code>configs/</code> which
has an individual file for each configuration.
One of the configs gets copied to <code>configs/current</code>, which
is then included by all Makefiles.
</p>
<h3>1.1 Compilation</h3>
<p>
Note: if you've obtained Mesa through CVS, do this first:
Mesa may be compiled in several different ways:
</p>
<pre>
cd Mesa
chmod a+x bin/mklib
</pre>
<ul>
<li><b><em>Stand-alone/Xlib mode</em></b> - Mesa is compiled as
a software renderer using Xlib to do all rendering.
libGL.so is a self-contained rendering library.
<p>
Just type <b>make</b> in the top-level directory.
To compile stand-alone Mesa type <b>make</b> in the top-level directory.
You'll see a list of supported system configurations.
Choose one from the list (such as linux-x86), and type:
</p>
<pre>
make linux-x86
</pre>
<p>This will produce libGL.so and several other libraries</p>
</li>
<li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers (for ATI,
Intel, Matrox, etc) are built.
libGL.so implements the GLX extension and dynamically loads the DRI drivers.
<p>
If you want to rebuild for a different configuration run
To build the DRI drivers you'll first need to have the DRM (Direct
Rendering Manager) kernel drivers and header files.
They're available from the <a href="http://dri.sf.net/" target="_parent">DRI</a> project.
</p>
<p>
You can get them from CVS by doing:
<pre>
cvs -d:pserver:anonymous@pds.freedesktop.org:/cvs/dri login
(hit enter when prompted for a password)
cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
</pre>
<p>
Make note of the directory in which the drm files are placed.
</p>
<p>
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
DRI Building Instructions</a> for the steps to build the DRM modules.
</p>
<p>
Next, in the <code>Mesa-x.y.z/configs/default</code> file, set the
<code>DRM_SOURCE_PATH</code> variable to indicate where the DRM files
are located.
</p>
<p>
Now build Mesa and the DRI drivers by running
</p>
<pre>
make linux-dri
</pre>
<p>
There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
and <code>linux-ppc</code> configurations, optimized for those architectures.
</p>
<p>
Finally, you'll need a DRI-enabled X server from
<a href="http://freedesktop.org/wiki/Software_2fXserver" target="_parent">
X.org</a> or <a href="http://www.xfree86.org" target="_parent">XFree86</a>.
Visit those projects' home pages for more information.
</p>
</li>
</ul>
<p>
Later, if you want to rebuild for a different configuration run
<code>make realclean</code> before rebuilding.
</p>
@@ -75,7 +99,8 @@ If you want to rebuild for a different configuration run
<h3>1.2 The libraries</h3>
<p>
When compilation has finished, look in the top-level <b>lib/</b> directory.
When compilation has finished, look in the top-level <code>lib/</code>
directory.
You'll see a set of library files similar to this:
</p>
<pre>
@@ -108,6 +133,23 @@ lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSM
<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
</p>
<p>
If you built the DRI hardware drivers, you'll also see the DRI drivers:
</p>
<pre>
-rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
-rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
-rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
-rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
-rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
-rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
-rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
-rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
-rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
-rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
</pre>
<h3>1.3 Running the demos</h3>

View File

@@ -30,7 +30,8 @@ SourceForge lists page.</a>
with the mailing lists please contact the SourceForge administrators for help.</p>
<p>Archives of the old Mesa mailing list which was hosted by unicamp.br
are available <a href="http://groups.yahoo.com/group/mesa/messages/">here</a>.</p>
are available <a href="http://groups.yahoo.com/group/mesa/messages/"
target="_parent">here</a>.</p>
<p>
Here are some other OpenGL-related forums you might find useful:
@@ -46,7 +47,8 @@ Usenet newsgroups:
</p>
<p>
<a href="http://www.opengl.org/">OpenGL discussion forums</A> at www.opengl.org
<a href="http://www.opengl.org/" target="_parent">OpenGL discussion forums</A>
at www.opengl.org
</p>
</HTML>

View File

@@ -52,6 +52,17 @@ This is a development release with new features, changes and bug fixes.
- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
- fixed a few Darwin compilation problems
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
0236f552d37514776945d5a013e5bb7b MesaLib-6.3.tar.gz
60e1a8f78c4a8c7750a1e95753190986 MesaLib-6.3.tar.bz2
ca7c950fbace68c70caa822322db7223 MesaLib-6.3.zip
25ea801645b376c014051804fe4974b2 MesaDemos-6.3.tar.gz
9248e74872ea88c57ec25c900c295057 MesaDemos-6.3.tar.bz2
8537dfa734ef258dcc7272097558d434 MesaDemos-6.3.zip
</pre>
<h2>December 9, 2004</h2>
@@ -1005,6 +1016,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.21 2005/07/20 18:07:11 brianp Exp $
$Id: news.html,v 3.22 2005/07/20 18:20:45 brianp Exp $
</body>
</html>

View File

@@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="RELNOTES-6.3.1">RELNOTES-6.3.1</A>
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>

View File

@@ -331,7 +331,16 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#if defined(__UNIXOS2__) || defined(__SOL64__)
#if defined(__sun__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__)
typedef long int int64_t;
#else
typedef long long int int64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
#elif defined( __VMS )

View File

@@ -38,7 +38,7 @@
#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
#ifndef DRI_NEW_INTERFACE_ONLY
#if 0 /*ndef DRI_NEW_INTERFACE_ONLY*/
# include <X11/X.h>
# include <GL/glx.h>
# include "GL/glxint.h"
@@ -62,6 +62,7 @@ typedef struct __DRIdrawableRec __DRIdrawable;
typedef struct __DRIdriverRec __DRIdriver;
typedef struct __DRIframebufferRec __DRIframebuffer;
typedef struct __DRIversionRec __DRIversion;
typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
typedef unsigned long __DRIid;
typedef void __DRInativeDisplay;
/*@}*/
@@ -71,42 +72,6 @@ typedef void __DRInativeDisplay;
* \name Functions provided by the driver loader.
*/
/*@{*/
extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
/**
* Type of a pointer to \c __glXGetInternalVersion, as returned by
* \c glXGetProcAddress.
*
* \sa __glXGetInternalVersion, glXGetProcAddress
*/
typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void );
/**
* Type of a pointer to \c __glXWindowExists, as returned by
* \c glXGetProcAddress.
*
* \sa __glXWindowExists, glXGetProcAddress
*/
typedef GLboolean (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw);
/**
* Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress.
*
* \sa __glXGetUST, glXGetProcAddress
*/
typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust );
/**
* Type of pointer to \c __glXCreateContextModes, as returned by
* \c glXGetProcAddress.
*
* \sa _gl_context_modes_create, glXGetProcAddress
*/
typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count,
size_t minimum_bytes_per_struct );
/**
* Type of a pointer to \c glXGetScreenDriver, as returned by
* \c glXGetProcAddress. This function is used to get the name of the DRI
@@ -127,39 +92,11 @@ typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int
typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
/**
* Type of a pointer to \c __glXScrEnableExtension, as returned by
* \c glXGetProcAddress. This function is used to enable a GLX extension
* on the specified screen.
*
* \sa __glXScrEnableExtension, glXGetProcAddress
* Type of a pointer to \c glxEnableExtension, as returned by
* \c __DRIinterfaceMethods::getProcAddress. This function is used to enable
* a GLX extension on the specified screen.
*/
typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
/**
* Type of a pointer to \c __glXGetDrawableInfo, as returned by
* \c glXGetProcAddress. This function is used to get information about the
* position, size, and clip rects of a drawable.
*
* \sa __glXGetDrawableInfo, glXGetProcAddress
*/
typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn,
__DRIid draw, unsigned int * index, unsigned int * stamp,
int * x, int * y, int * width, int * height,
int * numClipRects, drm_clip_rect_t ** pClipRects,
int * backX, int * backY,
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
/* Test for the xf86dri.h header file */
#ifndef _XF86DRI_H_
extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
__DRIid context_id );
extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
__DRIid drawable, drm_drawable_t *hHWDrawable );
extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
__DRIid drawable);
#endif
/*@}*/
@@ -173,16 +110,10 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
const __DRIversion * ddx_version, const __DRIversion * dri_version,
const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
void * pSAREA, int fd, int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes);
typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
extern CREATENEWSCREENFUNC __driCreateNewScreen;
#ifndef DRI_NEW_INTERFACE_ONLY
extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
#endif /* DRI_NEW_INTERFACE_ONLY */
extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
/**
@@ -209,6 +140,113 @@ struct __DRIversionRec {
int patch; /**< Patch-level. */
};
typedef void (*__DRIfuncPtr)(void);
struct __DRIinterfaceMethodsRec {
/**
* Get pointer to named function.
*/
__DRIfuncPtr (*getProcAddress)( const char * proc_name );
/**
* Create a list of \c __GLcontextModes structures.
*/
__GLcontextModes * (*createContextModes)(unsigned count,
size_t minimum_bytes_per_struct);
/**
* Destroy a list of \c __GLcontextModes structures.
*
* \todo
* Determine if the drivers actually need to call this.
*/
void (*destroyContextModes)( __GLcontextModes * modes );
/**
* Get the \c __DRIscreen for a given display and screen number.
*/
__DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
/**
* \name Client/server protocol functions.
*
* These functions implement the DRI client/server protocol for
* context and drawable operations. Platforms that do not implement
* the wire protocol (e.g., EGL) will implement glorified no-op functions.
*/
/*@{*/
/**
* Determine if the specified window ID still exists.
*
* \note
* Implementations may assume that the driver will only pass an ID into
* this function that actually corresponds to a window. On
* implementations where windows can only be destroyed by the DRI driver
* (e.g., EGL), this function is allowed to always return \c GL_TRUE.
*/
GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
/**
* Create the server-side portion of the GL context.
*/
GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
int configID, void * contextID, drm_context_t * hw_context );
/**
* Destroy the server-side portion of the GL context.
*/
GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
__DRIid context );
/**
* Create the server-side portion of the drawable.
*/
GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
__DRIid drawable, drm_drawable_t * hHWDrawable );
/**
* Destroy the server-side portion of the drawable.
*/
GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
__DRIid drawable );
/**
* This function is used to get information about the position, size, and
* clip rects of a drawable.
*/
GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
__DRIid draw, unsigned int * index, unsigned int * stamp,
int * x, int * y, int * width, int * height,
int * numClipRects, drm_clip_rect_t ** pClipRects,
int * backX, int * backY,
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
/*@}*/
/**
* \name Timing related functions.
*/
/*@{*/
/**
* Get the 64-bit unadjusted system time (UST).
*/
int (*getUST)(int64_t * ust);
/**
* Get the media stream counter (MSC) rate.
*
* Matching the definition in GLX_OML_sync_control, this function returns
* the rate of the "media stream counter". In practical terms, this is
* the frame refresh rate of the display.
*/
GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
int32_t * numerator, int32_t * denominator);
/*@}*/
};
/**
* Framebuffer information record. Used by libGL to communicate information
* about the framebuffer to the driver's \c __driCreateNewScreen function.
@@ -247,25 +285,6 @@ struct __DRIscreenRec {
*/
void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
/**
* Method to create the private DRI context data and initialize the
* context dependent methods.
*
* \sa __DRIscreenRec::createNewContext driCreateContext
* driCreateNewContext
*
* \deprecated
* This function has been replaced by \c __DRIscreenRec::createNewContext.
* New drivers will continue to export this method, but it will eventually
* (in the next XFree86 major relearse) go away.
*/
#ifndef DRI_NEW_INTERFACE_ONLY
void *(*createContext)(Display *dpy, XVisualInfo *vis, void *sharedPrivate,
__DRIcontext *pctx);
#else
void * createContext;
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Method to create the private DRI drawable data and initialize the
* drawable dependent methods.
@@ -341,30 +360,6 @@ struct __DRIcontextRec {
*/
void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
/**
* Method to bind a DRI drawable to a DRI graphics context.
*
* \deprecated Replaced by bindContext3.
*/
#ifndef DRI_NEW_INTERFACE_ONLY
Bool (*bindContext)(Display *dpy, int scrn, GLXDrawable draw,
GLXContext gc);
#else
void *bindContext;
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Method to unbind a DRI drawable to a DRI graphics context.
*
* \deprecated Replaced by unbindContext3.
*/
#ifndef DRI_NEW_INTERFACE_ONLY
Bool (*unbindContext)(Display *dpy, int scrn, GLXDrawable draw,
GLXContext gc, int will_rebind);
#else
void *unbindContext;
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Opaque pointer to private per context direct rendering data.
* \c NULL if direct rendering is not supported on the display or
@@ -372,32 +367,6 @@ struct __DRIcontextRec {
*/
void *private;
/**
* Method to bind a DRI drawable to a DRI graphics context.
*
* \since Internal API version 20030606.
* \deprecated Replaced by bindContext3.
*/
#ifndef DRI_NEW_INTERFACE_ONLY
Bool (*bindContext2)(Display *dpy, int scrn, GLXDrawable draw,
GLXDrawable read, GLXContext gc);
#else
void *bindContext2;
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Method to unbind a DRI drawable from a DRI graphics context.
*
* \since Internal API version 20030606.
* \deprecated Replaced by unbindContext3.
*/
#ifndef DRI_NEW_INTERFACE_ONLY
Bool (*unbindContext2)(Display *dpy, int scrn, GLXDrawable draw,
GLXDrawable read, GLXContext gc);
#else
void *unbindContext2;
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Pointer to the mode used to create this context.
*
@@ -408,17 +377,17 @@ struct __DRIcontextRec {
/**
* Method to bind a DRI drawable to a DRI graphics context.
*
* \since Internal API version 20040415.
* \since Internal API version 20050727.
*/
GLboolean (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
__DRIid read, __DRIcontext *ctx);
/**
* Method to unbind a DRI drawable from a DRI graphics context.
*
* \since Internal API version 20040415.
* \since Internal API version 20050727.
*/
GLboolean (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
__DRIid read, __DRIcontext *ctx);
};

View File

@@ -45,8 +45,8 @@ $(LIB_DIR):
# Make the library:
$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
@CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GLU_LIB) -major $(GLU_MAJOR) \
-minor $(GLU_MINOR) -patch $(GLU_TINY) \
@ $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CC)' \
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
$(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLU_LIB_DEPS) $(OBJECTS)

View File

@@ -136,8 +136,8 @@ $(LIB_DIR):
# Make the library:
$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GLU_LIB) -major $(GLU_MAJOR) \
-minor $(GLU_MINOR) -patch $(GLU_TINY) \
$(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' \
-major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
-cplusplus $(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLU_LIB_DEPS) $(OBJECTS)

View File

@@ -32,7 +32,7 @@ default: $(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GLUT_LIB) \
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLUT_LIB_DEPS) $(OBJECTS)

View File

@@ -90,9 +90,9 @@ default: $(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GLUT_LIB) \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLUT_LIB_DEPS) $(OBJECTS)

View File

@@ -55,9 +55,9 @@ default: depend $(LIB_DIR)/$(GLUT_LIB_NAME)
# Make the library
$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GLUT_LIB) \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \
-patch $(GLUT_TINY) $(GLUT_LIB_DEPS) -install $(LIB_DIR) \
$(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \
-major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \
$(GLUT_LIB_DEPS) -install $(LIB_DIR) \
$(MKLIB_OPTIONS) $(OBJECTS)

View File

@@ -33,8 +33,9 @@ clean:
# Make the library
$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GLW_LIB) -major $(MAJOR) -minor $(MINOR) \
-patch $(TINY) $(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' \
-major $(MAJOR) -minor $(MINOR) -patch $(TINY) \
$(MKLIB_OPTIONS) -install $(LIB_DIR) \
$(GLW_LIB_DEPS) $(OBJECTS)

View File

@@ -55,7 +55,8 @@ default: depend $(LIB_DIR)/$(GL_LIB_NAME)
# Make libGL
$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GL_LIB) -major 1 -minor 2 $(MKLIB_OPTIONS) \
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
-major 1 -minor 2 $(MKLIB_OPTIONS) \
-install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
rm -f $(LIB_DIR)/miniglx.conf
install example.miniglx.conf $(LIB_DIR)/miniglx.conf

View File

@@ -1,16 +1,12 @@
TOP = ../../..
include $(TOP)/configs/current
# This is a bit messy. We want this libGL to be capable of loading old
# interface drivers, so we have to turn off DRI_NEW_INTERFACE_ONLY. However,
# glcontextmodes.c is built elsewhere with DNIO on, so we symlink it across.
#
# Furthermore, context creation has evolved over the years, such that this
# Context creation has evolved over the years, such that this
# code will not build with DNIO defined. When we finally drop old interface
# support in libGL, we need to clean up both glxcmds.c and dri_interface.h.
DEFINES += -DGLX_DIRECT_RENDERING -DGLXEXT -DXF86DRI -DGLX_USE_DLOPEN \
-DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UDRI_NEW_INTERFACE_ONLY
-DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER
C_SOURCES = \
$(TOP)/src/mesa/glapi/glapi.c \
@@ -92,7 +88,8 @@ dispatch.c:
# Make libGL
$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GL_LIB) -major 1 -minor 2 $(MKLIB_OPTIONS) \
$(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
-major 1 -minor 2 $(MKLIB_OPTIONS) \
-install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)

View File

@@ -55,14 +55,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define RTLD_GLOBAL 0
#endif
#ifdef BUILT_IN_DRI_DRIVER
extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
#else /* BUILT_IN_DRI_DRIVER */
#ifndef DEFAULT_DRIVER_DIR
/* this is normally defined in the Imakefile */
@@ -102,23 +94,6 @@ static void ErrorMessageF(const char *f, ...)
}
/*
* We'll save a pointer to this function when we couldn't find a
* direct rendering driver for a given screen.
*/
static void *DummyCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
(void) dpy;
(void) scrn;
(void) psc;
(void) numConfigs;
(void) config;
return NULL;
}
/**
* Extract the ith directory path out of a colon-separated list of paths. No
* more than \c dirLen characters, including the terminating \c NUL, will be
@@ -181,6 +156,19 @@ ExtractDir(int index, const char *paths, int dirLen, char *dir)
}
/**
* Versioned name of the expected \c __driCreateNewScreen function.
*
* The version of the last incompatible loader/driver inteface change is
* appended to the name of the \c __driCreateNewScreen function. This
* prevents loaders from trying to load drivers that are too old.
*
* \todo
* Create a macro or something so that this is automatically updated.
*/
static const char createNewScreenName[] = "__driCreateNewScreen_20050727";
/**
* Try to \c dlopen the named driver.
*
@@ -249,18 +237,16 @@ static __DRIdriver *OpenDriver(const char *driverName)
return NULL; /* out of memory! */
}
driver->createScreenFunc = (CreateScreenFunc)
dlsym(handle, "__driCreateScreen");
driver->createNewScreenFunc = (CreateNewScreenFunc)
dlsym(handle, "__driCreateNewScreen");
driver->createNewScreenFunc = (PFNCREATENEWSCREENFUNC)
dlsym(handle, createNewScreenName);
if ( (driver->createScreenFunc == NULL)
&& (driver->createNewScreenFunc == NULL) ) {
if ( driver->createNewScreenFunc == NULL ) {
/* If the driver doesn't have this symbol then something's
* really, really wrong.
*/
ErrorMessageF("Neither __driCreateScreen or __driCreateNewScreen "
"are defined in %s_dri.so!\n", driverName);
ErrorMessageF("%s not defined in %s_dri.so!\n"
"Your driver may be too old for this libGL.\n",
createNewScreenName, driverName);
Xfree(driver);
dlclose(handle);
continue;
@@ -379,9 +365,6 @@ const char *glXGetDriverConfig (const char *driverName) {
}
#endif /* BUILT_IN_DRI_DRIVER */
/* This function isn't currently used.
*/
static void driDestroyDisplay(Display *dpy, void *private)
@@ -420,7 +403,6 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
*/
pdisp->private = NULL;
pdisp->destroyDisplay = NULL;
pdisp->createScreen = NULL;
if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
return NULL;
@@ -441,17 +423,10 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
pdisp->destroyDisplay = driDestroyDisplay;
/* allocate array of pointers to createScreen funcs */
pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createScreen) {
Xfree(pdpyp);
return NULL;
}
/* allocate array of pointers to createScreen funcs */
pdisp->createNewScreen = (CreateNewScreenFunc *) Xmalloc(numScreens * sizeof(void *));
/* allocate array of pointers to createNewScreen funcs */
pdisp->createNewScreen = (PFNCREATENEWSCREENFUNC *)
Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createNewScreen) {
Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
@@ -460,20 +435,10 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
if (!pdpyp->libraryHandles) {
Xfree(pdisp->createNewScreen);
Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
#ifdef BUILT_IN_DRI_DRIVER
/* we'll statically bind to the built-in __driCreateScreen function */
for (scrn = 0; scrn < numScreens; scrn++) {
pdisp->createScreen[scrn] = __driCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
#else
/* dynamically discover DRI drivers for all screens, saving each
* driver's "__driCreateScreen" function pointer. That's the bootstrap
* entrypoint for all DRI drivers.
@@ -481,17 +446,14 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
for (scrn = 0; scrn < numScreens; scrn++) {
__DRIdriver *driver = driGetDriver(dpy, scrn);
if (driver) {
pdisp->createScreen[scrn] = driver->createScreenFunc;
pdisp->createNewScreen[scrn] = driver->createNewScreenFunc;
pdpyp->libraryHandles[scrn] = driver->handle;
}
else {
pdisp->createScreen[scrn] = DummyCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
}
#endif
return (void *)pdpyp;
}

View File

@@ -40,10 +40,6 @@
#include "glcontextmodes.h"
#include "glheader.h"
#ifdef IN_DOXYGEN
#define GLX_PREFIX(x) x
#endif /* IN_DOXYGEN */
static void ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs );
@@ -422,9 +418,9 @@ CreatePbuffer( Display *dpy, const __GLcontextModes * fbconfig,
* Create a new pbuffer.
*/
PUBLIC GLXPbufferSGIX
GLX_PREFIX(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height,
int *attrib_list)
glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height,
int *attrib_list)
{
return (GLXPbufferSGIX) CreatePbuffer( dpy, (__GLcontextModes *) config,
width, height,
@@ -436,8 +432,7 @@ GLX_PREFIX(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config,
* Create a new pbuffer.
*/
PUBLIC GLXPbuffer
GLX_PREFIX(glXCreatePbuffer)(Display *dpy, GLXFBConfig config,
const int *attrib_list)
glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attrib_list)
{
return (GLXPbuffer) CreatePbuffer( dpy, (__GLcontextModes *) config,
0, 0,
@@ -449,7 +444,7 @@ GLX_PREFIX(glXCreatePbuffer)(Display *dpy, GLXFBConfig config,
* Destroy an existing pbuffer.
*/
PUBLIC void
GLX_PREFIX(glXDestroyPbuffer)(Display *dpy, GLXPbuffer pbuf)
glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf)
{
DestroyPbuffer( dpy, pbuf );
}
@@ -459,8 +454,8 @@ GLX_PREFIX(glXDestroyPbuffer)(Display *dpy, GLXPbuffer pbuf)
* Query an attribute of a drawable.
*/
PUBLIC void
GLX_PREFIX(glXQueryDrawable)(Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
glXQueryDrawable(Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
GetDrawableAttribute( dpy, drawable, attribute, value );
}
@@ -470,8 +465,8 @@ GLX_PREFIX(glXQueryDrawable)(Display *dpy, GLXDrawable drawable,
* Query an attribute of a pbuffer.
*/
PUBLIC int
GLX_PREFIX(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX drawable,
int attribute, unsigned int *value)
glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX drawable,
int attribute, unsigned int *value)
{
return GetDrawableAttribute( dpy, drawable, attribute, value );
}
@@ -481,8 +476,7 @@ GLX_PREFIX(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX drawable,
* Select the event mask for a drawable.
*/
PUBLIC void
GLX_PREFIX(glXSelectEvent)(Display *dpy, GLXDrawable drawable,
unsigned long mask)
glXSelectEvent(Display *dpy, GLXDrawable drawable, unsigned long mask)
{
CARD32 attribs[2];
@@ -497,8 +491,7 @@ GLX_PREFIX(glXSelectEvent)(Display *dpy, GLXDrawable drawable,
* Get the selected event mask for a drawable.
*/
PUBLIC void
GLX_PREFIX(glXGetSelectedEvent)(Display *dpy, GLXDrawable drawable,
unsigned long *mask)
glXGetSelectedEvent(Display *dpy, GLXDrawable drawable, unsigned long *mask)
{
unsigned int value;
@@ -514,8 +507,8 @@ GLX_PREFIX(glXGetSelectedEvent)(Display *dpy, GLXDrawable drawable,
PUBLIC GLXPixmap
GLX_PREFIX(glXCreatePixmap)( Display *dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list )
glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list )
{
return CreateDrawable( dpy, (__GLcontextModes *) config,
(Drawable) pixmap, attrib_list,
@@ -524,8 +517,8 @@ GLX_PREFIX(glXCreatePixmap)( Display *dpy, GLXFBConfig config, Pixmap pixmap,
PUBLIC GLXWindow
GLX_PREFIX(glXCreateWindow)( Display *dpy, GLXFBConfig config, Window win,
const int *attrib_list )
glXCreateWindow( Display *dpy, GLXFBConfig config, Window win,
const int *attrib_list )
{
return CreateDrawable( dpy, (__GLcontextModes *) config,
(Drawable) win, attrib_list,
@@ -534,14 +527,14 @@ GLX_PREFIX(glXCreateWindow)( Display *dpy, GLXFBConfig config, Window win,
PUBLIC void
GLX_PREFIX(glXDestroyPixmap)(Display *dpy, GLXPixmap pixmap)
glXDestroyPixmap(Display *dpy, GLXPixmap pixmap)
{
DestroyDrawable( dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap );
}
PUBLIC void
GLX_PREFIX(glXDestroyWindow)(Display *dpy, GLXWindow win)
glXDestroyWindow(Display *dpy, GLXWindow win)
{
DestroyDrawable( dpy, (GLXDrawable) win, X_GLXDestroyWindow );
}

View File

@@ -65,9 +65,6 @@
#elif defined( PTHREADS )
# include <pthread.h>
#endif
#ifdef GLX_BUILT_IN_XMESA
#include "realglx.h" /* just silences prototype warnings */
#endif
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 4
@@ -84,15 +81,6 @@ typedef struct _glapi_table __GLapi;
#include <GL/internal/dri_interface.h>
typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes, const __DRIversion * ddx_version,
const __DRIversion * dri_version, const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer, void * pSAREA,
int fd, int internal_api_version, __GLcontextModes ** driver_modes);
/**
* Display dependent methods. This structure is initialized during the
@@ -104,17 +92,6 @@ struct __DRIdisplayRec {
*/
void (*destroyDisplay)(Display *dpy, void *displayPrivate);
/**
* Methods to create the private DRI screen data and initialize the
* screen dependent methods.
* This is an array [indexed by screen number] of function pointers.
*
* \deprecated This array of function pointers has been replaced by
* \c __DRIdisplayRec::createNewScreen.
* \sa __DRIdisplayRec::createNewScreen
*/
CreateScreenFunc * createScreen;
/**
* Opaque pointer to private per display direct rendering data.
* \c NULL if direct rendering is not supported on this display.
@@ -124,10 +101,8 @@ struct __DRIdisplayRec {
/**
* Array of pointers to methods to create and initialize the private DRI
* screen data.
*
* \sa __DRIdisplayRec::createScreen
*/
CreateNewScreenFunc * createNewScreen;
PFNCREATENEWSCREENFUNC * createNewScreen;
};
@@ -137,8 +112,7 @@ struct __DRIdisplayRec {
struct __DRIdriverRec {
const char *name;
void *handle;
CreateScreenFunc createScreenFunc;
CreateNewScreenFunc createNewScreenFunc;
PFNCREATENEWSCREENFUNC createNewScreenFunc;
struct __DRIdriverRec *next;
};
@@ -160,6 +134,8 @@ extern const char *glXGetScreenDriver (Display *dpy, int scrNum);
extern const char *glXGetDriverConfig (const char *driverName);
extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
#endif
/************************************************************************/
@@ -512,14 +488,6 @@ extern void __glFreeAttributeState(__GLXcontext *);
* a pointer to the config data for that screen (if the screen supports GL).
*/
typedef struct __GLXscreenConfigsRec {
/**
* GLX visuals formated as \c __GLXvisualConfig structures.
*/
/*@{*/
__GLXvisualConfig * old_configs;
int numOldConfigs;
/*@}*/
/**
* GLX extension string reported by the X-server.
*/
@@ -539,10 +507,10 @@ typedef struct __GLXscreenConfigsRec {
#endif
/**
* Linked list of configurations for this screen. This is intended to
* be a superset of \c old_configs.
* Linked list of configurations for this screen.
*/
__GLcontextModes *configs;
/**
* Per-screen dynamic GLX extension tracking. The \c direct_support
* field only contains enough bits for 64 extensions. Should libGL
@@ -749,17 +717,6 @@ extern void _XSend(Display*, const void*, long);
#endif
/*
** GLX_BUILT_IN_XMESA controls whether libGL has a built-in verions of
** Mesa that can render to non-GLX displays.
*/
#ifdef GLX_BUILT_IN_XMESA
#define GLX_PREFIX(function) _real_##function
#else
#define GLX_PREFIX(function) function
#endif
extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );

View File

@@ -49,136 +49,17 @@
#ifdef GLX_DIRECT_RENDERING
#include "indirect_init.h"
#include "xf86vmode.h"
#include "xf86dri.h"
#endif
#include "glxextensions.h"
#include "glcontextmodes.h"
#include "glheader.h"
#include <sys/time.h>
#ifdef IN_DOXYGEN
#define GLX_PREFIX(x) x
#endif /* IN_DOXYGEN */
static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVersion[] = "1.4";
#if defined(GLX_DIRECT_RENDERING)
#include "xf86dri.h"
static Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc,
Display *dpy, XVisualInfo *vis, void *shared, __DRIcontext *ctx,
const __GLcontextModes *fbconfig, int render_type );
#ifndef DRI_NEW_INTERFACE_ONLY
static Bool dummyBindContext2( Display *dpy, int scrn,
GLXDrawable draw, GLXDrawable read, GLXContext gc );
static Bool dummyUnbindContext2( Display *dpy, int scrn,
GLXDrawable draw, GLXDrawable read, GLXContext gc );
/****************************************************************************/
/**
* Used as glue when a driver does not support
* \c __DRIcontextRec::bindContext2.
*
* XXX .bindContext is only defined as a function pointer if
* !DRI_NEW_INTERFACE_ONLY.
*
* \sa DriverCreateContextWrapper, __DRIcontextRec::bindContext2
*/
static Bool dummyBindContext2( Display *dpy, int scrn,
GLXDrawable draw, GLXDrawable read,
GLXContext gc )
{
assert( draw == read );
return (*gc->driContext.bindContext)( dpy, scrn, draw, gc );
}
/**
* Used as glue when a driver does not support
* \c __DRIcontextRec::unbindContext2.
*
* XXX .unbindContext is only defined as a function pointer if
* !DRI_NEW_INTERFACE_ONLY.
*
* \sa DriverCreateContextWrapper, __DRIcontextRec::unbindContext2
*/
static Bool dummyUnbindContext2( Display *dpy, int scrn,
GLXDrawable draw, GLXDrawable read,
GLXContext gc )
{
assert( draw == read );
return (*gc->driContext.unbindContext)( dpy, scrn, draw, gc, GL_FALSE );
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/****************************************************************************/
/**
* Wrap the call to the driver's \c createContext function.
*
* The \c createContext function is wrapped because not all drivers support
* the "new" \c unbindContext2 and \c bindContext2 interfaces. libGL should
* not have to check to see which functions the driver supports. Instead,
* if either function is not supported it is wrapped. The wrappers test to
* make sure that both drawables are the same and pass control to the old
* interface.
*
* \sa dummyBindContext2, dummyUnbindContext2,
* __DRIcontextRec::bindContext2, __DRIcontextRec::unbindContext2
*/
static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc,
Display *dpy, XVisualInfo *vis,
void *shared,
__DRIcontext *ctx,
const __GLcontextModes *modes,
int render_type )
{
void * ctx_priv = NULL;
if ( psc->driScreen.createNewContext != NULL ) {
assert( modes != NULL );
ctx_priv = (*psc->driScreen.createNewContext)(dpy, modes, render_type,
shared, ctx);
/* If the driver supports the createNewContext interface, then
* it MUST also support either the bindContext2 / unbindContext2
* interface or the bindContext3 / unbindContext3 interface.
*/
assert( (ctx_priv == NULL) || (ctx->unbindContext2 != NULL)
|| (ctx->unbindContext3 != NULL) );
assert( (ctx_priv == NULL) || (ctx->bindContext2 != NULL)
|| (ctx->bindContext3 != NULL) );
}
#ifndef DRI_NEW_INTERFACE_ONLY
else {
if ( vis != NULL ) {
ctx_priv = (*psc->driScreen.createContext)(dpy, vis, shared, ctx);
if ( ctx_priv != NULL ) {
if ( ctx->unbindContext2 == NULL ) {
ctx->unbindContext2 = dummyUnbindContext2;
}
if ( ctx->bindContext2 == NULL ) {
ctx->bindContext2 = dummyBindContext2;
}
}
}
}
#endif
return ctx_priv;
}
#endif
/****************************************************************************/
/**
* Get the __DRIdrawable for the drawable associated with a GLXContext
@@ -469,10 +350,10 @@ CreateContext(Display *dpy, XVisualInfo *vis,
if (psc && psc->driScreen.private) {
void * const shared = (shareList != NULL)
? shareList->driContext.private : NULL;
gc->driContext.private =
DriverCreateContextWrapper( psc, dpy, vis, shared,
&gc->driContext, mode,
renderType );
gc->driContext.private =
(*psc->driScreen.createNewContext)( dpy, mode, renderType,
shared,
&gc->driContext );
if (gc->driContext.private) {
gc->isDirect = GL_TRUE;
gc->screen = mode->screen;
@@ -543,9 +424,8 @@ CreateContext(Display *dpy, XVisualInfo *vis,
return gc;
}
PUBLIC GLXContext GLX_PREFIX(glXCreateContext)(Display *dpy, XVisualInfo *vis,
GLXContext shareList,
Bool allowDirect)
PUBLIC GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
GLXContext shareList, Bool allowDirect)
{
return CreateContext(dpy, vis, NULL, shareList, allowDirect, None,
False, 0);
@@ -620,7 +500,7 @@ DestroyContext(Display *dpy, GLXContext gc)
}
}
PUBLIC void GLX_PREFIX(glXDestroyContext)(Display *dpy, GLXContext gc)
PUBLIC void glXDestroyContext(Display *dpy, GLXContext gc)
{
DestroyContext(dpy, gc);
}
@@ -628,7 +508,7 @@ PUBLIC void GLX_PREFIX(glXDestroyContext)(Display *dpy, GLXContext gc)
/*
** Return the major and minor version #s for the GLX extension
*/
PUBLIC Bool GLX_PREFIX(glXQueryVersion)(Display *dpy, int *major, int *minor)
PUBLIC Bool glXQueryVersion(Display *dpy, int *major, int *minor)
{
__GLXdisplayPrivate *priv;
@@ -644,8 +524,7 @@ PUBLIC Bool GLX_PREFIX(glXQueryVersion)(Display *dpy, int *major, int *minor)
/*
** Query the existance of the GLX extension
*/
PUBLIC Bool GLX_PREFIX(glXQueryExtension)(Display *dpy, int *errorBase,
int *eventBase)
PUBLIC Bool glXQueryExtension(Display *dpy, int *errorBase, int *eventBase)
{
int major_op, erb, evb;
Bool rv;
@@ -662,7 +541,7 @@ PUBLIC Bool GLX_PREFIX(glXQueryExtension)(Display *dpy, int *errorBase,
** Put a barrier in the token stream that forces the GL to finish its
** work before X can proceed.
*/
PUBLIC void GLX_PREFIX(glXWaitGL)(void)
PUBLIC void glXWaitGL(void)
{
xGLXWaitGLReq *req;
GLXContext gc = __glXGetCurrentContext();
@@ -698,7 +577,7 @@ PUBLIC void GLX_PREFIX(glXWaitGL)(void)
** Put a barrier in the token stream that forces X to finish its
** work before GL can proceed.
*/
PUBLIC void GLX_PREFIX(glXWaitX)(void)
PUBLIC void glXWaitX(void)
{
xGLXWaitXReq *req;
GLXContext gc = __glXGetCurrentContext();
@@ -728,8 +607,7 @@ PUBLIC void GLX_PREFIX(glXWaitX)(void)
SyncHandle();
}
PUBLIC void GLX_PREFIX(glXUseXFont)(Font font, int first, int count,
int listBase)
PUBLIC void glXUseXFont(Font font, int first, int count, int listBase)
{
xGLXUseXFontReq *req;
GLXContext gc = __glXGetCurrentContext();
@@ -767,8 +645,8 @@ PUBLIC void GLX_PREFIX(glXUseXFont)(Font font, int first, int count,
** Copy the source context to the destination context using the
** attribute "mask".
*/
PUBLIC void GLX_PREFIX(glXCopyContext)(Display *dpy, GLXContext source,
GLXContext dest, unsigned long mask)
PUBLIC void glXCopyContext(Display *dpy, GLXContext source,
GLXContext dest, unsigned long mask)
{
xGLXCopyContextReq *req;
GLXContext gc = __glXGetCurrentContext();
@@ -842,7 +720,13 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID)
return reply.isDirect;
}
PUBLIC Bool GLX_PREFIX(glXIsDirect)(Display *dpy, GLXContext gc)
/**
* \todo
* Shouldn't this function \b always return \c GL_FALSE when
* \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with
* the GLX protocol here at all?
*/
PUBLIC Bool glXIsDirect(Display *dpy, GLXContext gc)
{
if (!gc) {
return GL_FALSE;
@@ -854,8 +738,8 @@ PUBLIC Bool GLX_PREFIX(glXIsDirect)(Display *dpy, GLXContext gc)
return __glXIsDirect(dpy, gc->xid);
}
PUBLIC GLXPixmap GLX_PREFIX(glXCreateGLXPixmap)(Display *dpy, XVisualInfo *vis,
Pixmap pixmap)
PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
Pixmap pixmap)
{
xGLXCreateGLXPixmapReq *req;
GLXPixmap xid;
@@ -883,7 +767,7 @@ PUBLIC GLXPixmap GLX_PREFIX(glXCreateGLXPixmap)(Display *dpy, XVisualInfo *vis,
/*
** Destroy the named pixmap
*/
PUBLIC void GLX_PREFIX(glXDestroyGLXPixmap)(Display *dpy, GLXPixmap glxpixmap)
PUBLIC void glXDestroyGLXPixmap(Display *dpy, GLXPixmap glxpixmap)
{
xGLXDestroyGLXPixmapReq *req;
CARD8 opcode;
@@ -903,7 +787,7 @@ PUBLIC void GLX_PREFIX(glXDestroyGLXPixmap)(Display *dpy, GLXPixmap glxpixmap)
SyncHandle();
}
PUBLIC void GLX_PREFIX(glXSwapBuffers)(Display *dpy, GLXDrawable drawable)
PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
{
xGLXSwapBuffersReq *req;
GLXContext gc;
@@ -952,8 +836,8 @@ PUBLIC void GLX_PREFIX(glXSwapBuffers)(Display *dpy, GLXDrawable drawable)
** Return configuration information for the given display, screen and
** visual combination.
*/
PUBLIC int GLX_PREFIX(glXGetConfig)(Display *dpy, XVisualInfo *vis,
int attribute, int *value_return)
PUBLIC int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute,
int *value_return)
{
__GLXdisplayPrivate *priv;
__GLXscreenConfigs *psc;
@@ -1309,8 +1193,7 @@ choose_visual( __GLcontextModes ** configs, int num_configs,
** Return the visual that best matches the template. Return None if no
** visual matches the template.
*/
PUBLIC XVisualInfo *GLX_PREFIX(glXChooseVisual)(Display *dpy, int screen,
int *attribList)
PUBLIC XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *attribList)
{
XVisualInfo *visualList = NULL;
__GLXdisplayPrivate *priv;
@@ -1368,8 +1251,7 @@ PUBLIC XVisualInfo *GLX_PREFIX(glXChooseVisual)(Display *dpy, int screen,
}
PUBLIC const char *GLX_PREFIX(glXQueryExtensionsString)( Display *dpy,
int screen )
PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen )
{
__GLXscreenConfigs *psc;
__GLXdisplayPrivate *priv;
@@ -1397,7 +1279,7 @@ PUBLIC const char *GLX_PREFIX(glXQueryExtensionsString)( Display *dpy,
return psc->effectiveGLXexts;
}
PUBLIC const char *GLX_PREFIX(glXGetClientString)( Display *dpy, int name )
PUBLIC const char *glXGetClientString( Display *dpy, int name )
{
switch(name) {
case GLX_VENDOR:
@@ -1411,8 +1293,7 @@ PUBLIC const char *GLX_PREFIX(glXGetClientString)( Display *dpy, int name )
}
}
PUBLIC const char *GLX_PREFIX(glXQueryServerString)( Display *dpy, int screen,
int name )
PUBLIC const char *glXQueryServerString( Display *dpy, int screen, int name )
{
__GLXscreenConfigs *psc;
__GLXdisplayPrivate *priv;
@@ -1593,8 +1474,7 @@ static int __glXQueryContextInfo(Display *dpy, GLXContext ctx)
}
PUBLIC int
GLX_PREFIX(glXQueryContext)(Display *dpy, GLXContext ctx,
int attribute, int *value)
glXQueryContext(Display *dpy, GLXContext ctx, int attribute, int *value)
{
int retVal;
@@ -1635,8 +1515,7 @@ PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
return ctx->xid;
}
PUBLIC GLXContext GLX_PREFIX(glXImportContextEXT)(Display *dpy,
GLXContextID contextID)
PUBLIC GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID)
{
GLXContext ctx;
@@ -1656,7 +1535,7 @@ PUBLIC GLXContext GLX_PREFIX(glXImportContextEXT)(Display *dpy,
return ctx;
}
PUBLIC void GLX_PREFIX(glXFreeContextEXT)(Display *dpy, GLXContext ctx)
PUBLIC void glXFreeContextEXT(Display *dpy, GLXContext ctx)
{
DestroyContext(dpy, ctx);
}
@@ -1667,16 +1546,15 @@ PUBLIC void GLX_PREFIX(glXFreeContextEXT)(Display *dpy, GLXContext ctx)
* GLX 1.3 functions - these are just stubs for now!
*/
PUBLIC GLXFBConfig *GLX_PREFIX(glXChooseFBConfig)(Display *dpy, int screen,
const int *attribList,
int *nitems)
PUBLIC GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
const int *attribList, int *nitems)
{
__GLcontextModes ** config_list;
int list_size;
config_list = (__GLcontextModes **)
GLX_PREFIX(glXGetFBConfigs)( dpy, screen, & list_size );
glXGetFBConfigs( dpy, screen, & list_size );
if ( (config_list != NULL) && (list_size > 0) && (attribList != NULL) ) {
list_size = choose_visual( config_list, list_size, attribList,
@@ -1692,26 +1570,23 @@ PUBLIC GLXFBConfig *GLX_PREFIX(glXChooseFBConfig)(Display *dpy, int screen,
}
PUBLIC GLXContext GLX_PREFIX(glXCreateNewContext)(Display *dpy,
GLXFBConfig config,
int renderType,
GLXContext shareList,
Bool allowDirect)
PUBLIC GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
int renderType, GLXContext shareList,
Bool allowDirect)
{
return CreateContext( dpy, NULL, (__GLcontextModes *) config, shareList,
allowDirect, None, True, renderType );
}
PUBLIC GLXDrawable GLX_PREFIX(glXGetCurrentReadDrawable)(void)
PUBLIC GLXDrawable glXGetCurrentReadDrawable(void)
{
GLXContext gc = __glXGetCurrentContext();
return gc->currentReadable;
}
PUBLIC GLXFBConfig *GLX_PREFIX(glXGetFBConfigs)(Display *dpy, int screen,
int *nelements)
PUBLIC GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
__GLcontextModes ** config = NULL;
@@ -1750,8 +1625,8 @@ PUBLIC GLXFBConfig *GLX_PREFIX(glXGetFBConfigs)(Display *dpy, int screen,
}
PUBLIC int GLX_PREFIX(glXGetFBConfigAttrib)(Display *dpy, GLXFBConfig config,
int attribute, int *value)
PUBLIC int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
int attribute, int *value)
{
__GLcontextModes * const modes = ValidateGLXFBConfig( dpy, config );
@@ -1761,8 +1636,7 @@ PUBLIC int GLX_PREFIX(glXGetFBConfigAttrib)(Display *dpy, GLXFBConfig config,
}
PUBLIC XVisualInfo *GLX_PREFIX(glXGetVisualFromFBConfig)(Display *dpy,
GLXFBConfig config)
PUBLIC XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config)
{
XVisualInfo visualTemplate;
__GLcontextModes * fbconfig = (__GLcontextModes *) config;
@@ -1787,7 +1661,7 @@ PUBLIC GLX_ALIAS(GLXDrawable, glXGetCurrentReadDrawableSGI, (void), (),
/*
** GLX_SGI_swap_control
*/
PUBLIC int GLX_PREFIX(glXSwapIntervalSGI)(int interval)
PUBLIC int glXSwapIntervalSGI(int interval)
{
xGLXVendorPrivateReq *req;
GLXContext gc = __glXGetCurrentContext();
@@ -1848,7 +1722,7 @@ PUBLIC int GLX_PREFIX(glXSwapIntervalSGI)(int interval)
/*
** GLX_MESA_swap_control
*/
PUBLIC GLint GLX_PREFIX(glXSwapIntervalMESA)(unsigned interval)
PUBLIC GLint glXSwapIntervalMESA(unsigned interval)
{
#ifdef GLX_DIRECT_RENDERING
GLXContext gc = __glXGetCurrentContext();
@@ -1880,7 +1754,7 @@ PUBLIC GLint GLX_PREFIX(glXSwapIntervalMESA)(unsigned interval)
return GLX_BAD_CONTEXT;
}
PUBLIC GLint GLX_PREFIX(glXGetSwapIntervalMESA)( void )
PUBLIC GLint glXGetSwapIntervalMESA( void )
{
#ifdef GLX_DIRECT_RENDERING
GLXContext gc = __glXGetCurrentContext();
@@ -1910,8 +1784,7 @@ PUBLIC GLint GLX_PREFIX(glXGetSwapIntervalMESA)( void )
** GLX_MESA_swap_frame_usage
*/
PUBLIC GLint GLX_PREFIX(glXBeginFrameTrackingMESA)(Display *dpy,
GLXDrawable drawable)
PUBLIC GLint glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable)
{
int status = GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
@@ -1931,8 +1804,7 @@ PUBLIC GLint GLX_PREFIX(glXBeginFrameTrackingMESA)(Display *dpy,
}
PUBLIC GLint GLX_PREFIX(glXEndFrameTrackingMESA)(Display *dpy,
GLXDrawable drawable)
PUBLIC GLint glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable)
{
int status = GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
@@ -1952,9 +1824,8 @@ PUBLIC GLint GLX_PREFIX(glXEndFrameTrackingMESA)(Display *dpy,
}
PUBLIC GLint GLX_PREFIX(glXGetFrameUsageMESA)(Display *dpy,
GLXDrawable drawable,
GLfloat *usage)
PUBLIC GLint glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable,
GLfloat *usage)
{
int status = GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
@@ -1980,11 +1851,9 @@ PUBLIC GLint GLX_PREFIX(glXGetFrameUsageMESA)(Display *dpy,
}
PUBLIC GLint GLX_PREFIX(glXQueryFrameTrackingMESA)(Display *dpy,
GLXDrawable drawable,
int64_t *sbc,
int64_t *missedFrames,
GLfloat *lastMissedUsage)
PUBLIC GLint glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable,
int64_t *sbc, int64_t *missedFrames,
GLfloat *lastMissedUsage)
{
int status = GLX_BAD_CONTEXT;
#ifdef GLX_DIRECT_RENDERING
@@ -2014,7 +1883,7 @@ PUBLIC GLint GLX_PREFIX(glXQueryFrameTrackingMESA)(Display *dpy,
/*
** GLX_SGI_video_sync
*/
PUBLIC int GLX_PREFIX(glXGetVideoSyncSGI)(unsigned int *count)
PUBLIC int glXGetVideoSyncSGI(unsigned int *count)
{
/* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
* FIXME: there should be a GLX encoding for this call. I can find no
@@ -2043,8 +1912,7 @@ PUBLIC int GLX_PREFIX(glXGetVideoSyncSGI)(unsigned int *count)
return GLX_BAD_CONTEXT;
}
PUBLIC int GLX_PREFIX(glXWaitVideoSyncSGI)(int divisor, int remainder,
unsigned int *count)
PUBLIC int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
{
#ifdef GLX_DIRECT_RENDERING
GLXContext gc = __glXGetCurrentContext();
@@ -2086,7 +1954,7 @@ PUBLIC int GLX_PREFIX(glXWaitVideoSyncSGI)(int divisor, int remainder,
*/
#if defined(_VL_H)
PUBLIC GLXVideoSourceSGIX GLX_PREFIX(glXCreateGLXVideoSourceSGIX)(Display *dpy,
PUBLIC GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX(Display *dpy,
int screen, VLServer server, VLPath path,
int nodeClass, VLNode drainNode)
{
@@ -2099,8 +1967,7 @@ PUBLIC GLXVideoSourceSGIX GLX_PREFIX(glXCreateGLXVideoSourceSGIX)(Display *dpy,
return 0;
}
PUBLIC void GLX_PREFIX(glXDestroyGLXVideoSourceSGIX)(Display *dpy,
GLXVideoSourceSGIX src)
PUBLIC void glXDestroyGLXVideoSourceSGIX(Display *dpy, GLXVideoSourceSGIX src)
{
(void) dpy;
(void) src;
@@ -2130,7 +1997,7 @@ PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
(dpy, config),
glXGetVisualFromFBConfig)
PUBLIC GLXPixmap GLX_PREFIX(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy,
PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy,
GLXFBConfigSGIX config, Pixmap pixmap)
{
xGLXVendorPrivateWithReplyReq *vpreq;
@@ -2172,7 +2039,7 @@ PUBLIC GLXPixmap GLX_PREFIX(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy,
return xid;
}
PUBLIC GLXContext GLX_PREFIX(glXCreateContextWithConfigSGIX)(Display *dpy,
PUBLIC GLXContext glXCreateContextWithConfigSGIX(Display *dpy,
GLXFBConfigSGIX config, int renderType,
GLXContext shareList, Bool allowDirect)
{
@@ -2196,8 +2063,8 @@ PUBLIC GLXContext GLX_PREFIX(glXCreateContextWithConfigSGIX)(Display *dpy,
}
PUBLIC GLXFBConfigSGIX GLX_PREFIX(glXGetFBConfigFromVisualSGIX)(Display *dpy,
XVisualInfo *vis)
PUBLIC GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy,
XVisualInfo *vis)
{
__GLXdisplayPrivate *priv;
__GLXscreenConfigs *psc;
@@ -2216,7 +2083,7 @@ PUBLIC GLXFBConfigSGIX GLX_PREFIX(glXGetFBConfigFromVisualSGIX)(Display *dpy,
/*
** GLX_SGI_cushion
*/
PUBLIC void GLX_PREFIX(glXCushionSGI)(Display *dpy, Window win, float cushion)
PUBLIC void glXCushionSGI(Display *dpy, Window win, float cushion)
{
(void) dpy;
(void) win;
@@ -2227,8 +2094,8 @@ PUBLIC void GLX_PREFIX(glXCushionSGI)(Display *dpy, Window win, float cushion)
/*
** GLX_SGIX_video_resize
*/
PUBLIC int GLX_PREFIX(glXBindChannelToWindowSGIX)(Display *dpy, int screen,
int channel , Window window)
PUBLIC int glXBindChannelToWindowSGIX(Display *dpy, int screen,
int channel , Window window)
{
(void) dpy;
(void) screen;
@@ -2237,8 +2104,8 @@ PUBLIC int GLX_PREFIX(glXBindChannelToWindowSGIX)(Display *dpy, int screen,
return 0;
}
PUBLIC int GLX_PREFIX(glXChannelRectSGIX)(Display *dpy, int screen, int channel,
int x, int y, int w, int h)
PUBLIC int glXChannelRectSGIX(Display *dpy, int screen, int channel,
int x, int y, int w, int h)
{
(void) dpy;
(void) screen;
@@ -2250,9 +2117,8 @@ PUBLIC int GLX_PREFIX(glXChannelRectSGIX)(Display *dpy, int screen, int channel,
return 0;
}
PUBLIC int GLX_PREFIX(glXQueryChannelRectSGIX)(Display *dpy, int screen,
int channel, int *x, int *y,
int *w, int *h)
PUBLIC int glXQueryChannelRectSGIX(Display *dpy, int screen, int channel,
int *x, int *y, int *w, int *h)
{
(void) dpy;
(void) screen;
@@ -2264,8 +2130,8 @@ PUBLIC int GLX_PREFIX(glXQueryChannelRectSGIX)(Display *dpy, int screen,
return 0;
}
int GLX_PREFIX(glXQueryChannelDeltasSGIX)(Display *dpy, int screen, int channel,
int *dx, int *dy, int *dw, int *dh)
int glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel,
int *dx, int *dy, int *dw, int *dh)
{
(void) dpy;
(void) screen;
@@ -2277,8 +2143,8 @@ int GLX_PREFIX(glXQueryChannelDeltasSGIX)(Display *dpy, int screen, int channel,
return 0;
}
PUBLIC int GLX_PREFIX(glXChannelRectSyncSGIX)(Display *dpy, int screen,
int channel, GLenum synctype)
PUBLIC int glXChannelRectSyncSGIX(Display *dpy, int screen,
int channel, GLenum synctype)
{
(void) dpy;
(void) screen;
@@ -2290,10 +2156,8 @@ PUBLIC int GLX_PREFIX(glXChannelRectSyncSGIX)(Display *dpy, int screen,
#if defined(_DM_BUFFER_H_)
PUBLIC Bool GLX_PREFIX(glXAssociateDMPbufferSGIX)(Display *dpy,
GLXPbufferSGIX pbuffer,
DMparams *params,
DMbuffer dmbuffer)
PUBLIC Bool glXAssociateDMPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuffer,
DMparams *params, DMbuffer dmbuffer)
{
(void) dpy;
(void) pbuffer;
@@ -2308,8 +2172,8 @@ PUBLIC Bool GLX_PREFIX(glXAssociateDMPbufferSGIX)(Display *dpy,
/*
** GLX_SGIX_swap_group
*/
PUBLIC void GLX_PREFIX(glXJoinSwapGroupSGIX)(Display *dpy, GLXDrawable drawable,
GLXDrawable member)
PUBLIC void glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable,
GLXDrawable member)
{
(void) dpy;
(void) drawable;
@@ -2320,17 +2184,15 @@ PUBLIC void GLX_PREFIX(glXJoinSwapGroupSGIX)(Display *dpy, GLXDrawable drawable,
/*
** GLX_SGIX_swap_barrier
*/
PUBLIC void GLX_PREFIX(glXBindSwapBarrierSGIX)(Display *dpy,
GLXDrawable drawable,
int barrier)
PUBLIC void glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable,
int barrier)
{
(void) dpy;
(void) drawable;
(void) barrier;
}
PUBLIC Bool GLX_PREFIX(glXQueryMaxSwapBarriersSGIX)(Display *dpy, int screen,
int *max)
PUBLIC Bool glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max)
{
(void) dpy;
(void) screen;
@@ -2342,10 +2204,8 @@ PUBLIC Bool GLX_PREFIX(glXQueryMaxSwapBarriersSGIX)(Display *dpy, int screen,
/*
** GLX_SUN_get_transparent_index
*/
PUBLIC Status GLX_PREFIX(glXGetTransparentIndexSUN)(Display *dpy,
Window overlay,
Window underlay,
long *pTransparent)
PUBLIC Status glXGetTransparentIndexSUN(Display *dpy, Window overlay,
Window underlay, long *pTransparent)
{
(void) dpy;
(void) overlay;
@@ -2358,8 +2218,8 @@ PUBLIC Status GLX_PREFIX(glXGetTransparentIndexSUN)(Display *dpy,
/*
** GLX_OML_sync_control
*/
PUBLIC Bool GLX_PREFIX(glXGetSyncValuesOML)(Display *dpy, GLXDrawable drawable,
int64_t *ust, int64_t *msc, int64_t *sbc)
PUBLIC Bool glXGetSyncValuesOML(Display *dpy, GLXDrawable drawable,
int64_t *ust, int64_t *msc, int64_t *sbc)
{
#ifdef GLX_DIRECT_RENDERING
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
@@ -2403,8 +2263,8 @@ PUBLIC Bool GLX_PREFIX(glXGetSyncValuesOML)(Display *dpy, GLXDrawable drawable,
* when GLX_OML_sync_control appears in the client extension string.
*/
PUBLIC Bool GLX_PREFIX(glXGetMscRateOML)(Display * dpy, GLXDrawable drawable,
int32_t * numerator, int32_t * denominator)
PUBLIC Bool glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
int32_t * numerator, int32_t * denominator)
{
#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
@@ -2477,11 +2337,9 @@ PUBLIC Bool GLX_PREFIX(glXGetMscRateOML)(Display * dpy, GLXDrawable drawable,
}
PUBLIC int64_t GLX_PREFIX(glXSwapBuffersMscOML)(Display *dpy,
GLXDrawable drawable,
int64_t target_msc,
int64_t divisor,
int64_t remainder)
PUBLIC int64_t glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable,
int64_t target_msc, int64_t divisor,
int64_t remainder)
{
#ifdef GLX_DIRECT_RENDERING
int screen;
@@ -2514,10 +2372,10 @@ PUBLIC int64_t GLX_PREFIX(glXSwapBuffersMscOML)(Display *dpy,
}
PUBLIC Bool GLX_PREFIX(glXWaitForMscOML)(Display * dpy, GLXDrawable drawable,
int64_t target_msc, int64_t divisor,
int64_t remainder, int64_t *ust,
int64_t *msc, int64_t *sbc)
PUBLIC Bool glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
int64_t target_msc, int64_t divisor,
int64_t remainder, int64_t *ust,
int64_t *msc, int64_t *sbc)
{
#ifdef GLX_DIRECT_RENDERING
int screen;
@@ -2557,9 +2415,9 @@ PUBLIC Bool GLX_PREFIX(glXWaitForMscOML)(Display * dpy, GLXDrawable drawable,
}
PUBLIC Bool GLX_PREFIX(glXWaitForSbcOML)(Display * dpy, GLXDrawable drawable,
int64_t target_sbc, int64_t *ust,
int64_t *msc, int64_t *sbc )
PUBLIC Bool glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
int64_t target_sbc, int64_t *ust,
int64_t *msc, int64_t *sbc )
{
#ifdef GLX_DIRECT_RENDERING
int screen;
@@ -2599,9 +2457,9 @@ PUBLIC Bool GLX_PREFIX(glXWaitForSbcOML)(Display * dpy, GLXDrawable drawable,
*/
/*@{*/
PUBLIC void *GLX_PREFIX(glXAllocateMemoryMESA)(Display *dpy, int scrn,
size_t size, float readFreq,
float writeFreq, float priority)
PUBLIC void *glXAllocateMemoryMESA(Display *dpy, int scrn,
size_t size, float readFreq,
float writeFreq, float priority)
{
#ifdef GLX_DIRECT_RENDERING
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
@@ -2626,7 +2484,7 @@ PUBLIC void *GLX_PREFIX(glXAllocateMemoryMESA)(Display *dpy, int scrn,
}
PUBLIC void GLX_PREFIX(glXFreeMemoryMESA)(Display *dpy, int scrn, void *pointer)
PUBLIC void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer)
{
#ifdef GLX_DIRECT_RENDERING
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
@@ -2644,8 +2502,8 @@ PUBLIC void GLX_PREFIX(glXFreeMemoryMESA)(Display *dpy, int scrn, void *pointer)
}
PUBLIC GLuint GLX_PREFIX(glXGetMemoryOffsetMESA)( Display *dpy, int scrn,
const void *pointer )
PUBLIC GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn,
const void *pointer )
{
#ifdef GLX_DIRECT_RENDERING
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, scrn );
@@ -2693,7 +2551,7 @@ PUBLIC GLuint GLX_PREFIX(glXGetMemoryOffsetMESA)( Display *dpy, int scrn,
* glXDestroyPbuffer glXDestroyPixmap glXDestroyWindow
* glXDestroyGLXPbufferSGIX glXDestroyGLXVideoSourceSGIX
*/
PUBLIC Bool GLX_PREFIX(glXReleaseBuffersMESA)( Display *dpy, GLXDrawable d )
PUBLIC Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d )
{
(void) dpy;
(void) d;
@@ -2701,10 +2559,8 @@ PUBLIC Bool GLX_PREFIX(glXReleaseBuffersMESA)( Display *dpy, GLXDrawable d )
}
PUBLIC GLXPixmap GLX_PREFIX(glXCreateGLXPixmapMESA)( Display *dpy,
XVisualInfo *visual,
Pixmap pixmap,
Colormap cmap )
PUBLIC GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
Pixmap pixmap, Colormap cmap )
{
(void) dpy;
(void) visual;
@@ -2714,9 +2570,8 @@ PUBLIC GLXPixmap GLX_PREFIX(glXCreateGLXPixmapMESA)( Display *dpy,
}
PUBLIC void GLX_PREFIX(glXCopySubBufferMESA)(Display *dpy, GLXDrawable drawable,
int x, int y,
int width, int height)
PUBLIC void glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable,
int x, int y, int width, int height)
{
(void) dpy;
(void) drawable;
@@ -2727,7 +2582,7 @@ PUBLIC void GLX_PREFIX(glXCopySubBufferMESA)(Display *dpy, GLXDrawable drawable,
}
PUBLIC Bool GLX_PREFIX(glXSet3DfxModeMESA)( int mode )
PUBLIC Bool glXSet3DfxModeMESA( int mode )
{
(void) mode;
return GL_FALSE;
@@ -2917,28 +2772,9 @@ static const struct name_address_pair GLX_functions[] = {
GLX_FUNCTION( glXGetSyncValuesOML ),
#ifdef GLX_DIRECT_RENDERING
/***
*** Internal functions useful to DRI drivers
*** With this, the DRI drivers shouldn't need dlopen()/dlsym() to
*** access internal libGL functions which may or may not exist.
***/
GLX_FUNCTION( __glXInitialize ),
GLX_FUNCTION( __glXFindDRIScreen ),
GLX_FUNCTION( __glXGetInternalVersion ),
GLX_FUNCTION( __glXWindowExists ),
GLX_FUNCTION2( __glXCreateContextWithConfig, XF86DRICreateContextWithConfig ),
GLX_FUNCTION2( __glXGetDrawableInfo, XF86DRIGetDrawableInfo ),
/*** DRI configuration ***/
GLX_FUNCTION( glXGetScreenDriver ),
GLX_FUNCTION( glXGetDriverConfig ),
GLX_FUNCTION( __glXScrEnableExtension ),
GLX_FUNCTION( __glXGetUST ),
GLX_FUNCTION2( __glXCreateContextModes, _gl_context_modes_create ),
GLX_FUNCTION2( __glXDestroyContextModes, _gl_context_modes_destroy ),
#endif
{ NULL, NULL } /* end of list */
@@ -2960,7 +2796,6 @@ get_glx_proc_address(const char *funcName)
}
#ifndef GLX_BUILT_IN_XMESA
/**
* Get the address of a named GL function. This is the pre-GLX 1.4 name for
* \c glXGetProcAddress.
@@ -3009,7 +2844,6 @@ PUBLIC void (*glXGetProcAddress(const GLubyte *procName))( void )
return glXGetProcAddressARB(procName);
}
#endif /* __GNUC__ */
#endif /* GLX_BUILT_IN_XMESA */
#ifdef GLX_DIRECT_RENDERING
@@ -3052,8 +2886,10 @@ int __glXGetInternalVersion(void)
* 20040415 - Added support for bindContext3 and unbindContext3.
* 20040602 - Add __glXGetDrawableInfo. I though that was there
* months ago. :(
* 20050727 - Gut all the old interfaces. This breaks compatability with
* any DRI driver built to any previous version.
*/
return 20040602;
return 20050727;
}
@@ -3087,7 +2923,7 @@ static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr)
*
* \since Internal API version 20021128.
*/
static Bool __glXWindowExists(Display *dpy, GLXDrawable draw)
Bool __glXWindowExists(Display *dpy, GLXDrawable draw)
{
XWindowAttributes xwa;
int (*oldXErrorHandler)(Display *, XErrorEvent *);

View File

@@ -111,6 +111,10 @@ static int _mesa_sparc_needs_init = 1;
#define INIT_MESA_SPARC
#endif
#ifdef GLX_DIRECT_RENDERING
static __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
#endif /* GLX_DIRECT_RENDERING */
static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
GLXDrawable read, GLXContext gc);
@@ -272,7 +276,6 @@ int __glXDebug = 0;
*/
int __glXCloseDisplay(Display *dpy, XExtCodes *codes);
static GLboolean FillInVisuals( __GLXscreenConfigs * psc );
/************************************************************************/
@@ -352,12 +355,6 @@ static void FreeScreenConfigs(__GLXdisplayPrivate *priv)
if(psc->effectiveGLXexts)
Xfree(psc->effectiveGLXexts);
if ( psc->old_configs != NULL ) {
Xfree( psc->old_configs );
psc->old_configs = NULL;
psc->numOldConfigs = 0;
}
psc->configs = NULL; /* NOTE: just for paranoia */
}
@@ -399,10 +396,6 @@ static int __glXFreeDisplayPrivate(XExtData *extension)
priv->driDisplay.private = NULL;
#endif
#ifdef GLX_DIRECT_RENDERING
XFree(priv->driDisplay.createScreen);
#endif
Xfree((char*) priv);
return 0;
}
@@ -442,112 +435,6 @@ static Bool QueryVersion(Display *dpy, int opcode, int *major, int *minor)
}
/**
* Determine if a \c __GLcontextModes structure has the right mojo to be
* converted to a \c __GLXvisualConfig to be sent to an "old" style DRI
* driver.
*/
#define MODE_HAS_MOJO(m) \
((m)->visualID != GLX_DONT_CARE) \
&& ((m)->sampleBuffers == 0) \
&& ((m)->samples == 0) \
&& (((m)->drawableType & GLX_WINDOW_BIT) != 0) \
&& (((m)->xRenderable == GL_TRUE) \
|| ((m)->xRenderable == GLX_DONT_CARE))
/**
* Convert the FBConfigs associated with a screen into an array of
* \c __GLXvisualConfig structures. These structures are passed into DRI
* drivers that use the "old" interface. The old-style drivers had a fairly
* strict set of visual types that could be supported. FBConfigs that
* cannot be supported are not converted.
*
* \param psc Screen whose FBConfigs need to be swizzled.
*
* \returns
* If memory could be allocated and at least one FBConfig could be converted
* to a \c __GLXvisualConfig structure, \c GL_TRUE is returned. Otherwise,
* \c GL_FALSE is returned.
*
* \todo
* When the old DRI driver interface is no longer supported, this function
* can be removed.
*/
static GLboolean
FillInVisuals( __GLXscreenConfigs * psc )
{
__GLcontextModes *modes;
int glx_visual_count;
glx_visual_count = 0;
for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) {
if ( MODE_HAS_MOJO( modes ) ) {
glx_visual_count++;
}
}
psc->old_configs = (__GLXvisualConfig *)
Xmalloc( sizeof( __GLXvisualConfig ) * glx_visual_count );
if ( psc->old_configs == NULL ) {
return GL_FALSE;
}
glx_visual_count = 0;
for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) {
if ( MODE_HAS_MOJO( modes ) ) {
#define COPY_VALUE(src_tag,dst_tag) \
psc->old_configs[glx_visual_count]. dst_tag = modes-> src_tag
COPY_VALUE( visualID, vid );
COPY_VALUE( rgbMode, rgba );
COPY_VALUE( stereoMode, stereo );
COPY_VALUE( doubleBufferMode, doubleBuffer );
psc->old_configs[glx_visual_count].class =
_gl_convert_to_x_visual_type( modes->visualType );
COPY_VALUE( level, level );
COPY_VALUE( numAuxBuffers, auxBuffers );
COPY_VALUE( redBits, redSize );
COPY_VALUE( greenBits, greenSize );
COPY_VALUE( blueBits, blueSize );
COPY_VALUE( alphaBits, alphaSize );
COPY_VALUE( rgbBits, bufferSize );
COPY_VALUE( accumRedBits, accumRedSize );
COPY_VALUE( accumGreenBits, accumGreenSize );
COPY_VALUE( accumBlueBits, accumBlueSize );
COPY_VALUE( accumAlphaBits, accumAlphaSize );
COPY_VALUE( depthBits, depthSize );
COPY_VALUE( stencilBits, stencilSize );
COPY_VALUE( visualRating, visualRating );
COPY_VALUE( transparentPixel, transparentPixel );
COPY_VALUE( transparentRed, transparentRed );
COPY_VALUE( transparentGreen, transparentGreen );
COPY_VALUE( transparentBlue, transparentBlue );
COPY_VALUE( transparentAlpha, transparentAlpha );
COPY_VALUE( transparentIndex, transparentIndex );
#undef COPY_VALUE
glx_visual_count++;
}
}
psc->numOldConfigs = glx_visual_count;
if ( glx_visual_count == 0 ) {
Xfree( psc->old_configs );
psc->old_configs = NULL;
}
return (glx_visual_count != 0);
}
void
__glXInitializeVisualConfigFromTags( __GLcontextModes *config, int count,
const INT32 *bp, Bool tagged_only,
@@ -784,6 +671,42 @@ filter_modes( __GLcontextModes ** server_modes,
}
/**
* Implement \c __DRIinterfaceMethods::getProcAddress.
*/
static __DRIfuncPtr get_proc_address( const char * proc_name )
{
if (strcmp( proc_name, "glxEnableExtension" ) == 0) {
return (__DRIfuncPtr) __glXScrEnableExtension;
}
return NULL;
}
/**
* Table of functions exported by the loader to the driver.
*/
static const __DRIinterfaceMethods interface_methods = {
get_proc_address,
_gl_context_modes_create,
_gl_context_modes_destroy,
__glXFindDRIScreen,
__glXWindowExists,
XF86DRICreateContextWithConfig,
XF86DRIDestroyContext,
XF86DRICreateDrawable,
XF86DRIDestroyDrawable,
XF86DRIGetDrawableInfo,
__glXGetUST,
glXGetMscRateOML,
};
/**
* Perform the required libGL-side initialization and call the client-side
@@ -805,7 +728,7 @@ filter_modes( __GLcontextModes ** server_modes,
static void *
CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
__DRIdisplay * driDpy,
CreateNewScreenFunc createNewScreen)
PFNCREATENEWSCREENFUNC createNewScreen)
{
__DRIscreenPrivate *psp = NULL;
#ifndef GLX_USE_APPLEGL
@@ -865,9 +788,9 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
char *driverName;
/*
* Get device name (like "tdfx") and the ddx version numbers.
* We'll check the version in each DRI driver's "createScreen"
* function.
* Get device name (like "tdfx") and the ddx version
* numbers. We'll check the version in each DRI driver's
* "createNewScreen" function.
*/
err_msg = "XF86DRIGetClientDriverName";
if (XF86DRIGetClientDriverName(dpy, scrn,
@@ -910,8 +833,9 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
if ( status == 0 ) {
/*
* Map the SAREA region. Further mmap regions may be setup in
* each DRI driver's "createScreen" function.
* Map the SAREA region. Further mmap regions
* may be setup in each DRI driver's
* "createNewScreen" function.
*/
status = drmMap(fd, hSAREA, SAREA_MAX,
&pSAREA);
@@ -935,6 +859,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
pSAREA,
fd,
api_ver,
& interface_methods,
& driver_modes );
filter_modes( & configs->configs,
@@ -1156,6 +1081,9 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
psc->ext_list_first_time = GL_TRUE;
/* Initialize the direct rendering per screen data and functions */
if (priv->driDisplay.private != NULL) {
/* FIXME: Should it be some sort of an error if createNewScreen[i]
* FIXME: is NULL?
*/
if (priv->driDisplay.createNewScreen &&
priv->driDisplay.createNewScreen[i]) {
@@ -1165,21 +1093,6 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
& priv->driDisplay,
priv->driDisplay.createNewScreen[i] );
}
else if (priv->driDisplay.createScreen &&
priv->driDisplay.createScreen[i]) {
/* screen initialization (bootstrap the driver) */
if ( (psc->old_configs == NULL)
&& !FillInVisuals(psc) ) {
FreeScreenConfigs(priv);
return GL_FALSE;
}
psc->driScreen.screenConfigs = (void *)psc;
psc->driScreen.private =
(*(priv->driDisplay.createScreen[i]))(dpy, i, &psc->driScreen,
psc->numOldConfigs,
psc->old_configs);
}
}
#endif
}
@@ -1273,7 +1186,6 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
/* Assinging zero here assures we'll never go direct */
dpyPriv->driDisplay.private = 0;
dpyPriv->driDisplay.destroyDisplay = 0;
dpyPriv->driDisplay.createScreen = 0;
}
else {
dpyPriv->driDisplay.private =
@@ -1607,44 +1519,23 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode,
}
#ifdef GLX_DIRECT_RENDERING
static Bool BindContextWrapper( Display *dpy, GLXContext gc,
GLXDrawable draw, GLXDrawable read )
{
#ifdef GLX_DIRECT_RENDERING
if ( gc->driContext.bindContext3 != NULL ) {
return (*gc->driContext.bindContext3)(dpy, gc->screen, draw, read,
& gc->driContext);
}
#ifndef DRI_NEW_INTERFACE_ONLY
else {
return (*gc->driContext.bindContext2)(dpy, gc->screen, draw, read,
gc);
}
#endif
#endif
return GL_FALSE;
return (*gc->driContext.bindContext)(dpy, gc->screen, draw, read,
& gc->driContext);
}
static Bool UnbindContextWrapper( Display *dpy, GLXContext gc )
static Bool UnbindContextWrapper( GLXContext gc )
{
#ifdef GLX_DIRECT_RENDERING
if ( gc->driContext.unbindContext3 != NULL ) {
return (*gc->driContext.unbindContext3)(dpy, gc->screen,
gc->currentDrawable,
gc->currentReadable,
& gc->driContext );
}
#ifndef DRI_NEW_INTERFACE_ONLY
else {
return (*gc->driContext.unbindContext2)(dpy, gc->screen,
gc->currentDrawable,
gc->currentReadable, gc);
}
#endif
#endif
return GL_FALSE;
return (*gc->driContext.unbindContext)(gc->currentDpy, gc->screen,
gc->currentDrawable,
gc->currentReadable,
& gc->driContext );
}
#endif /* GLX_DIRECT_RENDERING */
/*
@@ -1707,7 +1598,7 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
/* Unbind the old direct rendering context */
if (oldGC->isDirect) {
if (oldGC->driContext.private) {
if (! UnbindContextWrapper( oldGC->currentDpy, oldGC )) {
if (! UnbindContextWrapper( oldGC )) {
/* The make current failed. Just return GL_FALSE. */
return GL_FALSE;
}
@@ -1879,8 +1770,7 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
}
PUBLIC Bool GLX_PREFIX(glXMakeCurrent)(Display *dpy, GLXDrawable draw,
GLXContext gc)
PUBLIC Bool glXMakeCurrent(Display *dpy, GLXDrawable draw, GLXContext gc)
{
return MakeContextCurrent( dpy, draw, draw, gc );
}

View File

@@ -89,7 +89,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(NV_render_depth_texture), VER(0,0), N, N, N, N },
{ GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N },
{ GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */
{ GLX(OML_swap_method), VER(0,0), Y, N, N, N },
{ GLX(OML_swap_method), VER(0,0), Y, Y, N, N },
{ GLX(OML_sync_control), VER(0,0), Y, N, N, Y },
{ GLX(SGI_cushion), VER(0,0), N, N, N, N },
{ GLX(SGI_make_current_read), VER(1,3), Y, N, N, N },
@@ -99,7 +99,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(SGIS_color_range), VER(0,0), N, N, N, N },
{ GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
{ GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N },
{ GLX(SGIX_fbconfig), VER(1,3), Y, N, N, N },
{ GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N },
{ GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N },
{ GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N },
{ GLX(SGIX_swap_group), VER(0,0), N, N, N, N },

View File

@@ -262,16 +262,16 @@ typedef void (* PFNGLXDISABLEEXTENSIONPROC) ( const char * name );
#else
# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type GLX_PREFIX( real_func ) proto_args \
return_type real_func proto_args \
__attribute__ ((alias( # aliased_func ) ));
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
# else
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type GLX_PREFIX( real_func ) proto_args \
return_type real_func proto_args \
{ return aliased_func args ; }
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
void GLX_PREFIX( real_func ) proto_args \
void real_func proto_args \
{ aliased_func args ; }
# endif /* __GNUC__ */
#endif /* GLX_NO_STATIC_EXTENSION_FUNCTIONS */

View File

@@ -365,6 +365,8 @@ ALIAS( Map2f, Map2d )
ALIAS( ColorTableParameteriv, ColorTableParameterfv )
ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
ALIAS( PointParameterivNV, PointParameterfvEXT )
ALIAS( PointParameterfvARB, PointParameterfvEXT )
ALIAS( PointParameteriv, PointParameterfvEXT )
# undef HAVE_ALIAS
# undef PURE

View File

@@ -96,7 +96,7 @@ LIBGL_CORE_OBJECTS = \
# Make libGL from core object files
libgl-core: $(LIBGL_CORE_OBJECTS)
@ CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GL_LIB) \
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
-install $(LIB_DIR) $(MKLIB_OPTIONS) $(LIBGL_CORE_OBJECTS) $(GL_LIB_DEPS)
@@ -150,7 +150,7 @@ subdirs:
# Make the GL library
$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
@ CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(GL_LIB) \
@ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
-major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
-install $(LIB_DIR) \
$(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS)
@@ -158,13 +158,13 @@ $(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
# Make the OSMesa library
$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
@ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(OSMESA_LIB) \
$(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
-major $(MESA_MAJOR) \
-minor $(MESA_MINOR) -patch $(MESA_TINY) \
-install $(LIB_DIR) $(MKLIB_OPTIONS) \
$(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
else \
CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(OSMESA_LIB) \
$(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
-major $(MESA_MAJOR) \
-minor $(MESA_MINOR) -patch $(GL_TINY) \
-install $(LIB_DIR) $(MKLIB_OPTIONS) \

View File

@@ -13,15 +13,6 @@
*
* These functions are compiled into each DRI driver so libGL.so knows nothing
* about them.
*
* \note
* When \c DRI_NEW_INTERFACE_ONLY is defined, code is built / not built so
* that only the "new" libGL-to-driver interfaces are supported. This breaks
* backwards compatability. However, this may be necessary when DRI drivers
* are built to be used in non-XFree86 environments.
*
* \todo There are still some places in the code that need to be wrapped with
* \c DRI_NEW_INTERFACE_ONLY.
*/
@@ -35,17 +26,8 @@
#define MAP_FAILED ((void *)-1)
#endif
#ifndef DRI_NEW_INTERFACE_ONLY
# include <X11/Xlibint.h>
# include <Xext.h>
# include <extutil.h>
# include "xf86dri.h"
# define _mesa_malloc(b) Xmalloc(b)
# define _mesa_free(m) Xfree(m)
#else
# include "imports.h"
# define None 0
#endif /* DRI_NEW_INTERFACE_ONLY */
#include "imports.h"
#define None 0
#include "dri_util.h"
#include "drm_sarea.h"
@@ -55,6 +37,10 @@
typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator);
#endif
/* This pointer *must* be set by the driver's __driCreateNewScreen funciton!
*/
const __DRIinterfaceMethods * dri_interface = NULL;
/**
* Weak thread-safety dispatch pointer. Older versions of libGL will not have
* this symbol, so a "weak" version is included here so that the driver will
@@ -68,19 +54,6 @@ struct _glapi_table *_glapi_DispatchTSD __attribute__((weak)) = NULL;
*/
static const int empty_attribute_list[1] = { None };
/**
* Function used to determine if a drawable (window) still exists. Ideally
* this function comes from libGL. With older versions of libGL from XFree86
* we can fall-back to an internal version.
*
* \sa __driWindowExists __glXWindowExists
*/
static PFNGLXWINDOWEXISTSPROC window_exists;
typedef GLboolean (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( __DRInativeDisplay*, int, int, void *,
drm_context_t * );
static PFNGLXCREATECONTEXTWITHCONFIGPROC create_context_with_config;
/**
* Cached copy of the internal API version used by libGL and the client-side
@@ -99,27 +72,6 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, const __GLcontextMode
static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate);
#ifdef not_defined
static GLboolean driFeatureOn(const char *name)
{
char *env = getenv(name);
if (!env) return GL_FALSE;
if (!strcasecmp(env, "enable")) return GL_TRUE;
if (!strcasecmp(env, "1")) return GL_TRUE;
if (!strcasecmp(env, "on")) return GL_TRUE;
if (!strcasecmp(env, "true")) return GL_TRUE;
if (!strcasecmp(env, "t")) return GL_TRUE;
if (!strcasecmp(env, "yes")) return GL_TRUE;
if (!strcasecmp(env, "y")) return GL_TRUE;
return GL_FALSE;
}
#endif /* not_defined */
/**
* Print message to \c stderr if the \c LIBGL_DEBUG environment variable
* is set.
@@ -142,78 +94,6 @@ __driUtilMessage(const char *f, ...)
}
}
/*
* fd.o bug #1713: Some rare libGL's have __glXFindDRIScreen defined but do not
* export it via glXGetProcAddress. These are not supported anymore, so print
* an error message to that effect. - ajax 2004-10-26
*/
typedef __DRIscreen *(*PFNGLXFINDDRISCREEN)(__DRInativeDisplay *, int);
static __DRIscreen *glx_find_dri_screen(__DRInativeDisplay *d, int i)
{
PFNGLXFINDDRISCREEN findscreen =
(PFNGLXFINDDRISCREEN)glXGetProcAddress("__glXFindDRIScreen");
if (!findscreen)
{
__driUtilMessage("glXGetProcAddress(\"__glXFindDRIScreen\") failed!");
__driUtilMessage("Your libGL is too old, please upgrade.");
return NULL;
}
else return findscreen(d, i);
}
/*****************************************************************/
/** \name Visual utility functions */
/*****************************************************************/
/*@{*/
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* Find a \c __GLcontextModes structure matching the given visual ID.
*
* \param dpy Display to search for a matching configuration.
* \param scrn Screen number on \c dpy to be searched.
* \param vid Desired \c VisualID to find.
*
* \returns A pointer to a \c __GLcontextModes structure that matches \c vid,
* if found, or \c NULL if no match is found.
*/
static const __GLcontextModes *
findConfigMode(__DRInativeDisplay *dpy, int scrn, VisualID vid,
const __DRIscreen * pDRIScreen)
{
if ( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ) {
const __DRIscreenPrivate * const psp =
(const __DRIscreenPrivate *) pDRIScreen->private;
return _gl_context_modes_find_visual( psp->modes, vid );
}
return NULL;
}
/**
* This function is a hack to work-around old versions of libGL.so that
* do not export \c XF86DRICreateContextWithConfig. I would modify the
* code to just use this function, but the stand-alone driver (i.e., DRI
* drivers that are built to work without XFree86) shouldn't have to know
* about X structures like a \c Visual.
*/
static GLboolean
fake_XF86DRICreateContextWithConfig( __DRInativeDisplay* dpy, int screen, int configID,
XID* context, drm_context_t * hHWContext )
{
Visual vis;
vis.visualid = configID;
return XF86DRICreateContext( dpy, screen, & vis, context, hHWContext );
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/*@}*/
/*****************************************************************/
/** \name Drawable list management */
@@ -242,50 +122,6 @@ static __DRIdrawable *__driFindDrawable(void *drawHash, __DRIid draw)
return pdraw;
}
#ifndef DRI_NEW_INTERFACE_ONLY
static GLboolean __driWindowExistsFlag;
static int __driWindowExistsErrorHandler(Display *dpy, XErrorEvent *xerr)
{
if (xerr->error_code == BadWindow) {
__driWindowExistsFlag = GL_FALSE;
}
return 0;
}
/**
* Determine if a window associated with a \c GLXDrawable exists on the
* X-server.
*
* \param dpy Display associated with the drawable to be queried.
* \param draw \c GLXDrawable to test.
*
* \returns \c GL_TRUE if a window exists that is associated with \c draw,
* otherwise \c GL_FALSE is returned.
*
* \warning This function is not currently thread-safe.
*
* \deprecated
* \c __glXWindowExists (from libGL) is prefered over this function. Starting
* with the next major release of XFree86, this function will be removed.
* Even now this function is no longer directly called. Instead it is called
* via a function pointer if and only if \c __glXWindowExists does not exist.
*
* \sa __glXWindowExists glXGetProcAddress window_exists
*/
static GLboolean __driWindowExists(Display *dpy, GLXDrawable draw)
{
XWindowAttributes xwa;
int (*oldXErrorHandler)(Display *, XErrorEvent *);
XSync(dpy, GL_FALSE);
__driWindowExistsFlag = GL_TRUE;
oldXErrorHandler = XSetErrorHandler(__driWindowExistsErrorHandler);
XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */
XSetErrorHandler(oldXErrorHandler);
return __driWindowExistsFlag;
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Find drawables in the local hash that have been destroyed on the
@@ -303,7 +139,7 @@ static void __driGarbageCollectDrawables(void *drawHash)
do {
__DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private;
dpy = pdp->driScreenPriv->display;
if (! (*window_exists)(dpy, draw)) {
if (! (*dri_interface->windowExists)(dpy, draw)) {
/* Destroy the local drawable data in the hash table, if the
drawable no longer exists in the Xserver */
drmHashDelete(drawHash, draw);
@@ -341,7 +177,7 @@ static void __driGarbageCollectDrawables(void *drawHash)
* While casting the opaque private pointers associated with the parameters
* into their respective real types it also assures they are not \c NULL.
*/
static GLboolean driUnbindContext3(__DRInativeDisplay *dpy, int scrn,
static GLboolean driUnbindContext(__DRInativeDisplay *dpy, int scrn,
__DRIid draw, __DRIid read,
__DRIcontext *ctx)
{
@@ -355,7 +191,7 @@ static GLboolean driUnbindContext3(__DRInativeDisplay *dpy, int scrn,
/*
** Assume error checking is done properly in glXMakeCurrent before
** calling driUnbindContext3.
** calling driUnbindContext.
*/
if (ctx == NULL || draw == None || read == None) {
@@ -363,7 +199,7 @@ static GLboolean driUnbindContext3(__DRInativeDisplay *dpy, int scrn,
return GL_FALSE;
}
pDRIScreen = glx_find_dri_screen(dpy, scrn);
pDRIScreen = (*dri_interface->getScreen)(dpy, scrn);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return GL_FALSE;
@@ -523,7 +359,7 @@ static GLboolean DoBindContext(__DRInativeDisplay *dpy,
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
static GLboolean driBindContext3(__DRInativeDisplay *dpy, int scrn,
static GLboolean driBindContext(__DRInativeDisplay *dpy, int scrn,
__DRIid draw, __DRIid read,
__DRIcontext * ctx)
{
@@ -539,7 +375,7 @@ static GLboolean driBindContext3(__DRInativeDisplay *dpy, int scrn,
return GL_FALSE;
}
pDRIScreen = glx_find_dri_screen(dpy, scrn);
pDRIScreen = (*dri_interface->getScreen)(dpy, scrn);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return GL_FALSE;
@@ -548,79 +384,6 @@ static GLboolean driBindContext3(__DRInativeDisplay *dpy, int scrn,
return DoBindContext( dpy, draw, read, ctx, ctx->mode,
(__DRIscreenPrivate *)pDRIScreen->private );
}
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* This function takes both a read buffer and a draw buffer. This is needed
* for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent
* function.
*/
static GLboolean driBindContext2(Display *dpy, int scrn,
GLXDrawable draw, GLXDrawable read,
GLXContext gc)
{
__DRIscreen *pDRIScreen;
const __GLcontextModes *modes;
/*
** Assume error checking is done properly in glXMakeCurrent before
** calling driBindContext.
*/
if (gc == NULL || draw == None || read == None) {
/* ERROR!!! */
return GL_FALSE;
}
pDRIScreen = glx_find_dri_screen(dpy, scrn);
modes = (driCompareGLXAPIVersion( 20040317 ) >= 0)
? gc->driContext.mode
: findConfigMode( dpy, scrn, gc->vid, pDRIScreen );
if ( modes == NULL ) {
/* ERROR!!! */
return GL_FALSE;
}
/* findConfigMode will return NULL if the DRI screen or screen private
* are NULL.
*/
assert( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) );
return DoBindContext( dpy, draw, read, & gc->driContext, modes,
(__DRIscreenPrivate *)pDRIScreen->private );
}
static GLboolean driUnbindContext2(Display *dpy, int scrn,
GLXDrawable draw, GLXDrawable read,
GLXContext gc)
{
return driUnbindContext3(dpy, scrn, draw, read, & gc->driContext);
}
/*
* Simply call bind with the same GLXDrawable for the read and draw buffers.
*/
static GLboolean driBindContext(Display *dpy, int scrn,
GLXDrawable draw, GLXContext gc)
{
return driBindContext2(dpy, scrn, draw, draw, gc);
}
/*
* Simply call bind with the same GLXDrawable for the read and draw buffers.
*/
static GLboolean driUnbindContext(Display *dpy, int scrn,
GLXDrawable draw, GLXContext gc,
int will_rebind)
{
(void) will_rebind;
return driUnbindContext2( dpy, scrn, draw, draw, gc );
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/*@}*/
@@ -635,8 +398,8 @@ static GLboolean driUnbindContext(Display *dpy, int scrn,
* \param pdp pointer to the private drawable information to update.
*
* This function basically updates the __DRIdrawablePrivate struct's
* cliprect information by calling \c __DRIDrawablePrivate::getInfo. This is
* usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which
* cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo.
* This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which
* compares the __DRIdrwablePrivate pStamp and lastStamp values. If
* the values are different that means we have to update the clipping
* info.
@@ -669,7 +432,7 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
if (!__driFindDrawable(psp->drawHash, pdp->draw) ||
! (*pdp->getInfo)(pdp->display, pdp->screen, pdp->draw,
! (*dri_interface->getDrawableInfo)(pdp->display, pdp->screen, pdp->draw,
&pdp->index, &pdp->lastStamp,
&pdp->x, &pdp->y, &pdp->w, &pdp->h,
&pdp->numClipRects, &pdp->pClipRects,
@@ -803,7 +566,7 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
int renderType,
const int *attrs)
{
__DRIscreen * const pDRIScreen = glx_find_dri_screen(dpy, modes->screen);
__DRIscreen * const pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen);
__DRIscreenPrivate *psp;
__DRIdrawablePrivate *pdp;
@@ -824,7 +587,7 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
return NULL;
}
if (!XF86DRICreateDrawable(dpy, modes->screen, draw, &pdp->hHWDrawable)) {
if (!(*dri_interface->createDrawable)(dpy, modes->screen, draw, &pdp->hHWDrawable)) {
_mesa_free(pdp);
return NULL;
}
@@ -850,21 +613,9 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
pdp->driScreenPriv = psp;
pdp->driContextPriv = &psp->dummyContextPriv;
pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC)
glXGetProcAddress( (const GLubyte *) "__glXGetDrawableInfo" );
if ( pdp->getInfo == NULL ) {
#ifdef DRI_NEW_INTERFACE_ONLY
(void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw);
_mesa_free(pdp);
return NULL;
#else
pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC) XF86DRIGetDrawableInfo;
#endif /* DRI_NEW_INTERFACE_ONLY */
}
if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, modes,
renderType == GLX_PIXMAP_BIT)) {
(void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw);
(void)(*dri_interface->destroyDrawable)(dpy, modes->screen, pdp->draw);
_mesa_free(pdp);
return NULL;
}
@@ -873,19 +624,18 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy,
pdraw->destroyDrawable = driDestroyDrawable;
pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */
if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) {
pdraw->getSBC = driGetSBC;
pdraw->waitForSBC = driWaitForSBC;
pdraw->waitForMSC = driWaitForMSC;
pdraw->swapBuffersMSC = driSwapBuffersMSC;
pdraw->frameTracking = NULL;
pdraw->queryFrameTracking = driQueryFrameTracking;
pdraw->getSBC = driGetSBC;
pdraw->waitForSBC = driWaitForSBC;
pdraw->waitForMSC = driWaitForMSC;
pdraw->swapBuffersMSC = driSwapBuffersMSC;
pdraw->frameTracking = NULL;
pdraw->queryFrameTracking = driQueryFrameTracking;
/* This special default value is replaced with the configured
* default value when the drawable is first bound to a direct
* rendering context. */
pdraw->swap_interval = (unsigned)-1;
}
/* This special default value is replaced with the configured
* default value when the drawable is first bound to a direct
* rendering context.
*/
pdraw->swap_interval = (unsigned)-1;
pdp->swapBuffers = psp->DriverAPI.SwapBuffers;
@@ -921,8 +671,8 @@ static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate)
if (pdp) {
(*psp->DriverAPI.DestroyBuffer)(pdp);
if ((*window_exists)(dpy, pdp->draw))
(void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw);
if ((*dri_interface->windowExists)(dpy, pdp->draw))
(void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw);
if (pdp->pClipRects) {
_mesa_free(pdp->pClipRects);
pdp->pClipRects = NULL;
@@ -961,7 +711,7 @@ static void driDestroyContext(__DRInativeDisplay *dpy, int scrn, void *contextPr
if (pcp) {
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
__driGarbageCollectDrawables(pcp->driScreenPriv->drawHash);
(void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID);
(void) (*dri_interface->destroyContext)(dpy, scrn, pcp->contextID);
_mesa_free(pcp);
}
}
@@ -998,7 +748,7 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
__DRIscreenPrivate *psp;
void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL;
pDRIScreen = glx_find_dri_screen(dpy, modes->screen);
pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return NULL;
@@ -1011,7 +761,7 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
return NULL;
}
if (! (*create_context_with_config)(dpy, modes->screen, modes->fbconfigID,
if (! (*dri_interface->createContext)(dpy, modes->screen, modes->fbconfigID,
&pcp->contextID, &pcp->hHWContext)) {
_mesa_free(pcp);
return NULL;
@@ -1035,29 +785,12 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
}
pctx->destroyContext = driDestroyContext;
#ifdef DRI_NEW_INTERFACE_ONLY
pctx->bindContext = NULL;
pctx->unbindContext = NULL;
pctx->bindContext2 = NULL;
pctx->unbindContext2 = NULL;
pctx->bindContext3 = driBindContext3;
pctx->unbindContext3 = driUnbindContext3;
#else
pctx->bindContext = (void *)driBindContext;
pctx->unbindContext = (void *)driUnbindContext;
if ( driCompareGLXAPIVersion( 20030606 ) >= 0 ) {
pctx->bindContext2 = (void *)driBindContext2;
pctx->unbindContext2 = (void *)driUnbindContext2;
}
if ( driCompareGLXAPIVersion( 20040415 ) >= 0 ) {
pctx->bindContext3 = (void *)driBindContext3;
pctx->unbindContext3 = (void *)driUnbindContext3;
}
#endif
pctx->bindContext = driBindContext;
pctx->unbindContext = driUnbindContext;
if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) {
(void)XF86DRIDestroyContext(dpy, modes->screen, pcp->contextID);
(void) (*dri_interface->destroyContext)(dpy, modes->screen,
pcp->contextID);
_mesa_free(pcp);
return NULL;
}
@@ -1066,57 +799,6 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes,
return pcp;
}
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* Create the per-drawable private driver information.
*
* \param dpy the display handle.
* \param vis the visual information.
* \param sharedPrivate the shared context dependent methods or \c NULL if
* non-existent.
* \param pctx will receive the context dependent methods.
*
* \returns a opaque pointer to the per-context private information on success, or \c NULL
* on failure.
*
* \deprecated
* This function has been replaced by \c driCreateNewContext. In drivers
* built to work with XFree86, this function will continue to exist to support
* older versions of libGL. Starting with the next major relelase of XFree86,
* this function will be removed.
*
* \internal
* This function allocates and fills a __DRIcontextPrivateRec structure. It
* gets the visual, converts it into a __GLcontextModesRec and passes it
* to __DriverAPIRec::CreateContext to create the context.
*/
static void *driCreateContext(Display *dpy, XVisualInfo *vis,
void *sharedPrivate, __DRIcontext *pctx)
{
__DRIscreen *pDRIScreen;
const __GLcontextModes *modes;
pDRIScreen = glx_find_dri_screen(dpy, vis->screen);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return NULL;
}
/* Setup a __GLcontextModes struct corresponding to vis->visualid
* and create the rendering context.
*/
modes = findConfigMode(dpy, vis->screen, vis->visualid, pDRIScreen);
return (modes == NULL)
? NULL
: driCreateNewContext( dpy, modes, GLX_RGBA_TYPE,
sharedPrivate, pctx );
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/*@}*/
@@ -1184,6 +866,11 @@ static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPriv
* \param internal_api_version Version of the internal interface between the
* driver and libGL.
* \param driverAPI Driver API functions used by other routines in dri_util.c.
*
* \note
* There is no need to check the minimum API version in this function. Since
* the \c __driCreateNewScreen function is versioned, it is impossible for a
* loader that is too old to even load this driver.
*/
__DRIscreenPrivate *
__driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
@@ -1200,48 +887,6 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
__DRIscreenPrivate *psp;
#ifdef DRI_NEW_INTERFACE_ONLY
if ( internal_api_version < 20040602 ) {
fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. "
"20040602 or later is required.\n", internal_api_version );
return NULL;
}
#else
if ( internal_api_version == 20031201 ) {
fprintf( stderr, "libGL error: libGL version 20031201 has critical "
"binary compatilibity bugs.\nlibGL error: You must upgrade "
"to use direct-rendering!\n" );
return NULL;
}
#endif /* DRI_NEW_INTERFACE_ONLY */
window_exists = (PFNGLXWINDOWEXISTSPROC)
glXGetProcAddress( (const GLubyte *) "__glXWindowExists" );
if ( window_exists == NULL ) {
#ifdef DRI_NEW_INTERFACE_ONLY
fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. "
"20021128 or later is required.\n", internal_api_version );
return NULL;
#else
window_exists = (PFNGLXWINDOWEXISTSPROC) __driWindowExists;
#endif /* DRI_NEW_INTERFACE_ONLY */
}
create_context_with_config = (PFNGLXCREATECONTEXTWITHCONFIGPROC)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextWithConfig" );
if ( create_context_with_config == NULL ) {
#ifdef DRI_NEW_INTERFACE_ONLY
fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. "
"20031201 or later is required.\n", internal_api_version );
return NULL;
#else
create_context_with_config = (PFNGLXCREATECONTEXTWITHCONFIGPROC)
fake_XF86DRICreateContextWithConfig;
#endif /* DRI_NEW_INTERFACE_ONLY */
}
api_ver = internal_api_version;
psp = (__DRIscreenPrivate *)_mesa_malloc(sizeof(__DRIscreenPrivate));
@@ -1302,25 +947,10 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
psp->dummyContextPriv.driScreenPriv = NULL;
psc->destroyScreen = driDestroyScreen;
#ifndef DRI_NEW_INTERFACE_ONLY
psc->createContext = driCreateContext;
#else
psc->createContext = NULL;
#endif
psc->createNewDrawable = driCreateNewDrawable;
psc->getDrawable = driGetDrawable;
#ifdef DRI_NEW_INTERFACE_ONLY
psc->getMSC = driGetMSC;
psc->createNewContext = driCreateNewContext;
#else
if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) {
psc->getMSC = driGetMSC;
if ( driCompareGLXAPIVersion( 20030824 ) >= 0 ) {
psc->createNewContext = driCreateNewContext;
}
}
#endif
if ( (psp->DriverAPI.InitDriver != NULL)
&& !(*psp->DriverAPI.InitDriver)(psp) ) {
@@ -1333,233 +963,6 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
}
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* Utility function used to create a new driver-private screen structure.
*
* \param dpy Display pointer.
* \param scrn Index of the screen.
* \param psc DRI screen data (not driver private)
* \param numConfigs Number of visual configs pointed to by \c configs.
* \param configs Array of GLXvisualConfigs exported by the 2D driver.
* \param driverAPI Driver API functions used by other routines in dri_util.c.
*
* \deprecated
* This function has been replaced by \c __driUtilCreateNewScreen. In drivers
* built to work with XFree86, this function will continue to exist to support
* older versions of libGL. Starting with the next major relelase of XFree86,
* this function will be removed.
*/
__DRIscreenPrivate *
__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *configs,
const struct __DriverAPIRec *driverAPI)
{
int directCapable;
__DRIscreenPrivate *psp = NULL;
drm_handle_t hSAREA;
drmAddress pSAREA;
char *BusID;
__GLcontextModes *modes;
__GLcontextModes *temp;
int i;
__DRIversion ddx_version;
__DRIversion dri_version;
__DRIversion drm_version;
__DRIframebuffer framebuffer;
int fd = -1;
int status;
const char * err_msg;
const char * err_extra;
if (!XF86DRIQueryDirectRenderingCapable(dpy, scrn, &directCapable)
|| !directCapable) {
return NULL;
}
/* Create the linked list of context modes, and populate it with the
* GLX visual information passed in by libGL.
*/
modes = _gl_context_modes_create( numConfigs, sizeof(__GLcontextModes) );
if ( modes == NULL ) {
return NULL;
}
temp = modes;
for ( i = 0 ; i < numConfigs ; i++ ) {
assert( temp != NULL );
_gl_copy_visual_to_context_mode( temp, & configs[i] );
temp->screen = scrn;
temp = temp->next;
}
err_msg = "XF86DRIOpenConnection";
err_extra = NULL;
if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
fd = drmOpen(NULL,BusID);
_mesa_free(BusID); /* No longer needed */
err_msg = "open DRM";
err_extra = strerror( -fd );
if (fd >= 0) {
drm_magic_t magic;
err_msg = "drmGetMagic";
err_extra = NULL;
if (!drmGetMagic(fd, &magic)) {
drmVersionPtr version = drmGetVersion(fd);
if (version) {
drm_version.major = version->version_major;
drm_version.minor = version->version_minor;
drm_version.patch = version->version_patchlevel;
drmFreeVersion(version);
}
else {
drm_version.major = -1;
drm_version.minor = -1;
drm_version.patch = -1;
}
err_msg = "XF86DRIAuthConnection";
if (XF86DRIAuthConnection(dpy, scrn, magic)) {
char *driverName;
/*
* Get device name (like "tdfx") and the ddx version numbers.
* We'll check the version in each DRI driver's "createScreen"
* function.
*/
err_msg = "XF86DRIGetClientDriverName";
if (XF86DRIGetClientDriverName(dpy, scrn,
&ddx_version.major,
&ddx_version.minor,
&ddx_version.patch,
&driverName)) {
/* No longer needed. */
_mesa_free( driverName );
/*
* Get the DRI X extension version.
*/
err_msg = "XF86DRIQueryVersion";
if (XF86DRIQueryVersion(dpy,
&dri_version.major,
&dri_version.minor,
&dri_version.patch)) {
drm_handle_t hFB;
int junk;
/*
* Get device-specific info. pDevPriv will point to a struct
* (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h)
* that has information about the screen size, depth, pitch,
* ancilliary buffers, DRM mmap handles, etc.
*/
err_msg = "XF86DRIGetDeviceInfo";
if (XF86DRIGetDeviceInfo(dpy, scrn,
&hFB,
&junk,
&framebuffer.size,
&framebuffer.stride,
&framebuffer.dev_priv_size,
&framebuffer.dev_priv)) {
framebuffer.width = DisplayWidth(dpy, scrn);
framebuffer.height = DisplayHeight(dpy, scrn);
/*
* Map the framebuffer region.
*/
status = drmMap(fd, hFB, framebuffer.size,
(drmAddressPtr)&framebuffer.base);
err_msg = "drmMap of framebuffer";
err_extra = strerror( -status );
if ( status == 0 ) {
/*
* Map the SAREA region. Further mmap regions may be setup in
* each DRI driver's "createScreen" function.
*/
status = drmMap(fd, hSAREA, SAREA_MAX,
&pSAREA);
err_msg = "drmMap of sarea";
err_extra = strerror( -status );
if ( status == 0 ) {
PFNGLXGETINTERNALVERSIONPROC get_ver;
get_ver = (PFNGLXGETINTERNALVERSIONPROC)
glXGetProcAddress( (const GLubyte *) "__glXGetInternalVersion" );
err_msg = "InitDriver";
err_extra = NULL;
psp = __driUtilCreateNewScreen( dpy, scrn, psc, modes,
& ddx_version,
& dri_version,
& drm_version,
& framebuffer,
pSAREA,
fd,
(get_ver != NULL) ? (*get_ver)() : 1,
driverAPI );
}
}
}
}
}
}
}
}
}
if ( psp == NULL ) {
if ( pSAREA != MAP_FAILED ) {
(void)drmUnmap(pSAREA, SAREA_MAX);
}
if ( framebuffer.base != MAP_FAILED ) {
(void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size);
}
if ( framebuffer.dev_priv != NULL ) {
_mesa_free(framebuffer.dev_priv);
}
if ( fd >= 0 ) {
(void)drmClose(fd);
}
if ( modes != NULL ) {
_gl_context_modes_destroy( modes );
}
(void)XF86DRICloseConnection(dpy, scrn);
if ( err_extra != NULL ) {
fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg,
err_extra);
}
else {
fprintf(stderr, "libGL error: %s failed\n", err_msg );
}
fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n");
}
return psp;
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Compare the current GLX API version with a driver supplied required version.
*
@@ -1592,15 +995,11 @@ driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage )
{
static PFNGLXGETUSTPROC get_ust;
__DRIswapInfo sInfo;
int status;
int64_t ust;
__DRIdrawablePrivate * dpriv = (__DRIdrawablePrivate *) priv;
if ( get_ust == NULL ) {
get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
}
status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo );
if ( status == 0 ) {
@@ -1608,7 +1007,7 @@ driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv,
*missedFrames = sInfo.swap_missed_count;
*lastMissedUsage = sInfo.swap_missed_usage;
(*get_ust)( & ust );
(*dri_interface->getUST)( & ust );
*usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust );
}
@@ -1648,20 +1047,13 @@ float
driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust,
int64_t current_ust )
{
static PFNGLXGETMSCRATEOMLPROC get_msc_rate = NULL;
int32_t n;
int32_t d;
int interval;
float usage = 1.0;
if ( get_msc_rate == NULL ) {
get_msc_rate = (PFNGLXGETMSCRATEOMLPROC)
glXGetProcAddress( (const GLubyte *) "glXGetMscRateOML" );
}
if ( (get_msc_rate != NULL)
&& get_msc_rate( dPriv->display, dPriv->draw, &n, &d ) ) {
if ( (*dri_interface->getMSCRate)( dPriv->display, dPriv->draw, &n, &d ) ) {
interval = (dPriv->pdraw->swap_interval != 0)
? dPriv->pdraw->swap_interval : 1;

View File

@@ -51,11 +51,7 @@
#define CAPI /* XXX this should be globally defined somewhere */
#ifdef DRI_NEW_INTERFACE_ONLY
# include <GL/gl.h>
#else
# include "glxclient.h"
#endif /* DRI_NEW_INTERFACE_ONLY */
#include <GL/gl.h>
#include "drm.h"
#include "drm_sarea.h"
#include "GL/internal/glcore.h"
@@ -63,13 +59,6 @@
#define GLX_BAD_CONTEXT 5
/* This is a temporary relic. Once all drivers are converted to support
* the new interface, it can go away.
*/
#ifdef DRI_NEW_INTERFACE_ONLY
#define USE_NEW_INTERFACE
#endif
typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
typedef struct __DRIscreenPrivateRec __DRIscreenPrivate;
typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
@@ -325,7 +314,7 @@ struct __DRIdrawablePrivateRec {
* \name Display and screen information.
*
* Basically just need these for when the locking code needs to call
* __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo().
* \c __driUtilUpdateDrawableInfo.
*/
/*@{*/
__DRInativeDisplay *display;
@@ -336,12 +325,6 @@ struct __DRIdrawablePrivateRec {
* Called via glXSwapBuffers().
*/
void (*swapBuffers)( __DRIdrawablePrivate *dPriv );
/**
* Get information about the location, size, and clip rects of the
* drawable within the display.
*/
PFNGLXGETDRAWABLEINFOPROC getInfo;
};
/**
@@ -552,13 +535,6 @@ extern __DRIscreenPrivate * __driUtilCreateNewScreen( __DRInativeDisplay *dpy,
drm_sarea_t *pSAREA, int fd, int internal_api_version,
const struct __DriverAPIRec *driverAPI );
#ifndef DRI_NEW_INTERFACE_ONLY
extern __DRIscreenPrivate *
__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config,
const struct __DriverAPIRec *driverAPI);
#endif /* DRI_NEW_INTERFACE_ONLY */
/* Test the version of the internal GLX API. Returns a value like strcmp. */
extern int
driCompareGLXAPIVersion( GLint required_version );
@@ -567,10 +543,12 @@ extern float
driCalculateSwapUsage( __DRIdrawablePrivate *dPriv,
int64_t last_swap_ust, int64_t current_ust );
/* Test for the GLX header glx.h */
#ifndef GLX
extern void
(*glXGetProcAddress(const GLubyte *procname))( void );
#endif
/**
* Pointer to the \c __DRIinterfaceMethods passed to the driver by the loader.
*
* This pointer is set in the driver's \c __driCreateNewScreen function and
* is defined in dri_util.c.
*/
extern const __DRIinterfaceMethods * dri_interface;
#endif /* _DRI_UTIL_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@
* \author Ian Romanick <idr@us.ibm.com>
*/
#ifdef DRI_NEW_INTERFACE_ONLY
#ifdef IN_DRI_DRIVER
# include <stdlib.h>
# include <string.h>
# include <GL/gl.h>
@@ -55,11 +55,11 @@ extern void __glXFree( void * ptr );
# define _mesa_malloc(b) Xmalloc(b)
# define _mesa_free(m) Xfree(m)
# endif /* XFree86Server */
#endif /* DRI_NEW_INTERFACE_ONLY */
#endif /* !defined(IN_DRI_DRIVER) */
#include "glcontextmodes.h"
#ifndef DRI_NEW_INTERFACE_ONLY
#if !defined(IN_DRI_DRIVER)
#define NUM_VISUAL_TYPES 6
/**
@@ -320,7 +320,7 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int attribute,
return GLX_BAD_ATTRIBUTE;
}
}
#endif /* DRI_NEW_INTERFACE_ONLY */
#endif /* !defined(IN_DRI_DRIVER) */
/**

View File

@@ -32,14 +32,14 @@
#include "GL/internal/glcore.h"
#ifndef DRI_NEW_INTERFACE_ONLY
#if !defined(IN_DRI_DRIVER)
extern GLint _gl_convert_from_x_visual_type( int visualType );
extern GLint _gl_convert_to_x_visual_type( int visualType );
extern void _gl_copy_visual_to_context_mode( __GLcontextModes * mode,
const __GLXvisualConfig * config );
extern int _gl_get_context_mode_data( const __GLcontextModes *mode,
int attribute, int *value_return );
#endif /* DRI_NEW_INTERFACE_ONLY */
#endif /* !defined(IN_DRI_DRIVER) */
extern __GLcontextModes * _gl_context_modes_create( unsigned count,
size_t minimum_size );

View File

@@ -34,10 +34,9 @@
#include "mtypes.h"
#include "extensions.h"
#include "utils.h"
#include "dispatch.h"
#if !defined( DRI_NEW_INTERFACE_ONLY )
#include "xf86dri.h" /* For XF86DRIQueryVersion prototype. */
#endif
unsigned driDispatchRemapTable[ driDispatchRemapTable_size ];
#if defined(USE_X86_ASM)
#include "x86/common_x86_asm.h"
@@ -180,6 +179,30 @@ driGetRendererString( char * buffer, const char * hardware_name,
#define need_GL_ARB_multisample
#define need_GL_ARB_transpose_matrix
#define need_GL_ARB_window_pos
#define need_GL_EXT_compiled_vertex_array
#define need_GL_EXT_polygon_offset
#define need_GL_EXT_texture_object
#define need_GL_EXT_vertex_array
#define need_GL_MESA_window_pos
#include "extension_helper.h"
static const struct dri_extension all_mesa_extensions[] = {
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions },
{ "GL_ARB_window_pos", GL_ARB_window_pos_functions },
{ "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions },
{ "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions },
{ "GL_EXT_texture_object", GL_EXT_texture_object_functions },
{ "GL_EXT_vertex_array", GL_EXT_vertex_array_functions },
{ "GL_MESA_window_pos", GL_MESA_window_pos_functions },
{ NULL, NULL }
};
/**
* Enable extensions supported by the driver.
*
@@ -193,9 +216,15 @@ void driInitExtensions( GLcontext * ctx,
const struct dri_extension * extensions_to_enable,
GLboolean enable_imaging )
{
static int first_time = 1;
unsigned i;
if ( enable_imaging ) {
if ( first_time ) {
first_time = 0;
driInitExtensions( ctx, all_mesa_extensions, GL_FALSE );
}
if ( (ctx != NULL) && enable_imaging ) {
_mesa_enable_imaging_extensions( ctx );
}
@@ -224,12 +253,14 @@ void driInitSingleExtension( GLcontext * ctx,
{
unsigned i;
if ( ext->functions != NULL ) {
for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) {
const char * functions[16];
const char * parameter_signature;
const char * str = ext->functions[i].strings;
unsigned j;
unsigned offset;
/* Separate the parameter signature from the rest of the string.
@@ -264,68 +295,26 @@ void driInitSingleExtension( GLcontext * ctx,
/* Add each entry-point to the dispatch table.
*/
for ( j = 0 ; functions[j] != NULL ; j++ ) {
_glapi_add_entrypoint( functions[j],
ext->functions[i].offset );
offset = _glapi_add_dispatch( functions, parameter_signature );
if ( ext->functions[i].remap_index != -1 ) {
driDispatchRemapTable[ ext->functions[i].remap_index ] = offset;
}
if ( (ext->functions[i].offset != -1)
&& (ext->functions[i].offset != offset) ) {
fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n", functions[0],
driDispatchRemapTable[ ext->functions[i].remap_index ],
ext->functions[i].offset);
}
}
}
_mesa_enable_extension( ctx, ext->name );
if ( ctx != NULL ) {
_mesa_enable_extension( ctx, ext->name );
}
}
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* Utility function used by drivers to test the verions of other components.
*
* \deprecated
* All drivers using the new interface should use \c driCheckDriDdxVersions2
* instead. This function is implemented using a call that is not available
* to drivers using the new interface. Furthermore, the information gained
* by this call (the DRI and DDX version information) is already provided to
* the driver via the new interface.
*/
GLboolean
driCheckDriDdxDrmVersions(__DRIscreenPrivate *sPriv,
const char * driver_name,
int dri_major, int dri_minor,
int ddx_major, int ddx_minor,
int drm_major, int drm_minor)
{
static const char format[] = "%s DRI driver expected %s version %d.%d.x "
"but got version %d.%d.%d";
int major, minor, patch;
/* Check the DRI version */
if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
if (major != dri_major || minor < dri_minor) {
__driUtilMessage(format, driver_name, "DRI", dri_major, dri_minor,
major, minor, patch);
return GL_FALSE;
}
}
/* Check that the DDX driver version is compatible */
if (sPriv->ddxMajor != ddx_major || sPriv->ddxMinor < ddx_minor) {
__driUtilMessage(format, driver_name, "DDX", ddx_major, ddx_minor,
sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch);
return GL_FALSE;
}
/* Check that the DRM driver version is compatible */
if (sPriv->drmMajor != drm_major || sPriv->drmMinor < drm_minor) {
__driUtilMessage(format, driver_name, "DRM", drm_major, drm_minor,
sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch);
return GL_FALSE;
}
return GL_TRUE;
}
#endif /* DRI_NEW_INTERFACE_ONLY */
/**
* Utility function used by drivers to test the verions of other components.
*
@@ -343,7 +332,11 @@ driCheckDriDdxDrmVersions(__DRIscreenPrivate *sPriv,
* \returns \c GL_TRUE if all version requirements are met. Otherwise,
* \c GL_FALSE is returned.
*
* \sa __driCreateNewScreen, driCheckDriDdxDrmVersions, __driUtilMessage
* \sa __driCreateNewScreen, driCheckDriDdxDrmVersions2, __driUtilMessage
*
* \todo
* Now that the old \c driCheckDriDdxDrmVersions function is gone, this
* function and \c driCheckDriDdxDrmVersions2 should be renamed.
*/
GLboolean
driCheckDriDdxDrmVersions3(const char * driver_name,

View File

@@ -54,10 +54,16 @@ struct dri_extension_function {
const char * strings;
/**
* Location in the remap table where the dispatch offset should be
* stored.
*/
int remap_index;
/**
* Offset of the function in the dispatch table.
*/
unsigned offset;
int offset;
};
/**
@@ -90,12 +96,6 @@ extern void driInitExtensions( GLcontext * ctx,
extern void driInitSingleExtension( GLcontext * ctx,
const struct dri_extension * ext );
#ifndef DRI_NEW_INTERFACE_ONLY
extern GLboolean driCheckDriDdxDrmVersions( __DRIscreenPrivate *sPriv,
const char * driver_name, int dri_major, int dri_minor,
int ddx_major, int ddx_minor, int drm_major, int drm_minor );
#endif
extern GLboolean driCheckDriDdxDrmVersions2(const char * driver_name,
const __DRIversion * driActual, const __DRIversion * driExpected,
const __DRIversion * ddxActual, const __DRIversion * ddxExpected,

View File

@@ -181,11 +181,9 @@ int driWaitForMSC32( __DRIdrawablePrivate *priv,
GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache )
{
GLuint flags = 0;
GLuint flags = VBLANK_FLAG_INTERVAL;
int vblank_mode;
flags |= (driCompareGLXAPIVersion( 20030317 ) >= 0)
? VBLANK_FLAG_INTERVAL : 0;
if ( driCheckOption( optionCache, "vblank_mode", DRI_ENUM ) )
vblank_mode = driQueryOptioni( optionCache, "vblank_mode" );

View File

@@ -73,9 +73,6 @@ typedef struct {
#define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx))
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
static const GLubyte *
get_string(GLcontext *ctx, GLenum pname)
@@ -659,7 +656,6 @@ struct DRIDriverRec __driDriver = {
__driHaltFBDev
};
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
fbFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -709,7 +705,7 @@ fbFillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -780,17 +776,11 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &fbAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
*driver_modes = fbFillInModes( psp->fbBPP,
(psp->fbBPP == 16) ? 16 : 24,
(psp->fbBPP == 16) ? 0 : 8,
1);
}
*driver_modes = fbFillInModes( psp->fbBPP,
(psp->fbBPP == 16) ? 16 : 24,
(psp->fbBPP == 16) ? 0 : 8,
1);
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -616,25 +616,6 @@ static const struct __DriverAPIRec ffbAPI = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &ffbAPI);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static __GLcontextModes *
ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -684,7 +665,7 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -714,7 +695,6 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
@@ -727,9 +707,8 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -737,6 +716,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -745,6 +725,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, 1 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "ffb",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -757,13 +739,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &ffbAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
*driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
}
*driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -26,9 +26,7 @@
#ifndef _FFB_DAC_H
#define _FFB_DAC_H
#if defined( DRI_NEW_INTERFACE_ONLY )
#define Bool int
#endif
/* FFB utilizes two different ramdac chips:
*

View File

@@ -115,7 +115,7 @@ GLboolean gammaCreateContext( const __GLcontextModes *glVisual,
ctx = gmesa->glCtx;
ctx->Const.MaxTextureLevels = 13; /* 4K by 4K? Is that right? */
ctx->Const.MaxTextureLevels = GAMMA_TEX_MAXLEVELS;
ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */
ctx->Const.MaxTextureImageUnits = 1;
ctx->Const.MaxTextureCoordUnits = 1;

View File

@@ -118,7 +118,7 @@ typedef struct gamma_texture_object_t *gammaTextureObjectPtr;
#define VALID_GAMMA_TEXTURE_OBJECT(tobj) (tobj)
#define GAMMA_TEX_MAXLEVELS 12
#define GAMMA_TEX_MAXLEVELS 12 /* 2K x 2K */
/* For shared texture space managment, these texture objects may also
* be used as proxies for regions of texture memory containing other

View File

@@ -1593,7 +1593,6 @@ void gammaEmitHwState( gammaContextPtr gmesa )
WRITE(gmesa->buf, TxBaseAddr9, curTex->TextureBaseAddr[9]);
WRITE(gmesa->buf, TxBaseAddr10, curTex->TextureBaseAddr[10]);
WRITE(gmesa->buf, TxBaseAddr11, curTex->TextureBaseAddr[11]);
WRITE(gmesa->buf, TxBaseAddr12, curTex->TextureBaseAddr[12]);
WRITE(gmesa->buf, TextureCacheControl, (TCC_Enable | TCC_Invalidate));
} else {
CHECK_DMA_BUFFER(gmesa, 6);

View File

@@ -54,11 +54,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "GL/internal/dri_interface.h"
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *fill_in_modes( __GLcontextModes *modes,
unsigned pixel_bits,
unsigned depth_bits,
@@ -122,9 +117,8 @@ static __GLcontextModes *fill_in_modes( __GLcontextModes *modes,
return modes;
}
#endif /* USE_NEW_INTERFACE */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
i810FillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -162,7 +156,7 @@ i810FillInModes( unsigned pixel_bits, unsigned depth_bits,
num_modes = depth_buffer_factor * back_buffer_factor * 4;
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
m = fill_in_modes( m, pixel_bits,
@@ -189,8 +183,6 @@ i810FillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* static int i810_malloc_proxy_buf(drmBufMapPtr buffers) */
@@ -421,21 +413,6 @@ static const struct __DriverAPIRec i810API = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i810API);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
* requisite information about the system, and the driver initializes itself.
@@ -446,9 +423,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -456,6 +432,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -464,6 +441,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 2, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "i810",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -476,15 +455,10 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &i810API);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
*driver_modes = i810FillInModes( 16,
16, 0,
1);
}
*driver_modes = i810FillInModes( 16,
16, 0,
1);
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -323,7 +323,7 @@ static void init_setup_tab( void )
void i810PrintSetupFlags(char *msg, GLuint flags )
static void i810PrintSetupFlags(const char *msg, GLuint flags )
{
fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
msg,

View File

@@ -57,7 +57,4 @@ extern void i810_translate_vertex( GLcontext *ctx,
extern void i810InitVB( GLcontext *ctx );
extern void i810FreeVB( GLcontext *ctx );
extern void i810_print_vertex( GLcontext *ctx, const i810Vertex *v );
extern void i810PrintSetupFlags(char *msg, GLuint flags );
#endif

View File

@@ -149,7 +149,7 @@ static void i830BufferSize(GLframebuffer *buffer,
/* Extension strings exported by the i830 driver.
*/
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },

View File

@@ -67,9 +67,7 @@ DRI_CONF_BEGIN
DRI_CONF_END;
const GLuint __driNConfigOptions = 2;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /*USE_NEW_INTERFACE*/
extern const struct dri_extension card_extensions[];
static int i830_malloc_proxy_buf(drmBufMapPtr buffers)
{
@@ -144,8 +142,15 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
{
i830ScreenPrivate *i830Screen;
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension == NULL ) {
return GL_FALSE;
}
/* Allocate the private area */
i830Screen = (i830ScreenPrivate *)CALLOC(sizeof(i830ScreenPrivate));
if (!i830Screen) {
@@ -281,20 +286,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv)
}
#endif
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
}
}
}
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
return GL_TRUE;
}
@@ -428,23 +420,6 @@ static const struct __DriverAPIRec i830API = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i830API);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -492,7 +467,7 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -515,7 +490,6 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
@@ -528,9 +502,8 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -538,6 +511,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -546,6 +520,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 3, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "i830",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -558,17 +534,22 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &i830API);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = i830FillInModes( dri_priv->cpp * 8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = i830FillInModes( dri_priv->cpp * 8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -38,7 +38,7 @@
* Mesa's Driver Functions
***************************************/
static const struct dri_extension card_extensions[] =
static const struct dri_extension i830_extensions[] =
{
{ "GL_ARB_texture_env_crossbar", NULL },
{ NULL, NULL }
@@ -109,7 +109,7 @@ GLboolean i830CreateContext( const __GLcontextModes *mesaVis,
intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf;
driInitExtensions( ctx, card_extensions, GL_FALSE );
driInitExtensions( ctx, i830_extensions, GL_FALSE );
i830InitState( i830 );

View File

@@ -45,7 +45,7 @@
* Mesa's Driver Functions
***************************************/
static const struct dri_extension card_extensions[] =
static const struct dri_extension i915_extensions[] =
{
{ "GL_ARB_depth_texture", NULL },
{ "GL_ARB_fragment_program", NULL },
@@ -166,7 +166,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis,
ctx->Const.MaxFragmentProgramAddressRegs = 0; /* I don't think we have one */
driInitExtensions( ctx, card_extensions, GL_FALSE );
driInitExtensions( ctx, i915_extensions, GL_FALSE );
_tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12,

View File

@@ -153,7 +153,7 @@ static void intelBufferSize(GLframebuffer *buffer,
* It appears that ARB_texture_env_crossbar has "disappeared" compared to the
* old i830-specific driver.
*/
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },

View File

@@ -54,10 +54,7 @@ DRI_CONF_BEGIN
DRI_CONF_END;
const GLuint __driNConfigOptions = 1;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /*USE_NEW_INTERFACE*/
extern const struct dri_extension card_extensions[];
static void intelPrintDRIInfo(intelScreenPrivate *intelScreen,
__DRIscreenPrivate *sPriv,
@@ -78,8 +75,15 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
{
intelScreenPrivate *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if (glx_enable_extension == NULL) {
return GL_FALSE;
}
/* Allocate the private area */
intelScreen = (intelScreenPrivate *)CALLOC(sizeof(intelScreenPrivate));
if (!intelScreen) {
@@ -195,28 +199,13 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
}
}
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA;
sPriv->psc->freeMemory = (void *) intelFreeMemoryMESA;
sPriv->psc->memoryOffset = (void *) intelGetMemoryOffsetMESA;
if (glx_enable_extension != NULL) {
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
}
if ( driCompareGLXAPIVersion( 20030818 ) >= 0 ) {
sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA;
sPriv->psc->freeMemory = (void *) intelFreeMemoryMESA;
sPriv->psc->memoryOffset = (void *) intelGetMemoryOffsetMESA;
(*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
}
}
}
(*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
return GL_TRUE;
}
@@ -377,23 +366,7 @@ static const struct __DriverAPIRec intelAPI = {
.SwapBuffersMSC = NULL
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &intelAPI);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
intelFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -443,7 +416,7 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -452,9 +425,15 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits,
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
return NULL;
}
/* There's no direct color modes on intel? */
}
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
back_buffer_modes, back_buffer_factor,
GLX_DIRECT_COLOR ) ) {
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
__func__, __LINE__ );
return NULL;
}
/* Mark the visual as slow if there are "fake" stencil bits.
*/
@@ -466,7 +445,6 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
@@ -479,9 +457,8 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -489,14 +466,17 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
static const __DRIversion ddx_expected = { 1, 0, 0 };
static const __DRIversion ddx_expected = { 1, 4, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 1, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "i915",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -509,17 +489,22 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &intelAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = intelFillInModes( dri_priv->cpp * 8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
*driver_modes = intelFillInModes( dri_priv->cpp * 8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -67,11 +67,7 @@ static const GLuint __driNConfigOptions = 3;
static const GLuint __driNConfigOptions = 2;
#endif
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes * fill_in_modes( __GLcontextModes * modes,
unsigned pixel_bits,
unsigned depth_bits,
@@ -136,10 +132,8 @@ static __GLcontextModes * fill_in_modes( __GLcontextModes * modes,
return modes;
}
#endif /* USE_NEW_INTERFACE */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
mach64FillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -178,7 +172,7 @@ mach64FillInModes( unsigned pixel_bits, unsigned depth_bits,
num_modes = depth_buffer_factor * back_buffer_factor * 4;
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
for ( i = 0 ; i < depth_buffer_factor ; i++ ) {
m = fill_in_modes( m, pixel_bits,
@@ -204,7 +198,6 @@ mach64FillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* Create the device specific screen private data struct.
@@ -214,10 +207,18 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
{
mach64ScreenPtr mach64Screen;
ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI )
fprintf( stderr, "%s\n", __FUNCTION__ );
if ( glx_enable_extension == NULL ) {
return NULL;
}
/* Allocate the private area */
mach64Screen = (mach64ScreenPtr) CALLOC( sizeof(*mach64Screen) );
if ( !mach64Screen ) return NULL;
@@ -316,21 +317,15 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
}
mach64Screen->driScreen = sPriv;
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
if ( mach64Screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
}
if ( mach64Screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
return mach64Screen;
}
@@ -492,21 +487,6 @@ static struct __DriverAPIRec mach64API = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mach64API);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
* requisite information about the system, and the driver initializes itself.
@@ -517,9 +497,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -527,6 +506,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -535,6 +515,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "Mach64",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -547,17 +529,12 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &mach64API);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
*driver_modes = mach64FillInModes( dri_priv->cpp * 8,
16,
0,
1);
}
ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv;
*driver_modes = mach64FillInModes( dri_priv->cpp * 8,
16,
0,
1);
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -104,17 +104,12 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 6;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
#ifndef MGA_DEBUG
int MGA_DEBUG = 0;
#endif
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
mgaFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -164,7 +159,7 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -194,7 +189,6 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
static GLboolean
@@ -202,8 +196,15 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
{
mgaScreenPrivate *mgaScreen;
MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension == NULL ) {
return GL_FALSE;
}
/* Allocate the private area */
mgaScreen = (mgaScreenPrivate *)MALLOC(sizeof(mgaScreenPrivate));
if (!mgaScreen) {
@@ -232,24 +233,11 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
}
}
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
}
}
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
if (serverInfo->chipset != MGA_CARD_TYPE_G200 &&
serverInfo->chipset != MGA_CARD_TYPE_G400) {
@@ -446,14 +434,6 @@ static const struct dri_debug_control debug_control[] =
};
static int
get_ust_nop( int64_t * ust )
{
*ust = 1;
return 0;
}
static GLboolean
mgaCreateContext( const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
@@ -664,12 +644,7 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
mmesa->vblank_flags = (mmesa->mgaScreen->irq == 0)
? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(&mmesa->optionCache);
mmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
if ( mmesa->get_ust == NULL ) {
mmesa->get_ust = get_ust_nop;
}
(*mmesa->get_ust)( & mmesa->swap_ust );
(*dri_interface->getUST)( & mmesa->swap_ust );
if (driQueryOptionb(&mmesa->optionCache, "no_rast")) {
fprintf(stderr, "disabling 3D acceleration\n");
@@ -948,22 +923,6 @@ static const struct __DriverAPIRec mgaAPI = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mgaAPI);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
* requisite information about the system, and the driver initializes itself.
@@ -974,9 +933,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -984,6 +942,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -992,6 +951,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 3, 0, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "MGA",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -1004,20 +965,29 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &mgaAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
*driver_modes = mgaFillInModes( dri_priv->cpp * 8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv;
*driver_modes = mgaFillInModes( dri_priv->cpp * 8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, g400_extensions, GL_FALSE );
driInitSingleExtension( NULL, ARB_vp_extension );
driInitExtensions( NULL, NV_vp_extensions, GL_FALSE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */
/**

View File

@@ -271,8 +271,6 @@ struct mga_context_t {
uint32_t last_frame_fence;
PFNGLXGETUSTPROC get_ust;
/* Drawable, cliprect and scissor information
*/
int dirty_cliprects; /* which sets of cliprects are uptodate? */

View File

@@ -424,7 +424,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
& missed_target );
if ( missed_target ) {
mmesa->swap_missed_count++;
(void) (*mmesa->get_ust)( & mmesa->swap_missed_ust );
(void) (*dri_interface->getUST)( & mmesa->swap_missed_ust );
}
LOCK_HARDWARE( mmesa );
@@ -462,7 +462,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv )
mmesa->dirty |= MGA_UPLOAD_CLIPRECTS;
mmesa->swap_count++;
(void) (*mmesa->get_ust)( & mmesa->swap_ust );
(void) (*dri_interface->getUST)( & mmesa->swap_ust );
}

View File

@@ -71,7 +71,7 @@ int R128_DEBUG = 0;
#define need_GL_EXT_blend_minmax
#include "extension_helper.h"
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },

View File

@@ -75,6 +75,8 @@ static const GLuint __driNConfigOptions = 4;
static const GLuint __driNConfigOptions = 3;
#endif
extern const struct dri_extension card_extensions[];
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
*/
@@ -88,9 +90,6 @@ static const GLuint __driNConfigOptions = 3;
#define PCI_CHIP_RAGE128RL 0x524C
#endif
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
/* Create the device specific screen private data struct.
*/
@@ -99,8 +98,15 @@ r128CreateScreen( __DRIscreenPrivate *sPriv )
{
r128ScreenPtr r128Screen;
R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension == NULL ) {
return NULL;
}
/* Allocate the private area */
r128Screen = (r128ScreenPtr) CALLOC( sizeof(*r128Screen) );
if ( !r128Screen ) return NULL;
@@ -211,21 +217,15 @@ r128CreateScreen( __DRIscreenPrivate *sPriv )
}
r128Screen->driScreen = sPriv;
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
if ( r128Screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
}
if ( r128Screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
return r128Screen;
}
@@ -392,23 +392,6 @@ static struct __DriverAPIRec r128API = {
};
#ifndef DRI_NEW_INTERFACE_ONLY
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r128API);
return (void *) psp;
}
#endif /* DRI_NEW_INTERFACE_ONLY */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
r128FillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -458,7 +441,7 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -501,7 +484,7 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits,
* failure.
*/
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -509,6 +492,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -518,6 +502,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion drm_expected = { 2, 2, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "Rage128",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -530,17 +516,22 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &r128API);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv;
*driver_modes = r128FillInModes( dri_priv->bpp,
(dri_priv->bpp == 16) ? 16 : 24,
(dri_priv->bpp == 16) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv;
*driver_modes = r128FillInModes( dri_priv->bpp,
(dri_priv->bpp == 16) ? 16 : 24,
(dri_priv->bpp == 16) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -131,7 +131,7 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R200 driver.
*/
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
@@ -162,17 +162,17 @@ static const struct dri_extension card_extensions[] =
{ NULL, NULL }
};
static const struct dri_extension blend_extensions[] = {
const struct dri_extension blend_extensions[] = {
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ NULL, NULL }
};
static const struct dri_extension ARB_vp_extension[] = {
const struct dri_extension ARB_vp_extension[] = {
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
};
static const struct dri_extension NV_vp_extension[] = {
const struct dri_extension NV_vp_extension[] = {
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions }
};
@@ -249,14 +249,6 @@ static const struct dri_debug_control debug_control[] =
};
static int
get_ust_nop( int64_t * ust )
{
*ust = 1;
return 0;
}
/* Create the device specific rendering context.
*/
GLboolean r200CreateContext( const __GLcontextModes *glVisual,
@@ -509,11 +501,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
rmesa->prefer_gart_client_texturing =
(getenv("R200_GART_CLIENT_TEXTURES") != 0);
rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
if ( rmesa->get_ust == NULL ) {
rmesa->get_ust = get_ust_nop;
}
(*rmesa->get_ust)( & rmesa->swap_ust );
(*dri_interface->getUST)( & rmesa->swap_ust );
#if DO_DEBUG

View File

@@ -912,7 +912,6 @@ struct r200_context {
GLuint swap_count;
GLuint swap_missed_count;
PFNGLXGETUSTPROC get_ust;
/* r200_tcl.c
*/

View File

@@ -486,7 +486,7 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
rmesa->hw.all_dirty = GL_TRUE;
rmesa->swap_count++;
(*rmesa->get_ust)( & ust );
(*dri_interface->getUST)( & ust );
if ( missed_target ) {
rmesa->swap_missed_count++;
rmesa->swap_missed_ust = ust - rmesa->swap_ust;
@@ -540,7 +540,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv )
driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
(void) (*rmesa->get_ust)( & rmesa->swap_missed_ust );
(void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
}
LOCK_HARDWARE( rmesa );
@@ -554,7 +554,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv )
}
rmesa->swap_count++;
(void) (*rmesa->get_ust)( & rmesa->swap_ust );
(void) (*dri_interface->getUST)( & rmesa->swap_ust );
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;

View File

@@ -90,6 +90,11 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 17;
extern const struct dri_extension card_extensions[];
extern const struct dri_extension blend_extensions[];
extern const struct dri_extension ARB_vp_extension[];
extern const struct dri_extension NV_vp_extension[];
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
*/
@@ -136,15 +141,11 @@ static const GLuint __driNConfigOptions = 17;
#endif
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
static r200ScreenPtr __r200Screen;
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -194,7 +195,7 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -224,7 +225,6 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* Create the device specific screen private data struct.
@@ -235,8 +235,15 @@ r200CreateScreen( __DRIscreenPrivate *sPriv )
r200ScreenPtr screen;
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension == NULL ) {
return NULL;
}
/* Allocate the private area */
screen = (r200ScreenPtr) CALLOC( sizeof(*screen) );
if ( !screen ) {
@@ -460,34 +467,20 @@ r200CreateScreen( __DRIscreenPrivate *sPriv )
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
if ( screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
if ( driCompareGLXAPIVersion( 20030818 ) >= 0 ) {
sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA;
sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA;
sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA;
(*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
}
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
}
}
if ( screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA;
sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA;
sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA;
(*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" );
return screen;
}
@@ -643,23 +636,6 @@ static const struct __DriverAPIRec r200API = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r200API);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
* requisite information about the system, and the driver initializes itself.
@@ -670,9 +646,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -680,6 +655,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -688,6 +664,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 5, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions3( "R200",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -700,20 +678,28 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &r200API);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
*driver_modes = r200FillInModes( dri_priv->bpp,
(dri_priv->bpp == 16) ? 16 : 24,
(dri_priv->bpp == 16) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
*driver_modes = r200FillInModes( dri_priv->bpp,
(dri_priv->bpp == 16) ? 16 : 24,
(dri_priv->bpp == 16) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, blend_extensions, GL_FALSE );
driInitSingleExtension( NULL, ARB_vp_extension );
driInitSingleExtension( NULL, NV_vp_extension );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */
/**

View File

@@ -5,7 +5,7 @@ TOP = ../../../../..
include $(TOP)/configs/current
LIBNAME = r300_dri.so
DEFINES += -DCOMPILE_R300 -DGLX_DIRECT_RENDERING
DEFINES += -DCOMPILE_R300 -DGLX_DIRECT_RENDERING -DR200_MERGED=0
MINIGLX_SOURCES = server/radeon_dri.c

View File

@@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "matrix.h"
#include "extensions.h"
#include "state.h"
#include "bufferobj.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -72,7 +73,7 @@ int hw_tcl_on=0;
#define need_GL_EXT_blend_minmax
#include "extension_helper.h"
static const struct dri_extension card_extensions[] = {
const struct dri_extension card_extensions[] = {
{"GL_ARB_multisample", GL_ARB_multisample_functions},
{"GL_ARB_multitexture", NULL},
{"GL_ARB_texture_border_clamp", NULL},
@@ -191,7 +192,7 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = {
0,
};
void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
static void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
const GLvoid *data, GLenum usage, struct gl_buffer_object *obj)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
@@ -239,7 +240,7 @@ void r300BufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
#endif
}
void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj)
static void r300DeleteBuffer(GLcontext *ctx, struct gl_buffer_object *obj)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);

View File

@@ -80,6 +80,7 @@ typedef struct r300_context *r300ContextPtr;
typedef GLuint uint32_t;
typedef GLubyte uint8_t;
struct r300_fragment_program;
/* We should probably change types within vertex_shader
and pixel_shader structure later on */

View File

@@ -46,6 +46,7 @@
#include "glheader.h"
#include "macros.h"
#include "enums.h"
#include "arbfragparse.h"
#include "program.h"
#include "nvfragprog.h"
@@ -905,7 +906,7 @@ static GLboolean parse_program(struct r300_fragment_program *rp)
/* - Init structures
* - Determine what hwregs each input corresponds to
*/
void init_program(struct r300_fragment_program *rp)
static void init_program(struct r300_fragment_program *rp)
{
struct fragment_program *mp = &rp->mesa_program;
struct fp_instruction *fpi;
@@ -1003,7 +1004,7 @@ void init_program(struct r300_fragment_program *rp)
rp->temp_in_use = temps_used;
}
void update_params(struct r300_fragment_program *rp) {
static void update_params(struct r300_fragment_program *rp) {
struct fragment_program *mp = &rp->mesa_program;
int i;

View File

@@ -43,5 +43,7 @@ typedef struct _pfs_reg_t {
#define PFS_FLAG_SAT (1 << 0)
#define PFS_FLAG_ABS (1 << 1)
#endif
extern void translate_fragment_shader(struct r300_fragment_program *rp);
#endif /* __R300_FRAGPROG_H_ */

View File

@@ -145,4 +145,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
((arg1) << R300_FPI2_ARG1A_SHIFT) | \
((arg2) << R300_FPI2_ARG2A_SHIFT))
extern void debug_vp(GLcontext *ctx, struct vertex_program *vp);
extern void dump_program_params(GLcontext *ctx, struct vertex_program *vp);
#endif /* __R300_PROGRAM_H__ */

View File

@@ -44,6 +44,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "swrast_setup/swrast_setup.h"
#include "array_cache/acache.h"
#include "tnl/tnl.h"
#include "tnl/t_vp_build.h"
#include "radeon_reg.h"
#include "radeon_macros.h"
@@ -646,7 +647,9 @@ static void dtr(struct tnl_pipeline_stage *stage)
(void)stage;
}
GLboolean r300_create_render(GLcontext *ctx, struct tnl_pipeline_stage *stage){
static GLboolean r300_create_render(GLcontext *ctx,
struct tnl_pipeline_stage *stage)
{
return GL_TRUE;
}
@@ -678,12 +681,12 @@ static GLboolean r300_run_tcl_render(GLcontext *ctx,
if(ctx->VertexProgram._Enabled == GL_FALSE){
_tnl_UpdateFixedFunctionProgram(ctx);
}
vp = CURRENT_VERTEX_SHADER(ctx);
vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
if(vp->translated == GL_FALSE)
translate_vertex_shader(vp);
if(vp->translated == GL_FALSE){
fprintf(stderr, "Failing back to sw-tcl\n");
debug_vp(ctx, vp);
debug_vp(ctx, &vp->mesa_program);
hw_tcl_on=future_hw_tcl_on=0;
r300ResetHwState(rmesa);
return GL_TRUE;

View File

@@ -71,8 +71,8 @@ static void r300DeleteProgram(GLcontext *ctx, struct program *prog)
_mesa_delete_program(ctx, prog);
}
void r300ProgramStringNotify(GLcontext *ctx, GLenum target,
static void r300ProgramStringNotify(GLcontext *ctx, GLenum target,
struct program *prog)
{
struct r300_vertex_program *vp=(void *)prog;

View File

@@ -832,7 +832,7 @@ static void r300ClearStencil(GLcontext * ctx, GLint s)
#define SUBPIXEL_X 0.125
#define SUBPIXEL_Y 0.125
void r300UpdateWindow(GLcontext * ctx)
static void r300UpdateWindow(GLcontext * ctx)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->radeon.dri.drawable;
@@ -1326,7 +1326,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa);
while leaving colors intact. Nothing fancy (like lights)
If implementing lights make a copy first, so it is easy to switch between the two versions */
void r300GenerateSimpleVertexShader(r300ContextPtr r300)
static void r300GenerateSimpleVertexShader(r300ContextPtr r300)
{
int i;
GLuint o_reg = 0;
@@ -1559,7 +1559,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa)
* But it works for most things. I'll fix it later if someone
* else with a better clue doesn't
*/
unsigned int r300PackFloat24(float f)
static unsigned int r300PackFloat24(float f)
{
float mantissa;
int exponent;
@@ -1587,13 +1587,14 @@ unsigned int r300PackFloat24(float f)
void r300SetupPixelShader(r300ContextPtr rmesa)
{
GLcontext *ctx = rmesa->radeon.glCtx;
struct r300_fragment_program *rp = ctx->FragmentProgram._Current;
struct r300_fragment_program *rp =
(struct r300_fragment_program *)ctx->FragmentProgram._Current;
int i,k;
if (!rp) /* should only happenen once, just after context is created */
return;
translate_fragment_shader(ctx->FragmentProgram._Current);
translate_fragment_shader(rp);
if (!rp->translated) {
fprintf(stderr, "%s: No valid fragment shader, exiting\n", __func__);
exit(-1);
@@ -1849,7 +1850,7 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state)
/* Checks that r300ResetHwState actually modifies all states.
Should probably be burried in somewhere else as this file is getting longish. */
void verify_r300ResetHwState(r300ContextPtr r300, int stage)
static void verify_r300ResetHwState(r300ContextPtr r300, int stage)
{
struct r300_state_atom* atom;
int i;

View File

@@ -60,5 +60,10 @@ extern void r300ResetHwState(r300ContextPtr r300);
extern void r300InitState(r300ContextPtr r300);
extern void r300InitStateFuncs(struct dd_function_table* functions);
extern void r300SetupVertexShader(r300ContextPtr rmesa);
extern void r300SetupPixelShader(r300ContextPtr rmesa);
extern void r300_setup_textures(GLcontext *ctx);
extern void r300_setup_rs_unit(GLcontext *ctx);
#endif /* __R300_STATE_H__ */

View File

@@ -35,6 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "program.h"
#include "r300_context.h"
#include "r300_program.h"
#include "nvvertprog.h"
#define SCALAR_FLAG (1<<31)
@@ -365,7 +366,7 @@ static unsigned long t_swizzle(GLubyte swizzle)
}
}
void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
static void vp_dump_inputs(struct r300_vertex_program *vp, char *caller)
{
int i;

View File

@@ -124,12 +124,6 @@ static void radeonInitDriverFuncs(struct dd_function_table *functions)
}
static int get_ust_nop(int64_t * ust)
{
*ust = 1;
return 0;
}
/**
* Create and initialize all common fields of the context,
* including the Mesa context itself.
@@ -195,13 +189,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
radeon->vblank_flags = (radeon->radeonScreen->irq != 0)
? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ;
radeon->get_ust =
(PFNGLXGETUSTPROC) glXGetProcAddress((const GLubyte *)
"__glXGetUST");
if (radeon->get_ust == NULL) {
radeon->get_ust = get_ust_nop;
}
(*radeon->get_ust) (&radeon->swap_ust);
(*dri_interface->getUST) (&radeon->swap_ust);
return GL_TRUE;
}

View File

@@ -196,7 +196,6 @@ struct radeon_context {
GLuint swap_count;
GLuint swap_missed_count;
PFNGLXGETUSTPROC get_ust;
/* Derived state */
struct radeon_state state;

View File

@@ -208,7 +208,7 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv)
((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
radeon->swap_count++;
(*radeon->get_ust) (&ust);
(*dri_interface->getUST) (&ust);
if (missed_target) {
radeon->swap_missed_count++;
radeon->swap_missed_ust = ust - radeon->swap_ust;
@@ -266,7 +266,7 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
&missed_target);
if (missed_target) {
radeon->swap_missed_count++;
(void)(*radeon->get_ust) (&radeon->swap_missed_ust);
(void)(*dri_interface->getUST) (&radeon->swap_missed_ust);
}
LOCK_HARDWARE(radeon);
@@ -280,7 +280,7 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
}
radeon->swap_count++;
(void)(*radeon->get_ust) (&radeon->swap_ust);
(void)(*dri_interface->getUST) (&radeon->swap_ust);
if (radeon->sarea->pfCurrentPage == 1) {
radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset;

View File

@@ -132,6 +132,7 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driR300NConfigOptions = 13;
extern const struct dri_extension card_extensions[];
#ifndef RADEON_DEBUG
int RADEON_DEBUG = 0;
@@ -216,15 +217,11 @@ static const struct dri_debug_control debug_control[] = {
#define PCI_CHIP_R420_JK 0x4a4b
#endif
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
static radeonScreenPtr __radeonScreen;
static int getSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo);
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *radeonFillInModes(unsigned pixel_bits,
unsigned depth_bits,
unsigned stencil_bits,
@@ -274,7 +271,7 @@ static __GLcontextModes *radeonFillInModes(unsigned pixel_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes) (num_modes, sizeof(__GLcontextModes));
modes = (*dri_interface->createContextModes) (num_modes, sizeof(__GLcontextModes));
m = modes;
if (!driFillInModes(&m, fb_format, fb_type,
depth_bits_array, stencil_bits_array,
@@ -304,7 +301,7 @@ static __GLcontextModes *radeonFillInModes(unsigned pixel_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* Create the device specific screen private data struct.
*/
@@ -313,6 +310,15 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
radeonScreenPtr screen;
RADEONDRIPtr dri_priv = (RADEONDRIPtr) sPriv->pDevPriv;
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC)
(*dri_interface->getProcAddress("glxEnableExtension"));
void *const psc = sPriv->psc->screenConfigs;
if (glx_enable_extension == NULL) {
return NULL;
}
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC(sizeof(*screen));
@@ -580,48 +586,22 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
if (driCompareGLXAPIVersion(20030813) >= 0) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC)
glXGetProcAddress((const GLubyte *)
"__glXScrEnableExtension");
void *const psc = sPriv->psc->screenConfigs;
if (screen->irq != 0) {
(*glx_enable_extension) (psc, "GLX_SGI_swap_control");
(*glx_enable_extension) (psc, "GLX_SGI_video_sync");
(*glx_enable_extension) (psc, "GLX_MESA_swap_control");
}
if (glx_enable_extension != NULL) {
if (screen->irq != 0) {
(*glx_enable_extension) (psc,
"GLX_SGI_swap_control");
(*glx_enable_extension) (psc,
"GLX_SGI_video_sync");
(*glx_enable_extension) (psc,
"GLX_MESA_swap_control");
}
(*glx_enable_extension) (psc,
"GLX_MESA_swap_frame_usage");
(*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
#if R200_MERGED
if (driCompareGLXAPIVersion(20030818) >= 0) {
sPriv->psc->allocateMemory =
(void *)r200AllocateMemoryMESA;
sPriv->psc->freeMemory =
(void *)r200FreeMemoryMESA;
sPriv->psc->memoryOffset =
(void *)r200GetMemoryOffsetMESA;
sPriv->psc->allocateMemory = (void *)r200AllocateMemoryMESA;
sPriv->psc->freeMemory = (void *)r200FreeMemoryMESA;
sPriv->psc->memoryOffset = (void *)r200GetMemoryOffsetMESA;
(*glx_enable_extension) (psc,
"GLX_MESA_allocate_memory");
}
(*glx_enable_extension) (psc, "GLX_MESA_allocate_memory");
#endif
if (driCompareGLXAPIVersion(20030915) >= 0) {
(*glx_enable_extension) (psc,
"GLX_SGIX_fbconfig");
(*glx_enable_extension) (psc,
"GLX_OML_swap_method");
}
}
}
return screen;
}
@@ -799,22 +779,6 @@ static const struct __DriverAPIRec radeonAPI = {
.SwapBuffersMSC = NULL
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display * dpy, int scrn, __DRIscreen * psc,
int numConfigs, __GLXvisualConfig * config)
{
__DRIscreenPrivate *psp;
psp =
__driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI);
return (void *)psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
@@ -826,20 +790,22 @@ void *__driCreateScreen(Display * dpy, int scrn, __DRIscreen * psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn,
void *__driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
__DRIscreen * psc, const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd, int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes)
{
__DRIscreenPrivate *psp;
static const __DRIutilversion2 ddx_expected = { 4, 5, 0, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 11, 1 };
static const __DRIversion drm_expected = { 1, 17, 0 };
dri_interface = interface;
if (!driCheckDriDdxDrmVersions3("R300",
dri_version, &dri_expected,
@@ -853,25 +819,28 @@ void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn,
frame_buffer, pSAREA, fd,
internal_api_version, &radeonAPI);
if (psp != NULL) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress((const GLubyte *)
"__glXCreateContextModes");
if (create_context_modes != NULL) {
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
*driver_modes = radeonFillInModes(dri_priv->bpp,
(dri_priv->bpp ==
16) ? 16 : 24,
(dri_priv->bpp ==
16) ? 0 : 8,
(dri_priv->backOffset !=
dri_priv->
depthOffset));
}
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
*driver_modes = radeonFillInModes(dri_priv->bpp,
(dri_priv->bpp ==
16) ? 16 : 24,
(dri_priv->bpp ==
16) ? 0 : 8,
(dri_priv->backOffset !=
dri_priv->depthOffset));
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
return (void *)psp;
}
#endif /* USE_NEW_INTERFACE */
/**
* Get information about previous buffer swaps.

View File

@@ -125,7 +125,7 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R100 driver.
*/
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
@@ -213,14 +213,6 @@ static const struct dri_debug_control debug_control[] =
};
static int
get_ust_nop( int64_t * ust )
{
*ust = 1;
return 0;
}
/* Create the device specific context.
*/
GLboolean
@@ -450,11 +442,7 @@ radeonCreateContext( const __GLcontextModes *glVisual,
rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0)
? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
if ( rmesa->get_ust == NULL ) {
rmesa->get_ust = get_ust_nop;
}
(*rmesa->get_ust)( & rmesa->swap_ust );
(*dri_interface->getUST)( & rmesa->swap_ust );
#if DO_DEBUG

View File

@@ -775,7 +775,6 @@ struct radeon_context {
GLuint swap_count;
GLuint swap_missed_count;
PFNGLXGETUSTPROC get_ust;
/* radeon_tcl.c
*/

View File

@@ -935,7 +935,7 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv )
UNLOCK_HARDWARE( rmesa );
rmesa->swap_count++;
(*rmesa->get_ust)( & ust );
(*dri_interface->getUST)( & ust );
if ( missed_target ) {
rmesa->swap_missed_count++;
rmesa->swap_missed_ust = ust - rmesa->swap_ust;
@@ -983,7 +983,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
(void) (*rmesa->get_ust)( & rmesa->swap_missed_ust );
(void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
}
LOCK_HARDWARE( rmesa );
@@ -997,7 +997,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv )
}
rmesa->swap_count++;
(void) (*rmesa->get_ust)( & rmesa->swap_ust );
(void) (*dri_interface->getUST)( & rmesa->swap_ust );
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset;

View File

@@ -83,6 +83,8 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 13;
extern const struct dri_extension card_extensions[];
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
*/
@@ -115,13 +117,9 @@ static const GLuint __driNConfigOptions = 13;
#define PCI_CHIP_RS250_4437 0x4437
#endif
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -171,7 +169,7 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -201,7 +199,7 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* Create the device specific screen private data struct.
*/
@@ -210,8 +208,15 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
radeonScreenPtr screen;
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension == NULL ) {
return NULL;
}
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC( sizeof(*screen) );
if ( !screen ) {
@@ -390,28 +395,14 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv )
dri_priv->log2GARTTexGran;
}
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
if ( screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
}
}
if ( screen->irq != 0 ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
return screen;
@@ -566,21 +557,6 @@ static struct __DriverAPIRec radeonAPI = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
* requisite information about the system, and the driver initializes itself.
@@ -591,9 +567,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -601,6 +576,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -609,6 +585,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 3, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions3( "Radeon",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -621,20 +599,26 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &radeonAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
*driver_modes = radeonFillInModes( dri_priv->bpp,
(dri_priv->bpp == 16) ? 16 : 24,
(dri_priv->bpp == 16) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
*driver_modes = radeonFillInModes( dri_priv->bpp,
(dri_priv->bpp == 16) ? 16 : 24,
(dri_priv->bpp == 16) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */
/**
* Get information about previous buffer swaps.

View File

@@ -360,8 +360,3 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
return (void *) psp;
}
#endif
void __driRegisterExtensions(void)
{
/* No extensions */
}

View File

@@ -105,9 +105,6 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 10;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
static const struct dri_debug_control debug_control[] =
{
@@ -131,7 +128,7 @@ unsigned long time_sum=0;
struct timeval tv_s1,tv_f1;
#endif
static const struct dri_extension common_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
@@ -537,7 +534,7 @@ savageCreateContext( const __GLcontextModes *mesaVis,
debug_control );
#endif
driInitExtensions( ctx, common_extensions, GL_TRUE );
driInitExtensions( ctx, card_extensions, GL_TRUE );
if (savageScreen->chipset >= S3_SAVAGE4)
driInitExtensions( ctx, s4_extensions, GL_FALSE );
if (ctx->Mesa_DXTn ||
@@ -905,25 +902,6 @@ static const struct __DriverAPIRec savageAPI = {
};
#ifndef DRI_NEW_INTERFACE_ONLY
/*
* This is the (old) bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &savageAPI);
return (void *) psp;
}
#endif /* DRI_NEW_INTERFACE_ONLY */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
savageFillInModes( unsigned pixel_bits, unsigned depth_bits,
unsigned stencil_bits, GLboolean have_back_buffer )
@@ -976,7 +954,7 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -1019,7 +997,7 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits,
* failure.
*/
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -1027,6 +1005,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -1035,6 +1014,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 2, 1, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "Savage",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -1047,17 +1028,22 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &savageAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
*driver_modes = savageFillInModes( dri_priv->cpp*8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
}
SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
*driver_modes = savageFillInModes( dri_priv->cpp*8,
(dri_priv->cpp == 2) ? 16 : 24,
(dri_priv->cpp == 2) ? 0 : 8,
(dri_priv->backOffset != dri_priv->depthOffset) );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -64,7 +64,7 @@ int GlobalCurrentHwcx = -1;
int GlobalHwcxCountBase = 1;
int GlobalCmdQueueLen = 0;
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },

View File

@@ -59,11 +59,7 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 2;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
sisFillInModes(int bpp)
{
@@ -103,7 +99,7 @@ sisFillInModes(int bpp)
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes));
modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes));
m = modes;
if (!driFillInModes(&m, fb_format, fb_type, depth_bits_array,
stencil_bits_array, depth_buffer_factor,
@@ -123,7 +119,7 @@ sisFillInModes(int bpp)
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* Create the device specific screen private data struct.
*/
@@ -133,11 +129,6 @@ sisCreateScreen( __DRIscreenPrivate *sPriv )
sisScreenPtr sisScreen;
SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv;
#ifndef USE_NEW_INTERFACE
/* XXX Should this still be around for the old interface? */
if ( !driCheckDriDdxDrmVersions( sPriv, "SiS", 4, 0, 0, 1, 1, 0 ) )
return NULL;
#endif
/* Allocate the private area */
sisScreen = (sisScreenPtr)CALLOC( sizeof(*sisScreen) );
@@ -410,20 +401,6 @@ static struct __DriverAPIRec sisAPI = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &sisAPI);
return (void *)psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
@@ -435,9 +412,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes *modes,
const __DRIversion *ddx_version,
@@ -446,6 +422,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
const __DRIframebuffer *frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes **driver_modes )
{
@@ -454,6 +431,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
static const __DRIversion dri_expected = {4, 0, 0};
static const __DRIversion drm_expected = {1, 0, 0};
dri_interface = interface;
if (!driCheckDriDdxDrmVersions2("SiS", dri_version, &dri_expected,
ddx_version, &ddx_expected,
drm_version, &drm_expected)) {
@@ -465,14 +444,9 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
frame_buffer, pSAREA, fd,
internal_api_version, &sisAPI);
if (psp != NULL) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress((const GLubyte *)"__glXCreateContextModes");
if (create_context_modes != NULL) {
SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv;
*driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8);
}
SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv;
*driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8);
}
return (void *)psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -83,7 +83,7 @@
/**
* Common extension strings exported by all cards
*/
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
@@ -123,7 +123,7 @@ static const struct dri_extension card_extensions[] =
/**
* Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards.
*/
static const struct dri_extension napalm_extensions[] =
const struct dri_extension napalm_extensions[] =
{
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_combine", NULL },

View File

@@ -65,6 +65,9 @@ DRI_CONF_END;
static const GLuint __driNConfigOptions = 1;
extern const struct dri_extension card_extensions[];
extern const struct dri_extension napalm_extensions[];
static GLboolean
tdfxCreateScreen( __DRIscreenPrivate *sPriv )
{
@@ -346,12 +349,6 @@ static const struct __DriverAPIRec tdfxAPI = {
.SwapBuffersMSC = NULL
};
#ifdef USE_NEW_INTERFACE
/*
* new interface code, derived from radeon_screen.c
* XXX this may still be wrong
*/
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
unsigned depth_bits,
@@ -373,7 +370,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
num_modes = (depth_bits == 16) ? 32 : 16;
modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes));
modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes));
m = modes;
for (i = 0; i <= 1; i++) {
@@ -432,7 +429,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits,
* failure.
*/
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -440,6 +437,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
@@ -447,6 +445,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "tdfx",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -459,10 +459,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
frame_buffer, pSAREA, fd,
internal_api_version, &tdfxAPI);
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress((const GLubyte *)"__glXCreateContextModes");
if (create_context_modes != NULL) {
if (psp != NULL) {
/* divined from tdfx_dri.c, sketchy */
TDFXDRIPtr dri_priv = (TDFXDRIPtr) psp->pDevPriv;
int bpp = (dri_priv->cpp > 2) ? 24 : 16;
@@ -473,24 +470,18 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
*driver_modes = tdfxFillInModes(bpp, (bpp == 16) ? 16 : 24,
(bpp == 16) ? 0 : 8,
(dri_priv->backOffset!=dri_priv->depthOffset));
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, napalm_extensions, GL_FALSE );
}
return (void *)psp;
}
#endif /* USE_NEW_INTERFACE */
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &tdfxAPI);
return (void *) psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */

View File

@@ -358,34 +358,6 @@ tridentScreenPtr tridentCreateScreen( __DRIscreenPrivate *sPriv )
TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv;
tridentScreenPtr tridentScreen;
#if 0
/* Check the DRI version */
{
int major, minor, patch;
if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) {
if ( major != 3 || minor != 1 || patch < 0 ) {
__driUtilMessage( "r128 DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch );
return GL_FALSE;
}
}
}
/* Check that the DDX driver version is compatible */
if ( sPriv->ddxMajor != 4 ||
sPriv->ddxMinor != 0 ||
sPriv->ddxPatch < 0 ) {
__driUtilMessage( "r128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch );
return GL_FALSE;
}
/* Check that the DRM driver version is compatible */
if ( sPriv->drmMajor != 2 ||
sPriv->drmMinor != 1 ||
sPriv->drmPatch < 0 ) {
__driUtilMessage( "r128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch );
return GL_FALSE;
}
#endif
/* Allocate the private area */
tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) );
@@ -453,13 +425,8 @@ static struct __DriverAPIRec tridentAPI = {
tridentUnbindContext,
};
#ifndef USE_NEW_INTERFACE
#error trident_dri.so is new-interface only.
#else
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
PUBLIC void *__driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
PUBLIC void *__driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
@@ -468,10 +435,22 @@ PUBLIC void *__driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
__DRIscreenPrivate *psp;
/* XXX version checks */
static const __DRIversion ddx_expected = { 4, 0, 0 };
static const __DRIversion dri_expected = { 3, 1, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "Trident",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
drm_version, & drm_expected ) ) {
return NULL;
}
psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
ddx_version, dri_version, drm_version,
@@ -479,22 +458,11 @@ PUBLIC void *__driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
internal_api_version, &tridentAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
#if 0
if ( create_context_modes != NULL ) {
TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
*driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
GL_TRUE );
}
TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
*driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
GL_TRUE );
#endif
}
return (void *) psp;
}
#endif
void __driRegisterExtensions(void)
{
/* No extensions */
}

View File

@@ -251,7 +251,7 @@ static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the Unichrome driver.
*/
static const struct dri_extension card_extensions[] =
const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
@@ -342,12 +342,6 @@ FreeBuffer(struct via_context *vmesa)
via_free_dma_buffer(vmesa);
}
static int
get_ust_nop( int64_t * ust )
{
*ust = 1;
return 0;
}
GLboolean
viaCreateContext(const __GLcontextModes *visual,
@@ -563,13 +557,8 @@ viaCreateContext(const __GLcontextModes *visual,
if (getenv("VIA_PAGEFLIP"))
vmesa->allowPageFlip = 1;
vmesa->get_ust =
(PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
if ( vmesa->get_ust == NULL ) {
vmesa->get_ust = get_ust_nop;
}
vmesa->get_ust( &vmesa->swap_ust );
(*dri_interface->getUST)( &vmesa->swap_ust );
vmesa->regMMIOBase = (GLuint *)((GLuint)viaScreen->reg);

View File

@@ -320,7 +320,6 @@ struct via_context {
GLuint swap_count;
GLuint swap_missed_count;
PFNGLXGETUSTPROC get_ust;
GLuint pfCurrentOffset;
GLboolean allowPageFlip;

View File

@@ -512,7 +512,7 @@ static void viaWaitIdleVBlank( const __DRIdrawablePrivate *dPriv,
vmesa->vblank_flags, & missed_target );
if ( missed_target ) {
vmesa->swap_missed_count++;
vmesa->get_ust( &vmesa->swap_missed_ust );
(*dri_interface->getUST)( &vmesa->swap_missed_ust );
}
}
while (!viaCheckBreadcrumb(vmesa, value));
@@ -615,7 +615,7 @@ void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
vmesa->get_ust( &vmesa->swap_ust );
(*dri_interface->getUST)( &vmesa->swap_ust );
}
@@ -639,7 +639,7 @@ void viaPageFlip(const __DRIdrawablePrivate *dPriv)
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
vmesa->get_ust( &vmesa->swap_ust );
(*dri_interface->getUST)( &vmesa->swap_ust );
/* KW: FIXME: When buffers are freed, could free frontbuffer by

View File

@@ -61,10 +61,7 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 3;
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
extern const struct dri_extension card_extensions[];
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
@@ -100,6 +97,14 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
{
viaScreenPrivate *viaScreen;
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension == NULL ) {
return GL_FALSE;
}
/* Allocate the private area */
@@ -170,30 +175,13 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset;
if ( viaScreen->irqEnabled ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) {
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress(
(const GLubyte *) "__glXScrEnableExtension" );
void * const psc = sPriv->psc->screenConfigs;
if ( glx_enable_extension != NULL ) {
if ( viaScreen->irqEnabled ) {
(*glx_enable_extension)( psc, "GLX_SGI_swap_control" );
(*glx_enable_extension)( psc, "GLX_SGI_video_sync" );
(*glx_enable_extension)( psc, "GLX_MESA_swap_control" );
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) {
(*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" );
(*glx_enable_extension)( psc, "GLX_OML_swap_method" );
}
}
}
(*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" );
return GL_TRUE;
}
@@ -340,23 +328,6 @@ static struct __DriverAPIRec viaAPI = {
};
/*
* This is the bootstrap function for the driver.
* The __driCreateScreen name is the symbol that libGL.so fetches.
* Return: pointer to a __DRIscreenPrivate.
*/
#if !defined(DRI_NEW_INTERFACE_ONLY)
void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
__DRIscreenPrivate *psp;
psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &viaAPI);
return (void *)psp;
}
#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *
viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
{
@@ -395,7 +366,7 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array,
@@ -419,7 +390,6 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
@@ -432,9 +402,8 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
#ifdef USE_NEW_INTERFACE
PUBLIC
void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
@@ -443,6 +412,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -451,6 +421,8 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 2, 3, 0 };
dri_interface = interface;
if ( ! driCheckDriDdxDrmVersions2( "Unichrome",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -463,19 +435,24 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn,
frame_buffer, pSAREA, fd,
internal_api_version, &viaAPI);
if ( psp != NULL ) {
create_context_modes = (PFNGLXCREATECONTEXTMODES)
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
if ( create_context_modes != NULL ) {
VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
*driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
GL_TRUE );
}
VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
*driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
GL_TRUE );
/* Calling driInitExtensions here, with a NULL context pointer, does not actually
* enable the extensions. It just makes sure that all the dispatch offsets for all
* the extensions that *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is called, but we can't
* enable the extensions until we have a context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
}
fprintf(stderr, "%s - succeeded\n", __FUNCTION__);
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */
/**

View File

@@ -52,6 +52,9 @@
#include "xfonts.h"
#include "xmesaP.h"
#ifdef __VMS
#define _mesa_sprintf sprintf
#endif
/* This indicates the client-side GLX API and GLX encoder version. */
#define CLIENT_MAJOR_VERSION 1
@@ -1354,11 +1357,7 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) {
((__GLXcontext *) ctx)->currentDpy = dpy;
((__GLXcontext *) ctx)->currentDrawable = draw;
#ifndef GLX_BUILT_IN_XMESA
((__GLXcontext *) ctx)->currentReadable = read;
#else
__glXSetCurrentContext(ctx);
#endif
return True;
}
else {
@@ -1373,9 +1372,6 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
MakeCurrent_PrevReadable = 0;
MakeCurrent_PrevDrawBuffer = 0;
MakeCurrent_PrevReadBuffer = 0;
#ifdef GLX_BUILT_IN_XMESA
/* XXX bind dummy context with __glXSetCurrentContext(ctx); */
#endif
return True;
}
else {

View File

@@ -80,31 +80,7 @@ get_dispatch(Display *dpy)
* or Mesa's pseudo-GLX.
*/
{
struct _glxapi_table *t = NULL;
#ifdef GLX_BUILT_IN_XMESA
if (!getenv("LIBGL_FORCE_XMESA")) {
int ignore;
if (XQueryExtension( dpy, "GLX", &ignore, &ignore, &ignore )) {
/* the X server has the GLX extension */
t = _real_GetGLXDispatchTable();
}
}
#endif
if (!t) {
/* Fallback to Mesa with Xlib driver */
#ifdef GLX_BUILT_IN_XMESA
if (getenv("LIBGL_DEBUG")) {
fprintf(stderr,
"libGL: server %s lacks the GLX extension.",
dpy->display_name);
fprintf(stderr, " Using Mesa Xlib renderer.\n");
}
#endif
t = _mesa_GetGLXDispatchTable();
assert(t); /* this has to work */
}
struct _glxapi_table *t = _mesa_GetGLXDispatchTable();
if (t) {
struct display_dispatch *d;
@@ -146,10 +122,8 @@ get_dispatch(Display *dpy)
/* Set by glXMakeCurrent() and glXMakeContextCurrent() only */
#ifndef GLX_BUILT_IN_XMESA
static GLXContext CurrentContext = 0;
#define __glXGetCurrentContext() CurrentContext;
#endif
/*
@@ -235,29 +209,19 @@ glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value)
}
#ifdef GLX_BUILT_IN_XMESA
/* Use real libGL's glXGetCurrentContext() function */
#else
/* stand-alone Mesa */
GLXContext PUBLIC
glXGetCurrentContext(void)
{
return CurrentContext;
}
#endif
#ifdef GLX_BUILT_IN_XMESA
/* Use real libGL's glXGetCurrentContext() function */
#else
/* stand-alone Mesa */
GLXDrawable PUBLIC
glXGetCurrentDrawable(void)
{
__GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
return gc ? gc->currentDrawable : 0;
}
#endif
Bool PUBLIC
@@ -281,11 +245,9 @@ glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
return False;
}
b = (*t->MakeCurrent)(dpy, drawable, ctx);
#ifndef GLX_BUILT_IN_XMESA
if (b) {
CurrentContext = ctx;
}
#endif
return b;
}
@@ -397,7 +359,6 @@ glXQueryServerString(Display *dpy, int screen, int name)
/*** GLX_VERSION_1_2 ***/
#if !defined(GLX_BUILT_IN_XMESA)
Display PUBLIC *
glXGetCurrentDisplay(void)
{
@@ -406,7 +367,6 @@ glXGetCurrentDisplay(void)
if (NULL == gc) return NULL;
return gc->currentDpy;
}
#endif
@@ -500,16 +460,12 @@ glXDestroyWindow(Display *dpy, GLXWindow window)
}
#ifdef GLX_BUILT_IN_XMESA
/* Use the glXGetCurrentReadDrawable() function from libGL */
#else
GLXDrawable PUBLIC
glXGetCurrentReadDrawable(void)
{
__GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
return gc ? gc->currentReadable : 0;
}
#endif
int PUBLIC
@@ -564,11 +520,9 @@ glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXConte
if (!t)
return False;
b = (t->MakeContextCurrent)(dpy, draw, read, ctx);
#ifndef GLX_BUILT_IN_XMESA
if (b) {
CurrentContext = ctx;
}
#endif
return b;
}
@@ -661,16 +615,11 @@ glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXConte
return (t->MakeCurrentReadSGI)(dpy, draw, read, ctx);
}
#ifdef GLX_BUILT_IN_XMESA
/* Use glXGetCurrentReadDrawableSGI() from libGL */
#else
/* stand-alone Mesa */
GLXDrawable PUBLIC
glXGetCurrentReadDrawableSGI(void)
{
return glXGetCurrentReadDrawable();
}
#endif
#if defined(_VL_H)
@@ -710,27 +659,17 @@ glXFreeContextEXT(Display *dpy, GLXContext context)
(t->FreeContextEXT)(dpy, context);
}
#ifdef GLX_BUILT_IN_XMESA
/* Use real libGL's glXGetContextIDEXT() function */
#else
/* stand-alone Mesa */
GLXContextID PUBLIC
glXGetContextIDEXT(const GLXContext context)
{
return ((__GLXcontext *) context)->xid;
}
#endif
#ifdef GLX_BUILT_IN_XMESA
/* Use real libGL's glXGetCurrentDisplayEXT() function */
#else
/* stand-alone Mesa */
Display PUBLIC *
glXGetCurrentDisplayEXT(void)
{
return glXGetCurrentDisplay();
}
#endif
GLXContext PUBLIC
glXImportContextEXT(Display *dpy, GLXContextID contextID)

Some files were not shown because too many files have changed in this diff Show More