summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_util.c
AgeCommit message (Collapse)Author
2008-02-25Use dlsym() to avoid referencing __dri2DriverInitScreen.Kristian Høgsberg
Sort-of a stop-gap workaround. There are a couple of nicer ways to do this that doesn't require dlfcn.h, but they're more invasive.
2008-02-25Remove GetMSC DriverAPI function.Kristian Høgsberg
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.
2008-02-14Add new DRI2 infrastructure.Kristian Høgsberg
2008-01-09Fold DoBindContext() helper function into driBindContext().Kristian Høgsberg
2007-12-05Don't Swap buffer if a DRIDrawable is entirely obscuredXiang, Haihao
by another window.
2007-10-29Refactor and fix core vblank supportJesse Barnes
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.
2007-10-11Add a version field to __DRIextension.Kristian Høgsberg
2007-10-11Move new texOffset extension to the new extension mechanism.Kristian Høgsberg
2007-10-11Convert a left-over private void * to __DRIcontext *.Kristian Høgsberg
2007-10-11Add a DRI_ReadDrawable marker extension to signal read drawable capability.Kristian Høgsberg
2007-10-11Move media stream counter entry points to new extension.Kristian Høgsberg
2007-10-11Move GLX_MESA_swap_frame_usage DRI entry points to the new mechanism.Kristian Høgsberg
2007-10-10Move swap_interval to new extension mechanism.Kristian Høgsberg
2007-10-10Move the copySubBuffer extension over to the new mechanism.Kristian Høgsberg
2007-10-10Implement new screen extension API.Kristian Høgsberg
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-10Stop passing in unused fbconfigs to createNewScreen.Kristian Høgsberg
2007-10-10Pull createNewScreen entry point into dri_util.c.Kristian Høgsberg
This pulls the top level createNewScreen entry point out of the drivers and rewrites __driUtilCreateNewScreen in dri_util.c to be the new entry point. The change moves more logic into the common/ layer and changes the createNewScreen entry point to only be defined in one place.
2007-10-10Replace open-coded major, minor, and patch version fields with __DRIversionRec.Kristian Høgsberg
2007-10-10Convert all DRI entrypoints to take pointers to __DRI* types.Kristian Høgsberg
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-10Drop createContext and destroyContext from DRIinterfaceMethods.Kristian Høgsberg
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-10Drop createDrawable and destroyDrawable fron DRIinterfaceMethods.Kristian Høgsberg
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-10Drop __DRInativeDisplay and pass in __DRIscreen pointers instead.Kristian Høgsberg
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-05Remove XIDs from DRI interface (see #5714).Kristian Høgsberg
2007-07-10Clear pointers to freed cliprects.Michel Dänzer
Not doing this could lead to double frees under rare circumstances.
2007-05-22Add interfaces for overriding texture images with driver specific 'offsets'.Michel Dänzer
To be used by AIGLX for GLX_EXT_texture_from_pixmap without several additional data copies.
2007-02-26s/pdp/prp/ in DoBindContext()Panagiotis Papadakos
2007-02-26add missing param to _mesa_warning()Panagiotis Papadakos
2007-01-05Add reporting of damage by DRI drivers when the extension support is available.Eric Anholt
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).
2006-12-01Fix an infinite loop error that may occur when many contexts are boundThomas Hellström
to the same drawable in a multithreading environment. This one slipped out of the texman merge.
2006-11-01Merge texmem-0-3-branch.Keith Whitwell
2006-10-16Track the currently bound read drawable and make sure its info is upIan Romanick
to date.
2006-07-12fix another memleakTilman Sauerbeck
2006-03-31Dave Reveman's patch for GLX_MESA_copy_sub_buffer supportBrian Paul
2006-03-28Revert merge of new/experimental code from texmem branch.Keith Whitwell
2006-03-26merge from texman branchBrian Paul
2006-03-23fix coverity 926: use before NULL checkDave Airlie
2005-11-29assorted fixes for server-side direct rendering (bug 5199)Brian Paul
2005-09-04just formatting clean-upsBrian Paul
2005-08-05Fixes bugzillla #812.Ian Romanick
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-07-28Use the routines supplied in the __DRIinterfaceMethods structure to create aIan Romanick
destroy __GLcontextModes structures. This eliminates the need for DRI drivers to ever link with glcontextmodes.c.
2005-07-26Fixes the glXGetProcAddress portion of the interface. Most of the functionsIan Romanick
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-24All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allowsIan Romanick
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-06-02oops, undo previous changeBrian Paul
2005-06-02start removing old (pre-renderbuffer) span codeBrian Paul
2005-05-05Fix up origin in dri/fb driverJon Smirl
Calculated fbBPP
2005-04-13Revert revision 1.13. This allows server-side libGLcore (in X.org) to buildIan Romanick
with Mesa CVS. This change was wrong in the first place, and the issue that necessitated it has been resolved. For more background on the problem see: http://marc.theaimsgroup.com/?l=mesa3d-dev&m=111333880529935&w=2
2005-02-14fix some signed vs unsigned warningsDave Airlie
2005-01-31Bug #2428: #ifdef GLX_DIRECT_RENDERING in DRI drivers is pointless.Adam Jackson
2005-01-12Simplify usage of drmHash functions and fix bug inKeith Whitwell
__driGarbageCollectDrawables which would get confused while walking the hash values.
2004-12-14uint*t -> u_int*t changesAlan Hourihane