[Mesa3d-dev] [PATCH] Set GL context to null in __glXSetCurrentContextNull

2010-01-16 Thread Luca Barbieri
__glXSetCurrentContextNull currently does not set the GL context to null in the direct rendering case. This can result in a segfault trying to flush an invalid old context in glXMakeCurrent. This fixes a crash starting the Unigine demos (they still don't work due to missing extensions though). --

Re: [Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.

2010-01-16 Thread Luca Barbieri
Using SIGIO would be a problem in a library. However, the kernel can be told to send an arbitrary signal (see F_SETSIG) and glibc can allocate realtime signals with __libc_allocate_rtsig() (pthread uses this for internal signals). ---

Re: [Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.

2010-01-16 Thread Luca Barbieri
How about just having GLX open another connection to the X server and use that to receive ConfigureNotify? Since we are using direct rendering, we must be on the same machine, so it's just a unix/TCP loopback connection and should always work. Xlib stores the display name in _XDisplay.display_name

[Mesa3d-dev] [PATCH 0/2] st/mesa: EXT_framebuffer_multisample and CopyTex[Sub]Image acceleration

2010-01-16 Thread Marek Olšák
Hi, the first patch enables EXT_framebuffer_multisample in st/mesa. This extension appears to alias ARB_fbo functions and there's no other checking for multisampling in st/mesa where ARB_fbo is being enabled, so fbo_multisample could be enabled by default. The second patch enables hardware-accele

[Mesa3d-dev] [PATCH] Check if gcc supports -fvisibility=hidden before adding to CFLAGS

2010-01-16 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith --- configure.ac |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index d01d0f1..f121002 100644 --- a/configure.ac +++ b/configure.ac @@ -96,7 +96,14 @@ esac dnl Add flags for gcc and g++ if test "x$GC

[Mesa3d-dev] [PATCH] Remove hardcoded -Wall from Radeon DRI makefiles

2010-01-16 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith --- src/mesa/drivers/dri/r200/Makefile |2 +- src/mesa/drivers/dri/r300/Makefile |1 - src/mesa/drivers/dri/r600/Makefile |3 +-- src/mesa/drivers/dri/radeon/Makefile |2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/me

[Mesa3d-dev] [PATCH] radeon_compiler: include main/compiler.h for compiler portability macros

2010-01-16 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith --- .../drivers/dri/r300/compiler/radeon_compiler.h|2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index 731adc1..f27f858 1006

[Mesa3d-dev] [PATCH] Sun compilers now support some gcc __attribute__ values

2010-01-16 Thread Alan Coopersmith
Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__ calls for aligned, always_inline, noinline, pure, const, and malloc. This commit includes updates to files that were regenerated by gl_XML.py after adding the __SUNPRO_C checks to it Signed-off-by: Alan Coopersmith --- include/GL/

[Mesa3d-dev] [PATCH] inline is portable & standard, __inline is not

2010-01-16 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith --- src/glsl/cl/sl_cl_parse.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index e9b3707..61f50db 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -345,7 +34

[Mesa3d-dev] [PATCH] Add -I$(TOP)/src/mesa/shader needed when building shader/lex.yy.o

2010-01-16 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith --- src/mesa/sources.mak |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index a4d09c7..70fae92 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -377,5 +377,6 @@ GLSL_LIBS = \ INCL

Re: [Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.

2010-01-16 Thread Chia-I Wu
On Sat, Jan 16, 2010 at 10:58:28PM +0100, Francisco Jerez wrote: > The current buffer validation approach (AKA the DRI2 glViewport hack) > is both incorrect (because a compliant OpenGL application may opt for > the identity as viewport transform and work with window coordinates > directly) and inef

[Mesa3d-dev] New state tracker API discussion

2010-01-16 Thread Chia-I Wu
Hi Jakob, I've pushed an updated version to http://cgit.freedesktop.org/~olv/st_api/ If you think anything is not ready to go into st_api.h, just let me know. I will move them to DESIGN. Or you can start a repo that I can pull from. I myself would like to see the st_visual and st_api->make_cu

Re: [Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.

2010-01-16 Thread Francisco Jerez
Hi, Luca Barbieri writes: > What are the advantages of the new DRI2 event over the existing > ConfigureNotify? > Couldn't that be used as a fallback on older servers? ConfigureNotify is a core event, so: * All the methods we have to catch them are nasty hacks (or at least all the methods I c

Re: [Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.

2010-01-16 Thread Luca Barbieri
What are the advantages of the new DRI2 event over the existing ConfigureNotify? Couldn't that be used as a fallback on older servers? -- Throughout its 18-year history, RSA Conference consistently attracts the world's bes

[Mesa3d-dev] [mesa patch 1/3] dri2: Event driven buffer validation.

2010-01-16 Thread 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 inval

[Mesa3d-dev] [mesa patch 3/3] st/dri2: Use event-driven buffer validation.

2010-01-16 Thread Francisco Jerez
--- src/gallium/state_trackers/dri/dri_context.c |6 +-- src/gallium/state_trackers/dri/dri_drawable.c | 13 ++ src/gallium/state_trackers/dri/dri_screen.c | 12 ++ src/mesa/SConscript |1 - src/mesa/sources.mak |1 - sr

[Mesa3d-dev] [mesa patch 2/3] dri/nouveau: Use event driven buffer validation.

2010-01-16 Thread Francisco Jerez
--- This driver isn't in master yet, but I thought that maybe this patch could be interesting. src/mesa/drivers/dri/nouveau/nouveau_context.c | 38 +++--- src/mesa/drivers/dri/nouveau/nouveau_context.h |3 ++ src/mesa/drivers/dri/nouveau/nouveau_driver.c |1 + src/me

[Mesa3d-dev] [xserver patch 1/6] Add a PreConfigureWindow hook.

2010-01-16 Thread Francisco Jerez
Executed from the ConfigureWindow request, right before sending ConfigureNotify to the clients. This commit breaks the ScreenRec ABI. Signed-off-by: Francisco Jerez --- It might be possible to delay the ABI bump, but I'd rather do it this way. The already existing Resize and MoveWindow hooks are

[Mesa3d-dev] [xserver patch 3/6] dri2: Add a type parameter to SwapBuffers.

2010-01-16 Thread Francisco Jerez
It helps to determine if buffers need to be invalidated or not, and it makes sense for e.g. GLX_OML_swap_control. Note that this patch bumps the DRI2InfoRec version and the minimum required dri2proto version. Signed-off-by: Francisco Jerez --- configure.ac |2 +- glx/glxdri2.c

[Mesa3d-dev] [xserver patch 5/6] glx/dri2: Notify the driver when its buffers become invalid.

2010-01-16 Thread Francisco Jerez
Signed-off-by: Francisco Jerez --- glx/glxdri2.c | 28 +--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index c5e7b0b..0ac6900 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -67,6 +67,7 @@ struct __GLXDRIscreen {

[Mesa3d-dev] [xserver patch 4/6] glx: Enforce a 1:1 correspondence between GLX and X11 windows.

2010-01-16 Thread Francisco Jerez
The spec says (regarding glXCreateWindow): "If there is already a GLXFBConfig associated with win (as a result of a previous glXCreateWindow call), then a BadAlloc error is generated.". It will also come useful to implement DRI2InvalidateBuffers for the indirect case. Signed-off-by: Francisco Jere

[Mesa3d-dev] [xserver patch 6/6] dri2: Support the DRI2InvalidateBuffers event.

2010-01-16 Thread Francisco Jerez
Bumps the supported DRI2 protocol version to 1.3. Signed-off-by: Francisco Jerez --- hw/xfree86/dri2/dri2.c | 82 +++ hw/xfree86/dri2/dri2.h |4 ++ hw/xfree86/dri2/dri2ext.c | 22 +++ include/protocol-versions.h |2 +- 4 fil

[Mesa3d-dev] [xserver patch 2/6] dri2: No need to blit from front on DRI2GetBuffers if they're just being reused.

2010-01-16 Thread Francisco Jerez
It can be quite an expensive operation, so we're better off not doing it unless it's totally required. Signed-off-by: Francisco Jerez --- hw/xfree86/dri2/dri2.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 3db

[Mesa3d-dev] [dri2proto patch 2/3] More useful names for the DRI2_*_COMPLETE tokens.

2010-01-16 Thread Francisco Jerez
The same names could be reused for e.g. GLX_OML_swap_control, and the COMPLETE suffix doesn't make so much sense there. Signed-off-by: Francisco Jerez --- This patch isn't strictly necessary for buffer validation events, but it makes some of the X server code nicer. dri2proto.txt |6 +++---

[Mesa3d-dev] [RFC] Event-based buffer validation for DRI2.

2010-01-16 Thread Francisco Jerez
The current buffer validation approach (AKA the DRI2 glViewport hack) is both incorrect (because a compliant OpenGL application may opt for the identity as viewport transform and work with window coordinates directly) and inefficient (some programs have the habit of calling glViewport several times

[Mesa3d-dev] [dri2proto patch 3/3] Bump the package version.

2010-01-16 Thread Francisco Jerez
Signed-off-by: Francisco Jerez --- configure.ac |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index fc96197..c5affe3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.57]) -AC_INIT([DRI2Proto], [2.2], [https://bugs.

[Mesa3d-dev] [dri2proto patch 1/3] Define an event to notify clients about the validity of their buffers.

2010-01-16 Thread Francisco Jerez
Bumps the protocol version. Signed-off-by: Francisco Jerez --- dri2proto.h | 19 +-- dri2proto.txt | 31 --- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/dri2proto.h b/dri2proto.h index 43152c2..9708a4a 100644 --- a/dri2proto.h

Re: [Mesa3d-dev] [RFC] instanced-arrays branch

2010-01-16 Thread michal
Chia-I Wu wrote on 2010-01-16 02:28: > On Fri, Jan 15, 2010 at 07:22:52PM +0100, michal wrote: > >> I think I will try to manually patch it later. Thanks! >> > The first line of the patch is somehow garbled. But I am not sure if > that is a good fix, so please go ahead. > > Commited, th

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Jakob Bornecrantz
On 16 jan 2010, at 11.47, Chia-I Wu wrote: > On Sat, Jan 16, 2010 at 10:25:53AM +, Jakob Bornecrantz wrote: > [snipped] >>> Both glEGLImageTargetTexture2DOES and vgCreateEGLImageTargetKHR will >>> take EGLImage as their argument, there needs to be a lookup >>> function in >>> st_manager_api to

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Chia-I Wu
On Sat, Jan 16, 2010 at 10:25:53AM +, Jakob Bornecrantz wrote: [snipped] > >Both glEGLImageTargetTexture2DOES and vgCreateEGLImageTargetKHR will > >take EGLImage as their argument, there needs to be a lookup > >function in > >st_manager_api to return the pipe texture of the image. > We could ju

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Chia-I Wu
On Sat, Jan 16, 2010 at 10:10:17AM +, Jakob Bornecrantz wrote: > On 16 jan 2010, at 09.47, Chia-I Wu wrote: > >On Sat, Jan 16, 2010 at 05:49:44AM +, Jakob Bornecrantz wrote: > >>Here comes a quick review, lot of the things in here are out of date > >>due to discussions over email so I tried

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Chia-I Wu
On Sat, Jan 16, 2010 at 04:32:29AM +, Jakob Bornecrantz wrote: > I see what the problem is, EGL configurations defer things like > double buffering to be derived at surface creation time. For GLX > this is a part of the config from the start. Maybe we should have > those configureable attribute

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Jakob Bornecrantz
On 16 jan 2010, at 10.05, Chia-I Wu wrote: > On Sat, Jan 16, 2010 at 04:03:52AM +, Jakob Bornecrantz wrote: >>> I am thinking all resource peeking should be paired with >>> lock_resource >>> and unlock_resource. If an extension does not imply access >>> control, the >>> sequence might look l

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Jakob Bornecrantz
On 16 jan 2010, at 09.47, Chia-I Wu wrote: > On Sat, Jan 16, 2010 at 05:49:44AM +, Jakob Bornecrantz wrote: >> Here comes a quick review, lot of the things in here are out of date >> due to discussions over email so I tried to only comment on bits. >> A general note is that you seem to have rem

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Chia-I Wu
On Sat, Jan 16, 2010 at 04:03:52AM +, Jakob Bornecrantz wrote: > >I am thinking all resource peeking should be paired with lock_resource > >and unlock_resource. If an extension does not imply access > >control, the > >sequence might look like lock_resource -> increase reference count and > >st

Re: [Mesa3d-dev] Inter-StateTracker communication

2010-01-16 Thread Chia-I Wu
On Sat, Jan 16, 2010 at 05:49:44AM +, Jakob Bornecrantz wrote: > Here comes a quick review, lot of the things in here are out of date > due to discussions over email so I tried to only comment on bits. > A general note is that you seem to have removed a lot of comments. > Could you please base