packages: Mesa/Mesa-git.patch, Mesa/Mesa.spec - rel 3; git patch updated

arekm arekm at pld-linux.org
Sun May 6 17:14:03 CEST 2012


Author: arekm                        Date: Sun May  6 15:14:03 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 3; git patch updated

---- Files affected:
packages/Mesa:
   Mesa-git.patch (1.21 -> 1.22) , Mesa.spec (1.322 -> 1.323) 

---- Diffs:

================================================================
Index: packages/Mesa/Mesa-git.patch
diff -u packages/Mesa/Mesa-git.patch:1.21 packages/Mesa/Mesa-git.patch:1.22
--- packages/Mesa/Mesa-git.patch:1.21	Sat Apr 28 22:22:15 2012
+++ packages/Mesa/Mesa-git.patch	Sun May  6 17:13:58 2012
@@ -13,6 +13,109 @@
  </pre>
  
  <h2>New features</h2>
+diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c
+index d5deae7..1174d0a 100644
+--- a/src/egl/main/eglimage.c
++++ b/src/egl/main/eglimage.c
+@@ -45,7 +45,7 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
+ 
+    (void) dpy;
+ 
+-   memset(attrs, 0, sizeof(attrs));
++   memset(attrs, 0, sizeof(*attrs));
+    attrs->ImagePreserved = EGL_FALSE;
+    attrs->GLTextureLevel = 0;
+    attrs->GLTextureZOffset = 0;
+diff --git a/src/gallium/auxiliary/util/u_double_list.h b/src/gallium/auxiliary/util/u_double_list.h
+index 2384c36..9d1129b 100644
+--- a/src/gallium/auxiliary/util/u_double_list.h
++++ b/src/gallium/auxiliary/util/u_double_list.h
+@@ -105,6 +105,11 @@ static INLINE void list_delinit(struct list_head *item)
+ #define LIST_IS_EMPTY(__list)                   \
+     ((__list)->next == (__list))
+ 
++/**
++ * Cast from a pointer to a member of a struct back to the containing struct.
++ *
++ * 'sample' MUST be initialized, or else the result is undefined!
++ */
+ #ifndef container_of
+ #define container_of(ptr, sample, member)				\
+     (void *)((char *)(ptr)						\
+@@ -112,29 +117,29 @@ static INLINE void list_delinit(struct list_head *item)
+ #endif
+ 
+ #define LIST_FOR_EACH_ENTRY(pos, head, member)				\
+-   for (pos = container_of((head)->next, pos, member);			\
++   for (pos = NULL, pos = container_of((head)->next, pos, member);	\
+ 	&pos->member != (head);						\
+ 	pos = container_of(pos->member.next, pos, member))
+ 
+ #define LIST_FOR_EACH_ENTRY_SAFE(pos, storage, head, member)	\
+-   for (pos = container_of((head)->next, pos, member),			\
++   for (pos = NULL, pos = container_of((head)->next, pos, member),	\
+ 	storage = container_of(pos->member.next, pos, member);	\
+ 	&pos->member != (head);						\
+ 	pos = storage, storage = container_of(storage->member.next, storage, member))
+ 
+ #define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member)	\
+-   for (pos = container_of((head)->prev, pos, member),			\
++   for (pos = NULL, pos = container_of((head)->prev, pos, member),	\
+ 	storage = container_of(pos->member.prev, pos, member);		\
+ 	&pos->member != (head);						\
+ 	pos = storage, storage = container_of(storage->member.prev, storage, member))
+ 
+ #define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member)		\
+-   for (pos = container_of((start), pos, member);			\
++   for (pos = NULL, pos = container_of((start), pos, member);		\
+ 	&pos->member != (head);						\
+ 	pos = container_of(pos->member.next, pos, member))
+ 
+ #define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member)		\
+-   for (pos = container_of((start), pos, member);			\
++   for (pos = NULL, pos = container_of((start), pos, member);		\
+ 	&pos->member != (head);						\
+ 	pos = container_of(pos->member.prev, pos, member))
+ 
+diff --git a/src/gallium/auxiliary/util/u_linkage.h b/src/gallium/auxiliary/util/u_linkage.h
+index 43ec917..7b23123 100644
+--- a/src/gallium/auxiliary/util/u_linkage.h
++++ b/src/gallium/auxiliary/util/u_linkage.h
+@@ -49,15 +49,16 @@ unsigned util_semantic_set_from_program_file(struct util_semantic_set *set, cons
+  *
+  * num_slots is the size of the layout array and hardware limit instead.
+  *
+- * efficient_slots == 0 or efficient_solts == num_slots are typical settings.
++ * efficient_slots == 0 or efficient_slots == num_slots are typical settings.
+  */
+ void util_semantic_layout_from_set(unsigned char *layout, const struct util_semantic_set *set, unsigned efficient_slots, unsigned num_slots);
+ 
+ static INLINE void
+-util_semantic_table_from_layout(unsigned char *table, unsigned char *layout, unsigned char first_slot_value, unsigned char num_slots)
++util_semantic_table_from_layout(unsigned char *table, size_t table_size, unsigned char *layout,
++                                unsigned char first_slot_value, unsigned char num_slots)
+ {
+-   int i;
+-   memset(table, 0xff, sizeof(table));
++   unsigned char i;
++   memset(table, 0xff, table_size);
+ 
+    for(i = 0; i < num_slots; ++i)
+       table[layout[i]] = first_slot_value + i;
+diff --git a/src/gallium/drivers/nvfx/nvfx_fragprog.c b/src/gallium/drivers/nvfx/nvfx_fragprog.c
+index dbd7c77..0babcbb 100644
+--- a/src/gallium/drivers/nvfx/nvfx_fragprog.c
++++ b/src/gallium/drivers/nvfx/nvfx_fragprog.c
+@@ -977,7 +977,8 @@ nvfx_fragprog_prepare(struct nvfx_context* nvfx, struct nvfx_fpc *fpc)
+ 	if(fpc->fp->num_slots > num_texcoords)
+ 		return FALSE;
+ 	util_semantic_layout_from_set(fpc->fp->slot_to_generic, &set, 0, num_texcoords);
+-	util_semantic_table_from_layout(fpc->generic_to_slot, fpc->fp->slot_to_generic, 0, num_texcoords);
++	util_semantic_table_from_layout(fpc->generic_to_slot, sizeof fpc->generic_to_slot,
++                                        fpc->fp->slot_to_generic, 0, num_texcoords);
+ 
+ 	memset(fpc->fp->slot_to_fp_input, 0xff, sizeof(fpc->fp->slot_to_fp_input));
+ 
 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
@@ -558,6 +661,36 @@
  
      /* Make the last generic be WPOS. */
      vs->outputs.wpos = vs->outputs.generic[transform.last_generic + 1];
+diff --git a/src/gallium/state_trackers/vega/text.c b/src/gallium/state_trackers/vega/text.c
+index a183933..27d461c 100644
+--- a/src/gallium/state_trackers/vega/text.c
++++ b/src/gallium/state_trackers/vega/text.c
+@@ -73,8 +73,8 @@ static void add_glyph(struct vg_font *font,
+    glyph = CALLOC_STRUCT(vg_glyph);
+    glyph->object = obj;
+    glyph->is_hinted = isHinted;
+-   memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyphOrigin));
+-   memcpy(glyph->escapement, escapement, sizeof(escapement));
++   memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyph->glyph_origin));
++   memcpy(glyph->escapement, escapement, sizeof(glyph->glyph_origin));
+ 
+    cso_hash_insert(font->glyphs, (unsigned) glyphIndex, glyph);
+ }
+diff --git a/src/gallium/targets/egl-static/egl_st.c b/src/gallium/targets/egl-static/egl_st.c
+index 81d7bb4..67e3c29 100644
+--- a/src/gallium/targets/egl-static/egl_st.c
++++ b/src/gallium/targets/egl-static/egl_st.c
+@@ -54,8 +54,9 @@ dlopen_gl_lib_cb(const char *dir, size_t len, void *callback_data)
+    int ret;
+ 
+    if (len) {
++      assert(len <= INT_MAX && "path is insanely long!");
+       ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT,
+-            len, dir, name);
++            (int)len, dir, name);
+    }
+    else {
+       ret = util_snprintf(path, sizeof(path), "%s" UTIL_DL_EXT, name);
 diff --git a/src/glsl/Android.mk b/src/glsl/Android.mk
 index d7d17dd..84a8655 100644
 --- a/src/glsl/Android.mk
@@ -570,11 +703,148 @@
  	$(MESA_TOP)/src/mapi \
  	$(MESA_TOP)/src/mesa
  
+diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
+index dc64295..68fe6ad 100644
+--- a/src/glx/apple/Makefile
++++ b/src/glx/apple/Makefile
+@@ -26,6 +26,7 @@ SOURCES = \
+ 	apple_glx.c \
+ 	apple_glx_context.c \
+ 	apple_glx_drawable.c \
++	apple_glx_log.c \
+ 	apple_glx_pbuffer.c \
+ 	apple_glx_pixmap.c \
+ 	apple_glx_surface.c \
+diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c
+index d94c1e0..56cff64 100644
+--- a/src/glx/apple/apple_glx.c
++++ b/src/glx/apple/apple_glx.c
+@@ -33,6 +33,8 @@
+ #include <assert.h>
+ #include <stdarg.h>
+ #include <dlfcn.h>
++#include <pthread.h>
++#include <inttypes.h>
+ #include "appledri.h"
+ #include "apple_glx.h"
+ #include "apple_glx_context.h"
+@@ -43,22 +45,6 @@ static int dri_event_base = 0;
+ 
+ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
+ 
+-static bool diagnostic = false;
+-
+-void
+-apple_glx_diagnostic(const char *fmt, ...)
+-{
+-   va_list vl;
+-
+-   if (diagnostic) {
+-      fprintf(stderr, "DIAG: ");
+-
+-      va_start(vl, fmt);
+-      vfprintf(stderr, fmt, vl);
+-      va_end(vl);
+-   }
+-}
+-
+ int
+ apple_get_dri_event_base(void)
+ {
+@@ -125,10 +111,9 @@ apple_init_glx(Display * dpy)
+    if (initialized)
+       return false;
+ 
+-   if (getenv("LIBGL_DIAGNOSTIC")) {
+-      printf("initializing libGL in %s\n", __func__);
+-      diagnostic = true;
+-   }
++   apple_glx_log_init();
++
++   apple_glx_log(ASL_LEVEL_INFO, "Initializing libGL.");
+ 
+    apple_cgl_init();
+    (void) apple_glx_get_client_id();
+diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h
+index ce8c488..0967f18 100644
+--- a/src/glx/apple/apple_glx.h
++++ b/src/glx/apple/apple_glx.h
+@@ -38,7 +38,8 @@
+ #define XP_NO_X_HEADERS
+ #include <Xplugin.h>
+ 
+-void apple_glx_diagnostic(const char *fmt, ...);
++#include "apple_glx_log.h"
++
+ xp_client_id apple_glx_get_client_id(void);
+ bool apple_init_glx(Display * dpy);
+ void apple_glx_swap_buffers(void *ptr);
+diff --git a/src/glx/apple/apple_glx_context.c b/src/glx/apple/apple_glx_context.c
+index c58d05a..0bb25b4 100644
+--- a/src/glx/apple/apple_glx_context.c
++++ b/src/glx/apple/apple_glx_context.c
+@@ -421,7 +421,7 @@ apple_glx_make_current_context(Display * dpy, void *oldptr, void *ptr,
+     */
+ 
+    if (same_drawable && ac->is_current) {
+-      apple_glx_diagnostic("%s: same_drawable and ac->is_current\n");
++      apple_glx_diagnostic("same_drawable and ac->is_current\n");
+       return false;
+    }
+ 
 diff --git a/src/glx/apple/apple_glx_drawable.c b/src/glx/apple/apple_glx_drawable.c
-index 5530224..db28302 100644
+index 5530224..3f84d56 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)
+@@ -32,6 +32,7 @@
+ #include <stdlib.h>
+ #include <assert.h>
+ #include <pthread.h>
++#include <string.h>
+ #include "apple_glx.h"
+ #include "apple_glx_context.h"
+ #include "apple_glx_drawable.h"
+@@ -48,8 +49,8 @@ lock_drawables_list(void)
+    err = pthread_mutex_lock(&drawables_lock);
+ 
+    if (err) {
+-      fprintf(stderr, "pthread_mutex_lock failure in %s: %d\n",
+-              __func__, err);
++      fprintf(stderr, "pthread_mutex_lock failure in %s: %s\n",
++              __func__, strerror(err));
+       abort();
+    }
+ }
+@@ -62,8 +63,8 @@ unlock_drawables_list(void)
+    err = pthread_mutex_unlock(&drawables_lock);
+ 
+    if (err) {
+-      fprintf(stderr, "pthread_mutex_unlock failure in %s: %d\n",
+-              __func__, err);
++      fprintf(stderr, "pthread_mutex_unlock failure in %s: %s\n",
++              __func__, strerror(err));
+       abort();
+    }
+ }
+@@ -95,7 +96,7 @@ drawable_lock(struct apple_glx_drawable *agd)
+    err = pthread_mutex_lock(&agd->mutex);
+ 
+    if (err) {
+-      fprintf(stderr, "pthread_mutex_lock error: %d\n", err);
++      fprintf(stderr, "pthread_mutex_lock error: %s\n", strerror(err));
+       abort();
+    }
+ }
+@@ -108,7 +109,7 @@ drawable_unlock(struct apple_glx_drawable *d)
+    err = pthread_mutex_unlock(&d->mutex);
+ 
+    if (err) {
+-      fprintf(stderr, "pthread_mutex_unlock error: %d\n", err);
++      fprintf(stderr, "pthread_mutex_unlock error: %s\n", strerror(err));
+       abort();
+    }
+ }
+@@ -135,6 +136,7 @@ release_drawable(struct apple_glx_drawable *d)
  static bool
  destroy_drawable(struct apple_glx_drawable *d)
  {
@@ -582,7 +852,7 @@
  
     d->lock(d);
  
-@@ -172,6 +173,12 @@ destroy_drawable(struct apple_glx_drawable *d)
+@@ -172,6 +174,12 @@ destroy_drawable(struct apple_glx_drawable *d)
  
     apple_glx_diagnostic("%s: freeing %p\n", __func__, (void *) d);
  
@@ -595,6 +865,219 @@
     free(d);
  
     /* So that the locks are balanced and the caller correctly unlocks. */
+@@ -238,7 +246,7 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d)
+    err = pthread_mutexattr_init(&attr);
+ 
+    if (err) {
+-      fprintf(stderr, "pthread_mutexattr_init error: %d\n", err);
++      fprintf(stderr, "pthread_mutexattr_init error: %s\n", strerror(err));
+       abort();
+    }
+ 
+@@ -250,14 +258,14 @@ common_init(Display * dpy, GLXDrawable drawable, struct apple_glx_drawable *d)
+    err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ 
+    if (err) {
+-      fprintf(stderr, "error: setting pthread mutex type: %d\n", err);
++      fprintf(stderr, "error: setting pthread mutex type: %s\n", strerror(err));
+       abort();
+    }
+ 
+    err = pthread_mutex_init(&d->mutex, &attr);
+ 
+    if (err) {
+-      fprintf(stderr, "pthread_mutex_init error: %d\n", err);
++      fprintf(stderr, "pthread_mutex_init error: %s\n", strerror(err));
+       abort();
+    }
+ 
+diff --git a/src/glx/apple/apple_glx_log.c b/src/glx/apple/apple_glx_log.c
+new file mode 100644
+index 0000000..9ebf666
+--- /dev/null
++++ b/src/glx/apple/apple_glx_log.c
+@@ -0,0 +1,118 @@
++/*
++ * Copyright (c) 2012 Apple Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person
++ * obtaining a copy of this software and associated documentation files
++ * (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
++ * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Except as contained in this notice, the name(s) of the above
++ * copyright holders shall not be used in advertising or otherwise to
++ * promote the sale, use or other dealings in this Software without
++ * prior written authorization.
++ */
++
++#include <sys/cdefs.h>
++#include <asl.h>
++#include <stdio.h>
++#include <stdbool.h>
++#include <stdint.h>
++#include <stdlib.h>
++#include <inttypes.h>
++#include <pthread.h>
++#include "apple_glx_log.h"
++
++static bool diagnostic = false;
++static aslclient aslc;
++
++void apple_glx_log_init(void) {
++    if (getenv("LIBGL_DIAGNOSTIC")) {
++        diagnostic = true;
++    }
++
++    aslc = asl_open(NULL, NULL, 0);
++}
++
++void _apple_glx_log(int level, const char *file, const char *function,
++                    int line, const char *fmt, ...) {
++    va_list v;
++    va_start(v, fmt);
++    _apple_glx_vlog(level, file, function, line, fmt, v);
++    va_end(v);
++}
++
++static const char *
++_asl_level_string(int level)
++{
++        if (level == ASL_LEVEL_EMERG) return ASL_STRING_EMERG;
++        if (level == ASL_LEVEL_ALERT) return ASL_STRING_ALERT;
++        if (level == ASL_LEVEL_CRIT) return ASL_STRING_CRIT;
++        if (level == ASL_LEVEL_ERR) return ASL_STRING_ERR;
++        if (level == ASL_LEVEL_WARNING) return ASL_STRING_WARNING;
++        if (level == ASL_LEVEL_NOTICE) return ASL_STRING_NOTICE;
++        if (level == ASL_LEVEL_INFO) return ASL_STRING_INFO;
++        if (level == ASL_LEVEL_DEBUG) return ASL_STRING_DEBUG;
++        return "unknown";
++}
++
++void _apple_glx_vlog(int level, const char *file, const char *function,
++                     int line, const char *fmt, va_list args) {
++    aslmsg msg;
++    uint64_t thread = 0;
++
++    if (pthread_is_threaded_np()) {
++        pthread_threadid_np(NULL, &thread);
++    }
++
++    if (diagnostic) {
++        va_list args2;
++        va_copy(args2, args);
++
++        fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ",
++                _asl_level_string(level), file, line, function, thread);
++        vfprintf(stderr, fmt, args2);
++    }
++
++    msg = asl_new(ASL_TYPE_MSG);
++    if (msg) {
++        if (file)
++            asl_set(msg, "File", file);
++        if (function)
++            asl_set(msg, "Function", function);
++        if (line) {
++            char *_line;
++            asprintf(&_line, "%d", line);
++            if (_line) {
++                asl_set(msg, "Line", _line);
++                free(_line);
++            }
++        }
++        if (pthread_is_threaded_np()) {
++            char *_thread;
++            asprintf(&_thread, "%"PRIu64, thread);
++            if (_thread) {
++                asl_set(msg, "Thread", _thread);
++                free(_thread);
++            }
++        }
++    }
++
++    asl_vlog(aslc, msg, level, fmt, args);
++    if (msg)
++        asl_free(msg);
++}
+diff --git a/src/glx/apple/apple_glx_log.h b/src/glx/apple/apple_glx_log.h
+new file mode 100644
+index 0000000..4b1c531
+--- /dev/null
++++ b/src/glx/apple/apple_glx_log.h
+@@ -0,0 +1,57 @@
++/*
++ * Copyright (c) 2012 Apple Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person
++ * obtaining a copy of this software and associated documentation files
++ * (the "Software"), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
++ * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Except as contained in this notice, the name(s) of the above
++ * copyright holders shall not be used in advertising or otherwise to
++ * promote the sale, use or other dealings in this Software without
++ * prior written authorization.
++ */
++
++#ifndef APPLE_GLX_LOG_H
++#define APPLE_GLX_LOG_H
++
++#include <sys/cdefs.h>
++#include <asl.h>
++
++void apple_glx_log_init(void);
++
++__printflike(5, 6)
++void _apple_glx_log(int level, const char *file, const char *function,
++                    int line, const char *fmt, ...);
++#define apple_glx_log(l, f, args ...) \
++    _apple_glx_log(l, __FILE__, __FUNCTION__, __LINE__, f, ## args)
++
++
++__printflike(5, 0)
++void _apple_glx_vlog(int level, const char *file, const char *function,
++                     int line, const char *fmt, va_list v);
++#define apple_glx_vlog(l, f, v) \
++    _apple_glx_vlog(l, __FILE__, __FUNCTION__, __LINE__, f, v)
++
++/* This is just here to help the transition.
++ * TODO: Replace calls to apple_glx_diagnostic
++ */
++#define apple_glx_diagnostic(f, args ...) \
++    apple_glx_log(ASL_LEVEL_DEBUG, f, ## args)
++
++#endif
 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
@@ -749,6 +1232,241 @@
  };
  
  
+diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h
+index f660222..5064c18 100644
+--- a/src/mesa/drivers/dri/i965/brw_eu.h
++++ b/src/mesa/drivers/dri/i965/brw_eu.h
+@@ -1048,6 +1048,7 @@ struct brw_instruction *brw_WHILE(struct brw_compile *p);
+ struct brw_instruction *brw_BREAK(struct brw_compile *p);
+ struct brw_instruction *brw_CONT(struct brw_compile *p);
+ struct brw_instruction *gen6_CONT(struct brw_compile *p);
++struct brw_instruction *gen6_HALT(struct brw_compile *p);
+ /* Forward jumps:
+  */
+ void brw_land_fwd_jump(struct brw_compile *p, int jmp_insn_idx);
+diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
+index b2581da..21d3c5a 100644
+--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
++++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
+@@ -1339,6 +1339,20 @@ struct brw_instruction *brw_CONT(struct brw_compile *p)
+    return insn;
+ }
+ 
++struct brw_instruction *gen6_HALT(struct brw_compile *p)
++{
++   struct brw_instruction *insn;
++
++   insn = next_insn(p, BRW_OPCODE_HALT);
++   brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
++   brw_set_src0(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_D));
++   brw_set_src1(p, insn, brw_imm_d(0x0)); /* UIP and JIP, updated later. */
++
++   insn->header.compression_control = BRW_COMPRESSION_NONE;
++   insn->header.execution_size = BRW_EXECUTE_8;
++   return insn;
++}
++
+ /* DO/WHILE loop:
+  *
+  * The DO/WHILE is just an unterminated loop -- break or continue are
+@@ -2395,8 +2409,8 @@ brw_find_next_block_end(struct brw_compile *p, int start)
+ 	 return ip;
+       }
+    }
+-   assert(!"not reached");
+-   return start + 1;
++
++   return 0;
+ }
+ 
+ /* There is no DO instruction on gen6, so to find the end of the loop
+@@ -2425,7 +2439,7 @@ brw_find_loop_end(struct brw_compile *p, int start)
+ }
+ 
+ /* After program generation, go back and update the UIP and JIP of
+- * BREAK and CONT instructions to their correct locations.
++ * BREAK, CONT, and HALT instructions to their correct locations.
+  */
+ void
+ brw_set_uip_jip(struct brw_compile *p)
+@@ -2439,21 +2453,50 @@ brw_set_uip_jip(struct brw_compile *p)
+ 
+    for (ip = 0; ip < p->nr_insn; ip++) {
+       struct brw_instruction *insn = &p->store[ip];
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/packages/Mesa/Mesa-git.patch?r1=1.21&r2=1.22
    http://cvs.pld-linux.org/packages/Mesa/Mesa.spec?r1=1.322&r2=1.323



More information about the pld-cvs-commit mailing list