summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_util.c
AgeCommit message (Collapse)Author
2008-09-18mesa: added "main/" prefix to includes, remove some -I paths from ↵Brian Paul
Makefile.template
2008-08-29DRI2: Drop sarea, implement swap buffers in the X server.Kristian Høgsberg
2008-08-21Report damage before modifying the area, not after.Peter Hutterer
If we copy the area before reporting the damage in this area, the server may restore buffered data over the new data, leading to artefacts on the screen. Reproducable with two cursors (second of which is SW rendered) and moving windows around in compiz. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16384 .
2008-06-26Check in SwapBuffers for any new pending dri2 eventsAlan Hourihane
2008-06-11remove obsoleted doxygen \param commentsBrian Paul
Someone changed the function parameters but didn't bother to update the comments. Also, whitespace changes, clean-ups.
2008-06-09Check for NULL pointerAlan Hourihane
2008-06-04mesa/drm/ttm: allow build against non-TTM aware libdrmDave Airlie
I'll release a libdrm 2.3.1 without TTM apis included from a special drm branch that should allow mesa 7.1 to build against it. I've had to turn off DRI2 stuff.
2008-05-29Report correct damage rectangle in CopySubBuffer.Dennis Kasprzyk
2008-05-20Make utils.h self-contained.George Sapountzis
Move stuff with drm dependencies to dri_util.h, and move a couple of types without drm dependencies to utils.h.
2008-04-02Initialize GLX_EXT_texture_from_pixmap attributes correctly.Kristian Høgsberg
2008-03-31DRI interface changes and DRI2 direct rendering support.Kristian Høgsberg
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-09DRI2: Drop DriverAPI.UpdateBuffer.Kristian Høgsberg
__dri2ParseEvents() would determine the kind of event, but then call UpdateBuffer() in either case, and UpdateBuffer() would then have to figure that out again to dispatch to HandleBufferAttach() or HandleDrawableConfig(). Pretty pointless.
2008-03-09DRI2: Pass the context instead of the screen to __dri2ParseEvents().Kristian Høgsberg
Makes a lot more sense, since the screen is always implicit in the DRI drawable, but it may not be possible to track down a context from just a drawable.
2008-03-09DRI2: Add event buffer head as an argument to driCreateNewDrawable().Kristian Høgsberg
The DRI driver needs to know where in the buffer to start reading.
2008-03-03[dri2] Add tail pointer to reemitDrawableInfo callback.Kristian Høgsberg
When the DRI doesn't parse the event buffer for a while, the X server may overwrite data that the driver didn't get a chance to look at. The reemitDrawableInfo callback requests that the X server reemit all info for the specified drawable. To make use of this, the drive needs to know the new tail pointer so it know where to start reading from.
2008-03-03[dri2] Optimize event parsing to skip obsolete events.Kristian Høgsberg
This also fixes the problem where the X server does multiple resizes before the DRI driver gets the events. The obsolete buffer attach events then reference already destroyed buffer objects.
2008-02-29Use __DRIextension mechanism providing loader functionality to the driver.Kristian Høgsberg
Instead of passing in a fixed struct, the loader now passes in a list of __DRIextension structs, to advertise the functionality it can provide to the driver. Each extension is individually versioned and can be extended or phased out as the interface develops.
2008-02-29Reduce the versioning madness required to create a DRI2 screen.Kristian Høgsberg
Right now the DRI2 screen constructor takes 3 different versions: DRI, DDX and DRM. This is mostly useless, though: DRI: The DRI driver doesn't actually care about the DRI protocol, it only talks to the loader, which in turn speaks DRI protocol. Thus, the DRI protocol version is of not interest to the DRI driver, but it needs to know what functionality the loader provides. At this point that's reflected in the __DRIinterfaceMethods struct and the internal_version integer. DDX: The DDX version number is essentially used to track extensions to the SAREA. With DRI2 the SAREA consists of a number of versioned, self-describing blocks, so the DDX version is no longer interesting. DRM: We have the fd, lets just ask the kernel ourselves.
2008-02-25A few more fixes to the dlsym() fix.Kristian Høgsberg
Argh, seriously, I did test that, I just forgot to amend the commit before pushing.
2008-02-26dri2: dlsym requires some quotes..Dave Airlie
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