Commit Graph

67 Commits

Author SHA1 Message Date
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
Michel Dänzer d2f19a554a Fix some build warnings, mostly with XCB. 2007-10-30 17:58:50 +01:00
Kristian Høgsberg 6c753ad51d Pull workaround for unset GLX_DRAWABLE_TYPE back in.
The old version just set GLX_DRAWABLE_TYPE to GLX_WINDOW_BIT for
configs received through glXGetVisualConfigs and to
GLX_WINDOW_BIT | GLX_PIXMAP_BIT for configs received as FBConfigs.
The X server needs to send this info, but keep the workaround for now.

Fixes #12835.
2007-10-17 15:06:11 -04:00
Kristian Høgsberg 6c533ea2d1 Handle fbconfigs and glx visuals separately.
The old implementation fetches fbconfigs or glx visuals once and assumes the list
describes both fbconfigs and glx visuals.  This patch splits it up and fetches
visuals and fbconfigs in two steps and keep the two lists separate.  A server
could have no glx visuals or no glx fbconfigs and the old code wouldn't know the
difference.
2007-10-16 16:07:52 -04:00
Kristian Høgsberg 3eaec7dc5d Move enabling of DRI extensions into glxextensions.c 2007-10-11 11:26:47 -04:00
Kristian Høgsberg 594006d8b2 Remove now unused getProcAddress from DRIinterfaceMethods. 2007-10-11 11:25:37 -04:00
Kristian Høgsberg f968f67e62 Add a DRI_ReadDrawable marker extension to signal read drawable capability. 2007-10-11 11:22:55 -04:00
Kristian Høgsberg 106a6f29bb Move media stream counter entry points to new extension. 2007-10-11 11:21:29 -04:00
Kristian Høgsberg a7a0a2beb5 Move GLX_MESA_swap_frame_usage DRI entry points to the new mechanism. 2007-10-11 11:11:12 -04:00
Kristian Høgsberg 78a6aa57a0 Move GLX_MESA_allocate_memory related functions to new extension mechanism. 2007-10-11 11:09:57 -04:00
Kristian Høgsberg efaf90b03e Move swap_interval to new extension mechanism. 2007-10-10 19:14:10 -04:00
Kristian Høgsberg ac3e838fa7 Move the copySubBuffer extension over to the new mechanism. 2007-10-10 18:57:57 -04:00
Kristian Høgsberg f616a263a2 Implement new screen extension API.
This new API lets the loader examine DRI level extensions provided by the
driver in a forward compatible manner.

Much of the churn in the DRI interface is adding support for new
extensions or removing old, unused extensions.  This new extension
mechanism lets the loader query the extensions provided by the driver
and implement the extensions it knows about.  Deprecating extensions
is done by not exporting that extension in the list, which doesn't
require keeping old function pointers around to preserve ABI.
2007-10-10 18:47:22 -04:00
Kristian Høgsberg 295dc2d225 Stop passing in unused fbconfigs to createNewScreen. 2007-10-10 18:46:51 -04:00
Kristian Høgsberg 5987a03f99 Convert all DRI entrypoints to take pointers to __DRI* types.
The entrypoints take a mix of __DRIscreen * and void * (screen private)
arguments (similarly for contexts and drawables).  This patch does away
with passing the private void pointer and always only passes the fully
typed __DRIscreen pointer and always as the first argument.

This makes the interface more consistent and increases type safety, and
catches a bug where we would pass a screen private to DRIdrawable::getSBC.
2007-10-10 18:00:18 -04:00
Kristian Høgsberg aac367f48a Remove screenConfigs from __DRIscreen.
The screenConfigs field of __DRIscreen points back to the containing
__GLXscreenConfigs struct.  This is a serious abstraction violation; it
assumes that the loader is libGL and that there *is* a __GLXscreenConfigs
type in the loader.

Using the containerOf macro, we can get from the __DRIscreen pointer to
the containing __GLXscreenConfigs struct, at a place in the stack
where the above is a valid assumption.  Besides, the __DRI* structs shouldn't
hold state other than the private pointer.
2007-10-10 18:00:13 -04:00
Kristian Høgsberg 8ed5c7ca05 Drop createContext and destroyContext from DRIinterfaceMethods.
As for createDrawable and destroyDrawable, these functions immediately
upon entry to driCreateNewContext and immediately before exit from
driDestroyContext.  Instead of passing function pointers back and forth
just obtain the drm_context_t prior to calling DRIscreen::createNewContext
and pass it as a parameter.

This change also lets us keep the DRI context XID in the libGL loader only.
2007-10-10 17:09:16 -04:00
Kristian Høgsberg 4ff95e78e1 Drop createDrawable and destroyDrawable fron DRIinterfaceMethods.
All the DRI driver did was call the createDrawable callback immediately
upon entry to DRIscreen::createNewDrawable to get the drm_drawable_t.
We can just call that before calling into the DRI driver and pass the
returned drm_drawable_t as an argument to the DRI entry point.

Likewise for destroyDrawable.

Also, DRIdrawablePrivate::draw isn't used anywhere, and since the
driver no longer needs the XID of the drawable we can now drop that.
2007-10-10 17:07:26 -04:00
Kristian Høgsberg aceccda56b Drop __DRInativeDisplay and pass in __DRIscreen pointers instead.
Many DRI entry points took a __DRInativeDisplay pointer and a screen
index as arguments.  The only use for the native display pointer was to
pass it back to the loader when looking up the __DRIscreen for the given
screen index.

Instead, let's just pass in the __DRIscreen pointer directly, which
let's drop the __DRInativeDisplay type and the getScreen function.

The assumption is now that the loader will be able to retrieve context
from the __DRIscreen pointer when necessary.
2007-10-10 15:32:15 -04:00
Kristian Høgsberg 4a22ae8d44 Remove XIDs from DRI interface (see #5714). 2007-10-05 00:09:32 -04:00
Roland Scheidegger a6d4dddb38 suppress warning about ncon visuals (bug #6689) 2007-08-16 02:41:03 +02:00
Brian 702c8f1e6c remove unneeded initialization code (see bug 10569) 2007-04-09 11:21:51 -06:00
Brian f9574c3f6b allocate __GLXdisplayPrivate w/ Xcalloc instead of Xmalloc (bug 10569) 2007-04-09 08:49:26 -06:00
Adam Jackson d8bfc42bb7 Make sure GLX entrypoints are marked PUBLIC.
Fedora bug #229808.
2007-04-08 14:40:03 -04:00
Panagiotis Papadakos eab92fcdc2 fix mem leaks 2007-02-05 08:17:50 -07:00
Brian 0930248bb1 fix mem leak in __glXReportDamage (Panagiotis Papadakos) 2007-02-01 07:22:25 -07:00
Eric Anholt 3dd243c59e Track rename of DamagePost -> DamageAdd. 2007-01-09 16:39:10 -08:00
Eric Anholt c2b185cff8 Add reporting of damage by DRI drivers when the extension support is available.
With this, tools like ximagesrc in gstreamer correctly see updates from GL
rendering.  Support requires that the Xdamage library be current (but will be
disabled if not present) plus a new X Server with support for the new
XDamagePost request.  libGL now has a new interface version, and also links
against libXdamage and libXfixes to support it, but backwards compatibility
is retained.

Currently, all drivers report damage at SwapBuffers time through common code --
front buffer rendering doesn't result in damage being reported.  Also, the
damage is against the root window, as our drivers don't yet render to backing
store when they should (composited environments).
2007-01-05 18:23:57 -08:00
Dave Airlie 4bb39f5899 remove drm stuff from libGL, this is now in libdrm 2.3.0 2006-11-08 22:25:52 +00:00
Brian Paul 26b5904d70 disable debug printf 2006-11-01 18:49:41 +00:00
Keith Whitwell 48e6fff3a9 merge the (rest of) texmem branch 2006-11-01 14:26:10 +00:00
Ian Romanick 6ae157f9e7 Fix bug #8563.
Fixes a GLX protocol problem when binding an indirect rendering context
after a direct rendering context.  In this case, the oldContetTag sent to
the server should be None, but the currectContextTag stored in the direct
rendering context (i.e., -1) was sent instead.
2006-10-16 17:50:19 +00:00
Brian Paul d3b257374e added a SyncHandle() call, remove UnlockDisplay() call. (bug 8521) 2006-10-09 14:57:50 +00:00
Brian Paul 0a0cd3a8ae Updates for XCB. Bug 8560. 2006-10-09 14:55:46 +00:00
Ian Romanick dba173077e Major clean up of MakeContextCurrent
Rearrange most of the internals of MakeContextCurrent.	Put all of the code to
bind the new context up front.	If that is successful, unbind the old context.
This saves a lot of code and removes some locking crazyiness.

This patch has been tested for indirect rendering with glxinfo, glxgears,
manywin, and wincopy.
2006-10-07 02:52:18 +00:00
Brian Paul 25e441e8e9 in MakeContextCurrent() use old display pointer for __glXSetupForCommand(), bug 8443 2006-10-04 16:22:24 +00:00
Jeremy Kolb 07bacc2263 Update to use the new XCB naming convention. 2006-09-26 23:56:20 +00:00
Ian Romanick fc5b57b713 Clean up GLX function exports.
Make functions for the following extensions only accessable via
glXGetProcAddress:

    - GLX_EXT_texture_from_pixmap
    - GLX_MESA_copy_sub_buffer
    - GLX_MESA_release_buffers
    - GLX_MESA_swap_control
    - GLX_MESA_swap_frame_usage
    - GLX_OML_sync_control
    - GLX_SGI_make_current_read
    - GLX_SGI_swap_control
    - GLX_SGI_video_sync
    - GLX_SGIX_swap_barrier
    - GLX_SGIX_swap_group

Removed all remnants of the following extensions:

    - GLX_MESA_set_3dfx_mode
    - GLX_SGI_cushion
    - GLX_SGIX_dmbuffer
    - GLX_SGIX_video_resize
    - GLX_SGIX_video_source
    - GLX_SUN_get_transparent_index
    -
2006-08-29 15:38:19 +00:00
Tilman Sauerbeck f81b1dbe37 fix a memleak (that code block has been commented out for years for unknown reasons) 2006-07-15 12:09:27 +00:00
Tilman Sauerbeck e77875dcbe fix a memleak 2006-07-12 16:49:07 +00:00
David Reveman ba23f699f0 FBConfig support for EXT_tfp 2006-04-11 12:21:48 +00:00
Adam Jackson 5ab5517ba8 Coverity #468: Fill in the rest of the error_list to match the error codes
defined in glxproto.h.  Avoids reading semi-random memory (and probably
crashing) when calling __glXErrorString().
2006-04-03 00:00:53 +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 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