summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/glxcmds.c
Commit message (Collapse)AuthorAgeFilesLines
* glx: split out current context codeGeorge Sapountzis2008-04-231-10/+5
| | | | also clean header inclusion after code movement
* DRI interface changes and DRI2 direct rendering support.Kristian Høgsberg2008-03-311-61/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* glx: Add isDirect back to __GLXcontextRec. It is neededXiang, Haihao2008-03-181-0/+2
| | | | | | to check whether oldGC is used for direct rendering in function MakeContextCurrent. However it is possible oldGC->driContext is already freed. fix bug #14926.
* libGL: Pull the drawable hash back out in the generic code.Kristian Høgsberg2008-03-121-3/+1
| | | | This will be shared between dri and dri2 code.
* Only try to call DRI function if DRI got initialized properly.Kristian Høgsberg2008-03-101-3/+5
|
* Use _X_HIDDEN to hide a bunch of leaked symbols.Kristian Høgsberg2008-03-081-6/+7
|
* Move DRI context functions into dri_glx.c.Kristian Høgsberg2008-03-081-24/+27
| | | | Also drop isDirect flag; if gc->driContext is non-NULL, it's direct.
* Move DRI drawable creation into dri_glx.c.Kristian Høgsberg2008-03-081-4/+4
|
* Introduce __GLXDRIscreen so we can start moving function pointers in there.Kristian Høgsberg2008-03-081-10/+10
| | | | | Temporarily rename the __DRIscreen member to __driScreen. Eventually, we'll move that into __GLXDRIscreen and only access it in dri_glx.c.
* Move DRI specific parts of CreateContext into dri_glx.c.Kristian Høgsberg2008-03-081-29/+1
|
* Abstract __DRIdisplayPrivateRec away in dri_glx.c.Kristian Høgsberg2008-03-081-1/+1
| | | | | | | | 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.
* Update libGL DRI loader to latest DRI interface changes.Kristian Høgsberg2008-02-291-48/+0
|
* Remove GetMSC DriverAPI function.Kristian Høgsberg2008-02-251-10/+2
| | | | | | | | | | | The DriverAPI is internal to the DRI drivers and GetDrawableMSC obsoletes GetMSC. Also, since the DRI driver interface has not yet been released, just drop the getMSC function from the DRI interface instead using the ABI preserving version mechanism. Finally, using void pointer privates in the DRI interface is not allowed, always pass the actual types around (__DRIdrawable in this case) to enhance type safety and readability of the code.
* remove drawable from hash table when window is deleted (see bug 13091)WuNian2007-11-271-0/+1
|
* Fix compilation for !GLX_DIRECT_RENDERING.Kristian Høgsberg2007-11-061-59/+69
|
* Remove a couple of "deprecated" fields from __GLXcontextRec.Kristian Høgsberg2007-11-061-7/+7
| | | | | The __GLXcontextRec struct is internal to the libGL implementation. No point in "deprecating", just get rid of it.
* Pass the visual id to XF86DRICreateContextWithConfig(), not fbconfig id.Kristian Høgsberg2007-11-061-1/+1
|
* Lookup visual in visual list, not fbconfig list.Kristian Høgsberg2007-11-051-11/+15
| | | | Also, handle visual not found error case by throwing X error.
* Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesaJesse Barnes2007-10-291-0/+1
|\
| * Remember to call XSync() before resetting X error handler.Chris Rankin2007-10-291-0/+1
| |
* | Refactor and fix core vblank supportJesse Barnes2007-10-291-17/+26
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate support for synchronizing to and retrieving vblank counters. Also fix the core vblank code to return monotonic MSC counters, which are required by some GLX extensions. Adding support for multiple pipes to a low level driver is fairly easy, the Intel 965 driver provides simple example code (see intel_buffers.c:intelWindowMoved()). The new code bumps the media stream counter extension version to 2 and adds a new getDrawableMSC callback. This callback takes a drawablePrivate pointer, which is used to calculate the MSC value seen by clients based on the actual vblank counter(s) returned from the kernel. The new drawable private fields are as follows: - vblSeq - used for tracking vblank counts for buffer swapping - vblFlags - flags (e.g. current pipe), updated by low level driver - msc_base - MSC counter from the last time the current pipe changed - vblank_base - kernel DRM vblank counter from the last time the pipe changed Using the above variables, the core vblank code (in vblank.c) can calculate a monotonic MSC value. The low level DRI drivers are responsible for updating the current pipe (by setting VBLANK_FLAG_SECONDARY for example in vblFlags) along with msc_base and vblank_base whenever the pipe associated with a given drawable changes (again, see intelWindowMoved for an example of this). Drivers should fill in the GetDrawableMSC DriverAPIRec field to point to driDrawableGetMSC32 and add code for pipe switching as outlined above to fully support the new scheme.
* Handle fbconfigs and glx visuals separately.Kristian Høgsberg2007-10-161-3/+4
| | | | | | | | 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.
* Dont add fbconfigs to array that we didn't allocate for.Kristian Høgsberg2007-10-151-2/+4
|
* Convert a left-over private void * to __DRIcontext *.Kristian Høgsberg2007-10-111-2/+2
|
* Move media stream counter entry points to new extension.Kristian Høgsberg2007-10-111-30/+25
|
* Move GLX_MESA_swap_frame_usage DRI entry points to the new mechanism.Kristian Høgsberg2007-10-111-22/+18
|
* Move GLX_MESA_allocate_memory related functions to new extension mechanism.Kristian Høgsberg2007-10-111-20/+14
|
* Move swap_interval to new extension mechanism.Kristian Høgsberg2007-10-101-14/+11
|
* Move the copySubBuffer extension over to the new mechanism.Kristian Høgsberg2007-10-101-3/+3
|
* Convert all DRI entrypoints to take pointers to __DRI* types.Kristian Høgsberg2007-10-101-23/+19
| | | | | | | | | | 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.
* Drop mostly unused __DRIid typedef.Kristian Høgsberg2007-10-101-1/+1
|
* Avoid deadlock in GarbageCollectDRIDrawables.Kristian Høgsberg2007-10-101-8/+2
| | | | | | __glXinitialize() can't be called with the GLX lock held. Just pass in the __GLXscreenConfigs pointer so we don't have to look it up in __GLXdisplayPrivate.
* Drop createContext and destroyContext from DRIinterfaceMethods.Kristian Høgsberg2007-10-101-0/+14
| | | | | | | | | | 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.
* Drop createDrawable and destroyDrawable fron DRIinterfaceMethods.Kristian Høgsberg2007-10-101-2/+3
| | | | | | | | | | | | 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.
* Drop __DRInativeDisplay and pass in __DRIscreen pointers instead.Kristian Høgsberg2007-10-101-30/+30
| | | | | | | | | | | | | 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.
* Remove XIDs from DRI interface (see #5714).Kristian Høgsberg2007-10-051-76/+77
|
* Add reporting of damage by DRI drivers when the extension support is available.Eric Anholt2007-01-051-1/+2
| | | | | | | | | | | | | | 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).
* Add missing parenthesis so that glXSwapIntervalSGI protocol isIan Romanick2006-08-301-1/+1
| | | | correctly generated.
* Clean up GLX function exports.Ian Romanick2006-08-291-233/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -
* Update function signatures for EXT_tfp entrypoints.Adam Jackson2006-05-011-12/+8
|
* Add attrib_list to glXBindTexImageEXTDavid Reveman2006-04-111-2/+25
|
* Dave Reveman's patch for GLX_MESA_copy_sub_buffer supportBrian Paul2006-03-311-9/+61
|
* s/GLint/int/, to fit GLX conventionsBrian Paul2006-03-091-2/+3
|
* David Reveman's GLX_EXT_texture_from_pixmap extension patchBrian Paul2006-02-071-0/+84
|
* fix X #includes so they're relative to X11/ directory (bug 4047)Brian Paul2005-08-111-3/+3
|
* In order to create the set of available extensions, we have to know ifIan Romanick2005-08-051-1/+1
| | | | | | | | | | | | 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.
* Major rip-up of internal function insertion interface. The oldmesa_6_3_1Ian Romanick2005-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | _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)
* Remove the last remnants of GLX_BUILT_IN_XMESA. This allows the removal ofIan Romanick2005-07-261-137/+99
| | | | the evil, ugly GLX_PREFIX macro as well.
* Fixes the glXGetProcAddress portion of the interface. Most of the functionsIan Romanick2005-07-261-29/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...
* All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allowsIan Romanick2005-07-241-114/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.