Makefile | 2 docs/relnotes-7.7.1.html | 12 +- src/gallium/auxiliary/util/u_debug.c | 51 +++++++++ src/gallium/drivers/softpipe/sp_tile_cache.c | 7 - src/gallium/drivers/svga/svga_context.c | 5 src/gallium/drivers/svga/svga_state_rss.c | 13 ++ src/gallium/drivers/svga/svga_winsys.h | 3 src/gallium/state_trackers/dri/dri_screen.c | 91 +++++++++-------- src/gallium/state_trackers/xorg/xorg_crtc.c | 24 ++++ src/gallium/state_trackers/xorg/xorg_dri2.c | 14 ++ src/gallium/state_trackers/xorg/xorg_driver.c | 94 +++++++++++++----- src/gallium/state_trackers/xorg/xorg_exa.c | 3 src/gallium/state_trackers/xorg/xorg_renderer.c | 2 src/gallium/state_trackers/xorg/xorg_renderer.h | 2 src/gallium/state_trackers/xorg/xorg_tracker.h | 13 ++ src/gallium/state_trackers/xorg/xorg_xv.c | 14 +- src/gallium/winsys/drm/vmware/core/vmw_context.c | 20 +++ src/gallium/winsys/drm/vmware/core/vmw_context.h | 3 src/gallium/winsys/drm/vmware/core/vmw_screen.c | 10 + src/gallium/winsys/drm/vmware/core/vmw_screen.h | 12 +- src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c | 2 src/gallium/winsys/drm/vmware/core/vmw_screen_ioctl.c | 6 - src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 46 ++++++++ src/glx/x11/glx_pbuffer.c | 3 src/glx/x11/indirect_vertex_array.c | 3 src/mesa/drivers/dri/r300/r300_state.c | 21 ---- src/mesa/drivers/dri/r600/r600_context.c | 9 + src/mesa/drivers/dri/r600/r600_texstate.c | 28 ++--- src/mesa/drivers/dri/r600/r700_render.c | 18 ++- src/mesa/drivers/dri/r600/r700_state.c | 6 - src/mesa/drivers/dri/radeon/radeon_chipset.h | 1 src/mesa/drivers/dri/radeon/radeon_screen.c | 1 src/mesa/main/extensions.c | 15 ++ src/mesa/main/renderbuffer.c | 3 src/mesa/main/texrender.c | 5 src/mesa/main/version.h | 2 src/mesa/state_tracker/st_cb_drawpixels.c | 29 ++++- src/mesa/state_tracker/st_cb_fbo.c | 5 src/mesa/state_tracker/st_cb_texture.c | 2 39 files changed, 438 insertions(+), 162 deletions(-)
New commits: commit 00e41e007e82195fe935d827402a3af6200672b8 Author: Thomas Hellstrom <thellst...@vmware.com> Date: Sat Mar 13 20:25:29 2010 +0100 st/xorg: Fix Xv cliprect scaling. Due to a quantization error, different cliprects of scaled video windows may not have identical x / y scale. Signed-off-by: Thomas Hellstrom <thellst...@vmware.com> diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 37c8942..e920eb7 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -586,7 +586,7 @@ void renderer_copy_pixmap(struct xorg_renderer *r, void renderer_draw_yuv(struct xorg_renderer *r, - int src_x, int src_y, int src_w, int src_h, + float src_x, float src_y, float src_w, float src_h, int dst_x, int dst_y, int dst_w, int dst_h, struct pipe_texture **textures) { diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.h b/src/gallium/state_trackers/xorg/xorg_renderer.h index 5272cde..6b9f091 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.h +++ b/src/gallium/state_trackers/xorg/xorg_renderer.h @@ -53,7 +53,7 @@ void renderer_set_constants(struct xorg_renderer *r, void renderer_draw_yuv(struct xorg_renderer *r, - int src_x, int src_y, int src_w, int src_h, + float src_x, float src_y, float src_w, float src_h, int dst_x, int dst_y, int dst_w, int dst_h, struct pipe_texture **textures); diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index eb5ce88..4f0f8de 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -384,7 +384,7 @@ setup_fs_video_constants(struct xorg_renderer *r, boolean hdtv) static void draw_yuv(struct xorg_xv_port_priv *port, - int src_x, int src_y, int src_w, int src_h, + float src_x, float src_y, float src_w, float src_h, int dst_x, int dst_y, int dst_w, int dst_h) { struct pipe_texture **textures = port->yuv[port->current_set]; @@ -533,10 +533,10 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, int box_y2 = pbox->y2; float diff_x = (float)src_w / (float)dst_w; float diff_y = (float)src_h / (float)dst_h; - int offset_x = box_x1 - dstX + pPixmap->screen_x; - int offset_y = box_y1 - dstY + pPixmap->screen_y; - int offset_w; - int offset_h; + float offset_x = box_x1 - dstX + pPixmap->screen_x; + float offset_y = box_y1 - dstY + pPixmap->screen_y; + float offset_w; + float offset_h; x = box_x1; y = box_y1; @@ -547,8 +547,8 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, offset_h = dst_h - h; draw_yuv(pPriv, - src_x + offset_x*diff_x, src_y + offset_y*diff_y, - src_w - offset_w*diff_x, src_h - offset_h*diff_y, + (float) src_x + offset_x*diff_x, (float) src_y + offset_y*diff_y, + (float) src_w - offset_w*diff_x, (float) src_h - offset_h*diff_y, x, y, w, h); pbox++; commit 6624845a5df09285479382894c6952bd9e9842d0 Author: Ian Romanick <ian.d.roman...@intel.com> Date: Tue Mar 16 07:55:02 2010 -0700 mesa: set version string to 7.7.1-rc1 diff --git a/Makefile b/Makefile index b10d1fe..bd44a23 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ ultrix-gcc: # Rules for making release tarballs -VERSION=7.7.1-devel +VERSION=7.7.1-rc1 DIRECTORY = Mesa-$(VERSION) LIB_NAME = MesaLib-$(VERSION) DEMO_NAME = MesaDemos-$(VERSION) diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 1c5749f..3441592 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 7 #define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.7.1-DEVEL" +#define MESA_VERSION_STRING "7.7.1-rc1" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) commit c9c54180e431f690af4071a804a94c09cf824092 Author: Matthew W. S. Bell <matt...@bells23.org.uk> Date: Mon Mar 15 01:18:02 2010 +0000 Correct GL_EQUIV code in r67/7xx. From 247e121106e8d3e389f2e5a6edf13ea70ac18df7 Mon Sep 17 00:00:00 2001 These seem to be documented in <http://www.svgopen.org/2003/papers/RasterOperationsUsingFilterElements/index.html>. diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 25a8074..11b298b 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -616,7 +616,7 @@ static GLuint translate_logicop(GLenum logicop) case GL_XOR: return 0x66; case GL_EQUIV: - return 0xaa; + return 0x99; case GL_AND_REVERSE: return 0x44; case GL_AND_INVERTED: commit 93e77b0028170fafd176c3a80a99287343c946b4 Author: José Fonseca <jfons...@vmware.com> Date: Fri Mar 12 17:59:10 2010 +0000 mesa: List Quake3 extensions first. Quake3 truncates the extension string, and GL_EXT_compiled_vertex_array wasn't being detected, making it very slow. This is a quick fix. The IMHO best way to address this in a more general fashion is to sort by year. diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index fd705ea..07526d0 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -45,6 +45,18 @@ static const struct { const char *name; int flag_offset; } default_extensions[] = { + /* + * TODO: Sort by year, to ensure that old extensions are listed first, so + * that old applications that truncate the extension string get the basic + * extensions, roughly corresponding to what existed then. + * + * The best example is quake3demo, which often misses + * GL_EXT_compiled_vertex_array because it gets truncated. + */ + { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) }, + { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, + { OFF, "GL_EXT_texture_env_add", F(EXT_texture_env_add) }, + { OFF, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, { OFF, "GL_ARB_depth_clamp", F(ARB_depth_clamp) }, @@ -99,7 +111,6 @@ static const struct { { OFF, "GL_EXT_blend_subtract", F(EXT_blend_subtract) }, { OFF, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) }, { OFF, "GL_EXT_cull_vertex", F(EXT_cull_vertex) }, - { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) }, { OFF, "GL_EXT_convolution", F(EXT_convolution) }, { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, @@ -128,10 +139,8 @@ static const struct { { ON, "GL_EXT_subtexture", F(EXT_subtexture) }, { ON, "GL_EXT_texture", F(EXT_texture) }, { ON, "GL_EXT_texture3D", F(EXT_texture3D) }, - { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, { OFF, "GL_EXT_texture_cube_map", F(ARB_texture_cube_map) }, { ON, "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, - { OFF, "GL_EXT_texture_env_add", F(EXT_texture_env_add) }, { OFF, "GL_EXT_texture_env_combine", F(EXT_texture_env_combine) }, { OFF, "GL_EXT_texture_env_dot3", F(EXT_texture_env_dot3) }, { OFF, "GL_EXT_texture_filter_anisotropic", F(EXT_texture_filter_anisotropic) }, commit 0c9e8e6c6e704fac299e2c6224f6030541aef458 Author: Keith Whitwell <kei...@vmware.com> Date: Fri Mar 12 18:32:10 2010 +0000 mesa: Fix memory leak in decompress-with-blit. (cherry picked from commit f05a4ee6f2840590c90da4be2fe5c6295410a5af) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 0858a36..49c18a0 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -863,6 +863,8 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, _mesa_unmap_pbo_dest(ctx, &ctx->Pack); + screen->tex_transfer_destroy(tex_xfer); + /* destroy the temp / dest surface */ util_destroy_rgba_surface(dst_texture, dst_surface); } commit c50477c255a34444720fb944c54373462ef39fb9 Author: Michel Dänzer <daen...@vmware.com> Date: Fri Mar 12 18:24:34 2010 +0100 st/dri: Always try to set up R5G6B5 configs. Allows compiz to work in depth 16. The DRI2 getBuffersWithFormat hook is only required for 16/32 bit depth buffers, for colour buffers the only requirement is that the format matches the drawable depth, which we can't check here. diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index c55daf9..66a0e71 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -80,6 +80,9 @@ dri_fill_in_modes(struct dri_screen *screen, unsigned pixel_bits) { __DRIconfig **configs = NULL; + __DRIconfig **configs_r5g6b5 = NULL; + __DRIconfig **configs_a8r8g8b8 = NULL; + __DRIconfig **configs_x8r8g8b8 = NULL; unsigned num_modes; uint8_t depth_bits_array[5]; uint8_t stencil_bits_array[5]; @@ -117,25 +120,23 @@ dri_fill_in_modes(struct dri_screen *screen, pf_x8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8R8G8B8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0); - - /* we support buffers with different depths only if we can tell the driver - * the actual depth of each of them. */ - if (screen->sPriv->dri2.loader - && (screen->sPriv->dri2.loader->base.version > 2) - && (screen->sPriv->dri2.loader->getBuffersWithFormat != NULL)) { + pf_r5g6b5 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_R5G6B5_UNORM, + PIPE_TEXTURE_2D, + PIPE_TEXTURE_USAGE_RENDER_TARGET, 0); + + /* We can only get a 16 or 32 bit depth buffer with getBuffersWithFormat */ + if (screen->sPriv->dri2.loader && + (screen->sPriv->dri2.loader->base.version > 2) && + (screen->sPriv->dri2.loader->getBuffersWithFormat != NULL)) { pf_z16 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z16_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); pf_z32 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z32_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); - pf_r5g6b5 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_R5G6B5_UNORM, - PIPE_TEXTURE_2D, - PIPE_TEXTURE_USAGE_RENDER_TARGET, 0); } else { pf_z16 = FALSE; pf_z32 = FALSE; - pf_r5g6b5 = FALSE; } if (pf_z16) { @@ -164,41 +165,43 @@ dri_fill_in_modes(struct dri_screen *screen, num_modes = depth_buffer_factor * back_buffer_factor * msaa_samples_factor * 4; - if (pixel_bits == 16 && pf_r5g6b5) { - configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, back_buffer_modes, - back_buffer_factor, - msaa_samples_array, 1); + if (pf_r5g6b5) + configs_r5g6b5 = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, + depth_bits_array, stencil_bits_array, + depth_buffer_factor, back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); + + if (pf_a8r8g8b8) + configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, + depth_bits_array, + stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); + + if (pf_x8r8g8b8) + configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV, + depth_bits_array, + stencil_bits_array, + depth_buffer_factor, + back_buffer_modes, + back_buffer_factor, + msaa_samples_array, 1); + + if (pixel_bits == 16) { + configs = configs_r5g6b5; + if (configs_a8r8g8b8) + configs = configs ? driConcatConfigs(configs, configs_a8r8g8b8) : configs_a8r8g8b8; + if (configs_x8r8g8b8) + configs = configs ? driConcatConfigs(configs, configs_x8r8g8b8) : configs_x8r8g8b8; } else { - __DRIconfig **configs_a8r8g8b8 = NULL; - __DRIconfig **configs_x8r8g8b8 = NULL; - - if (pf_a8r8g8b8) - configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, - depth_bits_array, - stencil_bits_array, - depth_buffer_factor, - back_buffer_modes, - back_buffer_factor, - msaa_samples_array, 1); - if (pf_x8r8g8b8) - configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV, - depth_bits_array, - stencil_bits_array, - depth_buffer_factor, - back_buffer_modes, - back_buffer_factor, - msaa_samples_array, 1); - - if (configs_a8r8g8b8 && configs_x8r8g8b8) - configs = driConcatConfigs(configs_x8r8g8b8, configs_a8r8g8b8); - else if (configs_a8r8g8b8) - configs = configs_a8r8g8b8; - else if (configs_x8r8g8b8) - configs = configs_x8r8g8b8; - else - configs = NULL; + configs = configs_a8r8g8b8; + if (configs_x8r8g8b8) + configs = configs ? driConcatConfigs(configs, configs_x8r8g8b8) : configs_x8r8g8b8; + if (configs_r5g6b5) + configs = configs ? driConcatConfigs(configs, configs_r5g6b5) : configs_r5g6b5; } if (configs == NULL) { commit 3bf13656d37788e88d342cece75fd0753292c010 Author: Jakob Bornecrantz <ja...@vmware.com> Date: Sat Feb 6 16:58:32 2010 +0000 st/xorg: Include cursorstr.h diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index accc6d2..cba9b05 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -39,6 +39,7 @@ #include <xf86.h> #include <xf86i2c.h> #include <xf86Crtc.h> +#include <cursorstr.h> #include "xorg_tracker.h" #include "xf86Modes.h" commit fa4083d38b16e4db1420e1ff18ba018036478efa Author: Brian Paul <bri...@vmware.com> Date: Wed Mar 10 14:14:04 2010 -0700 docs: updates to 7.7.1 release notes diff --git a/docs/relnotes-7.7.1.html b/docs/relnotes-7.7.1.html index c3d42c1..93cf88f 100644 --- a/docs/relnotes-7.7.1.html +++ b/docs/relnotes-7.7.1.html @@ -30,12 +30,6 @@ tbd </pre> -<h2>New features</h2> -<ul> -<li>tbd -</ul> - - <h2>Bug fixes</h2> <ul> <li>Assorted fixes to VMware SVGA gallium driver. @@ -45,6 +39,12 @@ tbd <li>Gallium SSE codegen for XPD didn't always work. <li>Fixed Windows build. <li>Fixed broken glMultiDrawElements(). +<li>Silence bogus GL errors generated in glxinfo. +<li>Fixed several render to texture bugs. +<li>Assorted bug fixes in Mesa/Gallium state tracker including + glCopy/DrawPixels() to FBOs. +<li>Assorted fixes to Gallium drivers. +<li>Fixed broken glPush/PopClientAttrib() for vertex arrays in GLX code. </ul> commit d311ded31d0248b225f87c22a8eb9f12e580f964 Author: Brian Paul <bri...@vmware.com> Date: Wed Mar 10 10:39:17 2010 -0700 gallium/util: added surface dump code for unix diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index be5eb87..bb1f378 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -644,6 +644,57 @@ void debug_dump_image(const char *prefix, } EngUnmapFile(iFile); +#elif defined(PIPE_OS_UNIX) + /* write a ppm file */ + char filename[256]; + FILE *f; + + util_snprintf(filename, sizeof(filename), "%s.ppm", prefix); + + f = fopen(filename, "w"); + if (f) { + int i, x, y; + int r, g, b; + const uint8_t *ptr = (uint8_t *) data; + + /* XXX this is a hack */ + switch (format) { + case PIPE_FORMAT_B8G8R8A8_UNORM: + r = 2; + g = 1; + b = 0; + break; + case PIPE_FORMAT_A8R8G8B8_UNORM: + b = 0; + g = 1; + r = 2; + break; + default: + r = 0; + g = 1; + b = 2; + } + + fprintf(f, "P6\n"); + fprintf(f, "# ppm-file created by osdemo.c\n"); + fprintf(f, "%i %i\n", width, height); + fprintf(f, "255\n"); + fclose(f); + + f = fopen(filename, "ab"); /* reopen in binary append mode */ + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + i = y * stride + x * cpp; + fputc(ptr[i + r], f); /* write red */ + fputc(ptr[i + g], f); /* write green */ + fputc(ptr[i + b], f); /* write blue */ + } + } + fclose(f); + } + else { + fprintf(stderr, "Can't open %s for writing\n", filename); + } #endif } commit 34f02071618624263eba839b5aeb930d0e794078 Author: Brian Paul <bri...@vmware.com> Date: Wed Mar 10 10:34:13 2010 -0700 st/mesa: fix incorrect glCopyPixels between window/FBO There was a DrawBuffer/ReadBuffer typo and we were neglecting to invert the texture coords when copying from a window to an FBO. Plus, add some surface dump/debug code (disabled). diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 8399f6f..786495d 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -968,6 +968,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, GLfloat *color; enum pipe_format srcFormat, texFormat; int ptw, pth; + GLboolean invertTex = GL_FALSE; pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL); @@ -1043,8 +1044,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, } } - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - srcy = ctx->DrawBuffer->Height - srcy - height; + if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { + srcy = ctx->ReadBuffer->Height - srcy - height; if (srcy < 0) { height -= -srcy; @@ -1053,6 +1054,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (height < 0) return; + + invertTex = !invertTex; } /* Need to use POT texture? */ @@ -1082,7 +1085,9 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (!pt) return; - + /* Make temporary texture which is a copy of the src region. + * We'll draw a quad with this texture to draw the dest image. + */ if (srcFormat == texFormat) { /* copy source framebuffer surface into mipmap/texture */ struct pipe_surface *psRead = screen->get_tex_surface(screen, @@ -1103,6 +1108,13 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, psRead, srcx, srcy, width, height); } + + if (0) { + /* debug */ + debug_dump_surface("copypixsrcsurf", psRead); + debug_dump_surface("copypixtemptex", psTex); + } + pipe_surface_reference(&psRead, NULL); pipe_surface_reference(&psTex, NULL); } @@ -1150,7 +1162,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, /* draw textured quad */ draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2], width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, - pt, stvp, stfp, color, GL_TRUE); + pt, stvp, stfp, color, invertTex); pipe_texture_reference(&pt, NULL); } commit 8d3f629a13afb0d6acafc7a007972fdc5efe6847 Author: Brian Paul <bri...@vmware.com> Date: Wed Mar 10 10:31:01 2010 -0700 st/mesa: fix incorrect glDrawPixels into FBO We weren't inverting the textured quad when drawing into an fbo. diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 3b162d1..8399f6f 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -434,7 +434,7 @@ make_texture(struct st_context *st, /** * Draw quad with texcoords and optional color. - * Coords are window coords with y=0=bottom. + * Coords are gallium window coords with y=0=top. * \param color may be null * \param invertTex if true, flip texcoords vertically */ @@ -621,10 +621,15 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, pipe->set_sampler_textures(pipe, 1, &pt); } - /* Compute window coords (y=0=bottom) with pixel zoom. + /* Compute Gallium window coords (y=0=top) with pixel zoom. * Recall that these coords are transformed by the current * vertex shader and viewport transformation. */ + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) { + y = ctx->DrawBuffer->Height - (int) (y + height * ctx->Pixel.ZoomY); + invertTex = !invertTex; + } + x0 = (GLfloat) x; x1 = x + width * ctx->Pixel.ZoomX; y0 = (GLfloat) y; commit b98ef495d44850cd992e59beae4141ce3dcb70a3 Author: Thomas Hellstrom <thellst...@vmware.com> Date: Sat Mar 6 15:48:48 2010 +0100 st/xorg Avoid advertizing rotation / reflection support. We don't support it yet since we don't implement the shadow allocate functions. Signed-off-by: Thomas Hellstrom <thellst...@vmware.com> diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 5b78d57..accc6d2 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -146,6 +146,7 @@ crtc_gamma_set(xf86CrtcPtr crtc, CARD16 * red, CARD16 * green, CARD16 * blue, /* XXX: hockup */ } +#if 0 /* Implement and enable to enable rotation and reflection. */ static void * crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { @@ -168,6 +169,8 @@ crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) /* ScrnInfoPtr pScrn = crtc->scrn; */ } +#endif + /* * Cursor functions */ @@ -362,9 +365,9 @@ static const xf86CrtcFuncsRec crtc_funcs = { .hide_cursor = crtc_hide_cursor, .load_cursor_argb = crtc_load_cursor_argb, - .shadow_create = crtc_shadow_create, - .shadow_allocate = crtc_shadow_allocate, - .shadow_destroy = crtc_shadow_destroy, + .shadow_create = NULL, + .shadow_allocate = NULL, + .shadow_destroy = NULL, .gamma_set = crtc_gamma_set, .destroy = crtc_destroy, commit 21c91b410a2a2cbf8eb677e59e3322f86320f2b0 Author: Michel Dänzer <daen...@vmware.com> Date: Wed Mar 10 13:16:00 2010 +0100 st/xorg: Work around cursor reference counting bugs in older X servers. Could result in use of freed memory and consequently random crashes, e.g. on screen resize. diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index daa9f8b..5b78d57 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -276,7 +276,21 @@ err_bo_destroy: static void crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image) { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); modesettingPtr ms = modesettingPTR(crtc->scrn); + + /* Older X servers have cursor reference counting bugs leading to use of + * freed memory and consequently random crashes. Should be fixed as of + * xserver 1.8, but this workaround shouldn't hurt anyway. + */ + if (config->cursor) + config->cursor->refcnt++; + + if (ms->cursor) + FreeCursor(ms->cursor, None); + + ms->cursor = config->cursor; + if (ms->screen) crtc_load_cursor_argb_ga3d(crtc, image); #ifdef HAVE_LIBKMS diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 372fa3d..2aedbb0 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -949,6 +949,11 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen) drv_leave_vt(scrnIndex, 0); } + if (ms->cursor) { + FreeCursor(ms->cursor, None); + ms->cursor = NULL; + } + if (cust && cust->winsys_screen_close) cust->winsys_screen_close(cust); diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index 9de1df7..5703681 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -98,6 +98,7 @@ typedef struct _modesettingRec Bool noAccel; Bool SWCursor; + CursorPtr cursor; Bool swapThrottling; Bool dirtyThrottling; CloseScreenProcPtr CloseScreen; commit a8f3b3f88acc1f0193fa740e76e9d815f07f32ab Author: Thomas Hellstrom <thellst...@vmware.com> Date: Sun Feb 28 20:14:44 2010 +0100 st/xorg, vmware: Make throttling configurable. The xorg state tracker gets two new options to let the user choose whether to enable / disable dirty throttling and swapbuffer throttling. The default value of these options are enabled, unless the winsys supplies a customizer with other values. The customizer record has been extended to allow this, and also to set winsys-based throttling on a per- context basis. The vmware part of this patch disables the dirty throttling if the kernel supports command submission throttling, and also in that case sets kernel based throttling for everything but swapbuffers. The vmware winsys does not set throttling per context, even if it theoretically could, but instead sets throttling per screen. This should perhaps be changed, should the xorg state tracker start to use multiple rendering contexts. Kernel throttling is off by default for all new screens/contexts, so the dri state tracker is not affected. This significantly improves interactivity of the vmware xorg driver. Signed-off-by: Thomas Hellstrom <thellst...@vmware.com> diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index fd11c60..af22730 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -295,6 +295,7 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, GCPtr gc; RegionPtr copy_clip; Bool save_accel; + CustomizerPtr cust = ms->cust; /* * In driCreateBuffers we dewrap windows into the @@ -348,7 +349,8 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, ValidateGC(dst_draw, gc); /* If this is a full buffer swap, throttle on the previous one */ - if (dst_priv->fence && REGION_NUM_RECTS(pRegion) == 1) { + if (ms->swapThrottling && + dst_priv->fence && REGION_NUM_RECTS(pRegion) == 1) { BoxPtr extents = REGION_EXTENTS(pScreen, pRegion); if (extents->x1 == 0 && extents->y1 == 0 && @@ -370,6 +372,9 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, DamageRegionAppend(src_draw, pRegion); DamageRegionProcessPending(src_draw); + if (cust && cust->winsys_context_throttle) + cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_SWAP); + (*gc->ops->CopyArea)(src_draw, dst_draw, gc, 0, 0, pDraw->width, pDraw->height, 0, 0); ms->exa->accel = save_accel; @@ -377,8 +382,13 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, FreeScratchGC(gc); ms->ctx->flush(ms->ctx, PIPE_FLUSH_SWAPBUFFERS, - pDestBuffer->attachment == DRI2BufferFrontLeft ? + (pDestBuffer->attachment == DRI2BufferFrontLeft + && ms->swapThrottling) ? &dst_priv->fence : NULL); + + if (cust && cust->winsys_context_throttle) + cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_RENDER); + } Bool diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 8fb6e5a..372fa3d 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -79,12 +79,16 @@ typedef enum OPTION_SW_CURSOR, OPTION_2D_ACCEL, OPTION_DEBUG_FALLBACK, + OPTION_THROTTLE_SWAP, + OPTION_THROTTLE_DIRTY } drv_option_enums; static const OptionInfoRec drv_options[] = { {OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_2D_ACCEL, "2DAccel", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DEBUG_FALLBACK, "DebugFallback", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_THROTTLE_SWAP, "SwapThrottling", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_THROTTLE_DIRTY, "DirtyThrottling", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -550,23 +554,29 @@ static void drv_block_handler(int i, pointer blockData, pointer pTimeout, if (ms->ctx) { int j; - ms->ctx->flush(ms->ctx, PIPE_FLUSH_RENDER_CACHE, &ms->fence[XORG_NR_FENCES-1]); + ms->ctx->flush(ms->ctx, PIPE_FLUSH_RENDER_CACHE, + ms->dirtyThrottling ? + &ms->fence[XORG_NR_FENCES-1] : + NULL); - if (ms->fence[0]) - ms->ctx->screen->fence_finish(ms->ctx->screen, ms->fence[0], 0); + if (ms->dirtyThrottling) { + if (ms->fence[0]) + ms->ctx->screen->fence_finish(ms->ctx->screen, + ms->fence[0], 0); - /* The amount of rendering generated by a block handler can be - * quite small. Let us get a fair way ahead of hardware before - * throttling. - */ - for (j = 0; j < XORG_NR_FENCES - 1; j++) - ms->screen->fence_reference(ms->screen, - &ms->fence[j], - ms->fence[j+1]); - - ms->screen->fence_reference(ms->screen, - &ms->fence[XORG_NR_FENCES-1], - NULL); + /* The amount of rendering generated by a block handler can be + * quite small. Let us get a fair way ahead of hardware before + * throttling. + */ + for (j = 0; j < XORG_NR_FENCES - 1; j++) + ms->screen->fence_reference(ms->screen, + &ms->fence[j], + ms->fence[j+1]); + + ms->screen->fence_reference(ms->screen, + &ms->fence[XORG_NR_FENCES-1], + NULL); + } } @@ -650,6 +660,8 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) unsigned max_width, max_height; VisualPtr visual; CustomizerPtr cust = ms->cust; + MessageType from_st; + MessageType from_dt; if (!drv_init_drm(pScrn)) { FatalError("Could not init DRM"); @@ -737,6 +749,19 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ms->accelerate_2d = xf86ReturnOptValBool(ms->Options, OPTION_2D_ACCEL, FALSE); ms->debug_fallback = xf86ReturnOptValBool(ms->Options, OPTION_DEBUG_FALLBACK, ms->accelerate_2d); + if (cust && cust->winsys_screen_init) + cust->winsys_screen_init(cust, ms->fd); + + ms->swapThrottling = cust ? cust->swap_throttling : TRUE; + from_st = xf86GetOptValBool(ms->Options, OPTION_THROTTLE_SWAP, + &ms->swapThrottling) ? + X_CONFIG : X_DEFAULT; + + ms->dirtyThrottling = cust ? cust->dirty_throttling : TRUE; + from_dt = xf86GetOptValBool(ms->Options, OPTION_THROTTLE_DIRTY, + &ms->dirtyThrottling) ? + X_CONFIG : X_DEFAULT; + if (ms->screen) { ms->exa = xorg_exa_init(pScrn, ms->accelerate_2d); @@ -761,6 +786,11 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "3D Acceleration is disabled\n"); #endif + xf86DrvMsg(pScrn->scrnIndex, from_st, "Swap Throttling is %s.\n", + ms->swapThrottling ? "enabled" : "disabled"); + xf86DrvMsg(pScrn->scrnIndex, from_dt, "Dirty Throttling is %s.\n", + ms->dirtyThrottling ? "enabled" : "disabled"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "##################################\n"); miInitializeBackingStore(pScreen); @@ -793,9 +823,6 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); - if (cust && cust->winsys_screen_init) - cust->winsys_screen_init(cust, ms->fd); - return drv_enter_vt(scrnIndex, 1); } diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 6d89fca..3f8b367 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -1035,6 +1035,7 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel) modesettingPtr ms = modesettingPTR(pScrn); struct exa_context *exa; ExaDriverPtr pExa; + CustomizerPtr cust = ms->cust; exa = xcalloc(1, sizeof(struct exa_context)); if (!exa) @@ -1093,6 +1094,8 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel) exa->pipe = ms->api->create_context(ms->api, exa->scrn); /* Share context with DRI */ ms->ctx = exa->pipe; + if (cust && cust->winsys_context_throttle) + cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_RENDER); exa->renderer = renderer_create(exa->pipe); exa->accel = accel; diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index 33e8427..9de1df7 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -65,12 +65,22 @@ typedef struct #define XORG_NR_FENCES 3 +enum xorg_throttling_reason { + THROTTLE_RENDER, + THROTTLE_SWAP +}; + typedef struct _CustomizerRec { + Bool dirty_throttling; + Bool swap_throttling; Bool (*winsys_screen_init)(struct _CustomizerRec *cust, int fd); Bool (*winsys_screen_close)(struct _CustomizerRec *cust); Bool (*winsys_enter_vt)(struct _CustomizerRec *cust); Bool (*winsys_leave_vt)(struct _CustomizerRec *cust); + void (*winsys_context_throttle)(struct _CustomizerRec *cust, + struct pipe_context *pipe, + enum xorg_throttling_reason reason); } CustomizerRec, *CustomizerPtr; typedef struct _modesettingRec @@ -88,6 +98,8 @@ typedef struct _modesettingRec Bool noAccel; Bool SWCursor; + Bool swapThrottling; + Bool dirtyThrottling; CloseScreenProcPtr CloseScreen; /* Broken-out options. */ diff --git a/src/gallium/winsys/drm/vmware/core/vmw_context.c b/src/gallium/winsys/drm/vmware/core/vmw_context.c index b5fd4f5..b482954 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_context.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_context.c @@ -103,6 +103,9 @@ struct vmw_svga_winsys_context * referred. */ boolean preemptive_flush; + -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1nsee3-0006ch...@alioth.debian.org