Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
On May 5, 2011, at 1:09 PM, Jesse Barnes wrote: On Thu, 05 May 2011 12:59:50 -0700 Jeremy Huddleston jerem...@apple.com wrote: For *proto/mesa: Reviewed-by: Jeremy Huddleston jerem...@apple.com Thanks. For xserver: This looks incomplete. You also need to update swap_count in DRI2DrawableRec to be CARD32. That value is used in other places that actually preserve the full 64 bits. I could add an explicit cast in the few places where we pass it to the swap completion though if you think that's better... Yes, I realize that there are some areas that use 64bit for sbc. Do we really need 64bits for this? If so, how do we properly to communicate the 64bit value between server/client? Currently, your changes result in an implicit cast from 64bit to 32bits in DRI2SwapComplete which will cause problems if we really do need those extra bits: if (swap_complete) swap_complete(client, swap_data, type, ust, frame, pPriv-swap_count); It looks to me like much more of DRI2 should be rewritten to use 32bit swap counts, or there should be some other mechanism in place to communicate the full 64bit value. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
Yes, I realize that there are some areas that use 64bit for sbc. Do we really need 64bits for this? If so, how do we properly to communicate the 64bit value between server/client? Currently, your changes result in an implicit cast from 64bit to 32bits in DRI2SwapComplete which will cause problems if we really do need those extra bits: if (swap_complete) swap_complete(client, swap_data, type, ust, frame, pPriv-swap_count); It looks to me like much more of DRI2 should be rewritten to use 32bit swap counts, or there should be some other mechanism in place to communicate the full 64bit value. Yeah there are other mechanisms (the OML sync extension) for communicating the whole 64 bits. Both the swap reply and msc reply deal in the full 64 bits, just the swap event (an unrelated extension) truncates to 32 bits. (Also I think the 64 bit size for swap count in the OML extension is just inertia; getting to a count that high even at 120Hz is going to take awhile.) Ok, well this all really doesn't sit well with me, but it would put my mind slightly at ease if you would do some logging of the problem if we encounter it in DRI2SwapComplete. That might give your future self some clue as to what is going wrong when you see issues down the road: if (swap_complete) { if (pPriv-swap_count 0x) ErrorF(something appropriate); swap_complete(client, swap_data, type, ust, frame, (CARD32)pPriv-swap_count); } ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
For *proto/mesa: Reviewed-by: Jeremy Huddleston jerem...@apple.com For xserver: This looks incomplete. You also need to update swap_count in DRI2DrawableRec to be CARD32. On May 5, 2011, at 12:45 PM, Jesse Barnes wrote: Use the new event types so we can pass a valid SBC value to clients. Fix up the completion calls to use CARD32 instead of CARD64 to match the new field size. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org diff --git a/configure.ac b/configure.ac index 6eb780c..3e0ed5d 100644 --- a/configure.ac +++ b/configure.ac @@ -771,11 +771,11 @@ RECORDPROTO=recordproto = 1.13.99.1 SCRNSAVERPROTO=scrnsaverproto = 1.1 RESOURCEPROTO=resourceproto DRIPROTO=xf86driproto = 2.1.0 -DRI2PROTO=dri2proto = 2.3 +DRI2PROTO=dri2proto = 2.5 XINERAMAPROTO=xineramaproto BIGFONTPROTO=xf86bigfontproto = 1.2.0 DGAPROTO=xf86dgaproto = 2.0.99.1 -GLPROTO=glproto = 1.4.10 +GLPROTO=glproto = 1.4.14 DMXPROTO=dmxproto = 2.2.99.1 VIDMODEPROTO=xf86vidmodeproto = 2.2.99.1 WINDOWSWMPROTO=windowswmproto diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 93c5e5b..e872258 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -163,10 +163,10 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable) static void __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, - CARD64 msc, CARD64 sbc) + CARD64 msc, CARD32 sbc) { __GLXdrawable *drawable = data; -xGLXBufferSwapComplete wire; +xGLXBufferSwapComplete2 wire; if (!(drawable-eventMask GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK)) return; @@ -192,8 +192,7 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, wire.ust_lo = ust 0x; wire.msc_hi = msc 32; wire.msc_lo = msc 0x; -wire.sbc_hi = sbc 32; -wire.sbc_lo = sbc 0x; +wire.sbc = sbc; WriteEventsToClient(client, 1, (xEvent *) wire); } diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h index fe0bf6c..2a41ead 100644 --- a/hw/xfree86/dri2/dri2.h +++ b/hw/xfree86/dri2/dri2.h @@ -51,7 +51,7 @@ extern CARD8 dri2_minor; typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr; typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type, - CARD64 ust, CARD64 msc, CARD64 sbc); + CARD64 ust, CARD64 msc, CARD32 sbc); typedef DRI2BufferPtr (*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw, diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 4e48e65..552b26b 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -357,9 +357,9 @@ vals_to_card64(CARD32 lo, CARD32 hi) static void DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, - CARD64 sbc) + CARD32 sbc) { -xDRI2BufferSwapComplete event; +xDRI2BufferSwapComplete2 event; DrawablePtr pDrawable = data; event.type = DRI2EventBase + DRI2_BufferSwapComplete; @@ -369,8 +369,7 @@ DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, event.ust_lo = ust 0x; event.msc_hi = (CARD64)msc 32; event.msc_lo = msc 0x; -event.sbc_hi = (CARD64)sbc 32; -event.sbc_lo = sbc 0x; +event.sbc = sbc; WriteEventsToClient(client, 1, (xEvent *)event); } ___ xorg-de...@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] glx: Check flush DRI extension version at runtime
On Don, 2011-05-05 at 23:44 -0400, nobled wrote: The DRI driver itself might not have version 3 of the DRI2 flush extension, in which case this would've pointed to out of bounds memory... Pushed, thanks. As for your other patches, I'm hesitating until there's confirmation GLX_EXT_texture_from_pixmap actually works in practice with direct rendering. So, does it work for you, and if so, using which X and Mesa drivers? -- Earthling Michel Dänzer |http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] gallium: implement seamless cubemap extensions
On 05/05/2011 05:40 PM, Marek Olšák wrote: A new patch is attached. Reviewed-by: Brian Paul bri...@vmware.com ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] mesa: implement AMD_seamless_cubemap_per_texture
On 05/05/2011 05:39 PM, Marek Olšák wrote: A new patch is attached. Looks good, but it seems to be missing the code to set the seamless flag in samplerobj.c If you want to commit this and do that as a follow-up that's fine. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Status of VDPAU and XvMC state-trackers (was Re: Build error on current xvmc-r600 pipe-video)
Andy Furniss wrote: It does fix xvmc - my chip is RV770 (well RV790) so I wasn't expecting any change. I've got a RV670 box that I test with occasionally, so I thought I would try that - I didn't get to test the patch as I found it has suffered a separate regression, which causes quite different and bad artifacts. Playing around with git reset --hard I found that - dd6cd206a6395be651bc965580e17c0d63513c7b [g3dvl] correctly implement non power of two buffers regresses rendering on my RV670. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] st/egl: Implement EGL_WL_bind_wayland_display for x11, drm, wayland
--- configure.ac |4 +- src/gallium/state_trackers/egl/Makefile|2 + src/gallium/state_trackers/egl/common/egl_g3d.c|5 + .../state_trackers/egl/common/egl_g3d_api.c| 33 ++ .../state_trackers/egl/common/egl_g3d_image.c | 27 + src/gallium/state_trackers/egl/common/native.h |2 + .../egl/common/native_wayland_bufmgr.h | 46 .../egl/common/native_wayland_drm_bufmgr_helper.c | 57 ++ .../egl/common/native_wayland_drm_bufmgr_helper.h | 44 src/gallium/state_trackers/egl/drm/native_drm.c| 108 src/gallium/state_trackers/egl/drm/native_drm.h|9 ++ .../state_trackers/egl/wayland/native_drm.c| 69 + src/gallium/state_trackers/egl/x11/native_dri2.c | 69 + src/gallium/state_trackers/egl/x11/x11_screen.c| 17 +++ src/gallium/state_trackers/egl/x11/x11_screen.h|6 + src/gallium/targets/egl/Makefile |1 + 16 files changed, 497 insertions(+), 2 deletions(-) create mode 100644 src/gallium/state_trackers/egl/common/native_wayland_bufmgr.h create mode 100644 src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c create mode 100644 src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h diff --git a/configure.ac b/configure.ac index 3b05ca3..0eb223c 100644 --- a/configure.ac +++ b/configure.ac @@ -1194,12 +1194,12 @@ if test x$enable_egl = xyes; then EGL_DRIVERS_DIRS=glx fi +PKG_CHECK_MODULES([LIBUDEV], [libudev 150], + [have_libudev=yes],[have_libudev=no]) if test $mesa_driver = dri; then # build egl_dri2 when xcb-dri2 is available PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes], [have_xcb_dri2=yes],[have_xcb_dri2=no]) -PKG_CHECK_MODULES([LIBUDEV], [libudev 150], - [have_libudev=yes],[have_libudev=no]) if test $have_xcb_dri2 = yes; then EGL_DRIVER_DRI2=dri2 diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index 53673a7..763e7b5 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -6,6 +6,7 @@ common_INCLUDES = \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/auxiliary \ -I$(TOP)/src/egl/main \ + -I$(TOP)/src/egl/wayland/wayland-drm/ \ -I$(TOP)/include common_SOURCES = $(wildcard common/*.c) @@ -56,6 +57,7 @@ endif ifneq ($(findstring wayland, $(EGL_PLATFORMS)),) EGL_OBJECTS += $(wayland_OBJECTS) EGL_CPPFLAGS += -DHAVE_WAYLAND_BACKEND +DEFINES += -DHAVE_WAYLAND_BACKEND endif ifneq ($(findstring drm, $(EGL_PLATFORMS)),) EGL_OBJECTS += $(drm_OBJECTS) diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 2c7f3bd..4bd8656 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -552,6 +552,11 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy) if (dpy-Platform == _EGL_PLATFORM_WAYLAND gdpy-native-buffer) dpy-Extensions.MESA_drm_image = EGL_TRUE; +#ifdef EGL_WL_bind_wayland_display + if (gdpy-native-wayland_bufmgr) + dpy-Extensions.WL_bind_wayland_display = EGL_TRUE; +#endif + if (egl_g3d_add_configs(drv, dpy, 1) == 1) { _eglError(EGL_NOT_INITIALIZED, eglInitialize(unable to add configs)); goto fail; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c index f156832..8b1821e 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c @@ -868,6 +868,34 @@ egl_g3d_show_screen_surface(_EGLDriver *drv, _EGLDisplay *dpy, #endif /* EGL_MESA_screen_surface */ +#ifdef EGL_WL_bind_wayland_display + +static EGLBoolean +egl_g3d_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *dpy, +struct wl_display *wl_dpy) +{ + struct egl_g3d_display *gdpy = egl_g3d_display(dpy); + + if (!gdpy-native-wayland_bufmgr) + return EGL_FALSE; + + return gdpy-native-wayland_bufmgr-bind_display(gdpy-native, wl_dpy); +} + +static EGLBoolean +egl_g3d_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *dpy, + struct wl_display *wl_dpy) +{ + struct egl_g3d_display *gdpy = egl_g3d_display(dpy); + + if (!gdpy-native-wayland_bufmgr) + return EGL_FALSE; + + return gdpy-native-wayland_bufmgr-unbind_display(gdpy-native, wl_dpy); +} + +#endif /* EGL_WL_bind_wayland_display */ + void egl_g3d_init_driver_api(_EGLDriver *drv) { @@ -897,6 +925,11 @@ egl_g3d_init_driver_api(_EGLDriver *drv) drv-API.CreateDRMImageMESA =
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
On Fri, 06 May 2011 09:25:35 +0200 Michel Dänzer mic...@daenzer.net wrote: On Don, 2011-05-05 at 14:02 -0700, Jesse Barnes wrote: if (swap_complete) { if (pPriv-swap_count 0x) ErrorF(something appropriate); swap_complete(client, swap_data, type, ust, frame, (CARD32)pPriv-swap_count); } Yeah, it's annoying. How about I leave out the error message and handle wrapping on the client side instead? That way at least the client code won't notice that the server is only transmitting 32 bits... Nevermind, that can't work generally since clients are free to mask/unmask the events, so we could miss a 0 count and thus a wrap. Missing 0 isn't a problem, you can assume there's been a wraparound whenever the current value is smaller than the previous one. This would only fail if the client misses several wraparounds, in which case apparently it doesn't care all that much in the first place. :) Please do this. Yeah, it's more of a problem with low counts potentially, but as you say the app probably isn't looking at this field in that case... Ok let me see how to do it (the DRI case looks easy, not sure where to store the count in the indirect case though...) -- Jesse Barnes, Intel Open Source Technology Center ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] mesa: implement AMD_seamless_cubemap_per_texture
The follow-up patch is attached. Please review. Marek On Fri, May 6, 2011 at 3:50 PM, Brian Paul bri...@vmware.com wrote: On 05/05/2011 05:39 PM, Marek Olšák wrote: A new patch is attached. Looks good, but it seems to be missing the code to set the seamless flag in samplerobj.c If you want to commit this and do that as a follow-up that's fine. -Brian From eb4d785c321b0f9d5d351909b9c07ccfdfbe3678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= mar...@gmail.com Date: Fri, 6 May 2011 18:32:06 +0200 Subject: [PATCH] mesa: handle TEXTURE_CUBE_MAP_SEAMLESS in SamplerParameter --- src/mesa/main/samplerobj.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index 6e53f64..229267f 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -568,6 +568,25 @@ set_sampler_max_anisotropy(struct gl_context *ctx, } +static GLuint +set_sampler_cube_map_seamless(struct gl_context *ctx, + struct gl_sampler_object *samp, GLboolean param) +{ + if (!ctx-Extensions.AMD_seamless_cubemap_per_texture) + return INVALID_PNAME; + + if (samp-CubeMapSeamless == param) + return GL_FALSE; + + if (param != GL_TRUE param != GL_FALSE) + return INVALID_VALUE; + + flush(ctx); + samp-CubeMapSeamless = param; + return GL_TRUE; +} + + static void GLAPIENTRY _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) { @@ -616,6 +635,9 @@ _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) param); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, param); + break; case GL_TEXTURE_BORDER_COLOR: /* fall-through */ default: @@ -697,6 +719,9 @@ _mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, param); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param); + break; case GL_TEXTURE_BORDER_COLOR: /* fall-through */ default: @@ -775,6 +800,9 @@ _mesa_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); + break; case GL_TEXTURE_BORDER_COLOR: { GLfloat c[4]; @@ -863,6 +891,9 @@ _mesa_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]); + break; case GL_TEXTURE_BORDER_COLOR: res = set_sampler_border_colorf(ctx, sampObj, params); break; @@ -942,6 +973,9 @@ _mesa_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); + break; case GL_TEXTURE_BORDER_COLOR: res = set_sampler_border_colori(ctx, sampObj, params); break; @@ -1022,6 +1056,9 @@ _mesa_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params) case GL_TEXTURE_MAX_ANISOTROPY_EXT: res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); break; + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); + break; case GL_TEXTURE_BORDER_COLOR: res = set_sampler_border_colorui(ctx, sampObj, params); break; -- 1.7.4.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Replace ONE_DIV_LN2 constant with M_LOG2E
1/ln(2) is equivalent to log2(e), so define it as such. log2(e) = ln(e)/ln(2) = 1/ln(2) Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2 (right beside each other!) weren't the same. Reviewed-by: Alex Deucher alexdeuc...@gmail.com Signed-off-by: Matt Turner matts...@gmail.com --- src/mesa/main/compiler.h |4 src/mesa/program/prog_statevars.c |2 +- 2 files changed, 1 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index e17fd0f..81e08a0 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -366,10 +366,6 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) #define M_LOG2E (1.4426950408889634074) #endif -#ifndef ONE_DIV_LN2 -#define ONE_DIV_LN2 (1.442695040888963456) -#endif - #ifndef ONE_DIV_SQRT_LN2 #define ONE_DIV_SQRT_LN2 (1.201122408786449815) #endif diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c index d94d7fe..16f9690 100644 --- a/src/mesa/program/prog_statevars.c +++ b/src/mesa/program/prog_statevars.c @@ -459,7 +459,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], value[0] = (ctx-Fog.End == ctx-Fog.Start) ? 1.0f : (GLfloat)(-1.0F / (ctx-Fog.End - ctx-Fog.Start)); value[1] = ctx-Fog.End * -value[0]; - value[2] = (GLfloat)(ctx-Fog.Density * ONE_DIV_LN2); + value[2] = (GLfloat)(ctx-Fog.Density * M_LOG2E); /* M_LOG2E == 1/ln(2) */ value[3] = (GLfloat)(ctx-Fog.Density * ONE_DIV_SQRT_LN2); return; -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] Add precision to M_PI constant
Value found in my math.h header. Reviewed-by: Alex Deucher alexdeuc...@gmail.com Signed-off-by: Matt Turner matts...@gmail.com --- src/mesa/main/compiler.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 81e08a0..743841b 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -355,7 +355,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) #ifndef M_PI -#define M_PI (3.1415926536) +#define M_PI (3.14159265358979323846) #endif #ifndef M_E -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] Add Alpha to the little-endian machines.
From: Jay Estabrook jay.estabr...@gmail.com Reviewed-by: Matt Turner matts...@gmail.com Signed-off-by: Jay Estabrook jay.estabr...@gmail.com --- src/gallium/include/pipe/p_config.h |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 74a1fa2..9e8ff6a 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -99,6 +99,10 @@ #endif #endif +#if defined(__alpha__) +#define PIPE_ARCH_ALPHA +#endif + #if defined(__PPC__) #define PIPE_ARCH_PPC #if defined(__PPC64__) @@ -111,7 +115,7 @@ * Endian detection. */ -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) +#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ALPHA) #define PIPE_ARCH_LITTLE_ENDIAN #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) #define PIPE_ARCH_BIG_ENDIAN -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] Don't allow compilation if endianness isn't known
Signed-off-by: Matt Turner matts...@gmail.com --- PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of #ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here only serves to allow bad things to happen. src/gallium/include/pipe/p_config.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 9e8ff6a..6dea49a 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -120,7 +120,7 @@ #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) #define PIPE_ARCH_BIG_ENDIAN #else -#define PIPE_ARCH_UNKNOWN_ENDIAN +#error Unknown Endianness #endif -- 1.7.3.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 36919] New: Yo Frankie: Crash in dst_register
https://bugs.freedesktop.org/show_bug.cgi?id=36919 Summary: Yo Frankie: Crash in dst_register Product: Mesa Version: git Platform: Other URL: http://www.yofrankie.org/ OS/Version: All Status: NEW Severity: normal Priority: medium Component: Mesa core AssignedTo: mesa-dev@lists.freedesktop.org ReportedBy: s...@whiz.se Created an attachment (id=46407) -- (https://bugs.freedesktop.org/attachment.cgi?id=46407) backtrace When the game Yo Frankie is run with shaders enabled, it crashes in dst_register. Same problem with both r600g and llvmpipe. Pretty sure this is a regression so I will bisect when I have time. Program received signal SIGSEGV, Segmentation fault. 0xb676807e in dst_register (ctx=0x8975dd8, procType=0, ureg=0x104a03c8, program=0x1073cf68, numInputs=2, inputMapping=0xbfffe888, inputSemanticName=0xbfffe92c \001\003x\266P\346\217\b\020, inputSemanticIndex=0xbfffe94c , interpMode=0xbfffe808, numOutputs=0, outputMapping=0xbfffe900, outputSemanticName=0xbfffe96c \322\365t\266\360\370\215\b(Ś\b\017, outputSemanticIndex=0xbfffe98c \230\351\377\277@,_\017j\313ѿ, passthrough_edgeflags=0 '\000') at state_tracker/st_mesa_to_tgsi.c:201 201 return t-outputs[t-outputMapping[index]]; -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 36919] Yo Frankie: Crash in dst_register
https://bugs.freedesktop.org/show_bug.cgi?id=36919 --- Comment #1 from Sven Arvidsson s...@whiz.se 2011-05-06 13:07:17 PDT --- Forgot to mention, this is using git master 27d3e0b25cc3f2bd9f72778f0c9f54cb90c48622 -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
On Fri, 6 May 2011 13:00:19 -0700 Jeremy Huddleston jerem...@apple.com wrote: Yeah, that looks about right. This in combination with the latest version of xserver/glx/dri2: use new GLX/DRI2 swap event types Reviewed-by: Jeremy Huddleston jerem...@apple.com Thanks. It'll probably change a little as I add a glx_drawable type and move the counters there (mainly this logic will be duplicated for the indirect case). Patch on its way soon now that I've scaled back the effort from rewriting the whole object model to just tracking a glx drawable... -- Jesse Barnes, Intel Open Source Technology Center ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Status of VDPAU and XvMC state-trackers (was Re: Build error on current xvmc-r600 pip
On 05/06/2011 03:59 AM, Christoph Bumiller wrote: On 06.05.2011 06:59, Bryan Cain wrote: I found out the other day that nv50 doesn't support disabled GL rasterization rules, and doesn't plan to. Could iDCT be changed to work with GL rasterization rules enabled, or is there a reason that it can't or shouldn't use them? NV50 as in the hardware here. At least as far as we could find. I suppose adjusting the viewport translation by -0.5 might help, but I'd rather not. And if you want me to change the top-left rule into something else, you're completely out of luck. I don't. That's why I'm asking Christian to change the iDCT instead of asking you to change the driver. Bryan ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
On Fri, 6 May 2011 13:00:19 -0700 Jeremy Huddleston jerem...@apple.com wrote: Yeah, that looks about right. This in combination with the latest version of xserver/glx/dri2: use new GLX/DRI2 swap event types Reviewed-by: Jeremy Huddleston jerem...@apple.com Ok here's a more complete patch. It touches GLX and involves drawable lifetimes, which I'm not that familiar with, so careful review appreciated. Note the X vs GLX drawable ID switching in the DRI2 event handler (DRI2 just deals with X IDs). Kristian and Jeremy, is this a good basis for moving the Apple stuff over to a client GLX drawable type? -- Jesse Barnes, Intel Open Source Technology Center From fae63609dd4fd20ccd84d2211787136bb9a1da05 Mon Sep 17 00:00:00 2001 From: Jesse Barnes jbar...@virtuousgeek.org Date: Fri, 6 May 2011 10:31:24 -0700 Subject: [PATCH] GLX/DRI2: handle swap event swap count wrapping Create a new GLX drawable struct to track client related info, and add a wrap counter to it drawable and track it as we receive events. This allows us to support the full 64 bits of the event structure we pass to the client even though the server only gives us a 32 bit count. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org --- src/glx/dri2.c| 12 +- src/glx/glx_pbuffer.c | 14 src/glx/glxclient.h | 16 + src/glx/glxcmds.c | 57 + src/glx/glxext.c | 16 - 5 files changed, 112 insertions(+), 3 deletions(-) diff --git a/src/glx/dri2.c b/src/glx/dri2.c index 8654a37..229840d 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -88,6 +88,7 @@ static Bool DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); + struct glx_drawable *glxDraw; XextCheckExtension(dpy, info, dri2ExtensionName, False); @@ -98,6 +99,9 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event; xDRI2BufferSwapComplete2 *awire = (xDRI2BufferSwapComplete2 *)wire; + __GLXDRIdrawable *pdraw; + + pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire-drawable); /* Ignore swap events if we're not looking for them */ aevent-type = dri2GetSwapEventType(dpy, awire-drawable); @@ -124,7 +128,13 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) } aevent-ust = ((CARD64)awire-ust_hi 32) | awire-ust_lo; aevent-msc = ((CARD64)awire-msc_hi 32) | awire-msc_lo; - aevent-sbc = awire-sbc; + + glxDraw = GetGLXDrawable(dpy, pdraw-drawable); + if (awire-sbc glxDraw-lastEventSbc) +glxDraw-eventSbcWrap += 0x1; + glxDraw-lastEventSbc = awire-sbc; + aevent-sbc = awire-sbc + glxDraw-eventSbcWrap; + return True; } #endif diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index ec54f1e..420e754 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -380,7 +380,9 @@ static GLXDrawable CreateDrawable(Display *dpy, struct glx_config *config, Drawable drawable, const int *attrib_list, CARD8 glxCode) { + struct glx_display *const priv = __glXInitialize(dpy); xGLXCreateWindowReq *req; + struct glx_drawable *glxDraw; CARD32 *data; unsigned int i; CARD8 opcode; @@ -395,6 +397,10 @@ CreateDrawable(Display *dpy, struct glx_config *config, if (!opcode) return None; + glxDraw = Xmalloc(sizeof(*glxDraw)); + if (!glxDraw) + return None; + LockDisplay(dpy); GetReqExtra(GLXCreateWindow, 8 * i, req); data = (CARD32 *) (req + 1); @@ -413,6 +419,11 @@ CreateDrawable(Display *dpy, struct glx_config *config, UnlockDisplay(dpy); SyncHandle(); + if (InitGLXDrawable(dpy, glxDraw, drawable, req-glxwindow)) { + free(glxDraw); + return None; + } + CreateDRIDrawable(dpy, config, drawable, req-glxwindow, attrib_list, i); return req-glxwindow; @@ -425,7 +436,9 @@ CreateDrawable(Display *dpy, struct glx_config *config, static void DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode) { + struct glx_display *const priv = __glXInitialize(dpy); xGLXDestroyPbufferReq *req; + struct glx_drawable *glxDraw; CARD8 opcode; if ((dpy == NULL) || (drawable == 0)) { @@ -447,6 +460,7 @@ DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode) UnlockDisplay(dpy); SyncHandle(); + DestroyGLXDrawable(dpy, drawable); DestroyDRIDrawable(dpy, drawable, GL_FALSE); return; diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 2b6966f..f6aeeef 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -570,6 +570,8 @@ struct glx_display */ struct glx_screen **screens; + __glxHashTable *glXDrawHash; + #if defined(GLX_DIRECT_RENDERING) !defined(GLX_USE_APPLEGL) __glxHashTable *drawHash; @@ -582,6 +584,14 @@ struct glx_display #endif
Re: [Mesa-dev] [PATCH 1/2] Add Alpha to the little-endian machines.
On Fri, May 6, 2011 at 13:01:14 -0400, Matt Turner wrote: From: Jay Estabrook jay.estabr...@gmail.com Reviewed-by: Matt Turner matts...@gmail.com Signed-off-by: Jay Estabrook jay.estabr...@gmail.com --- src/gallium/include/pipe/p_config.h |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 74a1fa2..9e8ff6a 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -99,6 +99,10 @@ #endif #endif +#if defined(__alpha__) +#define PIPE_ARCH_ALPHA +#endif + #if defined(__PPC__) #define PIPE_ARCH_PPC #if defined(__PPC64__) @@ -111,7 +115,7 @@ * Endian detection. */ -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) +#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ALPHA) #define PIPE_ARCH_LITTLE_ENDIAN #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) #define PIPE_ARCH_BIG_ENDIAN Is there any particular reason this can't do the following, at least on glibc platforms? #include endian.h #if __BYTE_ORDER == __LITTLE_ENDIAN # define PIPE_ARCH_LITTLE_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN # define PIPE_ARCH_BIG_ENDIAN #endif Instead of having an always incomplete hardcoded list as detection... Cheers, Julien ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] Don't allow compilation if endianness isn't known
On Fri, May 6, 2011 at 13:01:15 -0400, Matt Turner wrote: Signed-off-by: Matt Turner matts...@gmail.com --- PIPE_ARCH_UNKNOWN_ENDIAN is used no where else. All #else branches of #ifdef PIPE_ARCH_LITTLE assume big-endian. Not #error'ing out here only serves to allow bad things to happen. I think this text should be part of the commit message. Patch looks like a good idea to me, fwiw. Cheers, Julien ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] Add Alpha to the little-endian machines.
On Fri, May 6, 2011 at 5:17 PM, Julien Cristau jcris...@debian.org wrote: On Fri, May 6, 2011 at 13:01:14 -0400, Matt Turner wrote: From: Jay Estabrook jay.estabr...@gmail.com Reviewed-by: Matt Turner matts...@gmail.com Signed-off-by: Jay Estabrook jay.estabr...@gmail.com --- src/gallium/include/pipe/p_config.h | 6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 74a1fa2..9e8ff6a 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -99,6 +99,10 @@ #endif #endif +#if defined(__alpha__) +#define PIPE_ARCH_ALPHA +#endif + #if defined(__PPC__) #define PIPE_ARCH_PPC #if defined(__PPC64__) @@ -111,7 +115,7 @@ * Endian detection. */ -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) +#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ALPHA) #define PIPE_ARCH_LITTLE_ENDIAN #elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) #define PIPE_ARCH_BIG_ENDIAN Is there any particular reason this can't do the following, at least on glibc platforms? #include endian.h #if __BYTE_ORDER == __LITTLE_ENDIAN # define PIPE_ARCH_LITTLE_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN # define PIPE_ARCH_BIG_ENDIAN #endif Instead of having an always incomplete hardcoded list as detection... Cheers, Julien Nope, that certainly makes sense to me. Matt ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
Yeah, that looks about right. This in combination with the latest version of xserver/glx/dri2: use new GLX/DRI2 swap event types Reviewed-by: Jeremy Huddleston jerem...@apple.com On May 6, 2011, at 10:39, Jesse Barnes wrote: On Fri, 06 May 2011 09:25:35 +0200 Michel Dänzer mic...@daenzer.net wrote: On Don, 2011-05-05 at 14:02 -0700, Jesse Barnes wrote: if (swap_complete) { if (pPriv-swap_count 0x) ErrorF(something appropriate); swap_complete(client, swap_data, type, ust, frame, (CARD32)pPriv-swap_count); } Yeah, it's annoying. How about I leave out the error message and handle wrapping on the client side instead? That way at least the client code won't notice that the server is only transmitting 32 bits... Nevermind, that can't work generally since clients are free to mask/unmask the events, so we could miss a 0 count and thus a wrap. Missing 0 isn't a problem, you can assume there's been a wraparound whenever the current value is smaller than the previous one. This would only fail if the client misses several wraparounds, in which case apparently it doesn't care all that much in the first place. :) Please do this. How does this look for the direct case? The indirect case is a little more complicated since I need to add a new glx_drawable type and track it (Kristian says this should help clean up some of the Apple mess as well). This patch handles at least one wrap correctly (I set the server's starting swap_count at 0xfff0 and then ran the glx-swap-event test in piglit; wrapping worked ok). -- Jesse Barnes, Intel Open Source Technology Center From f1e288f61e10b71018600a24ca0bdda93f8481db Mon Sep 17 00:00:00 2001 From: Jesse Barnes jbar...@virtuousgeek.org Date: Fri, 6 May 2011 10:31:24 -0700 Subject: [PATCH] DRI2: handle swap event swap count wrapping Add a wrap counter to the DRI drawable and track it as we receive events. This allows us to support the full 64 bits of the event structure we pass to the client even though the server only gives us a 32 bit count. Signed-off-by: Jesse Barnes jbar...@virtuousgeek.org --- src/glx/dri2.c | 12 +++- src/glx/dri2_glx.c |2 ++ src/glx/glxclient.h |2 ++ 3 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/glx/dri2.c b/src/glx/dri2.c index 8654a37..08ceec0 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -88,6 +88,7 @@ static Bool DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); + __GLXDRIdrawable *pdraw; XextCheckExtension(dpy, info, dri2ExtensionName, False); @@ -124,7 +125,16 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) } aevent-ust = ((CARD64)awire-ust_hi 32) | awire-ust_lo; aevent-msc = ((CARD64)awire-msc_hi 32) | awire-msc_lo; - aevent-sbc = awire-sbc; + + pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire-drawable); + if (!pdraw) + return False; + + if (awire-sbc pdraw-lastEventSbc) + pdraw-eventSbcWrap += 0x1; + pdraw-lastEventSbc = awire-sbc; + aevent-sbc = awire-sbc + pdraw-eventSbcWrap; + return True; } #endif diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index fc0237a..421f543 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -258,6 +258,8 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable, pdraw-base.xDrawable = xDrawable; pdraw-base.drawable = drawable; pdraw-base.psc = psc-base; + pdraw-base.lastEventSbc = 0; + pdraw-base.eventSbcWrap = 0; pdraw-bufferCount = 0; pdraw-swap_interval = 1; /* default may be overridden below */ pdraw-have_back = 0; diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 2b6966f..1eb2483 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -138,6 +138,8 @@ struct __GLXDRIdrawableRec GLenum textureTarget; GLenum textureFormat;/* EXT_texture_from_pixmap support */ unsigned long eventMask; + uint32_t lastEventSbc; + int64_t eventSbcWrap; }; /* -- 1.7.4.1 ___ xorg-de...@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] r600g: add support for anisotropic filtering
From b5ad4e6fb399203afcfe2a5ccb35bb8ccad28b65 Mon Sep 17 00:00:00 2001 From: Carl-Philip Haensch carli@carli-laptop.(none) Date: Fri, 6 May 2011 22:48:08 +0200 Subject: [PATCH] r600g: add support for anisotropic filtering --- src/gallium/drivers/r600/r600_state.c | 20 +--- src/gallium/drivers/r600/r600d.h |9 + 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 3f979cf..aeffb9e 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -364,6 +364,17 @@ static void *r600_create_rs_state(struct pipe_context *ctx, return rstate; } + + +static inline unsigned r600_tex_aniso_filter(unsigned filter) +{ + if (filter = 1) return 0; + if (filter = 2) return 1; + if (filter = 4) return 2; + if (filter = 8) return 3; +/* else */return 4; +} + static void *r600_create_sampler_state(struct pipe_context *ctx, const struct pipe_sampler_state *state) { @@ -376,13 +387,15 @@ static void *r600_create_sampler_state(struct pipe_context *ctx, rstate-id = R600_PIPE_STATE_SAMPLER; util_pack_color(state-border_color, PIPE_FORMAT_B8G8R8A8_UNORM, uc); + unsigned aniso_flag_offset = state-max_anisotropy 1 ? 4 : 0; r600_pipe_state_add_reg(rstate, R_03C000_SQ_TEX_SAMPLER_WORD0_0, S_03C000_CLAMP_X(r600_tex_wrap(state-wrap_s)) | S_03C000_CLAMP_Y(r600_tex_wrap(state-wrap_t)) | S_03C000_CLAMP_Z(r600_tex_wrap(state-wrap_r)) | - S_03C000_XY_MAG_FILTER(r600_tex_filter(state-mag_img_filter)) | - S_03C000_XY_MIN_FILTER(r600_tex_filter(state-min_img_filter)) | + S_03C000_XY_MAG_FILTER(r600_tex_filter(state-mag_img_filter) | aniso_flag_offset) | + S_03C000_XY_MIN_FILTER(r600_tex_filter(state-min_img_filter) | aniso_flag_offset) | S_03C000_MIP_FILTER(r600_tex_mipfilter(state-min_mip_filter)) | + S_03C000_ANISO(r600_tex_aniso_filter(state-max_anisotropy)) | S_03C000_DEPTH_COMPARE_FUNCTION(r600_tex_compare(state-compare_func)) | S_03C000_BORDER_COLOR_TYPE(uc.ui ? V_03C000_SQ_TEX_BORDER_COLOR_REGISTER : 0), 0x, NULL); r600_pipe_state_add_reg(rstate, R_03C004_SQ_TEX_SAMPLER_WORD1_0, @@ -492,7 +505,8 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c S_038014_BASE_ARRAY(state-u.tex.first_layer) | S_038014_LAST_ARRAY(state-u.tex.last_layer), 0x, NULL); r600_pipe_state_add_reg(rstate, R_038018_RESOURCE0_WORD6, - S_038018_TYPE(V_038010_SQ_TEX_VTX_VALID_TEXTURE), 0x, NULL); + S_038018_TYPE(V_038010_SQ_TEX_VTX_VALID_TEXTURE) | + S_038018_ANISO(4 /* max 16 samples */), 0x, NULL); return resource-base; } diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h index 8296b52..c997462 100644 --- a/src/gallium/drivers/r600/r600d.h +++ b/src/gallium/drivers/r600/r600d.h @@ -1012,6 +1012,9 @@ #define S_038018_MPEG_CLAMP(x) (((x) 0x3) 0) #define G_038018_MPEG_CLAMP(x) (((x) 0) 0x3) #define C_038018_MPEG_CLAMP 0xFFFC +#define S_038018_ANISO(x)(((x) 0x7) 2) +#define G_038018_ANISO(x)(((x) 2) 0x7) +#define C_038018_ANISO 0xFFE3 #define S_038018_PERF_MODULATION(x) (((x) 0x7) 5) #define G_038018_PERF_MODULATION(x) (((x) 5) 0x7) #define C_038018_PERF_MODULATION 0xFF1F @@ -1090,6 +1093,9 @@ #define S_03C000_MIP_FILTER(x) (((x) 0x3) 17) #define G_03C000_MIP_FILTER(x) (((x) 17) 0x3) #define C_03C000_MIP_FILTER 0xFFF9 +#define S_03C000_ANISO(x)(((x) 0x7) 19) +#define G_03C000_ANISO(x)(((x) 19) 0x7) +#define C_03C000_ANISO 0xFFB7 #define S_03C000_BORDER_COLOR_TYPE(x)(((x) 0x3) 22) #define G_03C000_BORDER_COLOR_TYPE(x)(((x) 22) 0x3) #define C_03C000_BORDER_COLOR_TYPE 0xFF3F @@ -1152,6 +1158,9 @@ #define S_03C008_PERF_Z(x) (((x) 0x3) 18) #define G_03C008_PERF_Z(x) (((x) 18) 0x3) #define C_03C008_PERF_Z 0xFFF3 +#define S_03C008_ANISO_BIAS(x) (((x) 0x3f) 22) +#define
Re: [Mesa-dev] mesa-from-git: build with clang(++) and --enable-glx-tls
See: http://cgit.freedesktop.org/xorg/xserver/commit/?id=bb4d145bd25e2aee988b100ecf1105ea3b6a40b8 I suggest you do something similar for mesa. On Apr 9, 2011, at 04:28, Sedat Dilek wrote: Just as an addendum to configure-option --enable-glx-tls (see [1] and [2]). - Sedat - [1] http://git.debian.org/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/rules;hb=refs/tags/mesa-7.10.1-1#l107 [2] http://git.debian.org/?p=pkg-xorg/xserver/xorg-server.git;a=blob;f=debian/rules;hb=refs/tags/xorg-server-2_1.10.0.901-1#l124 On Sat, Apr 9, 2011 at 12:52 PM, Sedat Dilek sedat.di...@googlemail.com wrote: Hi, I am currently playing with clang-3.0svn (and llvm) and mesa-from-git builds just fine. ( I tried also -O3 as {C,CXX}FLAGS and so on. ) Unfortunately, when turning on --enable-glx-tls, I see warnings like this: ... In file included from glapi_dispatch.c:40: In file included from ../../../src/mapi/glapi/glapi_priv.h:52: ../../../src/mapi/glapi/glapi.h:84:20: warning: unknown attribute 'tls_model' ignored [-Wunknown-attributes] __attribute__((tls_model(initial-exec))); ^ ../../../src/mapi/glapi/glapi.h:87:20: warning: unknown attribute 'tls_model' ignored [-Wunknown-attributes] __attribute__((tls_model(initial-exec))); ^ 2 warnings generated. ... Just FYI: Debian builds its xserver with --enable-glx-tls, too (and IIRC this is a pre-condition for mesa). If this info matters: I am here on Debian's xorg-server-1.10.0.901 (1.10.1 RC1). ( BTW, -O2 or -O3 does not matter. ) I have attached my full build.log. Regards, - Sedat - ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] r600g: add support for anisotropic filtering
Please resend by attaching the patch not pasting it On Fri, May 6, 2011 at 4:53 PM, Carl-Philip Haensch carl-philip.haen...@mailbox.tu-dresden.de wrote: From b5ad4e6fb399203afcfe2a5ccb35bb8ccad28b65 Mon Sep 17 00:00:00 2001 From: Carl-Philip Haensch carli@carli-laptop.(none) Date: Fri, 6 May 2011 22:48:08 +0200 Subject: [PATCH] r600g: add support for anisotropic filtering --- src/gallium/drivers/r600/r600_state.c | 20 +--- src/gallium/drivers/r600/r600d.h | 9 + 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 3f979cf..aeffb9e 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -364,6 +364,17 @@ static void *r600_create_rs_state(struct pipe_context *ctx, return rstate; } + + +static inline unsigned r600_tex_aniso_filter(unsigned filter) +{ + if (filter = 1) return 0; + if (filter = 2) return 1; + if (filter = 4) return 2; + if (filter = 8) return 3; + /* else */ return 4; +} + static void *r600_create_sampler_state(struct pipe_context *ctx, const struct pipe_sampler_state *state) { @@ -376,13 +387,15 @@ static void *r600_create_sampler_state(struct pipe_context *ctx, rstate-id = R600_PIPE_STATE_SAMPLER; util_pack_color(state-border_color, PIPE_FORMAT_B8G8R8A8_UNORM, uc); + unsigned aniso_flag_offset = state-max_anisotropy 1 ? 4 : 0; r600_pipe_state_add_reg(rstate, R_03C000_SQ_TEX_SAMPLER_WORD0_0, S_03C000_CLAMP_X(r600_tex_wrap(state-wrap_s)) | S_03C000_CLAMP_Y(r600_tex_wrap(state-wrap_t)) | S_03C000_CLAMP_Z(r600_tex_wrap(state-wrap_r)) | - S_03C000_XY_MAG_FILTER(r600_tex_filter(state-mag_img_filter)) | - S_03C000_XY_MIN_FILTER(r600_tex_filter(state-min_img_filter)) | + S_03C000_XY_MAG_FILTER(r600_tex_filter(state-mag_img_filter) | aniso_flag_offset) | + S_03C000_XY_MIN_FILTER(r600_tex_filter(state-min_img_filter) | aniso_flag_offset) | S_03C000_MIP_FILTER(r600_tex_mipfilter(state-min_mip_filter)) | + S_03C000_ANISO(r600_tex_aniso_filter(state-max_anisotropy)) | S_03C000_DEPTH_COMPARE_FUNCTION(r600_tex_compare(state-compare_func)) | S_03C000_BORDER_COLOR_TYPE(uc.ui ? V_03C000_SQ_TEX_BORDER_COLOR_REGISTER : 0), 0x, NULL); r600_pipe_state_add_reg(rstate, R_03C004_SQ_TEX_SAMPLER_WORD1_0, @@ -492,7 +505,8 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c S_038014_BASE_ARRAY(state-u.tex.first_layer) | S_038014_LAST_ARRAY(state-u.tex.last_layer), 0x, NULL); r600_pipe_state_add_reg(rstate, R_038018_RESOURCE0_WORD6, - S_038018_TYPE(V_038010_SQ_TEX_VTX_VALID_TEXTURE), 0x, NULL); + S_038018_TYPE(V_038010_SQ_TEX_VTX_VALID_TEXTURE) | + S_038018_ANISO(4 /* max 16 samples */), 0x, NULL); return resource-base; } diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h index 8296b52..c997462 100644 --- a/src/gallium/drivers/r600/r600d.h +++ b/src/gallium/drivers/r600/r600d.h @@ -1012,6 +1012,9 @@ #define S_038018_MPEG_CLAMP(x) (((x) 0x3) 0) #define G_038018_MPEG_CLAMP(x) (((x) 0) 0x3) #define C_038018_MPEG_CLAMP 0xFFFC +#define S_038018_ANISO(x) (((x) 0x7) 2) +#define G_038018_ANISO(x) (((x) 2) 0x7) +#define C_038018_ANISO 0xFFE3 #define S_038018_PERF_MODULATION(x) (((x) 0x7) 5) #define G_038018_PERF_MODULATION(x) (((x) 5) 0x7) #define C_038018_PERF_MODULATION 0xFF1F @@ -1090,6 +1093,9 @@ #define S_03C000_MIP_FILTER(x) (((x) 0x3) 17) #define G_03C000_MIP_FILTER(x) (((x) 17) 0x3) #define C_03C000_MIP_FILTER 0xFFF9 +#define S_03C000_ANISO(x) (((x) 0x7) 19) +#define G_03C000_ANISO(x) (((x) 19) 0x7) +#define C_03C000_ANISO 0xFFB7 #define S_03C000_BORDER_COLOR_TYPE(x) (((x) 0x3) 22) #define G_03C000_BORDER_COLOR_TYPE(x) (((x) 22) 0x3) #define C_03C000_BORDER_COLOR_TYPE 0xFF3F @@ -1152,6 +1158,9 @@ #define S_03C008_PERF_Z(x) (((x) 0x3) 18) #define G_03C008_PERF_Z(x) (((x) 18) 0x3) #define C_03C008_PERF_Z 0xFFF3 +#define
Re: [Mesa-dev] [PATCH 1/3] mesa: Add ARB_shader_texture_lod to the extension list; off by default.
Kenneth, I have implemented R500 support in master and it works very well with this series. There are also some new piglit tests. There was a typo in the ARB_shader_texture_lod.frag file in src/glsl, which is fixed by the attached patch. Other than that: Tested-by: Marek Olšák mar...@gmail.com I am little concerned that there will be no app using this line: #extension GL_ARB_shader_texture_lod : require The VDrift game is an example of that. Marek On Fri, Apr 22, 2011 at 9:02 PM, Kenneth Graunke kenn...@whitecape.org wrote: Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/mesa/main/extensions.c | 2 +- src/mesa/main/mtypes.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 8a0ab96..fc55184 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -111,6 +111,7 @@ static const struct extension extension_table[] = { { GL_ARB_seamless_cube_map, o(ARB_seamless_cube_map), GL, 2009 }, { GL_ARB_shader_objects, o(ARB_shader_objects), GL, 2002 }, { GL_ARB_shader_stencil_export, o(ARB_shader_stencil_export), GL, 2009 }, + { GL_ARB_shader_texture_lod, o(ARB_shader_texture_lod), GL, 2009 }, { GL_ARB_shading_language_100, o(ARB_shading_language_100), GL, 2003 }, { GL_ARB_shadow_ambient, o(ARB_shadow_ambient), GL, 2001 }, { GL_ARB_shadow, o(ARB_shadow), GL, 2001 }, @@ -142,7 +143,6 @@ static const struct extension extension_table[] = { { GL_ARB_vertex_shader, o(ARB_vertex_shader), GL, 2002 }, { GL_ARB_vertex_type_2_10_10_10_rev, o(ARB_vertex_type_2_10_10_10_rev), GL, 2009 }, { GL_ARB_window_pos, o(ARB_window_pos), GL, 2001 }, - /* EXT extensions */ { GL_EXT_abgr, o(EXT_abgr), GL, 1995 }, { GL_EXT_bgra, o(EXT_bgra), GL, 1995 }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 160ae9d..6e4c4f1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2781,6 +2781,7 @@ struct gl_extensions GLboolean ARB_seamless_cube_map; GLboolean ARB_shader_objects; GLboolean ARB_shader_stencil_export; + GLboolean ARB_shader_texture_lod; GLboolean ARB_shading_language_100; GLboolean ARB_shadow; GLboolean ARB_shadow_ambient; -- 1.7.4.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev From 362818914574d5e6943eb7b8357cac3da41f2655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= mar...@gmail.com Date: Sat, 7 May 2011 02:46:58 +0200 Subject: [PATCH 1/2] glsl: fix typo in textureCubeLod declaration --- .../builtins/profiles/ARB_shader_texture_lod.frag |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag b/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag index fefd707..c15e2a1 100644 --- a/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag +++ b/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag @@ -10,7 +10,7 @@ vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); vec4 texture3DLod(sampler3D sampler, vec3 coord, float lod); vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); -vec4 textureCubeLod (sampler3D sampler, vec3 coord, float lod); +vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); vec4 shadow1DLod(sampler1DShadow sampler, vec3 coord, float lod); vec4 shadow2DLod(sampler2DShadow sampler, vec3 coord, float lod); vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -- 1.7.4.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] xserver/glx/dri2: use new GLX/DRI2 swap event types
On Fri, 6 May 2011 15:41:17 -0700 Jeremy Huddleston jerem...@apple.com wrote: I believe you want to s/Xmalloc/malloc/ Yes, I can't speak for all the internals of DRI2 since most of that is foreign to me, but from a high level, this looks like the right approach. As for your specific question about Apple stuff, it's been a while since I touched that... perhaps something we can have a sit-down about during XDC. So from a high-level point of view: Reviewed-by: Jeremy Huddleston jerem...@apple.com but this should also be reviewed by someone who has more understanding of GLX. Thanks Jeremy. This turd is pretty polished at this point. Anyone else besides me care to test? There's a glx-swap-event test in piglit, and Mario may have some stuff... curious to see how well it stands up. Thanks, -- Jesse Barnes, Intel Open Source Technology Center ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev