packages: Mesa/Mesa-git.patch, Mesa/Mesa.spec - rel 2; updated from git
arekm
arekm at pld-linux.org
Sat Apr 28 22:22:20 CEST 2012
Author: arekm Date: Sat Apr 28 20:22:20 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 2; updated from git
---- Files affected:
packages/Mesa:
Mesa-git.patch (1.20 -> 1.21) , Mesa.spec (1.321 -> 1.322)
---- Diffs:
================================================================
Index: packages/Mesa/Mesa-git.patch
diff -u packages/Mesa/Mesa-git.patch:1.20 packages/Mesa/Mesa-git.patch:1.21
--- packages/Mesa/Mesa-git.patch:1.20 Wed Apr 4 22:51:04 2012
+++ packages/Mesa/Mesa-git.patch Sat Apr 28 22:22:15 2012
@@ -1,3 +1,18 @@
+diff --git a/docs/relnotes-8.0.2.html b/docs/relnotes-8.0.2.html
+index ad1818c..d73ba9f 100644
+--- a/docs/relnotes-8.0.2.html
++++ b/docs/relnotes-8.0.2.html
+@@ -28,7 +28,9 @@ for DRI hardware acceleration.
+
+ <h2>MD5 checksums</h2>
+ <pre>
+-tdb
++70eb3dc74fbfcd72f6776268ee1db52e MesaLib-8.0.2.tar.gz
++a368104e5700707048dc3e8691a9a7a1 MesaLib-8.0.2.tar.bz2
++d5e5cdb85d2afdbcd1c0623d3ed1c54d MesaLib-8.0.2.zip
+ </pre>
+
+ <h2>New features</h2>
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index d132638..920612b 100644
--- a/src/gallium/drivers/r300/r300_blit.c
@@ -555,6 +570,214 @@
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa
+diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c
+index 5530224..db28302 100644
+--- a/src/glx/apple/apple_glx_drawable.c
++++ b/src/glx/apple/apple_glx_drawable.c
+@@ -135,6 +135,7 @@ release_drawable(struct apple_glx_drawable *d)
+ static bool
+ destroy_drawable(struct apple_glx_drawable *d)
+ {
++ int err;
+
+ d->lock(d);
+
+@@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d)
+
+ apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d);
+
++ err = pthread_mutex_destroy(&d->mutex);
++ if (err) {
++ fprintf(stderr, "pthread_mutex_destroy error: %s\n", strerror(err));
++ abort();
++ }
++
+ free(d);
+
+ /* So that the locks are balanced and the caller correctly unlocks. */
+diff --git a/src/glx/apple/apple_glx_surface.c b/src/glx/apple/apple_glx_surface.c
+index 39f5130..d42fa3b 100644
+--- a/src/glx/apple/apple_glx_surface.c
++++ b/src/glx/apple/apple_glx_surface.c
+@@ -206,6 +206,10 @@ apple_glx_surface_destroy(unsigned int uid)
+ if (d) {
+ d->types.surface.pending_destroy = true;
+ d->release(d);
++
++ /* apple_glx_drawable_find_by_uid returns a locked drawable */
++ d->unlock(d);
++
+ /*
+ * We release 2 references to the surface. One was acquired by
+ * the find, and the other was leftover from a context, or
+@@ -217,7 +221,5 @@ apple_glx_surface_destroy(unsigned int uid)
+ * by a glViewport callback (see apple_glx_context_update()).
+ */
+ d->destroy(d);
+-
+- d->unlock(d);
+ }
+ }
+diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c
+index 5c04801..640c495 100644
+--- a/src/mapi/glapi/glapi_gentable.c
++++ b/src/mapi/glapi/glapi_gentable.c
+@@ -105,7 +105,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) {
+
+ struct _glapi_table *
+ _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
+- struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
++ struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void *));
+ char symboln[512];
+
+ if(!disp)
+diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
+index 36563ef..dc32292 100644
+--- a/src/mesa/drivers/dri/i915/i915_context.c
++++ b/src/mesa/drivers/dri/i915/i915_context.c
+@@ -76,6 +76,8 @@ i915InvalidateState(struct gl_context * ctx, GLuint new_state)
+ i915_update_provoking_vertex(ctx);
+ if (new_state & (_NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS))
+ i915_update_program(ctx);
++ if (new_state & (_NEW_PROGRAM | _NEW_POINT))
++ i915_update_sprite_point_enable(ctx);
+ }
+
+
+diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h
+index 8167137..7037465 100644
+--- a/src/mesa/drivers/dri/i915/i915_context.h
++++ b/src/mesa/drivers/dri/i915/i915_context.h
+@@ -40,6 +40,7 @@
+ #define I915_FALLBACK_POINT_SMOOTH 0x80000
+ #define I915_FALLBACK_POINT_SPRITE_COORD_ORIGIN 0x100000
+ #define I915_FALLBACK_DRAW_OFFSET 0x200000
++#define I915_FALLBACK_COORD_REPLACE 0x400000
+
+ #define I915_UPLOAD_CTX 0x1
+ #define I915_UPLOAD_BUFFERS 0x2
+@@ -338,6 +339,7 @@ extern void i915InitStateFunctions(struct dd_function_table *functions);
+ extern void i915InitState(struct i915_context *i915);
+ extern void i915_update_stencil(struct gl_context * ctx);
+ extern void i915_update_provoking_vertex(struct gl_context *ctx);
++extern void i915_update_sprite_point_enable(struct gl_context *ctx);
+
+
+ /*======================================================================
+diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
+index 756001f..94c7327 100644
+--- a/src/mesa/drivers/dri/i915/i915_state.c
++++ b/src/mesa/drivers/dri/i915/i915_state.c
+@@ -652,6 +652,48 @@ i915PointParameterfv(struct gl_context * ctx, GLenum pname, const GLfloat *param
+ }
+ }
+
++void
++i915_update_sprite_point_enable(struct gl_context *ctx)
++{
++ struct intel_context *intel = intel_context(ctx);
++ /* _NEW_PROGRAM */
++ struct i915_fragment_program *p =
++ (struct i915_fragment_program *) ctx->FragmentProgram._Current;
++ const GLbitfield64 inputsRead = p->FragProg.Base.InputsRead;
++ struct i915_context *i915 = i915_context(ctx);
++ GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
++ int i;
++ GLuint coord_replace_bits = 0x0;
++ GLuint tex_coord_unit_bits = 0x0;
++
++ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
++ /* _NEW_POINT */
++ if (ctx->Point.CoordReplace[i] && ctx->Point.PointSprite)
++ coord_replace_bits |= (1 << i);
++ if (inputsRead & FRAG_BIT_TEX(i))
++ tex_coord_unit_bits |= (1 << i);
++ }
++
++ /*
++ * Here we can't enable the SPRITE_POINT_ENABLE bit when the mis-match
++ * of tex_coord_unit_bits and coord_replace_bits, or this will make all
++ * the other non-point-sprite coords(like varying inputs, as we now use
++ * tex coord to implement varying inputs) be replaced to value (0, 0)-(1, 1).
++ *
++ * Thus, do fallback when needed.
++ */
++ FALLBACK(intel, I915_FALLBACK_COORD_REPLACE,
++ coord_replace_bits && coord_replace_bits != tex_coord_unit_bits);
++
++ s4 &= ~S4_SPRITE_POINT_ENABLE;
++ s4 |= (coord_replace_bits && coord_replace_bits == tex_coord_unit_bits) ?
++ S4_SPRITE_POINT_ENABLE : 0;
++ if (s4 != i915->state.Ctx[I915_CTXREG_LIS4]) {
++ i915->state.Ctx[I915_CTXREG_LIS4] = s4;
++ I915_STATECHANGE(i915, I915_UPLOAD_CTX);
++ }
++}
++
+
+ /* =============================================================
+ * Color masks
+@@ -869,18 +911,7 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
+ break;
+
+ case GL_POINT_SPRITE:
+- /* This state change is handled in i915_reduced_primitive_state because
+- * the hardware bit should only be set when rendering points.
+- */
+- dw = i915->state.Ctx[I915_CTXREG_LIS4];
+- if (state)
+- dw |= S4_SPRITE_POINT_ENABLE;
+- else
+- dw &= ~S4_SPRITE_POINT_ENABLE;
+- if (dw != i915->state.Ctx[I915_CTXREG_LIS4]) {
+- i915->state.Ctx[I915_CTXREG_LIS4] = dw;
+- I915_STATECHANGE(i915, I915_UPLOAD_CTX);
+- }
++ /* Handle it at i915_update_sprite_point_enable () */
+ break;
+
+ case GL_POINT_SMOOTH:
+diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
+index a36011a..68f0e05 100644
+--- a/src/mesa/drivers/dri/i915/intel_tris.c
++++ b/src/mesa/drivers/dri/i915/intel_tris.c
+@@ -1198,6 +1198,7 @@ static char *fallbackStrings[] = {
+ [19] = "Smooth point",
+ [20] = "point sprite coord origin",
+ [21] = "depth/color drawing offset",
++ [22] = "coord replace(SPRITE POINT ENABLE)",
+ };
+
+
+diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+index 0632052..cec1e95 100644
+--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
++++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+@@ -1921,7 +1921,10 @@ fs_visitor::emit_fb_writes()
+ {
+ this->current_annotation = "FB write header";
+ bool header_present = true;
+- int base_mrf = 2;
++ /* We can potentially have a message length of up to 15, so we have to set
++ * base_mrf to either 0 or 1 in order to fit in m0..m15.
++ */
++ int base_mrf = 1;
+ int nr = base_mrf;
+ int reg_width = c->dispatch_width / 8;
+
+diff --git a/src/mesa/drivers/dri/i965/gen6_sampler_state.c b/src/mesa/drivers/dri/i965/gen6_sampler_state.c
+index 15cae0a..a9a9df5 100644
+--- a/src/mesa/drivers/dri/i965/gen6_sampler_state.c
++++ b/src/mesa/drivers/dri/i965/gen6_sampler_state.c
+@@ -41,7 +41,7 @@ upload_sampler_state_pointers(struct brw_context *brw)
+ GS_SAMPLER_STATE_CHANGE |
+ PS_SAMPLER_STATE_CHANGE |
+ (4 - 2));
+- OUT_BATCH(0); /* VS */
++ OUT_BATCH(brw->sampler.offset); /* VS */
+ OUT_BATCH(0); /* GS */
+ OUT_BATCH(brw->sampler.offset);
+ ADVANCE_BATCH();
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index d3c0d70..9cdd804 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
@@ -586,3 +809,85 @@
rb->mt->hiz_mt = mt;
} else {
rb->mt = mt;
+diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
+index 5b3c246..f3a0d10 100644
+--- a/src/mesa/main/readpix.c
++++ b/src/mesa/main/readpix.c
+@@ -196,6 +196,11 @@ read_stencil_pixels( struct gl_context *ctx,
+ ctx->Driver.UnmapRenderbuffer(ctx, rb);
+ }
+
++
++/**
++ * Try to do glReadPixels of RGBA data using a simple memcpy or swizzle.
++ * \return GL_TRUE if successful, GL_FALSE otherwise (use the slow path)
++ */
+ static GLboolean
+ fast_read_rgba_pixels_memcpy( struct gl_context *ctx,
+ GLint x, GLint y,
+@@ -208,8 +213,20 @@ fast_read_rgba_pixels_memcpy( struct gl_context *ctx,
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
+ GLubyte *dst, *map;
+ int dstStride, stride, j, texelBytes;
++ GLboolean swizzle_rb = GL_FALSE, copy_xrgb = GL_FALSE;
+
+- if (!_mesa_format_matches_format_and_type(rb->Format, format, type))
++ /* XXX we could check for other swizzle/special cases here as needed */
++ if (rb->Format == MESA_FORMAT_RGBA8888_REV &&
++ format == GL_BGRA &&
++ type == GL_UNSIGNED_INT_8_8_8_8_REV) {
++ swizzle_rb = GL_TRUE;
++ }
++ else if (rb->Format == MESA_FORMAT_XRGB8888 &&
++ format == GL_BGRA &&
++ type == GL_UNSIGNED_INT_8_8_8_8_REV) {
++ copy_xrgb = GL_TRUE;
++ }
++ else if (!_mesa_format_matches_format_and_type(rb->Format, format, type))
+ return GL_FALSE;
+
+ /* check for things we can't handle here */
+@@ -240,10 +257,39 @@ fast_read_rgba_pixels_memcpy( struct gl_context *ctx,
+ }
+
+ texelBytes = _mesa_get_format_bytes(rb->Format);
+- for (j = 0; j < height; j++) {
+- memcpy(dst, map, width * texelBytes);
+- dst += dstStride;
+- map += stride;
++
++ if (swizzle_rb) {
++ /* swap R/B */
++ for (j = 0; j < height; j++) {
++ int i;
++ for (i = 0; i < width; i++) {
++ GLuint *dst4 = (GLuint *) dst, *map4 = (GLuint *) map;
++ GLuint pixel = map4[i];
++ dst4[i] = (pixel & 0xff00ff00)
++ | ((pixel & 0x00ff0000) >> 16)
++ | ((pixel & 0x000000ff) << 16);
++ }
++ dst += dstStride;
++ map += stride;
++ }
++ } else if (copy_xrgb) {
++ /* convert xrgb -> argb */
++ for (j = 0; j < height; j++) {
++ GLuint *dst4 = (GLuint *) dst, *map4 = (GLuint *) map;
++ int i;
++ for (i = 0; i < width; i++) {
++ dst4[i] = map4[i] | 0xff000000; /* set A=0xff */
++ }
++ dst += dstStride;
++ map += stride;
++ }
++ } else {
++ /* just memcpy */
++ for (j = 0; j < height; j++) {
++ memcpy(dst, map, width * texelBytes);
++ dst += dstStride;
++ map += stride;
++ }
+ }
+
+ ctx->Driver.UnmapRenderbuffer(ctx, rb);
================================================================
Index: packages/Mesa/Mesa.spec
diff -u packages/Mesa/Mesa.spec:1.321 packages/Mesa/Mesa.spec:1.322
--- packages/Mesa/Mesa.spec:1.321 Fri Apr 6 18:00:04 2012
+++ packages/Mesa/Mesa.spec Sat Apr 28 22:22:15 2012
@@ -32,7 +32,7 @@
Summary(pl.UTF-8): Wolnodostępna implementacja standardu OpenGL
Name: Mesa
Version: 8.0.2
-Release: 1
+Release: 2
License: MIT (core), SGI (GLU) and others - see license.html file
Group: X11/Libraries
Source0: ftp://ftp.freedesktop.org/pub/mesa/%{version}/%{name}Lib-%{version}.tar.bz2
@@ -1340,6 +1340,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.322 2012/04/28 20:22:15 arekm
+- rel 2; updated from git
+
Revision 1.321 2012/04/06 16:00:04 qboosh
- updated ac version
================================================================
---- CVS-web:
http://cvs.pld-linux.org/packages/Mesa/Mesa-git.patch?r1=1.20&r2=1.21
http://cvs.pld-linux.org/packages/Mesa/Mesa.spec?r1=1.321&r2=1.322
More information about the pld-cvs-commit
mailing list