summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_util.c
AgeCommit message (Collapse)Author
2010-03-15dri/common: mv __driUtilMessage to utils.cGeorge Sapountzis
allows to link with xmlconfig without dri_util, and has nothing drm-specific.
2010-03-12Grammar and spelling fixesJeff Smith
Signed-off-by: Jeff Smith <whydoubt@yahoo.com> Signed-off-by: Brian Paul <brianp@vmware.com>
2010-02-27dri: Add assert to check for null pointer dereference.Vinson Lee
2010-02-27dri: Assert pointer is not null before dereferencing.Vinson Lee
2010-02-24intel: Implement DRI image extensionKristian Høgsberg
2010-02-19Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg
2010-02-17intel: Implement the DRI2 invalidate function properlyKristian Høgsberg
This uses a stamp mechanisms to mark the DRI drawable as invalid. Instead of immediately updating the buffers we just bump the drawable stamp and call out to DRI2GetBuffers "later". "Later" used to be at LOCK_HARDWARE time, and this patch brings back callouts at the points where we used to call LOCK_HARDWARE. A new function, intel_prepare_render(), is called where we used to call LOCK_HARDWARE, and if the buffers are invalid, we call out to DRI2GetBuffers there. This lets us invalidate buffers only when notified instead of on every glViewport() call. If the loader calls the DRI invalidate entrypoint, we disable viewport triggered buffer invalidation. Additionally, we can clean up the old viewport mechanism a bit, since we can just invalidate the buffers and not worry about reentrancy and whatnot.
2010-02-16dri2: Event driven buffer validation.Francisco Jerez
When a buffer invalidation event is received from the X server, the "invalidate" hook of the DRI2 flush extension is executed: A generic implementation (dri2InvalidateDrawable) is provided that just bumps the "pStamp" sequence number in __DRIdrawableRec. For old servers not supporting buffer invalidation events, the invalidate hook will be called before flushing the fake front/back buffer (that's typically once per frame -- not a lot worse than the situation we were in before). No effort has been made on preserving backwards compatibility with version 2 of the flush extension, but I think it's acceptable because AFAIK no released stack is making use of it. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-02-16dri2: Allocate cliprect as part of the __DRIdrawableRecKristian Høgsberg
2010-02-12dri: Store the loader private passed in at dri context creationKristian Høgsberg
We just threw it away before, but we haven't had a use for it yet.
2010-01-11Merge branch 'master' of ssh://people.freedesktop.org/~jbarnes/mesaJesse Barnes
Conflicts due to DRI1 removal: src/mesa/drivers/dri/intel/intel_context.c src/mesa/drivers/dri/intel/intel_screen.c
2010-01-08DRI2: add SwapBuffers supportJesse Barnes
Support the new DRI2 protocol request, DRI2SwapBuffers, in both direct and indirect rendering context. This request allows the display server to optimize back->front swaps (e.g. through page flipping) and allows us to more easily support other GLX features like swap interval and the OML sync extension in DRI2. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-04Push __driDriverExtensions out of dri_util.c and into the driversKristian Høgsberg
This lets the individual drivers select which extensions to advertise. Specifically, most drivers (tdfx, sis, savage etc) don't support DRI2 but the shared extension list in dri_util.c does list the DRI2 extension. Pushing the list into the drivers, lets us avoid listing the DRI2 extension for drivers that don't support it.
2010-01-04Remove leftover __DRI{screen,drawable,context}Private referencesKristian Høgsberg
As part of the DRI driver interface rewrite I merged __DRIscreenPrivate and __DRIscreen, and likewise for __DRIdrawablePrivate and __DRIcontextPrivate. I left typedefs in place though, to avoid renaming all the *Private use internal to the driver. That was probably a mistake, and it turns out a one-line find+sed combo can do the mass rename. Better late than never.
2009-12-15dri: Initialize variable in driBindContext.Vinson Lee
2009-12-06dri: Fix potential null pointer dereference in driBindContext.Vinson Lee
(cherry picked from commit 919898e92fa23ff71a59d86a46ff0886a6f34e4d)
2009-12-06dri: Fix potential null pointer deference in dri_put_drawable.Vinson Lee
(cherry picked from commit 364070b1f2b08d43fb205ec198894a35bec6b2f3)
2009-08-25Revert "glx: Make drawables persistent untill they are changed by ↵Pauli Nieminen
glXMakeCurrent" This commit was not mean to end in to master yet. It is still queston if this right design to fix the problem. This reverts commit 45e3be3c07f543f3f2869ba7750ba4695cd25122.
2009-08-21glx: Make drawables persistent untill they are changed by glXMakeCurrentPauli Nieminen
This fixes bug that xdemos/manywin would segfault if it was run with command ./manywin 2. Demo is tring to call glXSwapBuffers while another context was bind using glXMakeCurrent. Fix is simple makes drawable and readable persistent untill they change or context is destroyed. I found a logic error when same dri context is used for multiple drawables which caused readable and drawable to fall out of sync in special case. Fix is simple just updating drawables more often than in original patch. Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-07dri: Fix problems with unitialized values in dri screen object.Pauli Nieminen
This fixes crash in r200 KMS driver when pSAREA was set to 1 randomly because of memory wasn't cleared. Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-07-08glx: death to RCS tagRALOVICH, Kristóf
2009-06-17GLX: attempt to fix glean makeCurrent test cases.Dave Airlie
Two parts to this: One we don't keep pointers to possibly freed memory anymore once we unbind the drawables from the context. Brian I need to figure out what the comment you made there, can we get a glean/piglit test so we can fix it properly? If the new gc is the same as the oldGC, we call the unbind even though we just bound it in that function. doh.
2009-04-22Merge remote branch 'origin/master' into radeon-rewriteDave Airlie
2009-04-17dri: __driUtilMessage(): not all messages are errorsBrian Paul
2009-04-16dri: attempt to actually refcount the __DRIDrawableDave Airlie
valgrind was showing a race between the drawable getting destroyed by the X resource freeing code, and the context getting destroyed later and freeing the drawable. However I've no idea if some other combination of things could cause this code to leak.
2009-04-13dri glx: Swap before checking for cliprects.Younes Manton
We don't update drawables anymore unless they are completely uninitialized, so we need to swap even if we don't have cliprects yet, otherwise we never end up calling the driver's SwapBuffers(). The driver should update the drawable in its SwapBuffers() anyway. See 8e753d04045a82062ac34d3b2622eb9dba8af374, "dri glx: Fix dri_util::driBindContext" for the change that exposed it.
2009-04-02dri glx: Fix dri_util::driBindContextThomas Hellstrom
1) Don't error-check here. It's done in glx makeCurrent. 2) Allow ctx and the dri drawables to be NULL for future use. This is currently blocked in glx makeCurrent. 3) Avoid updating dri drawables unless they are completely uninitialized. Since the updating was done outside of the lock, the driver need to verify and redo it anyway. Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-02dri glx: Propagate driver MakeCurrent errors.Thomas Hellstrom
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-01-06dri: correct the damage.Xiang, Haihao
Fixes bug #17234
2008-11-10dri: alloc __DRIscreen object with calloc()Brian Paul
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