Commit Graph

530 Commits

Author SHA1 Message Date
Dave Airlie 77506dac8e GLX: attempt to fix glean makeCurrent test cases.
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-06-17 13:59:28 +10:00
Owen W. Taylor 279143c6e8 Disable SGI_swap_control extension for DRI2
We currently don't have support for SGI_swap_control for direct
contexts with DRI2, so disable reporting the extension. Reporting
the extension, and then having glXSwapIntervalSGI() "succeed"
but do nothing can confuse applications.

https://bugs.freedesktop.org/show_bug.cgi?id=22123
2009-06-12 11:41:37 +10:00
Ian Romanick 1ad1576836 Thank you git for doing the right thing. 2009-06-03 17:55:42 +01:00
Ian Romanick c428f467b6 Fix compiling indirect.c when GLX_DIRECT_RENDERING is not defined
DO NOT HAND-EDIT GLX PROTOCOL FILES.  Seriously.  How can you miss the giant
comment at the top of the file?
2009-06-03 17:53:40 +01:00
Brian Paul 751977075f glapi: regenerated files for GL_ARB_copy_buffer 2009-06-02 21:35:10 -06:00
Aidan Thornton f2445dfd85 Initialize psp->waitX/waitGL for swrast_dri.so.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21053 .
2009-05-18 12:47:00 +02:00
Michel Dänzer 46b81b0cc8 glXChooseVisual: Only consider fbconfig if we can get the corresponding visual.
This can fail, e.g. when XLIB_SKIP_ARGB_VISUALS=1 is set.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524794 and
http://bugs.freedesktop.org/show_bug.cgi?id=21600 .
2009-05-12 09:34:13 +02:00
Brian Paul dd4c142e90 glx: replace Xmalloc() calls with Xcalloc()
Fixes a bug where psp->WaitX was uninitialized.  Reported by Chris Clayton.
2009-05-04 07:52:55 -06:00
Ian Romanick dbf87f2312 DRI2: Implement interface for drivers to access DRI2GetBuffersWithFormat
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:48:20 -07:00
Ian Romanick d8d7b2c395 DRI2: Implement protocol for DRI2GetBuffersWithFormat
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-24 12:48:20 -07:00
Brian Paul 05471828dc glx: added null pointer check in glXGetFBConfigs()
Fixes segfault seen with glxinfo with NVIDIA OpenGL.
2009-04-15 08:01:45 -06:00
Adam Jackson a3c3c1f143 glx: Make glXGetScreenDriver() work for DRI2 2009-04-14 17:56:29 -04:00
Ian Romanick e6386e0d9a DRI2: Assume that there is always a front buffer
Assume that the front-buffer exists even if the server didn't tell the
client that it exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-09 14:18:14 -07:00
Ian Romanick 82634ee8df DRI2: Provide an interface for drivers to flush front-buffer rendering
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-09 14:18:14 -07:00
Brian Paul 29ae40f5dc glx: remove unused local var in determineTextureFormat() 2009-04-03 09:07:04 -06:00
Thomas Hellstrom 96fd3df59a glx: MakeCurrent fixes.
1) If MakeContextCurrent is called with (NULL, None, None), Don't
   send the request to the X server if the current context is direct.
2) Return BadMatch in some error cases according to the glx spec.
3) If MakeContextCurrent is called for a context which is current in
   another thread, return BadAccess according to the glx spec.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-02 11:33:20 +02:00
Jeremy Huddleston f25c6b164f Fix compiling indirect.c when GLX_DIRECT_RENDERING is not defined
(cherry picked from commit b65bc1b6cb72df950c2e26446936804dfcdc432c)
2009-03-31 15:01:45 -07:00
Alan Coopersmith 707c017af6 define __builtin_expect for non-gcc compilers in two more glx files
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-03-25 11:07:31 -07:00
Michel Dänzer 11da7e02aa Revert "dri2: Avoid round-tripping on DRI2GetBuffers for the same set of buffers."
This scheme breaks when the display connection doesn't receive ConfigureNotify
events. This caused reporoducible problems (cropped / misplaced output) when
starting a 3D application in a guest operating system in VMware Workstation.

This reverts commit dd1c68f151.

Conflicts:

	src/glx/x11/dri2_glx.c
2009-03-25 15:53:28 +01:00
Eric Anholt 66175aac76 Fix DRI2 accelerated EXT_texture_from_pixmap with GL_RGB format.
This requires upgrading the interface so that the argument to
glXBindTexImageEXT isn't just dropped on the floor.  Note that this only
fixes the accelerated path on Intel, as Mesa's texture format support is
missing x8r8g8b8 support (right now, GL_RGB textures get uploaded as a8r8gb8,
but in this case we're not doing the upload so we can't really work around it
that way).

Fixes bugs with compositors trying to use shaders that use alpha channels, on
windows without a valid alpha channel.  Bug #19910 and likely others as well.

Reviewed-by:	Ian Romanick <ian.d.romanick@intel.com>
2009-03-20 10:41:28 -07:00
Roland Scheidegger 36010806a1 regenerate glapi 2009-03-12 15:04:47 +01:00
David S. Miller 857ac1e817 mesa: Resurrect SPARC asm code.
This rewrites the sparc GLAPI code so that it's PIC friendly and works
with all of the TLS/PTHREADS/64-bit/32-bit combinations properly.

As a result we can turn SPARC asm back on.  Currently it's only
enabled on Linux, as that's the only place where I can test this
stuff out.

For the moment the cliptest SPARC asm routines are disabled as they
are non-working.  The problem is that they use register %g7 as a
temporary which is where the threading libraries store the thread
pointer on SPARC.  I will fix that code up in a future change as it's
a pretty important routine to optimize.

Like x86 we do the runtime patch as a pthread once-invoked initializer
in init_glapi_relocs().

Unlike x86, however, our GLAPI stubs on SPARC are just two instruction
sequences that branch to a trampoline and put the GLAPI offset into a
register.  The trampoline is what we run-time patch.  The stubs thus
all look like:

glFoo:
	ba		__glapi_sparc_foo_stub
	 sethi		GLAPI_OFFSET(glFOO) * PTR_SIZE, %g3

This actually makes generate_entrypoint() a lot simpler on SPARC.  For
this case in generate_entrypoint() we generate stubs using a 'call'
instead of the 'ba' above to make sure it can reach.

In order to get a proper tail call going here, in the unpatched case,
we do several tricks.  To get the current PC, for example, we save the
return address register into a temporary, do a call, save the return
address register written by the call to another temporary, then
restore the original return address register value.  This is to
avoid having to allocate a stack frame.

This is necessary for PIC address formation.

This new GLAPI scheme lets us get rid of the ugly SPARC GLAPI hacks in
__glXInitialize() and one_time_init().

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-26 18:29:48 -07:00
Alan Hourihane 65562453fb glx: add support for a reallyFlush() function before swap occurs. 2009-02-23 20:28:11 +00:00
Alan Hourihane 63b51b5cf1 dri2: support glXWaitX & glXWaitGL by using fake front buffer. 2009-02-16 11:47:05 +00:00
Eric Anholt f967e8b507 dri2: Don't crash if the server returns more buffers than expected. 2009-02-10 18:45:17 -08:00
Eric Anholt 680c708dee dri2: Initialize variables for the getbuffers round-trip reduction.
Missed setting the initial values which usually didn't hurt at runtime.
2009-02-10 18:45:17 -08:00
Brian Paul e97681c7f5 mesa: merge gallium-0.2 into gallium-master-merge
Merge commit 'origin/gallium-0.2' into gallium-master-merge

Conflicts:

	Makefile
	docs/relnotes-7.4.html
	docs/relnotes.html
	src/mesa/drivers/dri/i965/brw_wm.h
	src/mesa/main/imports.c
	src/mesa/main/mtypes.h
	src/mesa/main/texcompress.c
	src/mesa/main/texenvprogram.c
	src/mesa/main/version.h
	src/mesa/vbo/vbo_exec_api.c
	src/mesa/vbo/vbo_save_draw.c
2009-02-09 09:22:22 -07:00
Eric Anholt dd1c68f151 dri2: Avoid round-tripping on DRI2GetBuffers for the same set of buffers.
We only wanted to request when asked for the same set of buffers when a resize
has happened.  We can just watch the protocol stream for a ConfigureNotify
and flag to do it then.

This is about a 5% win from doing two glViewport()s per frame in openarena.
2009-02-02 12:00:39 -08:00
Ian Romanick d485ee54dd Make GLX_SGIX_pbuffer mandatory
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-01-28 16:28:11 -08:00
Eric Anholt 0f72de5538 dri2: add complaints for more initialization failures.
Somehow we're running into DRI2Authenticate failing, and silent demotion to
swrast is bad.
2009-01-27 14:34:29 -08:00
Alan Hourihane 4df482086e Merge commit 'origin/master' into gallium-0.2
Conflicts:
	windows/VC8/mesa/osmesa/osmesa.vcproj
	windows/VC8/progs/demos/gears.vcproj
	windows/VC8/progs/progs.sln
2009-01-22 09:43:42 +00:00
Ian Romanick ab9b4e1f59 Fix issues with glXMakeContextCurrent and glXMakeCurrentReadSGI
There were several bugs in the infrastructure for these two routines.

1. GLX_ALIAS was incorrectly used.  The function and its alias must be
identical!  glXMakeContextCurrent / glXMakeCurrentReadSGI and
MakeContextCurrent had different parameters.  This caused the last
parameter of MakeContextCurrent to get random values.

2. We based the implementation of glXMakeContextCurrent on the manual
page instead of the GLX spec.  The GLX spec says that
glXMakeContextCurrent can be passed a Window as a drawable.  When this
happens, it will behave just like glXMakeCurrentReadSGI or
glXMakeCurrent.

3. If there was a problem finding or creating the DRI drawable,
MakeContextCurrent would crash instead of returning an error.

This commit fixes all three issues, and fixes bug #18367 and bug #19625.
2009-01-20 13:55:18 -08:00
Brian Paul b7f802eca2 glx: gcc 2.95 build fix (move declaration before code)
Adapted from patch by Matthieu Herbb <matthieu.herrb@laas.fr>
2009-01-18 10:00:34 -07:00
Alan Hourihane 658b1bdb1c Merge commit 'origin/master' into gallium-0.2
Conflicts:
	docs/install.html
	docs/relnotes-7.3.html
	src/mesa/shader/slang/slang_codegen.c
	src/mesa/shader/slang/slang_compile.c
	src/mesa/shader/slang/slang_emit.c
	src/mesa/shader/slang/slang_preprocess.c
	src/mesa/shader/slang/slang_preprocess.h
2009-01-14 23:33:41 +00:00
Matthieu Herrb 436024561a Build fixes for gcc 2.95 2009-01-11 16:56:34 -07:00
Owain G. Ainsworth b4866f8a52 Fix build with GCC 2.95. 2009-01-11 16:44:40 -07:00
Alan Hourihane a22d865f93 Merge commit 'origin/master' into gallium-0.2 2008-12-15 11:16:03 +00:00
Ian Romanick 2dd0c16f21 GLX: Change resulting from previous commit
Commit db61cbfa2aa241da49589331d8b6875d9a77d826 made modifications to
the protocol generator data and scripts.  This commit represents the
changes to the generated files resulting from the previous changes.

This is the client-side part of the fix for bugzilla #11003.
2008-12-14 18:46:17 -08:00
Alan Hourihane 33a1f495d4 Merge commit 'origin/master' into gallium-0.2
Conflicts:

	progs/glsl/Makefile
2008-12-08 14:29:50 +00:00
Kristian Høgsberg 154a9e5317 Bump dri2proto requirement to 1.99.3, drop CopyRegion bitmask from protocol. 2008-12-01 21:44:03 -05:00
Alan Hourihane c4c86bbd16 Merge commit 'origin/master' into gallium-0.2 2008-11-28 16:19:10 +00:00
RALOVICH, Kristóf 8c2b4b33c5 Revert "glx: xcbified visual and FBConfig choosing"
This reverts commit 62688f1135.
2008-11-27 07:20:38 -07:00
RALOVICH, Kristóf 80d1531ebe Revert "glx: revert using nonexsisten XCB version of glXGetFBConfigsSGIX"
This reverts commit 5369876501.
2008-11-27 07:20:35 -07:00
RALOVICH, Kristóf 5369876501 glx: revert using nonexsisten XCB version of glXGetFBConfigsSGIX
This uses a GLX VendorPrivate request. VendorPrivates are real GLX API
calls but use the same protocol request. XCB does not currently
support specific VendorPrivetes directly. See eg.:
http://lists.freedesktop.org/archives/xcb/2008-November/004036.html
for more information.
2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 1e167f6b5c glx: remove XCB debug leftover 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf ff3fa92eaa glx: xcbified glXSwapBuffers 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 62688f1135 glx: xcbified visual and FBConfig choosing 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 66db1b64e8 glx: xcbified __glXClientInfo 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 6d1d157606 glx: no graphics context during initialization 2008-11-26 10:02:11 -07:00
RALOVICH, Kristóf 9c7aaa7afb glx: xcbified __glXIsDirect 2008-11-26 10:02:10 -07:00
RALOVICH, Kristóf 00f22f972f glx: missing static on local function 2008-11-26 10:02:10 -07:00
RALOVICH, Kristóf f0d015cccb glx: use __glXGetString 2008-11-26 10:00:58 -07:00
RALOVICH, Kristóf 9c98e35ff6 glx: use __glXQueryServerString 2008-11-26 10:00:58 -07:00
RALOVICH, Kristóf 24b8a8cfe8 glx: implement __glXGetString, hide __glXGetStringFromServer 2008-11-26 10:00:58 -07:00
RALOVICH, Kristóf fd52001c5c glx: implement QueryVersion using XCB 2008-11-26 10:00:58 -07:00
RALOVICH, Kristóf 5444424562 glx: implement __glXQueryServerString using XCB 2008-11-26 10:00:58 -07:00
Brian Paul df6155fcff Merge commit 'origin/master' into gallium-0.2
Conflicts:

	progs/glsl/Makefile
2008-11-24 14:08:58 -07:00
Bernd Buschinski d52e8543b6 glx: Add missing include for XCB, fixing crash on 64-bit.
Bug #18689
2008-11-24 11:40:38 -08:00
Keith Whitwell 7468765b18 Merge commit 'origin/master' into gallium-0.2
Conflicts:

	src/mesa/shader/prog_print.c
2008-11-15 16:53:24 +00:00
Kristian Høgsberg e1fbb30211 glFlush before CopySubBuffer, fix coordinates and extension name typo. 2008-11-12 15:26:25 -05:00
Hanno Böck becf3d9272 glx: fix xcb build 2008-11-12 06:56:42 -07:00
Brian Paul 19e4222f93 Merge commit 'origin/master' into gallium-0.2
Conflicts:

	src/mesa/shader/prog_execute.c
	src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
2008-11-11 14:42:41 -07:00
Kristian Høgsberg 57d78067bd Don't mess with emacs tab width. 2008-11-11 13:41:43 -05:00
Brian Paul 13f96c5401 GLX: fix out-of-bounds memory issue in indirect glAreTexturesResident()
See bug 18445.
When getting array results, __glXReadReply() always reads a multiple of
four bytes.  This can cause writing to invalid memory when 'n' is not a
multiple of four.

Special-case the glAreTexturesResident() functions now.
To fix the bug, we use a temporary buffer that's a multiple of four bytes
in length.

NOTE: this commit also reverts part of commit 919ec22ecf
(glx/x11: Added some #ifdef GLX_DIRECT_RENDERING protection) which
directly edited the indirect.c file rather than the python generator!
I'm not repairing that issue at this time.
2008-11-10 14:27:42 -07:00
Alan Hourihane 61d3a66456 Merge commit 'origin/master' into gallium-0.2 2008-10-27 15:37:22 +00:00
Kristof Ralovich 0970de3171 glx: updated comment 2008-10-21 08:20:43 -06:00
Kristian Høgsberg d533a5d00a Update DRI2 implementation according to new specification. 2008-10-15 11:18:05 +01:00
Kristian Høgsberg e5ef0beb05 Revert pointless reindents to avoid merge conflicts.
Why are we reindenting code that's work in progress...
2008-10-15 11:18:05 +01:00
RALOVICH, Kristóf 5f6472fc69 glx: indent -br -i3 -npcs --no-tabs glxclient.h 2008-10-15 11:18:05 +01:00
RALOVICH, Kristóf 5e3edb6f98 glx: indent -br -i3 -npcs --no-tabs glcontextmodes.h 2008-10-15 11:18:04 +01:00
RALOVICH, Kristóf 00be6dfe2b glx: indent -br -i3 -npcs --no-tabs glxextensions.c 2008-10-15 11:18:04 +01:00
RALOVICH, Kristóf c6d037678d glx: indent -br -i3 -npcs --no-tabs glxextensions.h 2008-10-15 11:18:00 +01:00
RALOVICH, Kristóf 1bb4658fab glx: indent -br -i3 -npcs --no-tabs xfont.c 2008-10-15 11:17:59 +01:00
RALOVICH, Kristóf b57e9f2a74 glx: indent -br -i3 -npcs --no-tabs xf86dristr.h 2008-10-15 11:17:59 +01:00
RALOVICH, Kristóf 400c2d0cea glx: indent -br -i3 -npcs --no-tabs XF86dri.c 2008-10-15 11:17:58 +01:00
RALOVICH, Kristóf b69ef3eb51 glx: indent -br -i3 -npcs --no-tabs xf86dri.h 2008-10-15 11:17:58 +01:00
RALOVICH, Kristóf f7ff9f1913 glx: kill old K&R syntax in XF86dri.c 2008-10-15 11:17:58 +01:00
RALOVICH, Kristóf dd8b90a81b glx: indent -br -i3 -npcs --no-tabs vertarr.c 2008-10-15 11:17:58 +01:00
RALOVICH, Kristóf 801933c3e4 glx: indent -br -i3 -npcs --no-tabs singlepix.c 2008-10-15 11:17:57 +01:00
RALOVICH, Kristóf ee88fff432 glx: indent -br -i3 -npcs --no-tabs single2.c 2008-10-15 11:17:57 +01:00
RALOVICH, Kristóf 750f497713 glx: indent -br -i3 -npcs --no-tabs renderpix.c 2008-10-15 11:17:57 +01:00
RALOVICH, Kristóf 5b48c862c6 glx: indent -br -i3 -npcs --no-tabs render2.c 2008-10-15 11:17:56 +01:00
RALOVICH, Kristóf 3c900bd546 glx: indent -br -i3 -npcs --no-tabs pixelstore.c 2008-10-15 11:17:56 +01:00
RALOVICH, Kristóf 32d7d5fbae glx: indent -br -i3 -npcs --no-tabs pixel.c 2008-10-15 11:17:56 +01:00
RALOVICH, Kristóf 1b2f122739 glx: indent -br -i3 -npcs --no-tabs packsingle.h 2008-10-15 11:17:55 +01:00
RALOVICH, Kristóf 3a2568b375 glx: indent -br -i3 -npcs --no-tabs packrender.h 2008-10-15 11:17:55 +01:00
RALOVICH, Kristóf b5f7c84cdf glx: indent -br -i3 -npcs --no-tabs indirect_window_pos.c 2008-10-15 11:17:55 +01:00
RALOVICH, Kristóf f9fa7400d7 glx: indent -br -i3 -npcs --no-tabs indirect_vertex_program.c 2008-10-15 11:17:55 +01:00
RALOVICH, Kristóf 76ddfa3a4c glx: indent -br -i3 -npcs --no-tabs indirect_vertex_array_priv.h 2008-10-15 11:17:54 +01:00
RALOVICH, Kristóf c09881c79f glx: indent -br -i3 -npcs --no-tabs indirect_vertex_array.h 2008-10-15 11:17:54 +01:00
RALOVICH, Kristóf f2d45617dd glx: indent -br -i3 -npcs --no-tabs indirect_vertex_array.c 2008-10-15 11:17:54 +01:00
RALOVICH, Kristóf 5ae395a883 glx: indent -br -i3 -npcs --no-tabs indirect_transpose_matrix.c 2008-10-15 11:17:53 +01:00
RALOVICH, Kristóf 4cc369e820 glx: indent -br -i3 -npcs --no-tabs indirect_texture_compression.c 2008-10-15 11:17:53 +01:00
RALOVICH, Kristóf 5a3db8004e glx: indent -br -i3 -npcs --no-tabs glx_query.c 2008-10-15 11:17:51 +01:00
RALOVICH, Kristóf 35dc7eadfa glx: indent -br -i3 -npcs --no-tabs glx_pbuffer.c 2008-10-15 11:17:51 +01:00
RALOVICH, Kristóf 3dd46f15c3 glx: indent -br -i3 -npcs --no-tabs glxhash.c 2008-10-15 11:17:51 +01:00
RALOVICH, Kristóf b87e8ae0f5 glx: indent -br -i3 -npcs --no-tabs glxhash.h 2008-10-15 11:17:50 +01:00
RALOVICH, Kristóf b7f76587b8 glx: indent -br -i3 -npcs --no-tabs glxext.c 2008-10-15 11:17:49 +01:00
RALOVICH, Kristóf 3959d457d6 glx: indent -br -i3 -npcs --no-tabs glxcurrent.c 2008-10-15 11:17:49 +01:00
RALOVICH, Kristóf c6ea997137 glx: indent -br -i3 -npcs --no-tabs glxcmds.c 2008-10-15 11:17:48 +01:00