Compare commits

...

118 Commits

Author SHA1 Message Date
Brian Paul
eacd347fce update MESA_DEBUG with FP info 2005-08-19 23:34:10 +00:00
Adam Jackson
8fcd1e0287 Convert libGL and DRI drivers to require libdrm.
libdrm can be had from:

http://people.freedesktop.org/~ajax/libdrm/
2005-08-19 20:20:03 +00:00
Ian Romanick
2ae5645115 Fix a realloc problem with indirect vertex arrays. The actual head pointer
wasn't tracked and used for the realloc, so it tended to explode.
2005-08-19 18:53:26 +00:00
Brian Paul
b7c727e500 updates for 6.3.2 release, plus other assorted clean-ups 2005-08-19 16:57:50 +00:00
Alan Hourihane
d912f6cfe3 Commit missing piece from Egbert's 32/64 bit patches 2005-08-19 16:07:33 +00:00
Ian Romanick
f7eb54a12f Enable ARB_texture_compression. The code has been in place for a long time,
but, for whatever reason, the extension wasn't enabled.

Add some comments to i810ChooseTextureFormat.  There's some strangeness with
i810 texture formats.
2005-08-19 00:48:25 +00:00
Ian Romanick
e0029b33ef Add support for NV_blend_square. This was tested with
progs/tests/blendsquare.
2005-08-18 22:27:37 +00:00
Ian Romanick
ab5be2c5f7 Make sure extension entry point offsets are properly initialized. This is
primarilly needed to support functions that are internally implemented using
extension entry points (e.g., glBlendFunc uses glBlendFuncSeparate).
2005-08-18 22:16:46 +00:00
Ian Romanick
61ac29e7c6 Don't try to update hardware texture fields if there is no hardware texture.
This can happen when all the texture enables for a texture unit are disabled.

This fixes bugzilla #3195.
2005-08-18 20:01:01 +00:00
Ian Romanick
b462855c24 Add simple regression test for bugzilla #3195. 2005-08-18 19:52:44 +00:00
Ian Romanick
e918bac8cd Make the i810 driver use driGetRendererString like all the other drivers.
The GL_RENDERER string now accurately contains the chip name.  This was only
tested on a "plain" i810 (PCI ID 8086:7121).
2005-08-18 19:51:11 +00:00
Brian Paul
aa2a357bae Replace mult/div operators with bitwise operators in texel fetch routines
for better performance. (Roland Scheidegger)
2005-08-18 14:33:26 +00:00
Brian Paul
05fe2871e3 Bump version to 6.3.2 2005-08-16 23:13:25 +00:00
Brian Paul
926a19e108 updates for 6.3.2 2005-08-16 23:12:37 +00:00
Brian Paul
160b3284dd include stdint.h if WIN32 and GNUC (Colin Harrison). Patch forwarded to SGI. 2005-08-15 23:25:33 +00:00
Brian Paul
c2c2600728 test the standard stencil op modes too (Philipp Klaus Krause) 2005-08-15 22:57:30 +00:00
Roland Scheidegger
7a362deb8c In _mesa_TexEnvfv, do not accept values for GL_OPERAND2_ALPHA and GL_OPERAND2_RGB which are only valid with ARB_texture_env_combine but not with EXT_texture_env_combine, when only EXT_texture_env_combine is supported. 2005-08-15 18:24:12 +00:00
Ian Romanick
a3dd6efb00 Put back '-I/usr/X11R6/include'.
Make 'USING_EGL=0' the default for now.  It's causing too much confusion for
too many non-developers (which in turn wastes too much developer time).  It
is trivially overridden from the make command line.  See comments in
linux-dri.
2005-08-15 15:01:39 +00:00
Alan Hourihane
dabec11d27 Add Egberts fixes for 64bit architectures
Add additional checks for the *DRIRec info structure passed in from the
device driver. This ensures that things fallback to indirect rendering if
the DDX driver has had modifications (i.e. removal of the drmAddress field).
2005-08-15 06:59:24 +00:00
Alan Hourihane
69dc32cfac Add a check which compares the passed in size of the DDX driver private DRI
structure to the 3D drivers view of it, and abort if they don't match.

This traps the case with the drmAddress removal in the DDX driver.
2005-08-14 12:16:51 +00:00
Ian Romanick
33f9c98aa6 Enable support for EXT_stencil_wrap. The code was already there, but the
extension wasn't enabled.  I have verified its correct function with Mesa's
stencil_wrap test.  It is enabled on both Savage4 and Savage3D.  Since
Savage3D uses a software fallback for *all* stencil operations, this is safe.
2005-08-13 01:43:28 +00:00
Brian Paul
6fe7a0dc01 added FREXPF() macro (bug 4060) 2005-08-12 18:56:56 +00:00
Ian Romanick
f2876d1ee3 Remove the logic that determines at compile time whether or not HAVE_ALIAS
should be defined.  It was flawed on some platforms (e.g., Darwin & mingw).
Instead, rely on the build system to define it on the compiler command line.

This also reverts ajax's hand-edit to indirect_size.c.  I'll fix that on the
X.org side of things later today.
2005-08-11 20:29:45 +00:00
Ian Romanick
fbcc5aedf2 Remove support for the R200_NO_VTXFMT environment variable. Instead use
'tcl_mode=1'.  This fixes bugzilla #3972.
2005-08-11 19:47:06 +00:00
Ian Romanick
4c4e4bfa4e Makefile cleanups suggested by George Fufutos (bugzilla #3899). 2005-08-11 19:37:55 +00:00
Ian Romanick
ac7c147aaf Don't link with libGL, libEGL, or libEGLdri. On EGL setups libGL isn't
available, and on libGL setups libEGL and libEGLdri aren't available.
2005-08-11 19:29:25 +00:00
Ian Romanick
b7ae3e4787 Since Brian's recent commit, "-I/usr/X11R6/include/X11/extensions" is no
longer needed.
2005-08-11 19:23:23 +00:00
Brian Paul
82dfd4b71f fix X #includes so they're relative to X11/ directory (bug 4047) 2005-08-11 14:18:53 +00:00
Ian Romanick
ac887d4211 Make ffb driver build on x86-64. The fix is two fold. First, use the
proper DRM_CAS_RESULT to declare the variable used to store the result
of DRM_CAS.  Second, only use the "real" versions of LOCK_HARDWARE and
UNLOCK_HARDWARE on SPARC.  That's the only platform where the hardware
can really exist.
2005-08-11 04:25:36 +00:00
Ian Romanick
967b006f51 Remove _glapi_check_multithread from the interface exported by the loader to
the driver.  The loader now takes care of this for the driver.

Remove _glapi_DispatchTSD and give _glapi_Dispatch its semantic (i.e.,
having a NULL value means that the application is multithreaded and
_glapi_get_dispatch must be called).

Gut all of the dispatch override code.  This removes _glapi_RealDispatch,
_glapi_tls_RealDispatch, _glapi_begin_dispatch_override,
_glapi_end_dispatch_override, and _glapi_get_override_dispatch.

Remove _glapi_get_proc_address, _glapi_get_proc_name, _glapi_get_version,
and _glapi_check_table from the loader / driver interface.

Reviewed by: Brian Paul
2005-08-10 23:54:15 +00:00
Ian Romanick
1b8d0f149e Mesa uses the glVertexAttrib*NV functions to implement fixed-function
attributes in display lists.  If a driver doesn't add entry points for
GL_NV_vertex_program, it will explode.  This patch adds GL_NV_vertex_program
to the list of default extensions whose entry points are added by
driInitExtensions.

Thanks go to Roland Scheidegger for tracking the problem down and suggesting
the fix.
2005-08-10 23:39:42 +00:00
Brian Paul
8c9cd63c89 the PIXEL_MAP_I_TO_I table should be GLfloat, not GLint 2005-08-10 17:04:03 +00:00
Brian Paul
63c9ebeaff fix static assertion problem for gcc (bug 4022) 2005-08-10 14:42:21 +00:00
Brian Paul
6b563bda43 disable the pointer size assertions (bug 4021) 2005-08-10 14:40:05 +00:00
Brian Paul
5d40169436 fix indentation 2005-08-10 14:38:39 +00:00
Keith Whitwell
738c9a073f Check for prim/vertex store non-null before messing with refcounts. 2005-08-10 14:13:45 +00:00
Ian Romanick
258f005c6b Add rules and target to build src/mesa/x86-64/glapi_x86-64.S. 2005-08-09 18:54:12 +00:00
Keith Whitwell
c91720fb1a Decrement the context's refcounts on part-used storage structs on
context destroy.  Fixes memory leak.
2005-08-09 16:11:28 +00:00
Brian Paul
d2e289c70f actually free the renderbuffer in xmesa_delete_renderbuffer(), fixes a memory leak 2005-08-09 15:17:19 +00:00
Brian Paul
e78a3c42e4 delete display lists upon exit 2005-08-09 15:14:51 +00:00
Brian Paul
a1a6fa2fa1 free display lists and destroy window upon exit 2005-08-09 15:13:32 +00:00
Brian Paul
ecde87054c _mesa_free_framebuffer_data() call frees the renderbuffers, no need to call the Delete methods after 2005-08-09 15:07:55 +00:00
Brian Paul
24d55a1145 free context structure (bug 1252316) and s/free/_mesa_free/ 2005-08-09 14:23:28 +00:00
Ian Romanick
aba4864a25 Make the linux-dri-x86 builds work on x86-64 again. mklib now
determines the bits (either 32 or 64) for libraries without the lib
prefix.  progs/egl/Makefile passes CFLAGS on the link commands so that
things like '-m32' get propagated.
2005-08-08 23:22:46 +00:00
Brian Paul
7bf08c23fd s/Disaptch/Dispatch/ (bug 3918) 2005-08-08 21:42:51 +00:00
Brian Paul
63dffa4e77 added directfbgl.h to tarball 2005-08-08 21:30:12 +00:00
Ian Romanick
da0c5b2e2c Since glcontextmodes.[ch] are no longer used in the DRI drivers, removed the
IN_DRI_DRIVER cruft.  This was suggested by George Fufutos.
2005-08-08 17:22:44 +00:00
Dave Airlie
0d942b740c fix up color tiling in miniglx radeon server code 2005-08-08 04:34:35 +00:00
Dave Airlie
ac54de021a fix miniglx setting virtual size of 832 for 800x600 2005-08-08 04:17:52 +00:00
Jon Smirl
ae4e58c9ab Remove platform specific bits from radeon_egl.c 2005-08-08 03:58:26 +00:00
Eric Anholt
81b3c5e85c Dike out the linux-specific EGL bits unless it's a linux build. 2005-08-08 03:27:28 +00:00
Eric Anholt
f1a261377f Since this isn't a bash script, don't use function and instead inline the usage
into the one place that it's used.
2005-08-08 03:26:18 +00:00
Vladimir Dergachev
8e653f12bc Allow R300 driver to build on x86-64 and PowerPC. 2005-08-07 21:50:33 +00:00
Jon Smirl
bf54a28384 Add missing egldri.h header file 2005-08-07 02:30:32 +00:00
Jon Smirl
9a4dbf1cff Fix up some of the sample to work with the r200 EGL driver 2005-08-07 02:15:27 +00:00
Jon Smirl
7e5da5d526 Enable EGL support in 'linux-dri' config 2005-08-07 02:13:14 +00:00
Vladimir Dergachev
94a4eb1e78 Follow suggestion by Aapo Tahkola to fix giant memory leak from forgetting to free the key when entry was already found (presumably a common case). 2005-08-06 05:19:42 +00:00
Vladimir Dergachev
b8731903df Fix card_extensions by following corresponding r200 code.
Fix suggested by Ian Romanick.
R300 driver now works without segfault.
2005-08-06 04:39:27 +00:00
Ian Romanick
23a4f50c5b Fixes bugzilla #1730.
Make sure that all the values used in the clean-up code are initialized at
some point.  It is still unclear to me as to why GCC does not complain.  I
suspect the problem may be due to the depth of if-statement nesting.
2005-08-05 23:13:13 +00:00
Ian Romanick
6965f2cb0a Fixes bugzillla #812.
The weak version of _glapi_DispatchTSD was removed from dri_util.c.  As
stated in the bug report, this was only needed to support versions of libGL
that did not have this symbol.  Versions of libGL without this symbol are no
longer supported at all, so it is totally irrelevant.
2005-08-05 22:12:49 +00:00
Alan Hourihane
928218a283 remove the drmAddress 2005-08-05 20:47:59 +00:00
Ian Romanick
6bc24c5c05 In order to create the set of available extensions, we have to know if
direct-rendering is possible on a given screen.  It is not possible to
determine this by just looking at driDisplay.private in the display
structure.  However, it is possible to determine this by looking at
driScreen.private in the screen structure.  This field is only non-NULL if a
DRI driver has been successfully loaded and bootstrapped.  Once we get to
that point, we know that direct-rendering is at least theoretically
possible.

This fixes bugzilla #2875.
2005-08-05 19:13:51 +00:00
Ian Romanick
126c89e35f Fix recent problems with display lists and other parts of the code.
CALL_by_offset, SET_by_offset, and GET_by_offset all had various problems.

The core issue is that parts of the device-independent code in Mesa assumes
that all functions have slots in the dispatch table.  This is especially
true in the display list code.  It will merrilly try to set dispatch
pointers for glVertexAttrib1fARB even if GL_ARB_vertex_program is not
supported.  When the GET/SET/CALL macros are invoked, they would read a 0
from the remap table.  The problem is that 0 is the dispatch offset for
glNewList!

One change is that the remap table is now initialized to be full of -1
values.  In addtion, all of the *_by_offset marcos misbehave in an obvious
way if the specified offset is -1.  SET_by_offset will do nothing,
GET_by_offset will return NULL, and CALL_by_offset, since it uses
GET_by_offset, will segfault.

I also had to add GL_EXT_blend_func_separate to the list of default
extensions in all_mesa_extensions (src/mesa/drivers/dri/common/utils.c).
Even though many drivers do not export this extension, glBlendFunc is
internally implemented by calling glBlendFuncSeparate.  Without this
addition, glBlendFunc stopped working on drivers (such as mga) that do not
export GL_EXT_blend_func_separate.

There are still a few assertions / crashes in GL_ARB_vertex_program tests,
but I don't think that these are related to any of my changes.
2005-08-05 18:13:37 +00:00
Jon Smirl
33f5e47faf Remove EGL from linux-solo makefile 2005-08-05 03:48:15 +00:00
Jon Smirl
485528f2ac More EGL prep. No impact on anything outside of EGL 2005-08-05 03:33:59 +00:00
Jon Smirl
b507bd4160 New files for radeon egl driver.
Still a work in progress.
2005-08-04 22:23:34 +00:00
Ian Romanick
711555d1e3 Convert all instances of XTHREADS to USE_XTHREADS. This fixes one of
serveral things that are broken when building on a system with X.org 7.0rc0
installed.
2005-08-03 23:05:25 +00:00
Dave Airlie
7f5925d57c Add color tiling support to miniglx for radeon
(Stephane Marchesin + Dave Airlie)
2005-08-03 10:22:31 +00:00
Ian Romanick
7adcedcd54 Fix build problems related to finding Xthreads.h. 2005-08-01 16:30:24 +00:00
Ian Romanick
29206ae569 Remove unused structures and data fields. These had been left in because
DRI drivers using the "old" interface relied on certain fields being at
certain offsets.  Removing the structures would break that.  Now that the
old interface is no longer supported, the dead data can finally die.
2005-07-29 17:30:18 +00:00
Ian Romanick
dc6e2c778a Add a new config called linux-indirect. This build the GLX libGL just like
linux-dri, but it disables support for direct-rendering in it.  This config
mainly exists so that I can verify that changes to libGL haven't broken
builds on non-DRI platforms.
2005-07-29 17:25:50 +00:00
Jon Smirl
4508bcc72c Leave the AGP_BASE code in. It is pointless to bump the interface
for X on a miniglx fix. It can be removed later.
2005-07-29 16:53:02 +00:00
Jon Smirl
a7d4bfed8a Remove OUTREG(RADEON_AGP_BASE, info->ringHandle); from DRI driver
Code is already in DRM driver to do this.
2005-07-29 13:58:22 +00:00
Jon Smirl
4ce390b933 Commit Ian's fixes from Bug 3877
I have tested these on miniglx and they seem to be working.
I'm sure Dave will give them a better test.
2005-07-29 00:48:12 +00:00
Jon Smirl
df68d11b47 Fix a == vs !- typo for glx_enable_extension 2005-07-29 00:19:36 +00:00
Ian Romanick
82e3ecf413 Use the routines supplied in the __DRIinterfaceMethods structure to create a
destroy __GLcontextModes structures.  This eliminates the need for DRI
drivers to ever link with glcontextmodes.c.
2005-07-28 23:33:18 +00:00
Ian Romanick
f7c9eafa85 glxEnableExtension is a platform-specific function exported by the loader.
Therefore, drivers should not require it to run.
2005-07-28 21:57:17 +00:00
Ian Romanick
68679d2b9e Remove '#if 0' block that was accidentally left in. 2005-07-28 20:55:26 +00:00
Brian Paul
960467443e SPARC, DRI interface changes for 6.3.1 2005-07-28 02:46:26 +00:00
Ian Romanick
14fa5f6a60 The dri/*/depend files don't exist on a raw check-out, and that makes 'make
tarballs' have issues.
2005-07-28 01:15:45 +00:00
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
209 changed files with 11220 additions and 25046 deletions

178
Makefile
View File

@@ -89,6 +89,7 @@ linux-dri \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-indirect \
linux-fbdev \
linux-glide \
linux-icc \
@@ -133,11 +134,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.2
LIB_NAME = MesaLib-6.3.2
DEMO_NAME = MesaDemos-6.3.2
LIB_FILES = \
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/descrip.mms \
$(DIRECTORY)/mms-config. \
@@ -151,8 +152,9 @@ LIB_FILES = \
$(DIRECTORY)/docs/VERSIONS \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/dmesa.h \
$(DIRECTORY)/include/GL/amesa.h \
$(DIRECTORY)/include/GL/dmesa.h \
$(DIRECTORY)/include/GL/directfbgl.h \
$(DIRECTORY)/include/GL/fxmesa.h \
$(DIRECTORY)/include/GL/ggimesa.h \
$(DIRECTORY)/include/GL/gl.h \
@@ -173,6 +175,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 +240,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 +259,60 @@ 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/*/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 +343,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:

243
bin/mklib
View File

@@ -1,38 +1,28 @@
#!/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.
#
@@ -43,6 +33,7 @@ MAJOR=1
MINOR=0
PATCH=""
DEPS=""
LINK=""
CPLUSPLUS=0
STATIC=0
INSTALLDIR="."
@@ -58,26 +49,93 @@ 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')
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'
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 +178,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 +192,16 @@ 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}
# Check if objects are 32-bit and we're running in 64-bit
# environment. If so, pass -m32 flag to linker.
set ${OBJECTS}
ABI32=`file $1 | grep 32-bit`
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
OPTS="-m32 ${OPTS}"
fi
rm -f ${LIBNAME}
# make lib
${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
# finish up
@@ -190,12 +252,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 +280,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 +357,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 +467,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 +521,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 +543,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 +662,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,9 +8,9 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=6
MESA_MINOR=3
MESA_TINY=0
MESA_TINY=2
# external projects
# external projects. This should be useless now that we use libdrm.
DRM_SOURCE_PATH=$(TOP)/../drm
# Compiler and flags

View File

@@ -12,8 +12,9 @@ WARN_FLAGS = -Wall
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
X11_INCLUDES = -I/usr/X11R6/include
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \
-ffast-math $(X11_INCLUDES)
CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
@@ -21,8 +22,9 @@ CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
ASM_SOURCES =
# Library/program dependencies
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
@@ -38,6 +40,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 = i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis

View File

@@ -22,9 +22,10 @@ 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 \
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
@@ -37,17 +38,31 @@ ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB)
# This is now 0 by default since it seems to confuse the hell out of people
# and generate a lot of extra noise on bugzilla. If you need to build with
# EGL, do 'make linux-dri USING_EGL=1'
USING_EGL=0
# Directories
ifeq ($(USING_EGL), 1)
SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
PROGRAM_DIRS = egl
else
SRC_DIRS = glx/x11 mesa glu glut/glx glw
PROGRAM_DIRS =
endif
DRIVER_DIRS = dri
PROGRAM_DIRS =
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 = i810 i830 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb

View File

@@ -13,5 +13,5 @@ ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = dri_client mach64 r128 r200 radeon tdfx
DRI_DIRS = mach64 r128 r200 r300 radeon tdfx

View File

@@ -19,5 +19,5 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# the new interface. i810 and i830 are missing because there is no x86-64
# system where they could *ever* be used.
#
DRI_DIRS = dri_client i915 mach64 mga r128 r200 radeon tdfx unichrome savage
DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300

49
configs/linux-indirect Normal file
View File

@@ -0,0 +1,49 @@
# -*-makefile-*-
# Configuration for linux-indirect: Builds a libGL capable of indirect
# rendering, but *NOT* capable of direct rendering.
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
WARN_FLAGS = -Wall
OPT_FLAGS = -O -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 \
-DPTHREADS -DHAVE_ALIAS
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)
ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx/x11 glu glut/glx glw
DRIVER_DIRS =
PROGRAM_DIRS =
WINDOW_SYSTEM=dri

View File

@@ -11,32 +11,33 @@ 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)
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR)
GL_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
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 = egl mesa glx/mini glu glut/mini
SRC_DIRS = glx/mini mesa glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx egl
PROGRAM_DIRS = miniglx
#DRI_DIRS = ffb gamma sis savage
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb

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 $

37
docs/RELNOTES-6.3.2 Normal file
View File

@@ -0,0 +1,37 @@
Mesa 6.3.2 Release Notes
August 19, 2005
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.
6.3.2 is primarily a bug-fix release. See the VERSIONS file for details.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
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.2,v 3.2 2005/08/19 16:57:50 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,25 @@ 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
This was an intermediate release for X.org which wasn't otherwise released.
6.3.2 August 19, 2005
New:
- The distribution now includes the DRI drivers and GLX code
Changes:
- Made the DRI "new" driver interface standard, remove old code
Bug fixes:
- GL_ARB_vertex/fragment_shader were mistakenly listed in the
extensions string
- negative relative addressing in vertex programs was broken
- update/fix SPARC assembly code for vertex transformation
- fixed memory leak when freeing GLX drawables/renderbuffers
- fixed display list memory leak
- the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer
- wglGetProcAddress() didn't handle wgl-functions
- fixed glxext.h cross-compile issue (Colin Harrison)
- assorted DRI driver fixes

View File

@@ -38,7 +38,7 @@ a:visited {
<b>Download / Install</b>
<ul>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.2.1)</a>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Devel Release (6.3)</a>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Devel Release (6.3.2)</a>
<li><a href="download.html" target="MainFrame">Downloading/Unpacking</a>
<li><a href="install.html" target="MainFrame">Compilation/Installation</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
@@ -82,6 +82,7 @@ a:visited {
<ul>
<li><a href="http://www.opengl.org" target="_parent">OpenGL website</a>
<li><a href="http://dri.sourceforge.net" target="_parent">DRI website</a>
<li><a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>
<li><a href="games.html" target="MainFrame">Games and Entertainment</a>
<li><a href="libraries.html" target="MainFrame">Libraries and Toolkits</a>
<li><a href="modelers.html" target="MainFrame">Modeling and Rendering</a>

View File

@@ -16,7 +16,9 @@ Mesa supports the following environment variables:
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
<li>MESA_DEBUG - if set, error messages are printed to stderr
<li>MESA_DEBUG - if set, error messages are printed to stderr.
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
generate exceptions.
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
</ul>

View File

@@ -24,7 +24,7 @@ We're no longer developing the original Mesa GLU library.
</p>
<p>
The new SI GLU library code is included in the Mesa package.
The SI GLU library code is included in the Mesa distribution.
You don't have to download it separately.
</p>

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

@@ -146,7 +146,8 @@ I continue to enhance Mesa with new extensions and features.
<p>
This is a summary of the major versions of Mesa. Note that Mesa's major
version number tracks OpenGL's minor version number.
version number tracks OpenGL's minor version number (+1).
Work is underway to implement the OpenGL 2.0 specification.
</p>
@@ -162,10 +163,11 @@ extensions incorporated as standard features:
</ul>
<p>
Also note that several OpenGL tokens were renamed in OpenGL 1.5
for the sake of consistency. The old names will still be valid.
for the sake of consistency.
The old tokens are still available.
</p>
<pre>
New Name Old Name
New Token Old Token
------------------------------------------------------------
GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
GL_FOG_COORD GL_FOG_COORDINATE

View File

@@ -13,17 +13,18 @@ The Mesa distribution consists of several components. Different copyrights
and licenses apply to different components. For example, GLUT is copyrighted
by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa
device drivers are copyrighted by their authors. See below for a list of
Mesa's components and the copyright/license for each.
Mesa's main components and the license for each.
</p>
<p>
The core Mesa library is licensed according to the terms of the XFree86
copyright (an MIT-style license). This allows integration with the
XFree86/DRI project. Unless otherwise stated, the Mesa source code and
documentation is licensed as follows:
The core Mesa library is licensed according to the terms of the MIT license.
This allows integration with the XFree86, Xorg and DRI projects.
</p>
<p>
The default Mesa license is as follows:
</p>
<pre>
Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -47,70 +48,38 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<H1>Attention, Contributors</H1>
<p>
When contributing to the Mesa project you must agree to relinquish your
work to the holder of the copyright for the particular component you're
contributing to. That is, you can't put your own copyright on the code,
unless it's a modular piece that can be omitted from Mesa (like a new
device driver). If for example, you contribute a bug fix to Mesa's
texture mapping code, your code will become a part of the body of work
which is copyrighted by Brian Paul and licensed by the above terms.
When contributing to the Mesa project you must agree to the licensing terms
of the component to which you're contributing.
The following section lists the primary comonents of the Mesa distribution
and their respective licenses.
</p>
<H1>Mesa Component Licenses</H1>
<pre>
Mesa Component Licenses:
Component Files Primary Author License
Component Location Primary Author License
----------------------------------------------------------------------------
core Mesa code src/*.[ch] Brian Paul Mesa
include/GL/gl.h
Main Mesa code src/mesa/ Brian Paul Mesa (MIT)
GLX driver src/X/* Brian Paul Mesa
include/GL/glx.h
include/GL/xmesa.h
Device drivers src/mesa/drivers/* See drivers See drivers
OS/Mesa driver src/OSmesa/* Brian Paul Mesa
include/GL/osmesa.h
Ext headers include/GL/glext.h SGI SGI Free B
include/GL/glxext.h
3Dfx driver src/FX/* David Bucciarelli Mesa
include/GL/fxmesa.h
GLUT src/glut/ Mark Kilgard Mark's copyright
BeOS R4 driver src/BeOS/* Brian Paul Mesa
Mesa GLU library src/glu/mesa/ Brian Paul GNU-LGPL
MGL driver src/MGL/* SciTech, Inc SciTech copyright
include/GL/mglmesa.h
SGI GLU library src/glu/sgi/ SGI SGI Free B
Windows driver src/Windows/* Li Wei copyright by Li Wei
include/GL/wmesa.h
demo programs progs/demos/ various see source files
SVGA driver src/SVGA/* Brian Paul GNU-LGPL
include/GL/svgamesa.h
X demos progs/xdemos/ Brian Paul see source files
DOS driver src/DOS/* Charlie Wallace GNU-LGPL
include/GL/dosmesa.h
SGI demos progs/samples/ SGI SGI copyright
GGI driver src/GGI/* Uwe Maurer GNU-LGPL
include/GL/ggimesa.h
S3 driver src/S3/* S3, Inc. S3 copyright
GLUT src-glut/* Mark Kilgard Mark's copyright
include/GL/*glut*.h
GLU library src-glu/* Brian Paul GNU-LGPL
SI GLU library si-glu/* SGI SGI Free B
include/GL/glu.h
Ext registry include/GL/glext.h SGI SGI Free B
include/GL/glxext.h
demo programs demos/* various see source files
X demos xdemos/* Brian Paul see source files
SGI demos samples/* SGI SGI copyright
RedBook demos book/* SGI SGI copyright
RedBook demos progs/redbook/ SGI SGI copyright
</pre>
</body>

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

@@ -11,6 +11,36 @@
<H1>News</H1>
<h2>August 19, 2005</h2>
<p>
Mesa 6.3.2 has been released.
Note: there was no public release of version 6.3.1.
</p>
<pre>
New:
- The distribution now includes the DRI drivers and GLX code
Changes:
- Made the DRI "new" driver interface standard, remove old code
Bug fixes:
- GL_ARB_vertex/fragment_shader were mistakenly listed in the
extensions string
- negative relative addressing in vertex programs was broken
- update/fix SPARC assembly code for vertex transformation
- fixed memory leak when freeing GLX drawables/renderbuffers
- fixed display list memory leak
- the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer
- wglGetProcAddress() didn't handle wgl-functions
- fixed glxext.h cross-compile issue (Colin Harrison)
- assorted DRI driver fixes
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
(tbd)
</pre>
<h2>July 20, 2005</h2>
<p>
Mesa 6.3 has been released.
@@ -52,6 +82,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 +1046,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.23 2005/08/19 16:57:50 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.2">RELNOTES-6.3.2</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

@@ -14,98 +14,43 @@ supported on those systems. All you need is an ANSI C compiler and the
X development environment to use Mesa.
</p>
<p>Others have contributed drivers
for the Amiga, Apple Macintosh, BeOS, NeXT, OS/2, MS-DOS, VMS, Windows
<p>
The DRI hardware drivers for the X.org server and XFree86 provide
hardware accelerated rendering for chips from ATI, Intel, Matrox, 3dfx
and others on Linux and FreeBSD.
</p>
<p>
Drivers for other assorted platforms include:
the Amiga, Apple Macintosh, BeOS, NeXT, OS/2, MS-DOS, VMS, Windows
9x/NT, and Direct3D.
</p>
<p>
The following files describe the details for various platforms.
Be warned, some of these files (and drivers) may be very out of date.
Details about particular drivers follows.
Be warned that some drivers may be out of date and no longer function.
</p>
<UL>
<LI><A HREF="README.X11">README.X11</A> - X Window System / Unix / Linux
<LI><A HREF="README.WIN32">README.WIN32</A> - Microsoft Windows
<LI><A HREF="README.VMS">README.VMS</A> - DEC VMS
<LI><A HREF="README.GGI">README.GGI</A> - GGI
<LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
<LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
<LI><A HREF="README.BEOS">README.BEOS</A> - BeOS
<LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
<LI><A HREF="README.DJ">README.DJ</A> - DJGPP
<LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
<LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
<LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
<LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
<LI><A HREF="README.OS2">README.OS2</A> - OS/2
<LI><A HREF="README.WINDML">README.WINDML</A> - WindML
<LI>Xlib driver for the X Window System <A HREF="README.X11">(README.X11)</A>
<li><a href="http://dri.sourceforge.net/" target="_parent">
DRI hardware drivers</a> for the X window system
<LI>Microsoft Windows <A HREF="README.WIN32">(README.WIN32)</A>
<LI>DEC VMS <A HREF="README.VMS">(README.VMS)</A>
<LI>3dfx/Glide <A HREF="README.3DFX">(README.3DFX)</A>
<LI>GGI <A HREF="README.GGI">(README.GGI)</A>
<LI>Amiga Amiwin <A HREF="README.AMIWIN">(README.AMIWIN)</A>
<LI>BeOS <A HREF="README.BEOS">(README.BEOS)</A>
<LI>Direct3D driver <A HREF="README.D3D">(README.D3D)</A>
<LI>DJGPP <A HREF="README.DJ">(README.DJ)</A>
<LI>LynxOS <A HREF="README.LYNXOS">(README.LYNXOS)</A>
<LI>Mingw32 <A HREF="README.MINGW32">(README.MINGW32)</A>
<LI>NeXT <A HREF="README.NeXT">(README.NeXT)</A>
<LI>OpenStep <A HREF="README.OpenStep">(README.OpenStep)</A>
<LI>OS/2 <A HREF="README.OS2">(README.OS2)</A>
<LI>WindML <A HREF="README.WINDML">(README.WINDML)</A>
<LI><a href="http://utah-glx.sourceforge.net/" target="_parent">Utah GLX drivers</a>
</UL>
<p>
The standard Mesa distribution only supports software-based rendering, with
the exception of the 3Dfx Glide driver.
Information about other hardware support follows.
</p>
<ul>
<li>DRI-based hardware support for 3dfx, Intel, Matrox, ATI with XFree86
<blockquote>
<p>The <a href="http://dri.sourceforge.net/" target="_parent">DRI architecture</a>,
originally developed by Precision Insight, Inc. uses Mesa and
provides hardware acceleration for a number of popular chipsets.<br>
<br>
The DRI is part of XFree86 4.0 and later.
<br><br>
If you download and install XFree86 4.x you do not need to
install Mesa separately. All the important parts of Mesa
will be installed with the rest of XFree86.
</blockquote>
<li>3dfx Voodoo1, Voodoo2, Voodoo Rush, Voodoo Banshee, Voodoo3
<blockquote>
<p>All cards based on these chipsets should work with Linux and
Windows 95 via 3dfx's Glide library.
The Mesa/Glide driver is included with the Mesa distribution.
You'll need to install the Glide header files and runtime library.
</p>
<p>
David Bucciarelli wrote the original 3dfx driver for Mesa.<br>
Daryll Strauss ported Glide to Linux.
</p>
</blockquote>
<li>Matrox G200/G400, nVidia RIVA, ATI Rage Pro, Intel i810 on Linux
<blockquote>
<p>The <a href="http://utah-glx.sourceforge.net/" target="_parent">
Utah GLX project</a>
(no longer active) developed drivers for these chipsets and others.
</blockquote>
<li>Amiga Warp3D
<blockquote>
<p>Amiga systems can support 3D hardware with the Warp3D API.
See <a href="http://www.haage-partner.com/3dworld" target="_parent">here</a>.
</blockquote>
<li>Also see
<blockquote>
<p><a href="http://www.linux3d.org/" target="_parent">www.linux3d.org</a> for
other 3D hardware info for Linux.
</blockquote>
</ul>
<p>
<b><em>Note:</em></b>
If you have NVIDIA hardware in your computer,
you should download and install NVIDIA's OpenGL library. You may
however, want to download Mesa in order to use its GLU and GLUT
libraries, or assorted demo programs.</p>
</body>
</html>

View File

@@ -331,13 +331,24 @@ 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 )
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#elif defined(WIN32) && defined(__GNUC__)
#include <stdint.h>
#endif
#ifndef GLX_VERSION_1_3

View File

@@ -38,12 +38,6 @@
#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
#ifndef DRI_NEW_INTERFACE_ONLY
# include <X11/X.h>
# include <GL/glx.h>
# include "GL/glxint.h"
#endif
#include <GL/internal/glcore.h>
#include <xf86drm.h>
#include <drm.h>
@@ -62,6 +56,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 +66,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 +86,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 +104,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 +134,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 +279,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 +354,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 +361,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 +371,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

@@ -26,6 +26,7 @@
static GLint T0 = 0;
static GLint Frames = 0;
static GLint autoexit = 0;
static GLint win = 0;
/**
@@ -163,6 +164,15 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static void
cleanup(void)
{
glDeleteLists(gear1, 1);
glDeleteLists(gear2, 1);
glDeleteLists(gear3, 1);
glutDestroyWindow(win);
}
static void
draw(void)
{
@@ -198,16 +208,18 @@ draw(void)
Frames++;
{
GLint t = glutGet(GLUT_ELAPSED_TIME);
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
T0 = t;
Frames = 0;
if ((t >= 999.0 * autoexit) && (autoexit))
exit(0);
}
GLint t = glutGet(GLUT_ELAPSED_TIME);
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
T0 = t;
Frames = 0;
if ((t >= 999.0 * autoexit) && (autoexit)) {
cleanup();
exit(0);
}
}
}
}
@@ -239,6 +251,7 @@ key(unsigned char k, int x, int y)
view_rotz -= 5.0;
break;
case 27: /* Escape */
cleanup();
exit(0);
break;
default:
@@ -352,7 +365,7 @@ int main(int argc, char *argv[])
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow("Gears");
win = glutCreateWindow("Gears");
init(argc, argv);
glutDisplayFunc(draw);

View File

@@ -25,35 +25,35 @@ default: $(PROGRAMS)
demo1: demo1.o $(LIB_DIR)/libEGL.so
$(CC) demo1.o -L$(LIB_DIR) -lEGL -o $@
$(CC) $(CFLAGS) demo1.o -L$(LIB_DIR) -lEGL -o $@
demo1.o: demo1.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c
demo2: demo2.o $(LIB_DIR)/libEGL.so
$(CC) demo2.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) demo2.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
demo2.o: demo2.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c
demo3: demo3.o $(LIB_DIR)/libEGL.so
$(CC) demo3.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) demo3.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
demo3.o: demo3.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c
eglinfo: eglinfo.o $(LIB_DIR)/libEGL.so
$(CC) eglinfo.o -L$(LIB_DIR) -lEGL -o $@
$(CC) $(CFLAGS) eglinfo.o -L$(LIB_DIR) -lEGL -o $@
eglinfo.o: eglinfo.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
eglgears: eglgears.o $(LIB_DIR)/libEGL.so
$(CC) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
$(CC) $(CFLAGS) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
eglgears.o: eglgears.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c

View File

@@ -576,7 +576,7 @@ main(int argc, char *argv[])
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
EGLDisplay d = eglGetDisplay("!fb_dri");
EGLDisplay d = eglGetDisplay(":0");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -602,7 +602,7 @@ main(int argc, char *argv[])
printf("failed to create screen surface\n");
return 0;
}
eglShowSurfaceMESA(d, screen, screen_surf, mode);
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
@@ -610,25 +610,24 @@ main(int argc, char *argv[])
printf("make current failed\n");
return 0;
}
glViewport(0, 0, 1024, 768);
Init();
Init();
Reshape(1024, 768);
glDrawBuffer( GL_FRONT );
glClearColor( 0,
1.0,
0,
1);
glDrawBuffer( GL_FRONT );
glClearColor( 0, 1.0, 0, 1);
glClear( GL_COLOR_BUFFER_BIT );
glClear( GL_COLOR_BUFFER_BIT );
doubleBuffer = 1;
glDrawBuffer( GL_BACK );
doubleBuffer = 1;
glDrawBuffer( GL_BACK );
Draw(d, screen_surf);
write_ppm("dump.ppm", ((struct fb_display *)_eglLookupDisplay(d))->pFB, 1024, 768);
eglDestroySurface(d, screen_surf);
eglDestroyContext(d, ctx);
eglTerminate(d);

View File

@@ -87,9 +87,9 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static GLfloat eyesep = 5.0; /* Eye separation. */
static GLfloat fix_point = 40.0; /* Fixation point distance. */
static GLfloat left, right, asp; /* Stereo frustum params. */
//static GLfloat eyesep = 5.0; /* Eye separation. */
//static GLfloat fix_point = 40.0; /* Fixation point distance. */
//static GLfloat left, right, asp; /* Stereo frustum params. */
/*
@@ -385,7 +385,7 @@ main(int argc, char *argv[])
}
// DBR : Create EGL context/surface etc
EGLDisplay d = eglGetDisplay("!fb_dri");
EGLDisplay d = eglGetDisplay(":0");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -431,7 +431,9 @@ main(int argc, char *argv[])
init(); // Initialise the GL visual
reshape(1024,768);
glDrawBuffer( GL_BACK );
// DBR : Run the simulation
run_gears(d, screen_surf, 5.0);

View File

@@ -136,7 +136,7 @@ main(int argc, char *argv[])
{
int maj, min;
/*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
EGLDisplay d = eglGetDisplay("!fb_dri");
EGLDisplay d = eglGetDisplay("!r200_dri");
if (!eglInitialize(d, &maj, &min)) {
printf("eglinfo: eglInitialize failed\n");

View File

@@ -23,6 +23,7 @@ SOURCES = antialias.c \
blendsquare.c \
bufferobj.c \
bug_3101.c \
bug_3195.c \
crossbar.c \
cva.c \
dinoshade.c \
@@ -104,6 +105,12 @@ texrect: texrect.o readtex.o
texrect.o: texrect.c readtex.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
bug_3195: bug_3195.o readtex.o
$(CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
bug_3195.o: bug_3195.c readtex.h
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
invert: invert.o readtex.o
$(CC) invert.o readtex.o $(LIBS) -o $@

275
progs/tests/bug_3195.c Normal file
View File

@@ -0,0 +1,275 @@
/*
* Copyright (C) 2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, 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:
*
* 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.
*/
/**
* \file bug_3195.c
*
* Simple regression test for bug #3195. A bug in the i180 driver caused
* a segfault (inside the driver) when the LOD bias is adjusted and no texture
* is enabled. This test, which is based on progs/demos/lodbias.c, sets up
* all the texturing, disables all textures, adjusts the LOD bias, then
* re-enables \c GL_TEXTURE_2D.
*
* \author Brian Paul
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/glut.h>
#include <GL/glext.h>
#include "readtex.h"
#define TEXTURE_FILE "../images/girl.rgb"
static GLfloat Xrot = 0, Yrot = -30, Zrot = 0;
static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
static GLint BiasMin = -400, BiasMax = 400;
static void
PrintString(const char *s)
{
while (*s) {
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
s++;
}
}
static void Idle( void )
{
static int lastTime = 0;
int time = glutGet(GLUT_ELAPSED_TIME);
int step;
if (lastTime == 0)
lastTime = time;
else if (time - lastTime < 10)
return;
step = (time - lastTime) / 10 * BiasStepSign;
lastTime = time;
Bias += step;
if (Bias < BiasMin) {
exit(0);
}
else if (Bias > BiasMax) {
Bias = BiasMax;
BiasStepSign = -1;
}
glutPostRedisplay();
}
static void Display( void )
{
char str[100];
glClear( GL_COLOR_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho(-1, 1, -1, 1, -1, 1);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glDisable(GL_TEXTURE_2D);
glColor3f(1,1,1);
glRasterPos3f(-0.9, -0.9, 0.0);
sprintf(str, "Texture LOD Bias = %4.1f", Bias * 0.01);
PrintString(str);
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -8.0 );
glPushMatrix();
glRotatef(Xrot, 1, 0, 0);
glRotatef(Yrot, 0, 1, 0);
glRotatef(Zrot, 0, 0, 1);
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0.01 * Bias);
glEnable(GL_TEXTURE_2D);
glBegin(GL_POLYGON);
glTexCoord2f(0, 0); glVertex2f(-1, -1);
glTexCoord2f(2, 0); glVertex2f( 1, -1);
glTexCoord2f(2, 2); glVertex2f( 1, 1);
glTexCoord2f(0, 2); glVertex2f(-1, 1);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
glViewport( 0, 0, width, height );
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void SpecialKey( int key, int x, int y )
{
const GLfloat step = 3.0;
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
Xrot -= step;
break;
case GLUT_KEY_DOWN:
Xrot += step;
break;
case GLUT_KEY_LEFT:
Yrot -= step;
break;
case GLUT_KEY_RIGHT:
Yrot += step;
break;
}
glutPostRedisplay();
}
static void Init( void )
{
GLfloat maxBias;
const char * const ver_string = (const char * const)
glGetString( GL_VERSION );
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", ver_string);
printf("\nThis program should function nearly identically to Mesa's lodbias demo.\n"
"It should cycle through the complet LOD bias range once and exit. If bug\n"
"#3195 still exists, the demo should crash almost immediatly.\n");
printf("This is a regression test for bug #3101.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) {
printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");
exit(1);
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (glutExtensionSupported("GL_SGIS_generate_mipmap")) {
/* test auto mipmap generation */
GLint width, height, i;
GLenum format;
GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
if (!image) {
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
exit(1);
}
/* resize to 256 x 256 */
if (width != 256 || height != 256) {
GLubyte *newImage = malloc(256 * 256 * 4);
gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
256, 256, GL_UNSIGNED_BYTE, newImage);
free(image);
image = newImage;
}
printf("Using GL_SGIS_generate_mipmap\n");
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, format, 256, 256, 0,
format, GL_UNSIGNED_BYTE, image);
free(image);
/* make sure mipmap was really generated correctly */
width = height = 256;
for (i = 0; i < 9; i++) {
GLint w, h;
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
printf("Level %d size: %d x %d\n", i, w, h);
assert(w == width);
assert(h == height);
width /= 2;
height /= 2;
}
}
else if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
exit(1);
}
/* mipmapping required for this extension */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);
printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias);
BiasMin = -100 * maxBias;
BiasMax = 100 * maxBias;
/* Since we have (about) 8 mipmap levels, no need to bias beyond
* the range [-1, +8].
*/
if (BiasMin < -100)
BiasMin = -100;
if (BiasMax > 800)
BiasMax = 800;
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 350, 350 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3195 Test" );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutIdleFunc(Idle);
Init();
glutMainLoop();
return 0;
}

View File

@@ -10,28 +10,94 @@
#include <math.h>
#include <GL/glut.h>
GLboolean wrapping;
static void RunTest(void)
{
const GLenum prim = GL_QUAD_STRIP;
GLubyte val;
int bits, max, i;
int expected;
GLboolean failed;
glGetIntegerv(GL_STENCIL_BITS, &bits);
max = (1 << bits) - 1;
glClearStencil(0);
glEnable(GL_STENCIL_TEST);
glStencilFunc(GL_ALWAYS, 0, ~0);
/* test GL_KEEP */
glClearStencil(max);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
failed = GL_FALSE;
printf("Testing GL_KEEP...\n");
expected = max;
glBegin(prim);
glVertex2f(0, 0);
glVertex2f(10, 0);
glVertex2f(0, 10);
glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf("Failed GL_KEEP test(got %u, expected %u)\n", val, expected);
failed = GL_TRUE;
}
else
printf("OK!\n");
/* test GL_ZERO */
glClearStencil(max);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);
failed = GL_FALSE;
printf("Testing GL_ZERO...\n");
expected = 0;
glBegin(prim);
glVertex2f(0, 0);
glVertex2f(10, 0);
glVertex2f(0, 10);
glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf("Failed GL_ZERO test(got %u, expected %u)\n", val, expected);
failed = GL_TRUE;
}
else
printf("OK!\n");
/* test GL_REPLACE */
glClearStencil(max);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
failed = GL_FALSE;
printf("Testing GL_REPLACE...\n");
expected = 0;
glBegin(prim);
glVertex2f(0, 0);
glVertex2f(10, 0);
glVertex2f(0, 10);
glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf("Failed GL_REPLACE test(got %u, expected %u)\n", val, expected);
failed = GL_TRUE;
}
else
printf("OK!\n");
/* test GL_INCR (saturation) */
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
failed = GL_FALSE;
printf("Testing GL_INCR...\n");
for (i = 1; i < max+10; i++) {
int expected = (i > max) ? max : i;
expected = (i > max) ? max : i;
glBegin(prim);
glVertex2f(0, 0); glVertex2f(10, 0);
glVertex2f(0, 10); glVertex2f(10, 10);
@@ -44,39 +110,17 @@ static void RunTest(void)
failed = GL_TRUE;
}
}
if ( !failed )
printf("OK!\n");
if ( !failed ) printf("OK!\n");
/* test GL_INCR_WRAP_EXT (wrap around) */
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
failed = GL_FALSE;
printf("Testing GL_INCR_WRAP_EXT...\n");
for (i = 1; i < max+10; i++) {
int expected = i % (max + 1);
glBegin(prim);
glVertex2f(0, 0); glVertex2f(10, 0);
glVertex2f(0, 10); glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf( "Failed GL_INCR_WRAP test on iteration #%u "
"(got %u, expected %u)\n", i, val, expected );
failed = GL_TRUE;
}
}
if ( !failed ) printf("OK!\n");
/* test GL_DECR (saturation) */
glClearStencil(max);
/* test GL_INCR (saturation) */
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR);
failed = GL_FALSE;
printf("Testing GL_DECR...\n");
for (i = max-1; i > -10; i--) {
int expected = (i < 0) ? 0 : i;
expected = (i < 0) ? 0 : i;
glBegin(prim);
glVertex2f(0, 0); glVertex2f(10, 0);
glVertex2f(0, 10); glVertex2f(10, 10);
@@ -88,27 +132,76 @@ static void RunTest(void)
failed = GL_TRUE;
}
}
if ( !failed ) printf("OK!\n");
if ( !failed )
printf("OK!\n");
/* test GL_INCR_WRAP_EXT (wrap-around) */
/* test GL_INVERT */
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT);
failed = GL_FALSE;
printf("Testing GL_DECR_WRAP_EXT...\n");
for (i = max-1; i > -10; i--) {
int expected = (i < 0) ? max + i + 1: i;
glBegin(prim);
glVertex2f(0, 0); glVertex2f(10, 0);
glVertex2f(0, 10); glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf( "Failed GL_DECR_WRAP test on iteration #%u "
"(got %u, expected %u)\n", max - i, val, expected );
failed = GL_TRUE;
}
printf("Testing GL_INVERT...\n");
expected = max;
glBegin(prim);
glVertex2f(0, 0);
glVertex2f(10, 0);
glVertex2f(0, 10);
glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf("Failed GL_INVERT test(got %u, expected %u)\n", val, expected);
failed = GL_TRUE;
}
else
printf("OK!\n");
if(wrapping)
{
/* test GL_INCR_WRAP_EXT (wrap around) */
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
failed = GL_FALSE;
printf("Testing GL_INCR_WRAP_EXT...\n");
for (i = 1; i < max+10; i++) {
expected = i % (max + 1);
glBegin(prim);
glVertex2f(0, 0); glVertex2f(10, 0);
glVertex2f(0, 10); glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf( "Failed GL_INCR_WRAP test on iteration #%u "
"(got %u, expected %u)\n", i, val, expected );
failed = GL_TRUE;
}
}
if ( !failed )
printf("OK!\n");
/* test GL_DECR_WRAP_EXT (wrap-around) */
glClearStencil(max);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
failed = GL_FALSE;
printf("Testing GL_DECR_WRAP_EXT...\n");
for (i = max-1; i > -10; i--) {
expected = (i < 0) ? max + i + 1: i;
glBegin(prim);
glVertex2f(0, 0); glVertex2f(10, 0);
glVertex2f(0, 10); glVertex2f(10, 10);
glEnd();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val);
if (val != expected) {
printf( "Failed GL_DECR_WRAP test on iteration #%u "
"(got %u, expected %u)\n", max - i, val, expected );
failed = GL_TRUE;
}
}
if ( !failed )
printf("OK!\n");
}
if ( !failed ) printf("OK!\n");
glDisable(GL_STENCIL_TEST);
}
@@ -158,7 +251,7 @@ static void Init( void )
/* Check for both the extension string and GL version 1.4 on the
* outside chance that some silly vendor exports version 1.4 but doesn't
* outside chance that some vendor exports version 1.4 but doesn't
* export the extension string. The stencil-wrap modes are a required
* part of GL 1.4.
*/
@@ -166,11 +259,9 @@ static void Init( void )
ver_str = glGetString( GL_VERSION );
version = (ver_str == NULL) ? 1.0 : atof( ver_str );
if ( !glutExtensionSupported("GL_EXT_stencil_wrap")
&& (version < 1.4) ) {
printf("Sorry, GL_EXT_stencil_wrap not supported.\n");
exit(1);
}
wrapping = (glutExtensionSupported("GL_EXT_stencil_wrap") || (version >= 1.4));
if (!wrapping)
printf("GL_EXT_stencil_wrap not supported. Only testing the rest.\n");
}

View File

@@ -590,6 +590,9 @@ main(int argc, char *argv[])
event_loop(dpy, win);
glDeleteLists(gear1, 1);
glDeleteLists(gear2, 1);
glDeleteLists(gear3, 1);
glXDestroyContext(dpy, ctx);
XDestroyWindow(dpy, win);
XCloseDisplay(dpy);

View File

@@ -2,7 +2,7 @@
TOP = ../..
SUBDIRS = main drivers/demo
SUBDIRS = main drivers/demo drivers/dri
default: subdirs

View File

@@ -286,19 +286,12 @@ demoMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface rea
}
/*
* Just to silence warning
*/
extern _EGLDriver *
_eglMain(NativeDisplayType dpy);
/**
* The bootstrap function. Return a new DemoDriver object and
* plug in API functions.
*/
_EGLDriver *
_eglMain(NativeDisplayType dpy)
_eglMain(_EGLDisplay *dpy)
{
DemoDriver *demo;

View File

@@ -0,0 +1,64 @@
# src/egl/drivers/dri/Makefile
TOP = ../../../..
include $(TOP)/configs/current
### Include directories
INCLUDE_DIRS = \
-I. \
-I$(DRM_SOURCE_PATH)/shared-core \
-I$(DRM_SOURCE_PATH)/libdrm \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/shader \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/mesa/drivers/dri/common
HEADERS = egldri.h
SOURCES = egldri.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drm.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmHash.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmRandom.c
OBJECTS = $(SOURCES:.c=.o)
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
default: depend library Makefile
# EGLdri Library
library: $(LIB_DIR)/libEGLdri.so
$(LIB_DIR)/libEGLdri.so: $(OBJECTS)
$(TOP)/bin/mklib -o EGLdri -major 1 -minor 0 \
-install $(LIB_DIR) -ldl $(OBJECTS)
clean:
rm -f *.o
rm -f *.so
depend: $(SOURCES) $(HEADERS)
@ echo "running $(MKDEP)"
@ touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
$(SOURCES) $(HEADERS) > /dev/null
include depend
# DO NOT DELETE

1001
src/egl/drivers/dri/egldri.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,113 @@
#ifndef EGLDRI_INCLUDED
#define EGLDRI_INCLUDED
#include "egldisplay.h"
#include "eglscreen.h"
#include "eglsurface.h"
#include "eglcontext.h"
#include "mtypes.h"
#include "dri_util.h"
#include "drm_sarea.h"
/**
* dri display-specific driver class derived from _EGLDisplay
*/
typedef struct dri_display
{
_EGLDisplay Base; /* base class/object */
void *pFB;
int drmFD; /**< \brief DRM device file descriptor */
int minor;
unsigned long hFrameBuffer;
int virtualWidth;
int virtualHeight;
int fbSize;
int bpp;
int cpp;
int isPCI;
int SAREASize;
drm_sarea_t *pSAREA;
unsigned int serverContext; /**< \brief DRM context only active on server */
unsigned long FBStart; /**< \brief physical address of the framebuffer */
void *driverClientMsg;
int driverClientMsgSize;
int chipset;
void *driverPrivate;
drm_magic_t magic;
__GLcontextModes *driver_modes;
__DRIscreen driScreen;
} driDisplay;
/**
* dri driver-specific screen class derived from _EGLScreen
*/
typedef struct dri_screen
{
_EGLScreen Base;
char fb[NAME_MAX];
} driScreen;
/**
* dri driver-specific surface class derived from _EGLSurface
*/
typedef struct dri_surface
{
_EGLSurface Base; /* base class/object */
__DRIdrawable drawable;
} driSurface;
/**
* dri driver-specific context class derived from _EGLContext
*/
typedef struct dri_context
{
_EGLContext Base; /* base class/object */
__DRIcontext driContext; /**< \brief context dependent methods */
} driContext;
static inline driDisplay *
Lookup_driDisplay(EGLDisplay dpy)
{
_EGLDisplay *d = _eglLookupDisplay(dpy);
return (driDisplay *) d;
}
static inline driScreen *
Lookup_driScreen(EGLDisplay dpy, EGLScreenMESA screen)
{
_EGLScreen *s = _eglLookupScreen(dpy, screen);
return (driScreen *) s;
}
static inline driContext *
Lookup_driContext(EGLContext ctx)
{
_EGLContext *c = _eglLookupContext(ctx);
return (driContext *) c;
}
static inline driSurface *
Lookup_driSurface(EGLSurface surf)
{
_EGLSurface *s = _eglLookupSurface(surf);
return (driSurface *) s;
}
extern void _eglDRIInitDriverFallbacks(_EGLDriver *drv);
extern EGLBoolean _eglDRIShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA m);
extern EGLBoolean _eglDRIInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor);
extern EGLBoolean _eglDRIGetDisplayInfo(driDisplay *dpy);
extern EGLBoolean _eglDRICreateDisplay(driDisplay *dpy, __DRIframebuffer *framebuffer);
extern EGLBoolean _eglDRICreateScreen(driDisplay *dpy);
#endif /* EGLDRI_INCLUDED */

View File

@@ -45,7 +45,7 @@ _eglChooseDriver(EGLDisplay display)
else if (name[0] == ':' && (name[1] >= '0' && name[1] <= '9') && !name[2]) {
printf("EGL: Use driver for screen: %s\n", name);
/* XXX probe hardware here to determine which driver to open */
/* driverName = "something"; */
driverName = "libEGLdri";
}
else if (name[0] == '!') {
/* use specified driver name */
@@ -71,44 +71,40 @@ _eglChooseDriver(EGLDisplay display)
_EGLDriver *
_eglOpenDriver(_EGLDisplay *dpy, const char *driverName)
{
_EGLDriver *drv;
_EGLMain_t mainFunc;
void *lib;
char driverFilename[1000];
/* XXX also prepend a directory path??? */
sprintf(driverFilename, "%s.so", driverName);
#if 1
lib = dlopen(driverFilename, RTLD_NOW);
if (lib) {
_EGLDriver *drv;
_EGLMain_t mainFunc;
mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain");
if (!mainFunc) {
fprintf(stderr, "_eglMain not found in %s", (char *) driverFilename);
dlclose(lib);
return NULL;
}
drv = mainFunc(dpy);
if (!drv) {
dlclose(lib);
return NULL;
}
drv->LibHandle = lib;
drv->Display = dpy;
return drv;
}
else {
fprintf(stderr, "EGLdebug: Error opening %s: %s\n",
driverFilename, dlerror());
if (!lib) {
fprintf(stderr, "EGLdebug: Error opening %s: %s\n", driverFilename, dlerror());
return NULL;
}
#else
/* use built-in driver */
return _eglDefaultMain(d);
#endif
mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain");
if (!mainFunc) {
fprintf(stderr, "_eglMain not found in %s", (char *) driverFilename);
dlclose(lib);
return NULL;
}
drv = mainFunc(dpy);
if (!drv) {
dlclose(lib);
return NULL;
}
/* with a recurvise open you want the inner most handle */
if (!drv->LibHandle)
drv->LibHandle = lib;
else
dlclose(lib);
drv->Display = dpy;
return drv;
}

View File

@@ -125,10 +125,7 @@ struct _egl_driver
};
extern _EGLDriver *
_eglDefaultMain(NativeDisplayType d);
extern _EGLDriver *_eglMain(_EGLDisplay *dpy);
extern _EGLDriver *

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

@@ -5,7 +5,7 @@ TOP = ../../..
include $(TOP)/configs/current
DEFINES += -DGLX_DIRECT_RENDERING
DEFINES += -DGLX_DIRECT_RENDERING -DIN_MINI_GLX -UIN_DRI_DRIVER
C_SOURCES = \
$(TOP)/src/mesa/main/dispatch.c \
@@ -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

@@ -68,6 +68,8 @@ typedef struct DRIDriverContextRec {
int cpp;
int agpmode;
int isPCI;
int colorTiling; /**< \brief color tiling is enabled */
unsigned long FBStart; /**< \brief physical address of the framebuffer */
unsigned long MMIOStart; /**< \brief physical address of the MMIO region */

View File

@@ -30,3 +30,7 @@ agpmode=1
# Rotated monitor? -- NOTE: only works with subsetted radeon driver!
rotateMode=0
# Do we want to use color tiling ?
colorTiling=0

View File

@@ -104,6 +104,7 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/time.h> /* for gettimeofday */
#include <linux/kd.h>
#include <linux/vt.h>
@@ -115,17 +116,35 @@
#include "glapi.h"
extern GLboolean __glXCreateContextWithConfig(__DRInativeDisplay *dpy,
static GLboolean __glXCreateContextWithConfig(__DRInativeDisplay *dpy,
int screen, int fbconfigID, void *contextID,
drm_context_t *hHWContext);
extern GLboolean __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
static GLboolean __glXGetDrawableInfo(__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);
static __DRIscreen * __glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
static GLboolean __glXWindowExists(__DRInativeDisplay *dpy, __DRIid draw);
static int __glXGetUST( int64_t * ust );
static GLboolean __glXGetMscRate(__DRInativeDisplay * dpy, __DRIid drawable,
int32_t * numerator, int32_t * denominator);
static GLboolean xf86DRI_DestroyContext(__DRInativeDisplay *dpy, int screen,
__DRIid context_id );
static GLboolean xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen,
__DRIid drawable, drm_drawable_t *hHWDrawable );
static GLboolean xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen,
__DRIid drawable);
/** Wrapper around either malloc() */
void *
@@ -418,6 +437,8 @@ SetupFBDev( Display *dpy )
width = dpy->driverContext.shared.virtualWidth;
height = dpy->driverContext.shared.virtualHeight;
if (width==832)
width=800;
/* Bump size up to next supported mode.
*/
if (width <= 720 && height <= 480) {
@@ -440,8 +461,6 @@ SetupFBDev( Display *dpy )
}
dpy->driverContext.shared.virtualHeight = height;
dpy->driverContext.shared.virtualWidth = width;
dpy->driverContext.shared.fbStride = width * (dpy->driverContext.bpp / 8);
/* set the depth, resolution, etc */
@@ -726,7 +745,7 @@ CloseFBDev( Display *dpy )
* \internal
* Returns the MiniGLXDisplayRec::driScreen attribute.
*/
__DRIscreen *
static __DRIscreen *
__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn)
{
(void) scrn;
@@ -743,11 +762,11 @@ __glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn)
* Since Mini GLX only supports one window, compares the specified drawable with
* the MiniGLXDisplayRec::TheWindow attribute.
*/
Bool
__glXWindowExists(__DRInativeDisplay *dpy, GLXDrawable draw)
static GLboolean
__glXWindowExists(__DRInativeDisplay *dpy, __DRIid draw)
{
Display* display = (Display*)dpy;
if (display->TheWindow == draw)
const Display * const display = (Display*)dpy;
if (display->TheWindow == (Window) draw)
return True;
else
return False;
@@ -859,6 +878,7 @@ static int __read_config_file( Display *dpy )
dpy->rotateMode = 0;
dpy->driverContext.agpmode = 1;
dpy->driverContext.isPCI = 0;
dpy->driverContext.colorTiling = 0;
fname = getenv("MINIGLX_CONF");
if (!fname) fname = "/etc/miniglx.conf";
@@ -931,6 +951,9 @@ static int __read_config_file( Display *dpy )
else if (strcmp(opt, "isPCI") == 0) {
dpy->driverContext.isPCI = atoi(val) ? 1 : 0;
}
else if (strcmp(opt, "colorTiling") == 0) {
dpy->driverContext.colorTiling = atoi(val) ? 1 : 0;
}
}
fclose(file);
@@ -941,6 +964,19 @@ static int __read_config_file( Display *dpy )
return 1;
}
/**
* 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";
static int InitDriver( Display *dpy )
{
/*
@@ -968,9 +1004,9 @@ static int InitDriver( Display *dpy )
/* Pull in standard DRI client-side driver hooks:
*/
dpy->createNewScreen = (PFNCREATENEWSCREENFUNC)
dlsym(dpy->dlHandle, "__driCreateNewScreen");
dlsym(dpy->dlHandle, createNewScreenName);
if (!dpy->createNewScreen) {
fprintf(stderr, "Couldn't find __driCreateScreen in %s\n",
fprintf(stderr, "Couldn't find %s in %s\n", createNewScreenName,
dpy->clientDriverName);
goto failed;
}
@@ -1083,10 +1119,43 @@ __miniglx_StartServer( const char *display_name )
}
/**
* Implement \c __DRIinterfaceMethods::getProcAddress.
*/
static __DRIfuncPtr get_proc_address( const char * proc_name )
{
(void) proc_name;
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,
__glXCreateContextWithConfig,
xf86DRI_DestroyContext,
xf86DRI_CreateDrawable,
xf86DRI_DestroyDrawable,
__glXGetDrawableInfo,
__glXGetUST,
__glXGetMscRate,
};
static void *
CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
{
int directCapable;
void *psp = NULL;
drm_handle_t hSAREA;
drmAddress pSAREA;
@@ -1102,11 +1171,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
const char * err_extra;
drmVersionPtr version;
drm_handle_t hFB;
int junk;
drm_magic_t magic;
err_msg = "XF86DRIOpenConnection";
err_extra = NULL;
hSAREA = dpy->driverContext.shared.hSAREA;
BusID = dpy->driverContext.pciBusID;
@@ -1149,7 +1215,6 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
* We'll check the version in each DRI driver's "createScreen"
* function.
*/
err_msg = "XF86DRIGetClientDriverName";
ddx_version.major = 4;
ddx_version.minor = 0;
ddx_version.patch = 0;
@@ -1157,7 +1222,6 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
/*
* Get the DRI X extension version.
*/
err_msg = "XF86DRIQueryVersion";
dri_version.major = 4;
dri_version.minor = 0;
dri_version.patch = 0;
@@ -1168,7 +1232,6 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
* that has information about the screen size, depth, pitch,
* ancilliary buffers, DRM mmap handles, etc.
*/
err_msg = "XF86DRIGetDeviceInfo";
hFB = dpy->driverContext.shared.hFrameBuffer;
framebuffer.size = dpy->driverContext.shared.fbSize;
framebuffer.stride = dpy->driverContext.shared.fbStride;
@@ -1198,11 +1261,6 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
err_extra = strerror( -status );
if ( status == 0 ) {
PFNGLXGETINTERNALVERSIONPROC get_ver;
get_ver = (PFNGLXGETINTERNALVERSIONPROC)
glXGetProcAddress( (const GLubyte *) "__glXGetInternalVersion" );
err_msg = "InitDriver";
err_extra = NULL;
psp = dpy->createNewScreen(dpy, scrn, psc, NULL,
@@ -1212,7 +1270,8 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc)
& framebuffer,
pSAREA,
fd,
(get_ver != NULL) ? (*get_ver)() : 20040602,
20050727,
& interface_methods,
(__GLcontextModes **) &dpy->driver_modes);
/* fill in dummy visual ids */
@@ -2083,7 +2142,7 @@ glXDestroyContext( Display *dpy, GLXContext ctx )
if (ctx) {
if (glxctx == ctx) {
/* destroying current context */
ctx->driContext.bindContext3(dpy, 0, 0, 0, 0);
ctx->driContext.bindContext(dpy, 0, 0, 0, 0);
CurrentContext = 0;
}
ctx->driContext.destroyContext(dpy, 0, ctx->driContext.private);
@@ -2126,20 +2185,20 @@ glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx)
GLXDrawable oldDrawable = glXGetCurrentDrawable();
/* unbind old */
if (oldContext) {
oldContext->driContext.unbindContext3(dpy, 0,
oldContext->driContext.unbindContext(dpy, 0,
(__DRIid) oldDrawable, (__DRIid) oldDrawable,
&oldContext->driContext);
}
/* bind new */
CurrentContext = ctx;
ctx->driContext.bindContext3(dpy, 0, (__DRIid) drawable,
ctx->driContext.bindContext(dpy, 0, (__DRIid) drawable,
(__DRIid) drawable, &ctx->driContext);
ctx->drawBuffer = drawable;
ctx->curBuffer = drawable;
}
else if (ctx && dpy) {
/* unbind */
ctx->driContext.bindContext3(dpy, 0, 0, 0, 0);
ctx->driContext.bindContext(dpy, 0, 0, 0, 0);
}
else if (dpy) {
CurrentContext = 0; /* kw: this seems to be intended??? */
@@ -2210,7 +2269,7 @@ glXGetCurrentDrawable( void )
}
GLboolean
static GLboolean
__glXCreateContextWithConfig(__DRInativeDisplay *dpy, int screen,
int fbconfigID, void *contextID, drm_context_t *hHWContext)
{
@@ -2236,7 +2295,7 @@ __glXCreateContextWithConfig(__DRInativeDisplay *dpy, int screen,
}
GLboolean
static GLboolean
__glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
__DRIid draw, unsigned int * index, unsigned int * stamp,
int * x, int * y, int * width, int * height,
@@ -2278,23 +2337,23 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
}
GLboolean
XF86DRIDestroyContext(__DRInativeDisplay *dpy, int screen, __DRIid context_id )
static GLboolean
xf86DRI_DestroyContext(__DRInativeDisplay *dpy, int screen, __DRIid context_id )
{
return GL_TRUE;
}
GLboolean
XF86DRICreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable,
static GLboolean
xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable,
drm_drawable_t *hHWDrawable )
{
return GL_TRUE;
}
GLboolean
XF86DRIDestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable)
static GLboolean
xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable)
{
return GL_TRUE;
}
@@ -2348,12 +2407,6 @@ void (*glXGetProcAddress(const GLubyte *procname))( void )
{ "glXDestroyPbuffer", (void *) glXDestroyPbuffer },
{ "glXChooseFBConfig", (void *) glXChooseFBConfig },
{ "glXGetVisualFromFBConfig", (void *) glXGetVisualFromFBConfig },
{ "__glXCreateContextWithConfig", (void *) __glXCreateContextWithConfig },
{ "__glXGetDrawableInfo", (void *) __glXGetDrawableInfo },
{ "__glXWindowExists", (void *) __glXWindowExists },
{ "__glXCreateContextModes", (void *) _gl_context_modes_create },
{ "__glXFindDRIScreen", (void *)__glXFindDRIScreen },
{ "__glXScrEnableExtension", (void *)__glXScrEnableExtension },
{ NULL, NULL }
};
const struct name_address *entry;
@@ -2438,32 +2491,73 @@ void *glXAllocateMemoryMESA(Display *dpy, int scrn,
size_t size, float readFreq,
float writeFreq, float priority)
{
if (dpy->driScreen.private && dpy->driScreen.allocateMemory) {
return (*dpy->driScreen.allocateMemory)( dpy, scrn, size,
readFreq, writeFreq,
priority );
}
if (dpy->driScreen.private && dpy->driScreen.allocateMemory) {
return (*dpy->driScreen.allocateMemory)( dpy, scrn, size,
readFreq, writeFreq,
priority );
}
return NULL;
}
void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer){
if (dpy->driScreen.private && dpy->driScreen.freeMemory) {
(*dpy->driScreen.freeMemory)( dpy, scrn, pointer );
}
void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer)
{
if (dpy->driScreen.private && dpy->driScreen.freeMemory) {
(*dpy->driScreen.freeMemory)( dpy, scrn, pointer );
}
}
GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn,
const void *pointer )
{
if (dpy->driScreen.private && dpy->driScreen.memoryOffset) {
return (*dpy->driScreen.memoryOffset)( dpy, scrn, pointer );
}
if (dpy->driScreen.private && dpy->driScreen.memoryOffset) {
return (*dpy->driScreen.memoryOffset)( dpy, scrn, pointer );
}
return 0;
}
void
__glXScrEnableExtension( void *psc, const char * name )
/**
* Get the unadjusted system time (UST). Currently, the UST is measured in
* microseconds since Epoc. The actual resolution of the UST may vary from
* system to system, and the units may vary from release to release.
* Drivers should not call this function directly. They should instead use
* \c glXGetProcAddress to obtain a pointer to the function.
*
* \param ust Location to store the 64-bit UST
* \returns Zero on success or a negative errno value on failure.
*
* \note
* This function was copied directly from src/glx/x11/glxcmds.c.
*/
static int __glXGetUST( int64_t * ust )
{
struct timeval tv;
if ( ust == NULL ) {
return -EFAULT;
}
if ( gettimeofday( & tv, NULL ) == 0 ) {
ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
return 0;
} else {
return -errno;
}
}
/**
*
* \bug
* This needs to be implemented for miniGlx.
*/
static GLboolean __glXGetMscRate(__DRInativeDisplay * dpy, __DRIid drawable,
int32_t * numerator, int32_t * denominator)
{
*numerator = 0;
*denominator = 0;
return False;
}
/*@}*/

View File

@@ -199,9 +199,6 @@ extern int send_char_msg( Display *dpy, int i, char msg );
extern int blocking_read( Display *dpy, int connection, char *msg, size_t msg_size );
extern int handle_fd_events( Display *dpy, int nonblock );
extern Bool __glXWindowExists(__DRInativeDisplay *dpy, GLXDrawable draw);
extern int __miniglx_open_connections( Display *dpy );
extern void __miniglx_close_connections( Display *dpy );

View File

@@ -1,28 +1,15 @@
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
# 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
DEFINES += -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER
C_SOURCES = \
$(TOP)/src/mesa/glapi/glapi.c \
$(TOP)/src/mesa/glapi/glthread.c \
$(TOP)/src/mesa/main/dispatch.c \
glcontextmodes.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drm.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmHash.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmRandom.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmSL.c \
clientattrib.c \
compsize.c \
dispatch.c \
eval.c \
glxcmds.c \
glxext.c \
@@ -59,16 +46,10 @@ OBJECTS = $(C_SOURCES:.c=.o) \
INCLUDES = -I. \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/mesa/drivers/dri/common \
-I$(DRM_SOURCE_PATH)/libdrm \
-I$(DRM_SOURCE_PATH)/shared-core \
`pkg-config --cflags libdrm` \
$(X11_INCLUDES)
@@ -87,19 +68,13 @@ default: depend $(LIB_DIR)/$(GL_LIB_NAME)
glcontextmodes.c:
ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c .
dispatch.c:
ln -s $(TOP)/src/mesa/main/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)
drmtest: xf86drm.o drmtest.o
rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o
depend: $(C_SOURCES) $(ASM_SOURCES) Makefile
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES)

View File

@@ -40,7 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NEED_REPLIES
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include <X11/extensions/extutil.h>
#include "glheader.h"
#include "xf86dristr.h"

View File

@@ -38,7 +38,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <unistd.h>
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include <X11/extensions/extutil.h>
#include "glxclient.h"
#include "xf86dri.h"
#include "sarea.h"
@@ -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

@@ -31,8 +31,8 @@
#include <inttypes.h>
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <X11/extensions/extutil.h>
#include <X11/extensions/Xext.h>
#include <assert.h>
#include <string.h>
#include "glapi.h"
@@ -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

@@ -60,14 +60,11 @@
#include "GL/internal/glcore.h"
#include "glapitable.h"
#include "glxextensions.h"
#if defined( XTHREADS )
# include "Xthreads.h"
#if defined( USE_XTHREADS )
# include <X11/Xthreads.h>
#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
/************************************************************************/
@@ -178,51 +154,6 @@ typedef struct __GLXpixelStoreModeRec {
GLuint alignment;
} __GLXpixelStoreMode;
/* The next 3 structures are deprecated. Client state is no longer tracked
* using them. They only remain to maintain the layout / structure offset of
* __GLXcontextRec. In XFree86 5.0 they will be removed altogether.
*/
typedef struct __GLXvertexArrayPointerStateRecDEPRECATED {
GLboolean enable;
void (*proc)(const void *);
const GLubyte *ptr;
GLsizei skip;
GLint size;
GLenum type;
GLsizei stride;
} __GLXvertexArrayPointerStateDEPRECATED;
typedef struct __GLXvertArrayStateRecDEPRECATED {
__GLXvertexArrayPointerStateDEPRECATED vertex;
__GLXvertexArrayPointerStateDEPRECATED normal;
__GLXvertexArrayPointerStateDEPRECATED color;
__GLXvertexArrayPointerStateDEPRECATED index;
__GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS];
__GLXvertexArrayPointerStateDEPRECATED edgeFlag;
GLint maxElementsVertices;
GLint maxElementsIndices;
GLint activeTexture;
} __GLXvertArrayStateDEPRECATED;
typedef struct __GLXattributeRecDEPRECATED {
GLuint mask;
/*
** Pixel storage state. Most of the pixel store mode state is kept
** here and used by the client code to manage the packing and
** unpacking of data sent to/received from the server.
*/
__GLXpixelStoreMode storePack, storeUnpack;
/*
** Vertex Array storage state. The vertex array component
** state is stored here and is used to manage the packing of
** DrawArrays data sent to the server.
*/
__GLXvertArrayStateDEPRECATED vertArray;
} __GLXattributeDEPRECATED;
typedef struct __GLXattributeRec {
GLuint mask;
@@ -354,12 +285,9 @@ struct __GLXcontextRec {
GLenum, const GLvoid*, GLubyte*, GLubyte*);
/**
* \name Client side attribs.
* Client side attribs.
*/
/*@{*/
__GLXattributeDEPRECATED stateDEPRECATED;
__GLXattributeMachine attributes;
/*@}*/
/**
* Client side error code. This is set when client side gl API
@@ -512,14 +440,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 +459,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
@@ -627,7 +547,7 @@ extern __GLXdisplayPrivate *__glXInitialize(Display*);
extern int __glXDebug;
/* This is per-thread storage in an MT environment */
#if defined( XTHREADS ) || defined( PTHREADS )
#if defined( USE_XTHREADS ) || defined( PTHREADS )
extern void __glXSetCurrentContext(__GLXcontext *c);
@@ -650,14 +570,14 @@ extern __GLXcontext *__glXcurrentContext;
#define __glXGetCurrentContext() __glXcurrentContext
#define __glXSetCurrentContext(gc) __glXcurrentContext = gc
#endif /* defined( XTHREADS ) || defined( PTHREADS ) */
#endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */
/*
** Global lock for all threads in this address space using the GLX
** extension
*/
#if defined( XTHREADS )
#if defined( USE_XTHREADS )
extern xmutex_rec __glXmutex;
#define __glXLock() xmutex_lock(&__glXmutex)
#define __glXUnlock() xmutex_unlock(&__glXmutex)
@@ -749,17 +669,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

@@ -41,144 +41,25 @@
#include <inttypes.h>
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <X11/extensions/extutil.h>
#include <X11/extensions/Xext.h>
#include <assert.h>
#include <string.h>
#include "glapi.h"
#ifdef GLX_DIRECT_RENDERING
#include "indirect_init.h"
#include "xf86vmode.h"
#include <X11/extensions/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;
@@ -1387,7 +1269,7 @@ PUBLIC const char *GLX_PREFIX(glXQueryExtensionsString)( Display *dpy,
__glXCalculateUsableExtensions(psc,
#ifdef GLX_DIRECT_RENDERING
(priv->driDisplay.private != NULL),
(psc->driScreen.private != NULL),
#else
GL_FALSE,
#endif
@@ -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

@@ -46,16 +46,11 @@
#include "glxclient.h"
#include <stdio.h>
#include <Xext.h>
#include <extutil.h>
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
#include <assert.h>
#include "indirect_init.h"
#include "glapi.h"
#ifdef XTHREADS
# include "Xthreads.h"
#elif defined(PTHREADS)
# include <pthread.h>
#endif
#include "glxextensions.h"
#include "glcontextmodes.h"
#include "glheader.h"
@@ -111,6 +106,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);
@@ -146,7 +145,7 @@ static __GLapi *IndirectAPI = NULL;
* Current context management and locking
*/
#if defined( XTHREADS )
#if defined( USE_XTHREADS )
/* thread safe */
static GLboolean TSDinitialized = GL_FALSE;
@@ -272,7 +271,6 @@ int __glXDebug = 0;
*/
int __glXCloseDisplay(Display *dpy, XExtCodes *codes);
static GLboolean FillInVisuals( __GLXscreenConfigs * psc );
/************************************************************************/
@@ -352,12 +350,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 +391,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 +430,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 +666,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,12 +723,12 @@ 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
drm_handle_t hSAREA;
drmAddress pSAREA;
drmAddress pSAREA = MAP_FAILED;
char *BusID;
__DRIversion ddx_version;
__DRIversion dri_version;
@@ -831,6 +749,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
err_msg = "XF86DRIOpenConnection";
err_extra = NULL;
framebuffer.base = MAP_FAILED;
framebuffer.dev_priv = NULL;
if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
@@ -865,9 +784,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 +829,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 +855,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
pSAREA,
fd,
api_ver,
& interface_methods,
& driver_modes );
filter_modes( & configs->configs,
@@ -1156,6 +1077,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 +1089,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
}
@@ -1198,7 +1107,7 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy)
XEDataObject dataObj;
int major, minor;
#if defined(XTHREADS)
#if defined(USE_XTHREADS)
{
static int firstCall = 1;
if (firstCall) {
@@ -1273,7 +1182,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 +1515,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 */
/*
@@ -1702,12 +1589,14 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
oldGC->currentContextTag = 0;
}
_glapi_check_multithread();
#ifdef GLX_DIRECT_RENDERING
/* 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;
}
@@ -1722,7 +1611,6 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
}
} else {
#endif
_glapi_check_multithread();
/* Send a glXMakeCurrent request to bind the new context. */
LockDisplay(dpy);
@@ -1879,8 +1767,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

@@ -29,8 +29,8 @@
*/
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <X11/extensions/extutil.h>
#include <X11/extensions/Xext.h>
#include <string.h>
#include "glapi.h"
#include "glxextensions.h"
@@ -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

@@ -29,10 +29,6 @@
#include <GL/gl.h>
#include "indirect_size.h"
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# define HAVE_ALIAS
# endif
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define PURE __attribute__((pure))
# else
@@ -366,7 +362,6 @@ ALIAS( ColorTableParameteriv, ColorTableParameterfv )
ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
ALIAS( PointParameterivNV, PointParameterfvEXT )
# undef HAVE_ALIAS
# undef PURE
# undef FASTCALL
# undef INTERNAL

View File

@@ -211,12 +211,14 @@ struct array_state_vector {
* There are some bytes of extra data before \c array_info_cache that is
* used to hold the header for RenderLarge commands. This is
* \b not included in \c array_info_cache_size or
* \c array_info_cache_buffer_size.
* \c array_info_cache_buffer_size. \c array_info_cache_base stores a
* pointer to the true start of the buffer (i.e., what malloc returned).
*/
/*@{*/
size_t array_info_cache_size;
size_t array_info_cache_buffer_size;
void * array_info_cache;
void * array_info_cache_base;
/*@}*/

View File

@@ -382,13 +382,14 @@ allocate_array_info_cache( struct array_state_vector * arrays,
{
#define MAX_HEADER_SIZE 20
if ( arrays->array_info_cache_buffer_size < required_size ) {
GLubyte * temp = realloc( arrays->array_info_cache, required_size
+ MAX_HEADER_SIZE );
GLubyte * temp = realloc( arrays->array_info_cache_base,
required_size + MAX_HEADER_SIZE );
if ( temp == NULL ) {
return GL_FALSE;
}
arrays->array_info_cache_base = temp;
arrays->array_info_cache = temp + MAX_HEADER_SIZE;
arrays->array_info_cache_buffer_size = required_size;
}

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

@@ -10,15 +10,13 @@ COMMON_SOURCES = \
../common/vblank.c \
../common/dri_util.c \
../common/xmlconfig.c \
../common/drirenderbuffer.c \
../common/glcontextmodes.c
../common/drirenderbuffer.c
ifeq ($(WINDOW_SYSTEM),dri)
WINOBJ=../dri_client/dri.a
WINOBJ=
WINLIB=
INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) \
-I../dri_client \
-I../dri_client/imports
`pkg-config --cflags libdrm`
OBJECTS = $(C_SOURCES:.c=.o) \
$(ASM_SOURCES:.S=.o)
@@ -54,7 +52,8 @@ SHARED_INCLUDES = \
-I$(TOP)/src/mesa/shader \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/egl/main
-I$(TOP)/src/egl/main \
-I$(TOP)/src/egl/drivers/dri
##### RULES #####

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,52 +26,25 @@
#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"
#include "glcontextmodes.h"
#ifndef GLX_OML_sync_control
typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator);
#endif
/**
* 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
* dynamically link properly. The value is set to \c NULL. This forces the
* driver to fall back to the old dispatch interface.
/* This pointer *must* be set by the driver's __driCreateNewScreen funciton!
*/
struct _glapi_table *_glapi_DispatchTSD __attribute__((weak)) = NULL;
const __DRIinterfaceMethods * dri_interface = NULL;
/**
* This is used in a couple of places that call \c driCreateNewDrawable.
*/
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 +63,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 +85,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 +113,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 +130,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 +168,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 +182,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 +190,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 +350,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 +366,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 +375,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 +389,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 +423,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 +557,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 +578,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 +604,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 +615,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 +662,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 +702,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 +739,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 +752,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 +776,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 +790,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 */
/*@}*/
@@ -1154,7 +827,7 @@ static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPriv
_mesa_free(psp->pDevPriv);
(void)drmClose(psp->fd);
if ( psp->modes != NULL ) {
_gl_context_modes_destroy( psp->modes );
(*dri_interface->destroyContextModes)( psp->modes );
}
_mesa_free(psp);
}
@@ -1184,6 +857,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 +878,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 +938,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 +954,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 +986,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 +998,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 +1038,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,11 +31,11 @@
* \author Ian Romanick <idr@us.ibm.com>
*/
#ifdef DRI_NEW_INTERFACE_ONLY
#if defined(IN_MINI_GLX)
# include <stdlib.h>
# include <string.h>
# include <GL/gl.h>
# include "dri_interface.h"
# include "GL/internal/dri_interface.h"
# include "imports.h"
# define __glXMemset memset
#else
@@ -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_MINI_GLX) */
#include "glcontextmodes.h"
#ifndef DRI_NEW_INTERFACE_ONLY
#if !defined(IN_MINI_GLX)
#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_MINI_GLX) */
/**

View File

@@ -32,14 +32,14 @@
#include "GL/internal/glcore.h"
#ifndef DRI_NEW_INTERFACE_ONLY
#if !defined(IN_MINI_GLX)
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_MINI_GLX) */
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
int driDispatchRemapTable[ driDispatchRemapTable_size ];
#if defined(USE_X86_ASM)
#include "x86/common_x86_asm.h"
@@ -180,6 +179,39 @@ 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
/* These are needed in *all* drivers because Mesa internally implements
* certain functionality in terms of functions provided by these extensions.
* For example, glBlendFunc is implemented by calling glBlendFuncSeparateEXT.
*/
#define need_GL_EXT_blend_func_separate
#define need_GL_NV_vertex_program
#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_blend_func_separate", GL_EXT_blend_func_separate_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 },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ NULL, NULL }
};
/**
* Enable extensions supported by the driver.
*
@@ -193,9 +225,19 @@ 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 ) {
for ( i = 0 ; i < driDispatchRemapTable_size ; i++ ) {
driDispatchRemapTable[i] = -1;
}
first_time = 0;
driInitExtensions( ctx, all_mesa_extensions, GL_FALSE );
}
if ( (ctx != NULL) && enable_imaging ) {
_mesa_enable_imaging_extensions( ctx );
}
@@ -224,12 +266,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 +308,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 +345,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

@@ -842,19 +842,12 @@ fbSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw)
}
/*
* Just to silence warning
*/
extern _EGLDriver *
_eglMain(NativeDisplayType dpy);
/**
* The bootstrap function. Return a new fbDriver object and
* plug in API functions.
*/
_EGLDriver *
_eglMain(NativeDisplayType dpy)
_eglMain(_EGLDisplay *dpy)
{
fbDriver *fb;

View File

@@ -8,14 +8,18 @@
extern void ffbXMesaUpdateState(ffbContextPtr fmesa);
#define FFB_UPDATE_STATE(fmesa) ffbXMesaUpdateState(fmesa)
/* Lock the hardware and validate our state. */
#if defined(__i386__)
/* Lock the hardware and validate our state. This hardware can only ever
* exist on SPARC platforms. Don't bother building the real LOCK_HARDWARE and
* UNLOCK_HARDWARE code on non-SPARC platforms. The only reason the driver
* gets built on non-SPARC is to catch build breakages earlier.
*/
#if !defined(__sparc__)
#define LOCK_HARDWARE(fmesa)
#define UNLOCK_HARDWARE(fmesa)
#else
#define LOCK_HARDWARE(fmesa) \
do { \
int __ret=0; \
DRM_CAS_RESULT(__ret); \
DRM_CAS(fmesa->driHwLock, fmesa->hHWContext, \
(DRM_LOCK_HELD | fmesa->hHWContext), __ret);\
if (__ret) { \

View File

@@ -64,10 +64,17 @@ ffbInitDriver(__DRIscreenPrivate *sPriv)
{
ffbScreenPrivate *ffbScreen;
FFBDRIPtr gDRIPriv = (FFBDRIPtr) sPriv->pDevPriv;
drmAddress map;
if (getenv("LIBGL_FORCE_XSERVER"))
return GL_FALSE;
if (sPriv->devPrivSize != sizeof(FFBDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(FFBDRIRec) does not match passed size from device driver\n");
return GL_FALSE;
}
/* Allocate the private area. */
ffbScreen = (ffbScreenPrivate *) MALLOC(sizeof(ffbScreenPrivate));
if (!ffbScreen)
@@ -77,59 +84,59 @@ ffbInitDriver(__DRIscreenPrivate *sPriv)
if (drmMap(sPriv->fd,
gDRIPriv->hFbcRegs,
gDRIPriv->sFbcRegs,
&gDRIPriv->mFbcRegs)) {
&map)) {
FREE(ffbScreen);
return GL_FALSE;
}
ffbScreen->regs = (ffb_fbcPtr) gDRIPriv->mFbcRegs;
ffbScreen->regs = (ffb_fbcPtr) map;
/* Map ramdac registers. */
if (drmMap(sPriv->fd,
gDRIPriv->hDacRegs,
gDRIPriv->sDacRegs,
&gDRIPriv->mDacRegs)) {
drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs);
&map)) {
drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
FREE(ffbScreen);
return GL_FALSE;
}
ffbScreen->dac = (ffb_dacPtr) gDRIPriv->mDacRegs;
ffbScreen->dac = (ffb_dacPtr) map;
/* Map "Smart" framebuffer views. */
if (drmMap(sPriv->fd,
gDRIPriv->hSfb8r,
gDRIPriv->sSfb8r,
&gDRIPriv->mSfb8r)) {
drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs);
drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs);
&map)) {
drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
FREE(ffbScreen);
return GL_FALSE;
}
ffbScreen->sfb8r = (volatile char *) gDRIPriv->mSfb8r;
ffbScreen->sfb8r = (volatile char *) map;
if (drmMap(sPriv->fd,
gDRIPriv->hSfb32,
gDRIPriv->sSfb32,
&gDRIPriv->mSfb32)) {
drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs);
drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs);
drmUnmap(gDRIPriv->mSfb8r, gDRIPriv->sSfb8r);
&map)) {
drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r);
FREE(ffbScreen);
return GL_FALSE;
}
ffbScreen->sfb32 = (volatile char *) gDRIPriv->mSfb32;
ffbScreen->sfb32 = (volatile char *) map;
if (drmMap(sPriv->fd,
gDRIPriv->hSfb64,
gDRIPriv->sSfb64,
&gDRIPriv->mSfb64)) {
drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs);
drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs);
drmUnmap(gDRIPriv->mSfb8r, gDRIPriv->sSfb8r);
drmUnmap(gDRIPriv->mSfb32, gDRIPriv->sSfb32);
&map)) {
drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r);
drmUnmap((drmAddress)ffbScreen->sfb32, gDRIPriv->sSfb32);
FREE(ffbScreen);
return GL_FALSE;
}
ffbScreen->sfb64 = (volatile char *) gDRIPriv->mSfb64;
ffbScreen->sfb64 = (volatile char *) map;
ffbScreen->fifo_cache = 0;
ffbScreen->rp_active = 0;
@@ -150,11 +157,11 @@ ffbDestroyScreen(__DRIscreenPrivate *sPriv)
ffbScreenPrivate *ffbScreen = sPriv->private;
FFBDRIPtr gDRIPriv = (FFBDRIPtr) sPriv->pDevPriv;
drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs);
drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs);
drmUnmap(gDRIPriv->mSfb8r, gDRIPriv->sSfb8r);
drmUnmap(gDRIPriv->mSfb32, gDRIPriv->sSfb32);
drmUnmap(gDRIPriv->mSfb64, gDRIPriv->sSfb64);
drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs);
drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs);
drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r);
drmUnmap((drmAddress)ffbScreen->sfb32, gDRIPriv->sSfb32);
drmUnmap((drmAddress)ffbScreen->sfb64, gDRIPriv->sSfb64);
FREE(ffbScreen);
}
@@ -616,25 +623,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 +672,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 +702,6 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
@@ -727,9 +714,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,14 +723,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 = { 0, 0, 1 };
static const __DRIversion ddx_expected = { 0, 1, 1 };
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 +746,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

@@ -21,23 +21,18 @@ typedef struct ffb_dri_state {
typedef struct {
drm_handle_t hFbcRegs;
drmSize sFbcRegs;
drmAddress mFbcRegs;
drm_handle_t hDacRegs;
drmSize sDacRegs;
drmAddress mDacRegs;
drm_handle_t hSfb8r;
drmSize sSfb8r;
drmAddress mSfb8r;
drm_handle_t hSfb32;
drmSize sSfb32;
drmAddress mSfb32;
drm_handle_t hSfb64;
drmSize sSfb64;
drmAddress mSfb64;
/* Fastfill/Pagefill parameters. */
unsigned char disable_pagefill;

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

@@ -35,6 +35,11 @@ gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv )
GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)sPriv->pDevPriv;
int i;
if (sPriv->devPrivSize != sizeof(GLINTDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(GLINTDRIRec) does not match passed size from device driver\n");
return GL_FALSE;
}
#if 0
/* Check the DRI externsion version */
if ( sPriv->driMajor != 3 || sPriv->driMinor != 1 ) {

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

@@ -63,6 +63,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "utils.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#include "extension_helper.h"
#ifndef I810_DEBUG
@@ -72,13 +73,30 @@ int I810_DEBUG = (0);
PUBLIC const char __driConfigOptions[] = { 0 };
const GLuint __driNConfigOptions = 0;
#define DRIVER_DATE "20050818"
static const GLubyte *i810GetString( GLcontext *ctx, GLenum name )
{
static char buffer[128];
switch (name) {
case GL_VENDOR:
return (GLubyte *)"Keith Whitwell";
case GL_RENDERER:
return (GLubyte *)"Mesa DRI I810 20021125";
case GL_RENDERER: {
i810ContextPtr imesa = I810_CONTEXT(ctx);
const char * chipset;
switch (imesa->i810Screen->deviceID) {
case PCI_CHIP_I810: chipset = "i810"; break;
case PCI_CHIP_I810_DC100: chipset = "i810 DC-100"; break;
case PCI_CHIP_I810_E: chipset = "i810E"; break;
case PCI_CHIP_I815: chipset = "i815"; break;
default: chipset = "Unknown i810-class Chipset"; break;
}
(void) driGetRendererString( buffer, chipset, DRIVER_DATE, 0 );
return (GLubyte *) buffer;
}
default:
return 0;
}
@@ -101,16 +119,18 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the i810 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 },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};

View File

@@ -54,11 +54,8 @@ 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 */
extern const struct dri_extension card_extensions[];
#ifdef USE_NEW_INTERFACE
static __GLcontextModes *fill_in_modes( __GLcontextModes *modes,
unsigned pixel_bits,
unsigned depth_bits,
@@ -122,9 +119,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 +158,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 +185,6 @@ i810FillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/* static int i810_malloc_proxy_buf(drmBufMapPtr buffers) */
@@ -231,6 +225,10 @@ i810InitDriver(__DRIscreenPrivate *sPriv)
i810ScreenPrivate *i810Screen;
I810DRIPtr gDRIPriv = (I810DRIPtr)sPriv->pDevPriv;
if (sPriv->devPrivSize != sizeof(I810DRIRec)) {
fprintf(stderr,"\nERROR! sizeof(I810DRIRec) does not match passed size from device driver\n");
return GL_FALSE;
}
/* Allocate the private area */
i810Screen = (i810ScreenPrivate *)CALLOC(sizeof(i810ScreenPrivate));
@@ -421,21 +419,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 +429,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 +438,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 +447,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 +461,11 @@ 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);
driInitExtensions( NULL, card_extensions, GL_TRUE );
}
return (void *) psp;
}
#endif /* USE_NEW_INTERFACE */

View File

@@ -103,14 +103,23 @@ static void i810BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
switch (ctx->Color.BlendSrcRGB) {
case GL_ZERO: a |= SDM_SRC_ZERO; break;
case GL_SRC_ALPHA: a |= SDM_SRC_SRC_ALPHA; break;
case GL_ONE: a |= SDM_SRC_ONE; break;
case GL_DST_COLOR: a |= SDM_SRC_DST_COLOR; break;
case GL_ONE_MINUS_DST_COLOR: a |= SDM_SRC_INV_DST_COLOR; break;
case GL_SRC_COLOR: a |= SDM_SRC_SRC_COLOR; break;
case GL_ONE_MINUS_SRC_COLOR: a |= SDM_SRC_INV_SRC_COLOR; break;
case GL_SRC_ALPHA: a |= SDM_SRC_SRC_ALPHA; break;
case GL_ONE_MINUS_SRC_ALPHA: a |= SDM_SRC_INV_SRC_ALPHA; break;
case GL_DST_ALPHA: a |= SDM_SRC_ONE; break;
case GL_ONE_MINUS_DST_ALPHA: a |= SDM_SRC_ZERO; break;
case GL_SRC_ALPHA_SATURATE: /*a |= SDM_SRC_SRC_ALPHA; break;*/
case GL_DST_COLOR: a |= SDM_SRC_DST_COLOR; break;
case GL_ONE_MINUS_DST_COLOR: a |= SDM_SRC_INV_DST_COLOR; break;
/* (f, f, f, 1), f = min(As, 1 - Ad) = min(As, 1 - 1) = 0
* So (f, f, f, 1) = (0, 0, 0, 1). Since there is no destination alpha and
* the only supported alpha operation is GL_FUNC_ADD, the result modulating
* the source alpha with the alpha factor is largely irrelevant.
*/
case GL_SRC_ALPHA_SATURATE: a |= SDM_SRC_ZERO; break;
case GL_CONSTANT_COLOR:
case GL_ONE_MINUS_CONSTANT_COLOR:
case GL_CONSTANT_ALPHA:
@@ -122,14 +131,17 @@ static void i810BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
}
switch (ctx->Color.BlendDstRGB) {
case GL_SRC_ALPHA: a |= SDM_DST_SRC_ALPHA; break;
case GL_ONE_MINUS_SRC_ALPHA: a |= SDM_DST_INV_SRC_ALPHA; break;
case GL_ZERO: a |= SDM_DST_ZERO; break;
case GL_ONE: a |= SDM_DST_ONE; break;
case GL_SRC_COLOR: a |= SDM_DST_SRC_COLOR; break;
case GL_ONE_MINUS_SRC_COLOR: a |= SDM_DST_INV_SRC_COLOR; break;
case GL_SRC_ALPHA: a |= SDM_DST_SRC_ALPHA; break;
case GL_ONE_MINUS_SRC_ALPHA: a |= SDM_DST_INV_SRC_ALPHA; break;
case GL_DST_ALPHA: a |= SDM_DST_ONE; break;
case GL_ONE_MINUS_DST_ALPHA: a |= SDM_DST_ZERO; break;
case GL_DST_COLOR: a |= SDM_DST_DST_COLOR; break;
case GL_ONE_MINUS_DST_COLOR: a |= SDM_DST_INV_DST_COLOR; break;
case GL_CONSTANT_COLOR:
case GL_ONE_MINUS_CONSTANT_COLOR:
case GL_CONSTANT_ALPHA:

View File

@@ -282,48 +282,52 @@ static void i810TexParameter( GLcontext *ctx, GLenum target,
}
/**
* Setup hardware bits for new texture environment settings.
*
* \todo
* Determine whether or not \c param can be used instead of
* \c texUnit->EnvColor in the \c GL_TEXTURE_ENV_COLOR case.
*/
static void i810TexEnv( GLcontext *ctx, GLenum target,
GLenum pname, const GLfloat *param )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
GLuint unit = ctx->Texture.CurrentUnit;
const GLuint unit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
/* Only one env color. Need a fallback if env colors are different
* and texture setup references env color in both units.
*/
switch (pname) {
case GL_TEXTURE_ENV_COLOR: {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
GLfloat *fc = texUnit->EnvColor;
GLuint r, g, b, a, col;
CLAMPED_FLOAT_TO_UBYTE(r, fc[0]);
CLAMPED_FLOAT_TO_UBYTE(g, fc[1]);
CLAMPED_FLOAT_TO_UBYTE(b, fc[2]);
CLAMPED_FLOAT_TO_UBYTE(a, fc[3]);
GLubyte c[4];
GLuint envColor;
col = ((a << 24) |
(r << 16) |
(g << 8) |
(b << 0));
if (imesa->Setup[I810_CTXREG_CF1] != col) {
I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
imesa->Setup[I810_CTXREG_CF1] = col;
UNCLAMPED_FLOAT_TO_RGBA_CHAN( c, texUnit->EnvColor );
envColor = PACK_COLOR_8888( c[3], c[0], c[1], c[2] );
if (imesa->Setup[I810_CTXREG_CF1] != envColor) {
I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
imesa->Setup[I810_CTXREG_CF1] = envColor;
}
break;
}
case GL_TEXTURE_ENV_MODE:
imesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */
break;
case GL_TEXTURE_LOD_BIAS_EXT:
{
struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;
i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK);
t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(*param);
case GL_TEXTURE_LOD_BIAS: {
if ( texUnit->_Current != NULL ) {
const struct gl_texture_object *tObj = texUnit->_Current;
i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK);
t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(*param);
}
break;
}
default:
break;
@@ -430,6 +434,14 @@ static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
_mesa_delete_texture_object(ctx, tObj);
}
/**
* Choose a Mesa texture format to match the requested format.
*
* \todo
* Determine why \c _mesa_texformat_al88 doesn't work right for
* \c GL_LUMINANCE_ALPHA textures. It seems to work fine for \c GL_INTENSITY,
* but \c GL_LUMINANCE_ALPHA gets some red bands in progs/demos/texenv.
*/
static const struct gl_texture_format *
i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
@@ -500,7 +512,11 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
#if 0
return &_mesa_texformat_al88;
#else
return &_mesa_texformat_argb4444;
#endif
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_MESA ||

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

@@ -212,7 +212,7 @@ static int I810DRIAgpInit( const DRIDriverContext *ctx, I810Ptr info)
drmAgpAlloc(ctx->drmFD, 4096 * 1024, 1, NULL, &dcacheHandle);
info->dcacheHandle = dcacheHandle;
fprintf(stderr, "[agp] dcacheHandle : %p\n", dcacheHandle);
fprintf(stderr, "[agp] dcacheHandle : 0x%x\n", dcacheHandle);
#define Elements(x) sizeof(x)/sizeof(*x)
for (pitch_idx = 0; pitch_idx < Elements(i810_pitches); pitch_idx++)
@@ -710,7 +710,7 @@ static int I810ScreenInit( DRIDriverContext *ctx, I810Ptr info )
return 0;
}
fprintf(stderr,
"[drm] register handle = 0x%08lx\n", info->regs);
"[drm] register handle = 0x%08x\n", info->regs);
I810DRIAgpPreInit(ctx, info);
/* Need to AddMap the framebuffer and mmio regions here:

View File

@@ -11,7 +11,6 @@
typedef struct {
drm_handle_t regs;
drmSize regsSize;
drmAddress regsMap;
drmSize backbufferSize;
drm_handle_t backbuffer;

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,7 +142,14 @@ 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 (sPriv->devPrivSize != sizeof(I830DRIRec)) {
fprintf(stderr,"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
return GL_FALSE;
}
/* Allocate the private area */
i830Screen = (i830ScreenPrivate *)CALLOC(sizeof(i830ScreenPrivate));
@@ -281,19 +286,8 @@ 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" );
}
}
if ( glx_enable_extension != NULL ) {
(*glx_enable_extension)( psc, "GLX_SGI_make_current_read" );
}
return GL_TRUE;
@@ -428,23 +422,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 +469,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 +492,6 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
#endif /* USE_NEW_INTERFACE */
/**
@@ -528,9 +504,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 +513,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 +522,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 +536,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

@@ -18,7 +18,6 @@
typedef struct _I830DRIRec {
drm_handle_t regs;
drmSize regsSize;
drmAddress regsMap;
drmSize backbufferSize;
drm_handle_t backbuffer;

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,

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