Commit Graph

103 Commits

Author SHA1 Message Date
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
Michel Dänzer ff20543c81 Merge branch '7.8' 2010-04-23 11:18:29 +02:00
Michel Dänzer c37e275e77 glx/dri2: Fix build with dri2proto which doesn't define X_DRI2SwapInterval. 2010-04-23 11:16:03 +02:00
Jesse Barnes 45e2b51c85 DRI2/GLX: check for vblank_mode in DRI2 GLX code
Re-add support for the vblank_mode environment and configuration
variable.  Useful for benchmarking and app control.
2010-04-22 12:49:45 -07:00
Jesse Barnes 0a18cdb0ed DRI2: check for swapAvailable before using swap interval protocol
This should have been part of the last change...
2010-04-19 14:20:21 -07:00
Jesse Barnes 385e2896eb DRI2: synchronize swap interval with server at startup time
In the direct rendered case, we need to tell the server our initial swap
interval.  If we don't, the local and server values will be out of sync,
since the server and client defaults may be different (as they were
before this patch).
2010-04-19 09:56:32 -07:00
Michael Schmidt d9793fc3ac Initialize DRI2 swap interval to 0
https://bugs.freedesktop.org/show_bug.cgi?id=27628
2010-04-14 10:15:47 -04:00
Jesse Barnes 2b4d8616f5 GLX/DRI2: pass GLX drawable ID to dri2InvalidateBuffers
The IDs will be the same in the case where an X window is used directly
as a GLX drawable, but will fail if a new GLX drawable is created
explicitly, as with glxgears_fbconfig.

Fixes fdo bug #27190.
2010-04-01 17:29:19 -07:00
Jeremy Huddleston 115203281c Revert accidental commits from the xquartz tree
This reverts commit 9aadc793f3.
This reverts commit 69ea4e7718.
This reverts commit dbe8b01393.
This reverts commit 23215ef4d6.
This reverts commit 9495e37030.
This reverts commit 0594cf7088.
This reverts commit 86a7978d37.
This reverts commit 437902ce97.
2010-04-01 17:01:51 -07:00
Jeremy Huddleston 23215ef4d6 apple: Change ifdefs for DRI to be DRI && !APPLE
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-01 12:33:46 -07:00
Michel Dänzer 07c6d94cd7 glx/dri2: Fix debug build with old dri2proto.
Apparently the higher compiler optimization level in non-debug builds was
eliminating the unused functions referencing the unresolved DRI2 symbols...
2010-03-30 11:50:13 +02:00
Brian Paul ae7b3a632d glx: Move initialization of ext_list_first_time to where it's storage is allocated
Move the initialization of ext_list_first_time from all of the DRI loader's
CreateScreen routines, to where the storage for the screen config is
allocated.

It needs to get set in the screen-config even if DRI is forced off
using LIBGL_ALWAYS_INDIRECT, so that psc->direct_support is initialized
correctly, otherwise __glXExtensionBitIsEnabled() always returns FALSE

Specifically, this causes a problem with an X server which advertises
GLX<=1.2, and the GLX_SGIX_fbconfig extension.
glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to
check if the GLX_SGIX_fbconfig extension is available, but that function
won't return correct information because that data has never been
initialized, because ext_list_first_time was never set...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>

(cherry picked from commit 96ab4d2b84)
2010-03-05 17:32:36 -07:00
Jesse Barnes 1ca968363d DRI2: expose OML_sync_control if possible
If the server supports the OML related protocol, enable support for the
extension.
2010-03-05 11:22:05 -08:00
Francisco Jerez 61d26bc82e dri2: Event driven buffer validation.
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-16 10:38:50 -05:00
Kristian Høgsberg 6e8897ff9f Retire miniglx and move the actual glx code up to src/glx 2010-02-09 09:58:36 -05:00
Renamed from src/glx/x11/dri2_glx.c (Browse further)