Commit Graph

64 Commits

Author SHA1 Message Date
Henri Verbeet 7d9e0ea739 glx: Properly check for a valid fd in dri2CreateScreen().
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 10:54:04 -07:00
Henri Verbeet bfc889517a glx: Fix leaks in DRI2 screen creation error paths.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-01-31 09:29:54 -07:00
Juan Zhao e59fa4c46c dri2: release texture image.
Add release function for texture_from_pixmap extension.
Some platform need to release texture image for texture_from_pixmap
extension, add this interface for those platforms.
2011-01-09 14:55:16 -05:00
Kristian Høgsberg 86a1938aa5 glx: Invalidate buffers after binding a drawable
If the server doesn't send invalidate events, we may miss a
resize before the rendering starts.  Invalidate the buffers now
so the driver will recheck before rendering starts.

https://bugs.freedesktop.org/show_bug.cgi?id=29984
https://bugs.freedesktop.org/show_bug.cgi?id=30155
2010-09-22 17:36:19 -04:00
Luca Barbieri a0e5103200 glx: decouple dri2.c and GLX, fixing Gallium EGL and d3d1x build
The Gallium EGL state tracker reuses dri2.c but not the GLX code.

Currently there is a bit of code in dri2.c that is incorrectly tied
to GLX: instead, make it call an helper that both GLX and Gallium EGL
implement, like dri2InvalidateBuffers.

This avoids a link error complaining that dri2GetGlxDrawableFromXDrawableId
is undefined.

Note that we might want to move the whole event translation elsewhere,
and probably stop using non-XCB DRI2 altogether, but this seems to be
the minimal fix.
2010-09-22 08:01:49 +02:00
Kristian Høgsberg 441344ba7e glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
2010-09-21 10:20:23 -04:00
Kristian Høgsberg 4ebf07a426 glx: Don't destroy DRI2 drawables for legacy glx drawables
For GLX 1.3 drawables, we can destroy the DRI2 drawable when the GLX
drawable is destroyed.  However, for legacy drawables, there os no
good way of knowing when the application is done with it, so we just
let the DRI2 drawable linger on the server.  The server will destroy
the DRI2 drawable when it destroys the X drawable or the client exits
anyway.

https://bugs.freedesktop.org/show_bug.cgi?id=30109
2010-09-13 08:42:22 -04:00
Kristian Høgsberg 16887d042a glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread
safe.  Instead, just destroy the client side structures when the
drawable is no long current for a context.
2010-09-08 09:20:42 -04:00
Kristian Høgsberg 2542d8e0c2 glx: Move deref after NULL check 2010-08-04 12:51:26 -04:00
Kristian Høgsberg 9da1c9da13 glx: dri2InvalidateBuffers() needs the X drawable XID not the GLX one
This never ceases to entertain.
2010-08-04 08:47:36 -04:00
Kristian Høgsberg c491e585e4 glx: Move bind and unbind to context vtable 2010-07-28 16:45:25 -04:00
Kristian Høgsberg c356f5867f glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types. 2010-07-28 16:45:25 -04:00
Kristian Høgsberg 66fc35cde9 glx: Rename __GLXscreenConfigs to struct glx_screen
Because double underscores in private type names is painful.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg 6ddf66e923 glx: Rename __GLcontextModes to struct glx_config
With this rename, we use 'config' consitently to refer to GLX configurations
instead of the modes/configs/visual mess before.
2010-07-28 16:42:00 -04:00
Carl Worth db011c8141 Avoid a compiler warning about a potentially unused variable.
There is no assignment to the "ret" variable if X_DRI2SwapBuffers is
not defined. In this case, the earlier explicit "return 0" is likely
to be used, but the compiler can't be sure of that, (nor can I for
that matter).

We cover this case by explicitly initializing "ret" to 0.
2010-07-28 10:42:46 -07:00
Eric Anholt af6a2aede6 glx: Fix another case of confusing driContext and dri2_context * 2010-07-23 20:58:12 -07:00
Eric Anholt 566373967a glx: Correctly look up the dri2 context pointer for SetTexBuffer.
gc->driContext points at the second member of the dri2 context.  The
dri2 context is just a subclass of the GLX context.

Fixes piglit tfp testcase.
2010-07-23 20:58:12 -07:00
Kristian Høgsberg d77bb8e059 glx: Don't destroy context with XID 0
We use XID 0 to indicate the context has already been destroyed, but it's
currently bound.
2010-07-23 22:05:53 -04:00
Kristian Høgsberg 6393a33944 glx: zero out drawable structs after allocation 2010-07-23 22:05:53 -04:00
Kristian Høgsberg 6ec39db726 glx: Refactor and simplify context creation
This lets us better separate context creation between the different
backends.
2010-07-23 22:05:53 -04:00
Kristian Høgsberg c796bb0cc3 glx: Move context destroy to context vtable 2010-07-23 22:05:52 -04:00
Eric Anholt 9a12a3925a glx: Don't try to swap a front buffer if we don't have one.
Fixes glean glsl1 since 7b7845a076
2010-07-23 13:59:22 -07:00
Kristian Høgsberg eeaab2047c glx: Drop screen argument to GetGLXDRIDrawable
We'll just get it from the returned drawable when we need it.
2010-07-22 22:36:37 -04:00
Kristian Høgsberg 7b7845a076 glx: Move WaitGL, WaitX, UseXFont to context vtable functions 2010-07-22 22:24:00 -04:00
Kristian Høgsberg 31819830b6 glx: Allocate the __GLXcontext in the DRI drivers 2010-07-22 22:16:32 -04:00
Kristian Høgsberg f679640868 glx: Move __driContext field out of __GLXcontextRec 2010-07-21 22:17:24 -04:00
Michel Dänzer bd3d2724f5 glx/dri2: Fix dri2CopySubBuffer() again.
Only refresh the fake front buffer if there is one, and only destroy the region
once.

Fixes X11 protocol errors reported by 'mcgreg' on IRC.
2010-07-20 12:21:17 +02:00
Kristian Høgsberg a7292f2920 glx: Move DRI CopySubBuffer extension to DRI1 code
We do this in the X server for DRI2.
2010-07-19 22:45:51 -04:00
Kristian Høgsberg bab13969d8 glx: Move driver_configs to DRI screen privates 2010-07-19 22:45:51 -04:00
Kristian Høgsberg 037755122e glx: Don't use __glXInitialize() when we might be holding __glXLock() 2010-07-19 22:45:51 -04:00
Kristian Høgsberg 8d0228912b glx: Workaround mismatch in signedness between extensions and protocol
The DRI2 protocol for ust, msc and sbc are unsigned but the extensions
talk about int64_t.  Do a little dance to make the compiler shut up.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg 271c3c3a90 glx: Move __DRIdrawable pointers to DRI drawable privates 2010-07-19 22:45:50 -04:00
Kristian Høgsberg 70887d5172 glx: Move __driScreen into the dri screen privates 2010-07-19 22:45:50 -04:00
Kristian Høgsberg 089fc37c6f glx: Move DRI1 specific extensions and code to DRI1 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg 9e546ecfd4 glx: Move DRI2 extensions to DRI2 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg f972115d33 glx: Add screen privates for dri drivers and moved some fields there
GLXscreenConfigs is badly named and a dumping ground for a lot of stuff.
This patch creates private screen structs for the dri drivers and moves
some of their fields over there.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg a296d96de4 glx: Rename various DRI structs away from obnoxious __GLXfooRec convention
Enough is enough.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg 308e13ecd1 glx: Factor out common code from dri2WaitGL() and dri2WaitX() 2010-07-19 22:45:50 -04:00
Kristian Høgsberg b006d465ea glx: Dont use dri2WaitX() to update fake front
This saves a superfluous flush and a create/destryo region.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg 3750ebd540 glx: Fix drawable lookup in DRI2 event handler
DRI2 events are sent to the X drawable ID used to create the DRI2 drawable,
not the GLX drawable ID.  So when an event comes in, we need to look up
the __GLXDRIdrawable by its X drawable ID, which needs a new hash table.
2010-07-19 09:37:38 -04:00
Kristian Høgsberg ab780bccb7 glx: Invalidate drawable in glXBindTexImageEXT() if we don't get events
When we don't get invalidate events, we need to invalidate a drawable
before using it for tfp to make sure we have uptodate buffers.
2010-05-21 23:24:37 -04:00
Kristian Høgsberg 643b2af020 glx: Split tfp functions out to context vtable
This introduces a new per-context vtable, which lets us clean up all the
#ifdef's a bit and move the DRI2 specific implementation into dri2_glx.c.
2010-05-21 23:24:37 -04:00
Kristian Høgsberg 4cd259ca59 dri2_glx: Put the invalidate b/c code back in
The backwards compatibility code calls the DRI driver invalidate hook
on swap buffer and flush front buffer.  This lets the DRI driver rely
on invalidate callbacks and drop the glViewport() hack, even if the
server doesn't send invalidate events.  This is essentially a revert
of 2d00d16da7, except that we now also
pass the __DRI_USE_INVALIDATE extension even when the server doesn't
have DRI2 invalidate events.
2010-05-18 22:58:01 -04:00
Kristian Høgsberg c8f407bcec dri2_glx: Terminate loader extension list outside #ifdef 2010-05-18 22:58:01 -04:00
Kristian Høgsberg 4258e3a2e1 glx: Provide the __DRI_USE_INVALIDATE extension to the driver when we can
When we have DRI2 protocol at least 2.3, we get an event from the
server when the back buffers get invalidated.  When that's the case
let the driver know that it can rely on invalidate instead of the
glViewport polling.
2010-05-11 10:23:53 -04:00
Kristian Høgsberg 2d00d16da7 glx: Only call DRI2 invalidate when necessary
We only need this when the server may have swapped the buffers or
when we receive an invalidate event from the server.  The default
behaviour is still that the DRI driver will invalidate its own buffers
when glViewport is called.

https://bugs.freedesktop.org/show_bug.cgi?id=27277
2010-05-10 17:48:11 -04:00
Brian Paul 1fa7789e82 Merge branch '7.8'
Conflicts:

	src/glx/dri2_glx.c
	src/glx/glx_pbuffer.c
2010-04-28 07:21:25 -06:00
Pierre Willenbrock d20fce057e Initialize have_back.
There is a user somewhere that tests it before its initial set.

Signed-off-by: Eric Anholt <eric@anholt.net>
2010-04-27 17:12:39 -07:00
Pierre Willenbrok cc806f70b2 glx: Initialize have_back.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-27 15:53:28 -06:00
Jeremy Huddleston 80b280db88 apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-27 11:26:51 -07:00