Commit Graph

110 Commits

Author SHA1 Message Date
Kristian Høgsberg 6e8897ff9f Retire miniglx and move the actual glx code up to src/glx 2010-02-09 09:58:36 -05:00
Francisco Jerez 8b0b5ace48 glx: Fix SwapBuffers regression introduced by 01923fb72d.
After that commit, some dri2 protocol symbols were being checked from
places that weren't including dri2proto.h, effectively disabling some
valuable SwapBuffers codepaths.
2010-02-08 23:29:15 +00:00
Keith Whitwell 01923fb72d glx: permit building with older protocol headers
I'd like to be able to build mesa on current distro releases without
having to upgrade from the standard dri2proto and glproto headers.  With
this change I'm able to build on ancient releases such as Ubuntu 9-10...

In general, it would be nice to be able to build-test mesa to check for
unintended breakages without having to follow the external dependencies
of every group working on the codebase.

Seems to introduce no changes to the build of libglapi.a when tested against
new versions of the headers.
2010-02-08 13:05:35 +00:00
Vinson Lee e3a99e8522 glx: Remove unnecessary headers. 2010-02-01 00:22:50 -08:00
Robert Bragg 7a9329ba99 mesa: misc GLX_INTEL_swap_event fixes
Fixup a few issues found through testing:
  - update GLX names to match glproto
  - register DRI2WireToEvent so it actually gets called

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2010-01-25 15:40:56 -08:00
Jesse Barnes 7f170573ea DRI2/GLX: add INTEL_swap_event support
Add event support for the GLX swap buffers event, along with DRI2 protocol
support for generating GLX swap buffers events in the direct rendered case.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-08 12:37:43 -05:00
Vinson Lee cf3bb0cf31 glx: Move declaration outside for loop. 2009-12-23 12:42:38 -08:00
RALOVICH, Kristóf 0896268b97 glx: indent -br -i3 -npcs --no-tabs
Some manual intervention applied since XEXT_* and other macro magic
fooled indent. Auto generated files were also skipped.
2009-08-13 15:13:21 -06:00
Brian Paul e87320b5e0 Merge branch 'mesa_7_5_branch' 2009-07-30 08:22:57 -06:00
RALOVICH, Kristóf e32b601e7d glx: properly release DRI configs
Release per screen DRI driver configs during screen destruction.
2009-07-28 10:35:56 -06:00
RALOVICH, Kristóf 8363dff251 glx: remove XTHREADS support 2009-07-27 15:38:04 -06:00
David S. Miller 857ac1e817 mesa: Resurrect SPARC asm code.
This rewrites the sparc GLAPI code so that it's PIC friendly and works
with all of the TLS/PTHREADS/64-bit/32-bit combinations properly.

As a result we can turn SPARC asm back on.  Currently it's only
enabled on Linux, as that's the only place where I can test this
stuff out.

For the moment the cliptest SPARC asm routines are disabled as they
are non-working.  The problem is that they use register %g7 as a
temporary which is where the threading libraries store the thread
pointer on SPARC.  I will fix that code up in a future change as it's
a pretty important routine to optimize.

Like x86 we do the runtime patch as a pthread once-invoked initializer
in init_glapi_relocs().

Unlike x86, however, our GLAPI stubs on SPARC are just two instruction
sequences that branch to a trampoline and put the GLAPI offset into a
register.  The trampoline is what we run-time patch.  The stubs thus
all look like:

glFoo:
	ba		__glapi_sparc_foo_stub
	 sethi		GLAPI_OFFSET(glFOO) * PTR_SIZE, %g3

This actually makes generate_entrypoint() a lot simpler on SPARC.  For
this case in generate_entrypoint() we generate stubs using a 'call'
instead of the 'ba' above to make sure it can reach.

In order to get a proper tail call going here, in the unpatched case,
we do several tricks.  To get the current PC, for example, we save the
return address register into a temporary, do a call, save the return
address register written by the call to another temporary, then
restore the original return address register value.  This is to
avoid having to allocate a stack frame.

This is necessary for PIC address formation.

This new GLAPI scheme lets us get rid of the ugly SPARC GLAPI hacks in
__glXInitialize() and one_time_init().

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-26 18:29:48 -07:00
RALOVICH, Kristóf 8c2b4b33c5 Revert "glx: xcbified visual and FBConfig choosing"
This reverts commit 62688f1135.
2008-11-27 07:20:38 -07:00
RALOVICH, Kristóf 80d1531ebe Revert "glx: revert using nonexsisten XCB version of glXGetFBConfigsSGIX"
This reverts commit 5369876501.
2008-11-27 07:20:35 -07:00
RALOVICH, Kristóf 5369876501 glx: revert using nonexsisten XCB version of glXGetFBConfigsSGIX
This uses a GLX VendorPrivate request. VendorPrivates are real GLX API
calls but use the same protocol request. XCB does not currently
support specific VendorPrivetes directly. See eg.:
http://lists.freedesktop.org/archives/xcb/2008-November/004036.html
for more information.
2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 62688f1135 glx: xcbified visual and FBConfig choosing 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 6d1d157606 glx: no graphics context during initialization 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 9c98e35ff6 glx: use __glXQueryServerString 2008-11-26 10:00:58 -07:00
RALOVICH, Kristóf fd52001c5c glx: implement QueryVersion using XCB 2008-11-26 10:00:58 -07:00
Kristian Høgsberg 57d78067bd Don't mess with emacs tab width. 2008-11-11 13:41:43 -05:00
RALOVICH, Kristóf acb7e52430 glx: indent -br -i3 -npcs --no-tabs glxext.c 2008-10-13 16:53:39 -06:00
RALOVICH, Kristóf 58b72103d3 glx: add a line of Emacs helping variables 2008-10-13 16:53:38 -06:00
RALOVICH, Kristóf 0b188d1cdc glx: make INIT_MESA_SPARC more robust
Embed the macro body into do { ... } while(0) .
2008-10-13 16:53:38 -06:00
Adam Jackson dc8058c337 Update to SGI FreeB 2.0.
Under the terms of version 1.1, "once Covered Code has been published
under a particular version of the License, Recipient may, for the
duration of the License, continue to use it under the terms of that
version, or choose to use such Covered Code under the terms of any
subsequent version published by SGI."

FreeB 2.0 license refers to "dates of first publication".  They are here
taken to be 1991-2000, as noted in the original license text:

 ** Original Code. The Original Code is: OpenGL Sample Implementation,
 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
 ** Copyright in any portions created by third parties is as indicated
 ** elsewhere herein. All Rights Reserved.

Official FreeB 2.0 text:

http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf

As always, this code has not been tested for conformance with the OpenGL
specification.  OpenGL conformance testing is available from
http://khronos.org/ and is required for use of the OpenGL logo in
product advertising and promotion.
2008-09-19 17:16:53 -04:00
Brian Paul a25e1aa0aa glx: remove #include "glheader.h" lines
Was only used to get the PUBLIC/USED macros.
Also, replace "GL_FALSE" with "False" in a couple places.
2008-09-18 13:26:30 -06:00
Kristof Ralovich 8434c65bb9 glx: free driScreen in FreeScreenConfigs() 2008-08-20 15:33:03 -06:00
Kristof Ralovich fb36a54a1c fix mem leak (free psc->visuals) 2008-08-20 15:33:03 -06:00
Jeremy Huddleston 919ec22ecf glx/x11: Added some #ifdef GLX_DIRECT_RENDERING protection 2008-08-08 02:52:10 -07:00
George Sapountzis a36bf890e8 glx: add LIBGL_ALWAYS_SOFTWARE
this disables accelerated DRI and fallbacks to client-side software rendering.

compile-tested only.
2008-07-07 18:34:17 +03:00
George Sapountzis 1087cc61b3 glx: load swrast_dri.so
caveats:

- does not work with old (i.e. libGLcore) xserver:

- made unbindContext a noop

- extensions:

  GLX_SGI_make_current_read
  GLX_EXT_texture_from_pixmap
  GLX_MESA_copy_sub_buffer
2008-06-13 15:54:08 +03:00
George Sapountzis df04ffbf02 glx: split out current context code
also clean header inclusion after code movement
2008-04-23 11:12:31 +03:00
Kristian Høgsberg e82dd8c6e1 DRI interface changes and DRI2 direct rendering support.
Add DRI2 direct rendering support to libGL and add DRI2 client side
protocol code.  Extend the GLX 1.3 create drawable functions in
glx_pbuffer.c to call into the DRI driver when possible.

Introduce __DRIconfig, opaque struct that represents a DRI driver
configuration.  Get's rid of the open coded __GLcontextModes in the
DRI driver interface and the context modes create and destroy
functions that the loader was requires to provide.  glcore.h is no
longer part of the DRI driver interface.  The DRI config is GL binding
agnostic, that is, not specific to GLX, EGL or other bindings.

The core API is now also an extension, and the driver exports a list
of extensions as the symbol __driDriverExtensions, which the loader
must dlsym() for.  The list of extension will always include the DRI
core extension, which allows creating and manipulating DRI screens,
drawables and contexts.  The DRI legacy extension, when available,
provides alternative entry points for creating the DRI objects that
work with the XF86DRI infrastructure.

Change DRI2 client code to not use drm drawables or contexts.  We
never used drm_drawable_t's and the only use for drm_context_t was as
a unique identifier when taking the lock.  We now just allocate a
unique lock ID out of the DRILock sarea block.  Once we get rid of the
lock entirely, we can drop this hack.

Change the interface between dri_util.c and the drivers, so that the
drivers now export the DriverAPI struct as driDriverAPI instead of the
InitScreen entry point.  This lets us avoid dlsym()'ing for the DRI2
init screen function to see if DRI2 is supported by the driver.
2008-03-31 16:51:26 -04:00
Xiang, Haihao ae2c31ed66 glx: Add isDirect back to __GLXcontextRec. It is needed
to check whether oldGC is used for direct rendering in
function MakeContextCurrent. However it is possible
oldGC->driContext is already freed. fix bug #14926.
2008-03-18 15:02:57 +08:00
Kristian Høgsberg 9110425c72 libGL: Pull the drawable hash back out in the generic code.
This will be shared between dri and dri2 code.
2008-03-12 02:18:12 -04:00
Kristian Høgsberg 94f39f2e7c Add another missing check for uninitialized DRI.
Spotted by Chris Taylor.
2008-03-12 02:04:16 -04:00
Kristian Høgsberg 3731159ec6 Only try to call DRI function if DRI got initialized properly. 2008-03-10 18:46:19 -04:00
Brian 9162bc8f48 remove extra #include of assert.h (bug 14932) 2008-03-10 07:43:40 -06:00
Kristian Høgsberg 3d28a2690f Use _X_HIDDEN to hide a bunch of leaked symbols. 2008-03-08 22:28:01 -05:00
Kristian Høgsberg 020c64b2cf Move DRI context functions into dri_glx.c.
Also drop isDirect flag; if gc->driContext is non-NULL, it's direct.
2008-03-08 21:57:29 -05:00
Kristian Høgsberg 20b9230ce1 Move DRI drawable creation into dri_glx.c. 2008-03-08 21:02:23 -05:00
Kristian Høgsberg 92d2a78f8d Introduce __GLXDRIscreen so we can start moving function pointers in there.
Temporarily rename the __DRIscreen member to __driScreen.  Eventually,
we'll move that into __GLXDRIscreen and only access it in dri_glx.c.
2008-03-08 20:34:24 -05:00
Kristian Høgsberg a1ea6f6198 Convert driCreateScreen and driDestroyScreen to function pointers.
We avoid leaking the symbols and will be able to replace them with
DRI2 implementation later on.
2008-03-08 19:15:50 -05:00
Kristian Høgsberg 425f9ed44e Abstract __DRIdisplayPrivateRec away in dri_glx.c.
This patch moves __DRIdisplayPrivateRec definition into dri_glx.c and
let's dri_glx.c allocate the __DRIdisplay struct pointer to from
__GLXdisplayPrivate.

A small step towards moving more of the dri functionality into dri_glx.c.
2008-03-08 19:10:21 -05:00
Kristian Høgsberg f585cb29b8 Make __glXCloseDisplay static instead of prototyping it to avoid warning. 2008-03-08 17:38:02 -05:00
Kristian Høgsberg 0f2723cacb Simplify dri loading code by eliminating dlopen "cache".
No need to jump through hoops to track __DRIdrivers and avoid dlopening the
same .so more than twice, dlopen() does this internally.  Besides, we
were already bypassing this and dlopening drivers for each screen,
whether or not they were already dlopened.
2008-03-08 16:19:39 -05:00
Kristian Høgsberg 890d44e54f libGL: Consolidate DRI initialization in dri_glx.c
Move a lot of code over from glx_ext.c.
2008-03-08 16:19:39 -05:00
Kristian Høgsberg 3c5a1e4c2d Update libGL DRI loader to latest DRI interface changes. 2008-02-29 16:42:29 -05:00
Kristian Høgsberg 286ce27193 Fix compilation for !GLX_DIRECT_RENDERING. 2007-11-06 14:34:15 -05:00
Kristian Høgsberg 866d271aa8 Don't return 0 in a void function. 2007-11-06 13:32:33 -05:00
Kristian Høgsberg e2c2df5c23 Filter both visuals and fbconfigs against driver supported configs. 2007-11-05 17:02:29 -05:00