Mesa (master): util: Cast to match the MSVC intrinsics.

2010-02-03 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 7bd949734c96a0af49cb0b89230dc82799c593b7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bd949734c96a0af49cb0b89230dc82799c593b7

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb  3 22:16:39 2010 +

util: Cast to match the MSVC intrinsics.

The cast is not optional in C++.

---

 src/gallium/auxiliary/util/u_atomic.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_atomic.h 
b/src/gallium/auxiliary/util/u_atomic.h
index e30280a..540112f 100644
--- a/src/gallium/auxiliary/util/u_atomic.h
+++ b/src/gallium/auxiliary/util/u_atomic.h
@@ -233,25 +233,25 @@ extern C {
 static INLINE boolean
 p_atomic_dec_zero(int32_t *v)
 {
-   return _InterlockedDecrement(v) == 0;
+   return _InterlockedDecrement((long *)v) == 0;
 }
 
 static INLINE void
 p_atomic_inc(int32_t *v)
 {
-   _InterlockedIncrement(v);
+   _InterlockedIncrement((long *)v);
 }
 
 static INLINE void
 p_atomic_dec(int32_t *v)
 {
-   _InterlockedDecrement(v);
+   _InterlockedDecrement((long *)v);
 }
 
 static INLINE int32_t
 p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
 {
-   return _InterlockedCompareExchange(v, _new, old);
+   return _InterlockedCompareExchange((long *)v, _new, old);
 }
 
 #ifdef __cplusplus

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Use only the shared object name when linking progs.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: ef67ad05cb2a23e555cfbfc67faf435677fbcf73
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef67ad05cb2a23e555cfbfc67faf435677fbcf73

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 09:21:00 2010 +

scons: Use only the shared object name when linking progs.

Otherwise the whole path gets baked into the executable.

---

 progs/SConscript|3 ++-
 src/glut/glx/SConscript |2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/progs/SConscript b/progs/SConscript
index 66a1745..2ec95a2 100644
--- a/progs/SConscript
+++ b/progs/SConscript
@@ -23,7 +23,8 @@ if platform != 'embedded':
progs_env.Prepend(LIBS = ['GLU', 'GL'])
 
# Glut
-   progs_env.Prepend(LIBS = [glut])
+   progs_env.Prepend(LIBPATH = [glut.dir])
+   progs_env.Prepend(LIBS = [glut.name])
 
# GLEW
progs_env.Prepend(LIBS = [glew])
diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript
index 5234e6d..9363b5c 100644
--- a/src/glut/glx/SConscript
+++ b/src/glut/glx/SConscript
@@ -105,5 +105,7 @@ env.InstallSharedLibrary(glut, version=(3, 7, 1))
 
 if env['platform'] == 'windows':
 glut = env.FindIxes(glut, 'LIBPREFIX', 'LIBSUFFIX')
+else:
+glut = env.FindIxes(glut, 'SHLIBPREFIX', 'SHLIBSUFFIX')
 
 Export('glut')

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Have MinGW target MSVCRT 7.0

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 5a743d9c513e6a36612872f270ea97b269451280
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a743d9c513e6a36612872f270ea97b269451280

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb  3 22:53:03 2010 +

scons: Have MinGW target MSVCRT 7.0

Necessary for _aligned_malloc/free().

---

 scons/crossmingw.py |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scons/crossmingw.py b/scons/crossmingw.py
index 9cb0b89..a4ae74e 100644
--- a/scons/crossmingw.py
+++ b/scons/crossmingw.py
@@ -177,6 +177,7 @@ def generate(env):
 # default in recent gcc versions
 env.AppendUnique(CFLAGS = ['-gstabs'])
 
+env.AppendUnique(CPPDEFINES = [('__MSVCRT_VERSION__', '0x0700')])
 #env.AppendUnique(LIBS = ['iberty'])
 env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup'])
 #env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at'])

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Add missing include.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 063f1238d1a62c489a4638968a72bd5e451fe227
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=063f1238d1a62c489a4638968a72bd5e451fe227

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 14:34:52 2010 +

util: Add missing include.

---

 src/gallium/auxiliary/util/u_dl.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_dl.c 
b/src/gallium/auxiliary/util/u_dl.c
index b42b429..37ed789 100644
--- a/src/gallium/auxiliary/util/u_dl.c
+++ b/src/gallium/auxiliary/util/u_dl.c
@@ -28,6 +28,7 @@
 
 
 #include pipe/p_config.h
+#include pipe/p_compiler.h
 
 #if defined(PIPE_OS_UNIX)
 #include dlfcn.h

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): os: Add missing dummy threading definitions.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 1207098deefb83559ba275e89f2bd154a65d21ca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1207098deefb83559ba275e89f2bd154a65d21ca

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 14:34:33 2010 +

os: Add missing dummy threading definitions.

---

 src/gallium/auxiliary/os/os_thread.h |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index 6310860..2da5fd7 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -167,6 +167,25 @@ typedef unsigned pipe_condvar;
 /** Dummy definitions */
 
 typedef unsigned pipe_thread;
+
+#define PIPE_THREAD_ROUTINE( name, param ) \
+   void * name( void *param )
+
+static INLINE pipe_thread pipe_thread_create( void *(* routine)( void *), void 
*param )
+{
+   return 0;
+}
+
+static INLINE int pipe_thread_wait( pipe_thread thread )
+{
+   return -1;
+}
+
+static INLINE int pipe_thread_destroy( pipe_thread thread )
+{
+   return -1;
+}
+
 typedef unsigned pipe_mutex;
 typedef unsigned pipe_condvar;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Disable unit tests on embedded platforms.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 9cd2abdf8b7978d8a903d4aee9e2072a0c87e9ad
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9cd2abdf8b7978d8a903d4aee9e2072a0c87e9ad

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 14:36:10 2010 +

llvmpipe: Disable unit tests on embedded platforms.

---

 src/gallium/drivers/llvmpipe/SConscript |   29 +++--
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/SConscript 
b/src/gallium/drivers/llvmpipe/SConscript
index 6bb545a..563220f 100644
--- a/src/gallium/drivers/llvmpipe/SConscript
+++ b/src/gallium/drivers/llvmpipe/SConscript
@@ -73,21 +73,22 @@ llvmpipe = env.ConvenienceLibrary(
])
 
 
-env = env.Clone()
+if env['platform'] != 'embedded':
+env = env.Clone()
 
-env.Prepend(LIBS = [llvmpipe] + gallium)
+env.Prepend(LIBS = [llvmpipe] + gallium)
 
-tests = [
-'format',
-'blend',
-'conv',
-]
+tests = [
+'format',
+'blend',
+'conv',
+]
 
-for test in tests:
-target = env.Program(
-target = 'lp_test_' + test,
-source = ['lp_test_' + test + '.c', 'lp_test_main.c'],
-)
-env.InstallProgram(target)
+for test in tests:
+target = env.Program(
+target = 'lp_test_' + test,
+source = ['lp_test_' + test + '.c', 'lp_test_main.c'],
+)
+env.InstallProgram(target)
 
-Export('llvmpipe')
+Export('llvmpipe')

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): trace: Use u_time.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: d015dfb45abe53caaa6a754c8008c878af3ea707
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d015dfb45abe53caaa6a754c8008c878af3ea707

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 14:37:45 2010 +

trace: Use u_time.

---

 src/gallium/drivers/trace/tr_rbug.c |   13 +++--
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_rbug.c 
b/src/gallium/drivers/trace/tr_rbug.c
index d66a75c..691b83c 100644
--- a/src/gallium/drivers/trace/tr_rbug.c
+++ b/src/gallium/drivers/trace/tr_rbug.c
@@ -26,11 +26,13 @@
  **/
 
 
+#include os/os_thread.h
 #include util/u_format.h
 #include util/u_string.h
 #include util/u_memory.h
 #include util/u_simple_list.h
 #include util/u_network.h
+#include util/u_time.h
 
 #include tgsi/tgsi_parse.h
 
@@ -43,15 +45,6 @@
 
 #include errno.h
 
-#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
-#  define sleep Sleep
-#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_APPLE)
-#  include unistd.h
-#  define sleep usleep
-#else
-#  warning No socket implementation
-#endif
-
 #define U642VOID(x) ((void *)(unsigned long)(x))
 #define VOID2U64(x) ((uint64_t)(unsigned long)(x))
 
@@ -805,7 +798,7 @@ PIPE_THREAD_ROUTINE(trace_rbug_thread, void_tr_rbug)
debug_printf(trace_rbug - remote debugging listening on port %u\n, 
--port);
 
while(tr_rbug-running) {
-  sleep(1);
+  util_time_sleep(1);
 
   c = u_socket_accept(s);
   if (c  0)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium: Don' t try to auto-detect the OS when embedded os is already pre-defined.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 47a080df15f5df1cfe72b83ccc1629d993b2a3c0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=47a080df15f5df1cfe72b83ccc1629d993b2a3c0

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 14:37:30 2010 +

gallium: Don't try to auto-detect the OS when embedded os is already 
pre-defined.

---

 src/gallium/include/pipe/p_config.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/include/pipe/p_config.h 
b/src/gallium/include/pipe/p_config.h
index 064605a..c5928dd 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -115,8 +115,10 @@
 #endif
 
 
+#if !defined(PIPE_OS_EMBEDDED)
+
 /*
- * Operating system family.
+ * Auto-detect the operating system family.
  * 
  * See subsystem below for a more fine-grained distinction.
  */
@@ -164,7 +166,7 @@
 #endif
 
 /*
- * Subsystem.
+ * Try to auto-detect the subsystem.
  * 
  * NOTE: There is no way to auto-detect most of these.
  */
@@ -191,5 +193,7 @@
 #endif
 #endif /* PIPE_OS_WINDOWS */
 
+#endif /* !PIPE_OS_EMBEDDED */
+
 
 #endif /* P_CONFIG_H_ */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Promote EMBEDDED from subsystem to full os.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 5cf88a4787555e1cf754adc665880a35130f625c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5cf88a4787555e1cf754adc665880a35130f625c

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 14:35:38 2010 +

scons: Promote EMBEDDED from subsystem to full os.

---

 scons/gallium.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index ac68bd6..a9a8b83 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -230,7 +230,7 @@ def generate(env):
 cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
 cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
 if platform == 'embedded':
-cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
+cppdefines += ['PIPE_OS_EMBEDDED']
 env.Append(CPPDEFINES = cppdefines)
 
 # C compiler options

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): os/os_memory_aligned.h: fix memory allocation alignment for 64 bits

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 24ea02553efccc52581479819d8ead8d2bb06aaf
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=24ea02553efccc52581479819d8ead8d2bb06aaf

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 18:06:55 2010 +

os/os_memory_aligned.h: fix memory allocation alignment for 64 bits

Based on Andreia Gaita sh...@jitted.com's patch.

---

 src/gallium/auxiliary/os/os_memory.h |2 +-
 src/gallium/auxiliary/os/os_memory_aligned.h |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_memory.h 
b/src/gallium/auxiliary/os/os_memory.h
index 704aa07..556662d 100644
--- a/src/gallium/auxiliary/os/os_memory.h
+++ b/src/gallium/auxiliary/os/os_memory.h
@@ -58,7 +58,7 @@ void *
 os_realloc(void *ptr, size_t old_size, size_t new_size);
 
 void *
-os_malloc_aligned(size_t size, uint alignment);
+os_malloc_aligned(size_t size, size_t alignment);
 
 void
 os_free_aligned(void *ptr);
diff --git a/src/gallium/auxiliary/os/os_memory_aligned.h 
b/src/gallium/auxiliary/os/os_memory_aligned.h
index d4528f7..72c5cf6 100644
--- a/src/gallium/auxiliary/os/os_memory_aligned.h
+++ b/src/gallium/auxiliary/os/os_memory_aligned.h
@@ -43,7 +43,7 @@
  * Return memory on given byte alignment
  */
 static INLINE void *
-os_malloc_aligned(size_t size, uint alignment)
+os_malloc_aligned(size_t size, size_t alignment)
 {
char *ptr, *buf;
 
@@ -51,7 +51,7 @@ os_malloc_aligned(size_t size, uint alignment)
if (!ptr)
   return NULL;
 
-   buf = (char *)(((uintptr_t)ptr + sizeof(void *) + alignment - 1)  
~(alignment - 1));
+   buf = (char *)(((uintptr_t)ptr + sizeof(void *) + alignment - 1)  
~((uintptr_t)(alignment - 1)));
*(char **)(buf - sizeof(void *)) = ptr;
 
return buf;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium: Add a define for deprecated function attribute.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: b7b7ea9532055a189eb1d276301937eae39f4168
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7b7ea9532055a189eb1d276301937eae39f4168

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 18:24:17 2010 +

gallium: Add a define for deprecated function attribute.

---

 src/gallium/include/pipe/p_compiler.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/gallium/include/pipe/p_compiler.h 
b/src/gallium/include/pipe/p_compiler.h
index 84956a2..c7d3507 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -145,6 +145,14 @@ typedef unsigned char boolean;
 
 
 
+#if (__GNUC__  3 || (__GNUC__ == 3  __GNUC_MINOR__ = 1))
+#define PIPE_DEPRECATED  __attribute__((__deprecated__))
+#else
+#define PIPE_DEPRECATED
+#endif
+
+
+
 /* Macros for data alignment. */
 #if defined(__GNUC__) || (defined(__SUNPRO_C)  (__SUNPRO_C = 0x590))
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Reimplement u_time on top of os_time.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 5ee324ad3cfe62de661a1a6a7a60b2eec5738ef1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5ee324ad3cfe62de661a1a6a7a60b2eec5738ef1

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 18:24:36 2010 +

util: Reimplement u_time on top of os_time.

---

 src/gallium/auxiliary/Makefile  |1 -
 src/gallium/auxiliary/SConscript|1 -
 src/gallium/auxiliary/util/u_time.c |  229 ---
 src/gallium/auxiliary/util/u_time.h |   89 +-
 4 files changed, 59 insertions(+), 261 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index 7d5e009..ac1872c 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -120,7 +120,6 @@ C_SOURCES = \
util/u_surface.c \
util/u_texture.c \
util/u_tile.c \
-   util/u_time.c \
util/u_timed_winsys.c \
util/u_upload_mgr.c \
util/u_simple_screen.c \
diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript
index 21b4435..d5b325e 100644
--- a/src/gallium/auxiliary/SConscript
+++ b/src/gallium/auxiliary/SConscript
@@ -156,7 +156,6 @@ source = [
 'util/u_surface.c',
 'util/u_texture.c',
 'util/u_tile.c',
-'util/u_time.c',
 'util/u_timed_winsys.c',
 'util/u_upload_mgr.c',
 'util/u_simple_screen.c',
diff --git a/src/gallium/auxiliary/util/u_time.c 
b/src/gallium/auxiliary/util/u_time.c
deleted file mode 100644
index 806708b..000
--- a/src/gallium/auxiliary/util/u_time.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/**
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * 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, sub license, 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 (including the
- * next paragraph) 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 NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
- *
- **/
-
-/**
- * @file
- * OS independent time-manipulation functions.
- * 
- * @author Jose Fonseca jrfons...@tungstengraphics.com
- */
-
-
-#include pipe/p_config.h
-
-#if !defined(PIPE_OS_EMBEDDED)
-
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) 
|| defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
-#include sys/time.h
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
-#include windows.h
-#include winddi.h
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
-#include windows.h
-extern VOID KeQuerySystemTime(PLARGE_INTEGER);
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) || 
defined(PIPE_SUBSYSTEM_WINDOWS_CE)
-#include windows.h
-#else
-#error Unsupported OS
-#endif
-
-#include util/u_time.h
-
-
-#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || 
defined(PIPE_SUBSYSTEM_WINDOWS_USER) || defined(PIPE_SUBSYSTEM_WINDOWS_CE)
-
-static int64_t frequency = 0;
-
-static INLINE void 
-util_time_get_frequency(void)
-{
-   if(!frequency) {
-#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
-  LONGLONG temp;
-  EngQueryPerformanceFrequency(temp);
-  frequency = temp;
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) || 
defined(PIPE_SUBSYSTEM_WINDOWS_CE)
-  LARGE_INTEGER temp;
-  QueryPerformanceFrequency(temp);
-  frequency = temp.QuadPart;
-#endif
-   }
-}
-#endif
-
-
-void 
-util_time_get(struct util_time *t)
-{
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) 
|| defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
-   gettimeofday(t-tv, NULL);
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
-   LONGLONG temp;
-   EngQueryPerformanceCounter(temp);
-   t-counter = temp;
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
-   /* Updated every 10 miliseconds, measured in units of 100 nanoseconds.
-* http://msdn.microsoft.com/en-us/library/ms801642.aspx */
-   LARGE_INTEGER temp;
-   KeQuerySystemTime(temp);
-   t-counter = temp.QuadPart;
-#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) || 
defined

Mesa (master): os: Ensure header includes are outside extern C {}.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 0eb8e77ffba9704c3d7ac8aa29e2640fb7002754
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0eb8e77ffba9704c3d7ac8aa29e2640fb7002754

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 18:24:57 2010 +

os: Ensure header includes are outside extern C {}.

---

 src/gallium/auxiliary/os/os_misc.h |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_misc.h 
b/src/gallium/auxiliary/os/os_misc.h
index 56e48ca..d59f981 100644
--- a/src/gallium/auxiliary/os/os_misc.h
+++ b/src/gallium/auxiliary/os/os_misc.h
@@ -38,6 +38,12 @@
 #include pipe/p_compiler.h
 
 
+#if defined(PIPE_OS_UNIX)
+#  include signal.h /* for kill() */
+#  include unistd.h /* getpid() */
+#endif
+
+
 #ifdef  __cplusplus
 extern C {
 #endif
@@ -51,8 +57,6 @@ extern C {
 #elif defined(PIPE_CC_MSVC)
 #  define os_break()  __debugbreak()
 #elif defined(PIPE_OS_UNIX)
-#  include signal.h /* for kill() */
-#  include unistd.h /* for getpid() */
 #  define os_break() kill(getpid(), SIGTRAP)
 #elif defined(PIPE_OS_EMBEDDED)
 void os_break(void);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): trace: util_stream - os_stream

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 838d9884be626045b0306fb265d04e47cb38ae8d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=838d9884be626045b0306fb265d04e47cb38ae8d

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 18:45:25 2010 +

trace: util_stream - os_stream

---

 src/gallium/drivers/trace/tr_dump.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_dump.c 
b/src/gallium/drivers/trace/tr_dump.c
index 7105a69..8de451c 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -46,10 +46,10 @@
 
 #include pipe/p_compiler.h
 #include os/os_thread.h
+#include os/os_stream.h
 #include util/u_debug.h
 #include util/u_memory.h
 #include util/u_string.h
-#include util/u_stream.h
 
 #include tr_dump.h
 #include tr_screen.h
@@ -57,7 +57,7 @@
 #include tr_buffer.h
 
 
-static struct util_stream *stream = NULL;
+static struct os_stream *stream = NULL;
 static unsigned refcount = 0;
 static pipe_mutex call_mutex;
 static long unsigned call_no = 0;
@@ -69,7 +69,7 @@ static INLINE void
 trace_dump_write(const char *buf, size_t size)
 {
if(stream)
-  util_stream_write(stream, buf, size);
+  os_stream_write(stream, buf, size);
 }
 
 
@@ -220,7 +220,7 @@ trace_dump_trace_close(void)
 {
if(stream) {
   trace_dump_writes(/trace\n);
-  util_stream_close(stream);
+  os_stream_close(stream);
   stream = NULL;
   refcount = 0;
   call_no = 0;
@@ -250,7 +250,7 @@ boolean trace_dump_trace_begin()
 
if(!stream) {
 
-  stream = util_stream_create(filename, 0);
+  stream = os_stream_create(filename, 0);
   if(!stream)
  return FALSE;
 
@@ -367,7 +367,7 @@ void trace_dump_call_end_locked(void)
trace_dump_indent(1);
trace_dump_tag_end(call);
trace_dump_newline();
-   util_stream_flush(stream);
+   os_stream_flush(stream);
 }
 
 void trace_dump_call_begin(const char *klass, const char *method)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Eliminate mixed space/tabs.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 7b6fa78d86612b73e662dc6981d32ef3cd534642
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b6fa78d86612b73e662dc6981d32ef3cd534642

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 19:37:56 2010 +

scons: Eliminate mixed space/tabs.

---

 scons/gallium.py |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 7f42c76..a40a957 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -281,10 +281,10 @@ def generate(env):
 ccflags += [
 '-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
 ]
-   if distutils.version.LooseVersion(ccversion) = 
distutils.version.LooseVersion('4.2'):
-   ccflags += [
-   '-mstackrealign', # ensure stack is aligned
-   ]
+if distutils.version.LooseVersion(ccversion) = 
distutils.version.LooseVersion('4.2'):
+ccflags += [
+'-mstackrealign', # ensure stack is aligned
+]
 if env['machine'] == 'x86_64':
 ccflags += ['-m64']
 # See also:
@@ -301,12 +301,12 @@ def generate(env):
 '-std=gnu99',
 ]
 if distutils.version.LooseVersion(ccversion) = 
distutils.version.LooseVersion('4.2'):
-   ccflags += [
-   '-Werror=pointer-arith',
-   ]
-   cflags += [
-   '-Werror=declaration-after-statement',
-   ]
+ccflags += [
+'-Werror=pointer-arith',
+]
+cflags += [
+'-Werror=declaration-after-statement',
+]
 if msvc:
 # See also:
 # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Only override scons CC selection in the embedded platform.

2010-02-04 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 9f151f93e69e988508d480beb36adb7674434ea7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f151f93e69e988508d480beb36adb7674434ea7

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb  4 19:37:30 2010 +

scons: Only override scons CC selection in the embedded platform.

---

 scons/gallium.py |   28 
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index a9a8b83..7f42c76 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -110,8 +110,21 @@ def generate(env):
 env['toolchain'] = 'wcesdk'
 env.Tool(env['toolchain'])
 
-if os.environ.has_key('CC'):
-env['CC'] = os.environ['CC']
+if env['platform'] == 'embedded':
+# Allow overriding compiler from environment
+if os.environ.has_key('CC'):
+env['CC'] = os.environ['CC']
+# Update CCVERSION to match
+pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
+ stdin = 'devnull',
+ stderr = 'devnull',
+ stdout = subprocess.PIPE)
+if pipe.wait() == 0:
+line = pipe.stdout.readline()
+match = re.search(r'[0-9]+(\.[0-9]+)+', line)
+if match:
+env['CCVERSION'] = match.group(0)
+
 
 env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
 env['msvc'] = env['CC'] == 'cl'
@@ -238,16 +251,7 @@ def generate(env):
 cxxflags = [] # C++
 ccflags = [] # C  C++
 if gcc:
-ccversion = ''
-pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
- stdin = 'devnull',
- stderr = 'devnull',
- stdout = subprocess.PIPE)
-if pipe.wait() == 0:
-line = pipe.stdout.readline()
-match = re.search(r'[0-9]+(\.[0-9]+)+', line)
-if match:
-   ccversion = match.group(0)
+ccversion = env['CCVERSION']
 if debug:
 ccflags += ['-O0', '-g3']
 elif ccversion.startswith('4.2.'):

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (lp-pre-binning): Merge commit 'fj/mesa-next'

2010-02-05 Thread Jose Fonseca
Module: Mesa
Branch: lp-pre-binning
Commit: c036d13d7d2cc905226fe53ebd86a18da808963f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c036d13d7d2cc905226fe53ebd86a18da808963f

Author: Keith Whitwell kei...@vmware.com
Date:   Fri Feb  5 09:50:21 2010 +

Merge commit 'fj/mesa-next'

---



___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): allow make to build lp_test_* for llvmpipe

2010-02-05 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 476b668ccc3f234676dbd3f15207eafe7965222e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=476b668ccc3f234676dbd3f15207eafe7965222e

Author: Chris Li chr...@vmware.com
Date:   Fri Feb  5 01:29:43 2010 -0800

allow make to build lp_test_* for llvmpipe

Signed-off-by: José Fonseca jfons...@vmware.com

---

 configs/linux-llvm|2 +-
 src/gallium/drivers/llvmpipe/Makefile |   13 +
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/configs/linux-llvm b/configs/linux-llvm
index 988b705..4bb5ff8 100644
--- a/configs/linux-llvm
+++ b/configs/linux-llvm
@@ -31,7 +31,7 @@ ifeq ($(MESA_LLVM),1)
 #  LLVM_CFLAGS=`llvm-config --cflags`
   LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo 
interpreter instrumentation` -Wno-long-long
   LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo 
interpreter instrumentation)
-  LLVM_LIBS = $(shell llvm-config --libs backend bitreader engine ipo 
interpreter instrumentation)
+  LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine 
ipo interpreter instrumentation)
   MKLIB_OPTIONS=-cplusplus
 else
   LLVM_CFLAGS=
diff --git a/src/gallium/drivers/llvmpipe/Makefile 
b/src/gallium/drivers/llvmpipe/Makefile
index 899af6a..698078b 100644
--- a/src/gallium/drivers/llvmpipe/Makefile
+++ b/src/gallium/drivers/llvmpipe/Makefile
@@ -74,3 +74,16 @@ lp_tile_soa.c: lp_tile_soa.py 
../../auxiliary/util/u_format_parse.py ../../auxil
 # to make a .s file to inspect assembly code
 .c.s:
$(CC) -S $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $
+
+
+testprogs := lp_test_format\
+lp_test_blend  \
+lp_test_conv
+
+LIBS += $(GL_LIB_DEPS) -L. -lllvmpipe -L../../auxiliary/ -lgallium
+
+$(testprogs): lp_test_% : lp_test_%.o lp_test_main.o
+   $(LD) $^ -o $@ -Wl,--start-group  $(LIBS) -Wl,--end-group
+
+
+default: $(testprogs)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): svga: Actually call fence_reference in texture downloads.

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: b750786fb149fb1276187bbbd1c042609e5962aa
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b750786fb149fb1276187bbbd1c042609e5962aa

Author: José Fonseca jfons...@vmware.com
Date:   Thu Jan 28 20:51:52 2010 +

svga: Actually call fence_reference in texture downloads.

---

 src/gallium/drivers/svga/svga_screen_texture.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen_texture.c 
b/src/gallium/drivers/svga/svga_screen_texture.c
index ad7bb65..12f3531 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.c
+++ b/src/gallium/drivers/svga/svga_screen_texture.c
@@ -205,7 +205,7 @@ svga_transfer_dma(struct svga_transfer *st,
   if(transfer == SVGA3D_READ_HOST_VRAM) {
  svga_screen_flush(screen, fence);
  sws-fence_finish(sws, fence, 0);
- //sws-fence_reference(sws, fence, NULL);
+ sws-fence_reference(sws, fence, NULL);
   }
}
else {
@@ -235,7 +235,7 @@ svga_transfer_dma(struct svga_transfer *st,
 if(y) {
svga_screen_flush(screen, fence);
sws-fence_finish(sws, fence, 0);
-   //sws-fence_reference(sws, fence, NULL);
+   sws-fence_reference(sws, fence, NULL);
 }
 
 hw = sws-buffer_map(sws, st-hwbuf, PIPE_BUFFER_USAGE_CPU_WRITE);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Fix null buffer object reference counting.

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 05ac187f305bb653d569b5c07446ec0f4cd7ff08
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=05ac187f305bb653d569b5c07446ec0f4cd7ff08

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb  1 21:30:50 2010 +

mesa: Fix null buffer object reference counting.

Always use _mesa_reference_buffer_object, and never call
ctx-Driver.DeleteBuffer() directly to prevent dangling pointers to the
null buffer object.

This fixes crash/assertions in sharedtex_mt and Autodesk Mudbox.

---

 src/mesa/main/shared.c  |   14 --
 src/mesa/vbo/vbo_save.c |   11 +++
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 6cf63f6..a7cf623 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -93,12 +93,14 @@ _mesa_alloc_shared_state(GLcontext *ctx)
shared-BufferObjects = _mesa_NewHashTable();
 #endif
 
-   /* Allocate the default buffer object and set refcount so high that
-* it never gets deleted.
-* XXX with recent/improved refcounting this may not longer be needed.
-*/
+   /* Allocate the default buffer object */
shared-NullBufferObj = ctx-Driver.NewBufferObject(ctx, 0, 0);
+#ifndef DEBUG
+   /* Set refcount so high that it never gets deleted.
+* XXX with recent/improved refcounting this should be no longer be needed.
+*/
shared-NullBufferObj-RefCount = 1000 * 1000 * 1000;
+#endif
 
/* Create default texture objects */
for (i = 0; i  NUM_TEXTURE_TARGETS; i++) {
@@ -202,7 +204,7 @@ delete_bufferobj_cb(GLuint id, void *data, void *userData)
   ctx-Driver.UnmapBuffer(ctx, 0, bufObj);
   bufObj-Pointer = NULL;
}
-   ctx-Driver.DeleteBuffer(ctx, bufObj);
+   _mesa_reference_buffer_object(ctx, bufObj, NULL);
 }
 
 
@@ -335,7 +337,7 @@ free_shared_state(GLcontext *ctx, struct gl_shared_state 
*shared)
 #endif
 
 #if FEATURE_ARB_vertex_buffer_object
-   ctx-Driver.DeleteBuffer(ctx, shared-NullBufferObj);
+   _mesa_reference_buffer_object(ctx, shared-NullBufferObj, NULL);
 #endif
 
 #if FEATURE_ARB_sync
diff --git a/src/mesa/vbo/vbo_save.c b/src/mesa/vbo/vbo_save.c
index 10f705c..fd9a130 100644
--- a/src/mesa/vbo/vbo_save.c
+++ b/src/mesa/vbo/vbo_save.c
@@ -58,8 +58,19 @@ void vbo_save_init( GLcontext *ctx )
 
{
   struct gl_client_array *arrays = save-arrays;
+  unsigned i;
+
   memcpy(arrays,  vbo-legacy_currval,  16 * sizeof(arrays[0]));
   memcpy(arrays + 16, vbo-generic_currval, 16 * sizeof(arrays[0]));
+
+  for (i = 0; i  16; ++i) {
+ arrays[i ].BufferObj = NULL;
+ arrays[i + 16].BufferObj = NULL;
+ _mesa_reference_buffer_object(ctx, arrays[i ].BufferObj, 
+   vbo-legacy_currval[i].BufferObj);
+ _mesa_reference_buffer_object(ctx, arrays[i + 16].BufferObj,
+   vbo-generic_currval[i].BufferObj);
+  }
}
 
ctx-Driver.CurrentSavePrimitive = PRIM_UNKNOWN;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Always do proper ref counting of shared state.

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 1c39dbb90cefad8a5a97e75042466d66ea4270bc
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c39dbb90cefad8a5a97e75042466d66ea4270bc

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb  1 21:22:10 2010 +

mesa: Always do proper ref counting of shared state.

---

 src/mesa/main/context.c |   24 
 src/mesa/main/shared.c  |   31 +--
 src/mesa/main/shared.h  |2 +-
 3 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 74c6ac4..fccce51 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -835,7 +835,7 @@ _mesa_initialize_context(GLcontext *ctx,
_glthread_UNLOCK_MUTEX(shared-Mutex);
 
if (!init_attrib_groups( ctx )) {
-  _mesa_free_shared_state(ctx, ctx-Shared);
+  _mesa_release_shared_state(ctx, ctx-Shared);
   return GL_FALSE;
}
 
@@ -843,7 +843,7 @@ _mesa_initialize_context(GLcontext *ctx,
ctx-Exec = alloc_dispatch_table();
ctx-Save = alloc_dispatch_table();
if (!ctx-Exec || !ctx-Save) {
-  _mesa_free_shared_state(ctx, ctx-Shared);
+  _mesa_release_shared_state(ctx, ctx-Shared);
   if (ctx-Exec)
  _mesa_free(ctx-Exec);
   return GL_FALSE;
@@ -933,8 +933,6 @@ _mesa_create_context(const GLvisual *visual,
 void
 _mesa_free_context_data( GLcontext *ctx )
 {
-   GLint RefCount;
-
if (!_mesa_get_current_context()){
   /* No current context, but we may need one in order to delete
* texture objs, etc.  So temporarily bind the context now.
@@ -988,14 +986,7 @@ _mesa_free_context_data( GLcontext *ctx )
_mesa_free(ctx-Save);
 
/* Shared context state (display lists, textures, etc) */
-   _glthread_LOCK_MUTEX(ctx-Shared-Mutex);
-   RefCount = --ctx-Shared-RefCount;
-   _glthread_UNLOCK_MUTEX(ctx-Shared-Mutex);
-   assert(RefCount = 0);
-   if (RefCount == 0) {
-  /* free shared state */
-  _mesa_free_shared_state( ctx, ctx-Shared );
-   }
+   _mesa_release_shared_state( ctx, ctx-Shared );
 
/* needs to be after freeing shared state */
_mesa_free_display_list_data(ctx);
@@ -1397,7 +1388,6 @@ _mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare)
 {
if (ctx  ctxToShare  ctx-Shared  ctxToShare-Shared) {
   struct gl_shared_state *oldSharedState = ctx-Shared;
-  GLint RefCount;
 
   ctx-Shared = ctxToShare-Shared;
   
@@ -1407,13 +1397,7 @@ _mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare)
 
   update_default_objects(ctx);
 
-  _glthread_LOCK_MUTEX(oldSharedState-Mutex);
-  RefCount = --oldSharedState-RefCount;
-  _glthread_UNLOCK_MUTEX(oldSharedState-Mutex);
-
-  if (RefCount == 0) {
- _mesa_free_shared_state(ctx, oldSharedState);
-  }
+  _mesa_release_shared_state(ctx, oldSharedState);
 
   return GL_TRUE;
}
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 4d01e8a..6cf63f6 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -288,8 +288,8 @@ delete_renderbuffer_cb(GLuint id, void *data, void 
*userData)
  *
  * \sa alloc_shared_state().
  */
-void
-_mesa_free_shared_state(GLcontext *ctx, struct gl_shared_state *shared)
+static void
+free_shared_state(GLcontext *ctx, struct gl_shared_state *shared)
 {
GLuint i;
 
@@ -368,3 +368,30 @@ _mesa_free_shared_state(GLcontext *ctx, struct 
gl_shared_state *shared)
 
_mesa_free(shared);
 }
+
+
+/**
+ * Decrement shared state object reference count and potentially free it
+ * and all children structures.
+ *
+ * \param ctx GL context.
+ * \param shared shared state pointer.
+ *
+ * \sa free_shared_state().
+ */
+void
+_mesa_release_shared_state(GLcontext *ctx, struct gl_shared_state *shared)
+{
+   GLint RefCount;
+
+   _glthread_LOCK_MUTEX(shared-Mutex);
+   RefCount = --shared-RefCount;
+   _glthread_UNLOCK_MUTEX(shared-Mutex);
+
+   assert(RefCount = 0);
+
+   if (RefCount == 0) {
+  /* free shared state */
+  free_shared_state( ctx, shared );
+   }
+}
diff --git a/src/mesa/main/shared.h b/src/mesa/main/shared.h
index e59177e..ef164a1 100644
--- a/src/mesa/main/shared.h
+++ b/src/mesa/main/shared.h
@@ -31,7 +31,7 @@ _mesa_alloc_shared_state(GLcontext *ctx);
 
 
 void
-_mesa_free_shared_state(GLcontext *ctx, struct gl_shared_state *shared);
+_mesa_release_shared_state(GLcontext *ctx, struct gl_shared_state *shared);
 
 
 #endif

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Ensure object refcount is null when destroying the buffer.

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 829d9bb7334ffea0d5d0c4076dd75c41525fae0c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=829d9bb7334ffea0d5d0c4076dd75c41525fae0c

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb  1 21:33:04 2010 +

mesa: Ensure object refcount is null when destroying the buffer.

Lets see if this is not too pedantic. Obj pointers are never exposed to
GL apps so it should be possible to get this right.

Furthermore apps with GL widgets and test suits create and destroy many
contexts and objects, so bad reference counting is not really an option.

---

 src/mesa/state_tracker/st_cb_bufferobjects.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c 
b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 3ff5890..f1b4f11 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -75,6 +75,8 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object 
*obj)
 {
struct st_buffer_object *st_obj = st_buffer_object(obj);
 
+   assert(obj-RefCount == 0);
+
if (st_obj-buffer) 
   pipe_buffer_reference(st_obj-buffer, NULL);
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium: Using the proper pattern rules for Makefile template.

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 62d1e40e0d672cc84708cd8a99f26ee5917c6aef
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=62d1e40e0d672cc84708cd8a99f26ee5917c6aef

Author: Chris Li chr...@vmware.com
Date:   Fri Feb  5 21:22:39 2010 -0800

gallium: Using the proper pattern rules for Makefile template.

The .o.c rule is consider obsolete.

Signed-off-by: José Fonseca jfons...@vmware.com

---

 src/gallium/Makefile.template |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template
index 1364235..35f603a 100644
--- a/src/gallium/Makefile.template
+++ b/src/gallium/Makefile.template
@@ -53,13 +53,13 @@ install:
 
 # RULES #
 
-.c.o:
+%.o: %.c
$(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $ -o $@
 
-.cpp.o:
+%.o: %.cpp
$(CXX) -c $(INCLUDES) $(DEFINES) $(CXXFLAGS) $(LIBRARY_DEFINES) $ -o $@
 
-.S.o:
+%.o: %.S
$(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES)  $ -o $@
 
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Make llvm unit test depend on libllvmpipe.a

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 8b6ec94aec2d0f18a862fd50bfeb2cc89a0d23d3
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b6ec94aec2d0f18a862fd50bfeb2cc89a0d23d3

Author: Chris Li chr...@vmware.com
Date:   Fri Feb  5 19:41:32 2010 -0800

llvmpipe: Make llvm unit test depend on libllvmpipe.a

Signed-off-by: José Fonseca jfons...@vmware.com

---

 src/gallium/drivers/llvmpipe/Makefile |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/Makefile 
b/src/gallium/drivers/llvmpipe/Makefile
index 7e7b620..e880042 100644
--- a/src/gallium/drivers/llvmpipe/Makefile
+++ b/src/gallium/drivers/llvmpipe/Makefile
@@ -60,8 +60,7 @@ testprogs := lp_test_format   \
 
 LIBS += $(GL_LIB_DEPS) -L. -lllvmpipe -L../../auxiliary/ -lgallium
 
-$(testprogs): lp_test_% : lp_test_%.o lp_test_main.o
-   $(LD) $^ -o $@ -Wl,--start-group  $(LIBS) -Wl,--end-group
-
+$(testprogs): lp_test_% : lp_test_%.o lp_test_main.o libllvmpipe.a
+   $(LD) $(filter %.o,$^) -o $@ -Wl,--start-group  $(LIBS) -Wl,--end-group
 
 default: $(testprogs)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium: Adding the %.s rule to generate asm code

2010-02-09 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: a8f4904fb33f4fe5da560f85ecf003601e0ec06a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8f4904fb33f4fe5da560f85ecf003601e0ec06a

Author: Chris Li chr...@vmware.com
Date:   Fri Feb  5 21:25:17 2010 -0800

gallium: Adding the %.s rule to generate asm code

Signed-off-by: José Fonseca jfons...@vmware.com

---

 src/gallium/Makefile.template |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template
index 35f603a..5d9d2db 100644
--- a/src/gallium/Makefile.template
+++ b/src/gallium/Makefile.template
@@ -53,6 +53,9 @@ install:
 
 # RULES #
 
+%.s: %.c
+   $(CC) -S $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $ -o $@
+
 %.o: %.c
$(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $ -o $@
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Leave depth buffer in swizzled format.

2010-02-10 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 5e6a9005100ec2636ce9734a5e4535216494cf60
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e6a9005100ec2636ce9734a5e4535216494cf60

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb 10 11:01:26 2010 +

llvmpipe: Leave depth buffer in swizzled format.

This fixes several assertion failures due to only Z32 being supported.

---

 src/gallium/drivers/llvmpipe/lp_rast.c  |  157 +--
 src/gallium/drivers/llvmpipe/lp_rast.h  |4 -
 src/gallium/drivers/llvmpipe/lp_rast_priv.h |   31 +-
 src/gallium/drivers/llvmpipe/lp_setup.c |4 -
 4 files changed, 78 insertions(+), 118 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c 
b/src/gallium/drivers/llvmpipe/lp_rast.c
index 5ae323f..6dbcb3c 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -229,13 +229,58 @@ void lp_rast_clear_zstencil( struct lp_rasterizer *rast,
  unsigned thread_index,
  const union lp_rast_cmd_arg arg)
 {
-   unsigned i;
-   uint32_t *depth_tile = rast-tasks[thread_index].tile.depth;
-   
+   struct lp_rasterizer_task *task = rast-tasks[thread_index];
+   const unsigned tile_x = task-x;
+   const unsigned tile_y = task-y;
+   const unsigned height = TILE_SIZE/TILE_VECTOR_HEIGHT;
+   const unsigned width = TILE_SIZE*TILE_VECTOR_HEIGHT;
+   unsigned block_size = 
util_format_get_blocksize(rast-zsbuf_transfer-texture-format);
+   uint8_t *dst;
+   unsigned dst_stride = rast-zsbuf_transfer-stride*TILE_VECTOR_HEIGHT;
+   unsigned i, j;
+
LP_DBG(DEBUG_RAST, %s 0x%x\n, __FUNCTION__, arg.clear_zstencil);
 
-   for (i = 0; i  TILE_SIZE * TILE_SIZE; i++)
-  depth_tile[i] = arg.clear_zstencil;
+   assert(rast-zsbuf_map);
+   if (!rast-zsbuf_map)
+  return;
+
+   LP_DBG(DEBUG_RAST, %s\n, __FUNCTION__);
+
+   /*
+* Clear the aera of the swizzled depth/depth buffer matching this tile, in
+* stripes of TILE_VECTOR_HEIGHT x TILE_SIZE at a time.
+*
+* The swizzled depth format is such that the depths for
+* TILE_VECTOR_HEIGHT x TILE_VECTOR_WIDTH pixels have consecutive offsets.
+*/
+
+   dst = lp_rast_depth_pointer(rast, tile_x, tile_y);
+
+   switch (block_size) {
+   case 1:
+  memset(dst, (uint8_t) arg.clear_zstencil, height * width);
+  break;
+   case 2:
+  for (i = 0; i  height; i++) {
+ uint16_t *row = (uint16_t *)dst;
+ for (j = 0; j  width; j++)
+*row++ = (uint16_t) arg.clear_zstencil;
+ dst += dst_stride;
+  }
+  break;
+   case 4:
+  for (i = 0; i  height; i++) {
+ uint32_t *row = (uint32_t *)dst;
+ for (j = 0; j  width; j++)
+*row++ = arg.clear_zstencil;
+ dst += dst_stride;
+  }
+  break;
+   default:
+ assert(0);
+ break;
+   }
 }
 
 
@@ -282,53 +327,6 @@ void lp_rast_load_color( struct lp_rasterizer *rast,
 }
 
 
-static void
-lp_tile_read_z32(uint32_t *tile,
- const uint8_t *map,
- unsigned map_stride,
- unsigned x0, unsigned y0, unsigned w, unsigned h)
-{
-   unsigned x, y;
-   const uint8_t *map_row = map + y0*map_stride;
-   for (y = 0; y  h; ++y) {
-  const uint32_t *map_pixel = (uint32_t *)(map_row + x0*4);
-  for (x = 0; x  w; ++x) {
- *tile++ = *map_pixel++;
-  }
-  map_row += map_stride;
-   }
-}
-
-/**
- * Load tile z/stencil from the framebuffer surface.
- * This is a bin command called during bin processing.
- */
-void lp_rast_load_zstencil( struct lp_rasterizer *rast,
-unsigned thread_index,
-const union lp_rast_cmd_arg arg )
-{
-   struct lp_rasterizer_task *task = rast-tasks[thread_index];
-   const unsigned x = task-x;
-   const unsigned y = task-y;
-   unsigned w = TILE_SIZE;
-   unsigned h = TILE_SIZE;
-
-   if (x + w  rast-state.fb.width)
-  w -= x + w - rast-state.fb.width;
-
-   if (y + h  rast-state.fb.height)
-  h -= y + h - rast-state.fb.height;
-
-   LP_DBG(DEBUG_RAST, %s %d,%d %dx%d\n, __FUNCTION__, x, y, w, h);
-
-   assert(rast-zsbuf_transfer-texture-format == PIPE_FORMAT_Z32_UNORM);
-   lp_tile_read_z32(task-tile.depth,
-rast-zsbuf_map, 
-rast-zsbuf_transfer-stride,
-x, y, w, h);
-}
-
-
 void lp_rast_set_state( struct lp_rasterizer *rast,
 unsigned thread_index,
 const union lp_rast_cmd_arg arg )
@@ -377,7 +375,7 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast,
 color[i] = tile-color[i] + 4 * block_offset;
 
  /* depth buffer */
- depth = tile-depth + block_offset;
+ depth = lp_rast_depth_pointer(rast, tile_x + x, tile_y + y);
 
  /* run shader */
  state-jit_function[0]( state-jit_context,
@@ -435,12 +433,11 @@ void lp_rast_shade_quads( struct 

Mesa (master): llvmpipe: Fix null pointer dereference when no depth buffer is bound.

2010-02-10 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: ba33fed6106609ed04612b46011e28fab69d2310
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba33fed6106609ed04612b46011e28fab69d2310

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb 10 11:25:26 2010 +

llvmpipe: Fix null pointer dereference when no depth buffer is bound.

---

 src/gallium/drivers/llvmpipe/lp_rast_priv.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h 
b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index 4760d33..5c5497e 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -139,6 +139,9 @@ lp_rast_depth_pointer( struct lp_rasterizer *rast,
void * depth;
assert((x % TILE_VECTOR_WIDTH) == 0);
assert((y % TILE_VECTOR_HEIGHT) == 0);
+   if(!rast-zsbuf_map)
+  return NULL;
+   assert(rast-zsbuf_transfer);
depth = rast-zsbuf_map +
y*rast-zsbuf_transfer-stride +

TILE_VECTOR_HEIGHT*x*util_format_get_blocksize(rast-zsbuf_transfer-texture-format);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Map rendertargets when bound as textures.

2010-02-10 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: b44c444a0fd203004612cab86ac78ae3bef2794b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b44c444a0fd203004612cab86ac78ae3bef2794b

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb 10 19:59:53 2010 +

llvmpipe: Map rendertargets when bound as textures.

Fixes gearbox segfault (fdo 25960). Corruption remains.

---

 src/gallium/drivers/llvmpipe/lp_setup.c |   19 +++
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c 
b/src/gallium/drivers/llvmpipe/lp_setup.c
index 6601fa6..538492b 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -45,6 +45,8 @@
 #include lp_fence.h
 #include lp_rast.h
 #include lp_setup_context.h
+#include lp_screen.h
+#include lp_winsys.h
 
 #include draw/draw_context.h
 #include draw/draw_vbuf.h
@@ -472,11 +474,20 @@ lp_setup_set_sampler_textures( struct setup_context 
*setup,
  jit_tex-width = tex-width0;
  jit_tex-height = tex-height0;
  jit_tex-stride = lp_tex-stride[0];
- if(!lp_tex-dt)
+ if(!lp_tex-dt) {
 jit_tex-data = lp_tex-data;
- else
-/* FIXME: map the rendertarget */
-assert(0);
+ }
+ else {
+/*
+ * XXX: Where should this be unmapped?
+ */
+
+struct llvmpipe_screen *screen = llvmpipe_screen(tex-screen);
+struct llvmpipe_winsys *winsys = screen-winsys;
+jit_tex-data = winsys-displaytarget_map(winsys, lp_tex-dt,
+  
PIPE_BUFFER_USAGE_CPU_READ);
+assert(jit_tex-data);
+ }
 
  /* the scene references this texture */
  {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Only build progs when explicitly requested in the command line.

2010-02-10 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: f6a16dfa9714c33a16cae3826dec7806be6c21cd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6a16dfa9714c33a16cae3826dec7806be6c21cd

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb 10 20:23:10 2010 +

scons: Only build progs when explicitly requested in the command line.

---

 SConstruct |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/SConstruct b/SConstruct
index 2e00ec4..964af7e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -225,8 +225,9 @@ SConscript(
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
 )
 
-SConscript(
-   'progs/SConscript',
-   variant_dir = os.path.join('progs', env['build']),
-   duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
-)
+if 'progs' in COMMAND_LINE_TARGETS:
+SConscript(
+'progs/SConscript',
+variant_dir = os.path.join('progs', env['build']),
+duplicate = 0 # 
http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallivm: TGSI_OPCODE_CONT is not deprecated.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 128d93a009c493c65f0fa5d220fac3098a54fa14
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=128d93a009c493c65f0fa5d220fac3098a54fa14

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 10:08:10 2010 +

gallivm: TGSI_OPCODE_CONT is not deprecated.

Note that with FIXME instead of an assertion failure.

Addresses fdo 25956.

---

 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index a52c6c5..2896c52 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1403,8 +1403,7 @@ emit_instruction(
   break;
 
case TGSI_OPCODE_CONT:
-  /* deprecated? */
-  assert(0);
+  /* FIXME */
   return 0;
   break;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Clamp both extremes of triangles to framebuffer size.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 764c172aa96d48e1cf18b903661064c1ef8df1b5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=764c172aa96d48e1cf18b903661064c1ef8df1b5

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 10:58:46 2010 +

llvmpipe: Clamp both extremes of triangles to framebuffer size.

Fix segmentation fault when triangles crossed the axis.

---

 src/gallium/drivers/llvmpipe/lp_setup_tri.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c 
b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 9e59a66..a8bf540 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -442,8 +442,11 @@ do_triangle_ccw(struct setup_context *setup,
maxx = maxx / TILE_SIZE;
maxy = maxy / TILE_SIZE;
 
-   /* Clamp maxx, maxy to framebuffer size
+   /*
+* Clamp to framebuffer size
 */
+   minx = MAX2(minx, 0);
+   miny = MAX2(miny, 0);
maxx = MIN2(maxx, scene-tiles_x - 1);
maxy = MIN2(maxy, scene-tiles_y - 1);
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Move tile coordinate assertion into a more useful place.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 8c0391726a89414356c705fcc2d5a38d12d0fe2b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c0391726a89414356c705fcc2d5a38d12d0fe2b

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 10:59:41 2010 +

llvmpipe: Move tile coordinate assertion into a more useful place.

---

 src/gallium/drivers/llvmpipe/lp_scene.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h 
b/src/gallium/drivers/llvmpipe/lp_scene.h
index fb478cc..23a54f0 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.h
+++ b/src/gallium/drivers/llvmpipe/lp_scene.h
@@ -227,6 +227,9 @@ lp_scene_putback_data( struct lp_scene *scene, unsigned 
size)
 static INLINE struct cmd_bin *
 lp_scene_get_bin(struct lp_scene *scene, unsigned x, unsigned y)
 {
+   assert(x  scene-tiles_x);
+   assert(y  scene-tiles_y);
+
return scene-tile[x][y];
 }
 
@@ -247,9 +250,6 @@ lp_scene_bin_command( struct lp_scene *scene,
struct cmd_bin *bin = lp_scene_get_bin(scene, x, y);
struct cmd_block_list *list = bin-commands;
 
-   assert(x  scene-tiles_x);
-   assert(y  scene-tiles_y);
-
if (list-tail-count == CMD_BLOCK_MAX) {
   lp_bin_new_cmd_block( list );
}

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Handle TGSI_TOKEN_TYPE_PROPERTY.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 9381dd590f2e45acb8fbb0aa5503c917b832204d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9381dd590f2e45acb8fbb0aa5503c917b832204d

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 11:08:30 2010 +

llvmpipe: Handle TGSI_TOKEN_TYPE_PROPERTY.

Avoids assertion failures with certain shaders.

---

 src/gallium/auxiliary/gallivm/lp_bld_interp.c   |1 +
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_interp.c 
b/src/gallium/auxiliary/gallivm/lp_bld_interp.c
index a6acaea..2fc8940 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_interp.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_interp.c
@@ -376,6 +376,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context 
*bld,
 
   case TGSI_TOKEN_TYPE_INSTRUCTION:
   case TGSI_TOKEN_TYPE_IMMEDIATE:
+  case TGSI_TOKEN_TYPE_PROPERTY:
  break;
 
   default:
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 2896c52..4cf28a9 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1498,6 +1498,9 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
  }
  break;
 
+  case TGSI_TOKEN_TYPE_PROPERTY:
+ break;
+
   default:
  assert( 0 );
   }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Fix drm/intel build.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: c72e8b3edd81c524f3237a27e6e91208ae2196c5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c72e8b3edd81c524f3237a27e6e91208ae2196c5

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 11:51:32 2010 +

scons: Fix drm/intel build.

---

 src/gallium/winsys/drm/intel/dri/SConscript |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/winsys/drm/intel/dri/SConscript 
b/src/gallium/winsys/drm/intel/dri/SConscript
index 104e987..0df841d 100644
--- a/src/gallium/winsys/drm/intel/dri/SConscript
+++ b/src/gallium/winsys/drm/intel/dri/SConscript
@@ -4,17 +4,18 @@ env = drienv.Clone()
 
 env.ParseConfig('pkg-config --cflags --libs libdrm_intel')
 
-drivers = [
+env.Prepend(LIBS = [
 st_dri,
 inteldrm,
-softpipe,
 i915,
 trace,
-]
+mesa,
+glsl,
+gallium
+])
 
 env.LoadableModule(
 target ='i915_dri.so',
 source = COMMON_GALLIUM_SOURCES,
-LIBS = drivers + mesa + gallium + env['LIBS'],
 SHLIBPREFIX = '',
 )

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert llvmpipe: Move tile coordinate assertion into a more useful place.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: be29a60f9ec273931ec2cc244619a387de3075a0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=be29a60f9ec273931ec2cc244619a387de3075a0

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 12:14:01 2010 +

Revert llvmpipe: Move tile coordinate assertion into a more useful place.

This reverts commit 8c0391726a89414356c705fcc2d5a38d12d0fe2b.

Too pendantic.

---

 src/gallium/drivers/llvmpipe/lp_scene.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h 
b/src/gallium/drivers/llvmpipe/lp_scene.h
index 23a54f0..fb478cc 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.h
+++ b/src/gallium/drivers/llvmpipe/lp_scene.h
@@ -227,9 +227,6 @@ lp_scene_putback_data( struct lp_scene *scene, unsigned 
size)
 static INLINE struct cmd_bin *
 lp_scene_get_bin(struct lp_scene *scene, unsigned x, unsigned y)
 {
-   assert(x  scene-tiles_x);
-   assert(y  scene-tiles_y);
-
return scene-tile[x][y];
 }
 
@@ -250,6 +247,9 @@ lp_scene_bin_command( struct lp_scene *scene,
struct cmd_bin *bin = lp_scene_get_bin(scene, x, y);
struct cmd_block_list *list = bin-commands;
 
+   assert(x  scene-tiles_x);
+   assert(y  scene-tiles_y);
+
if (list-tail-count == CMD_BLOCK_MAX) {
   lp_bin_new_cmd_block( list );
}

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): wgl: Fail gracefully whenever 3D could not be enabled for some reason.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 7fec5f88a50ffa95a818f730c4ff91a6adf4a79e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fec5f88a50ffa95a818f730c4ff91a6adf4a79e

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 16:32:23 2010 +

wgl: Fail gracefully whenever 3D could not be enabled for some reason.

---

 src/gallium/state_trackers/wgl/stw_context.c   |6 ++
 src/gallium/state_trackers/wgl/stw_framebuffer.c   |   17 -
 .../state_trackers/wgl/stw_getprocaddress.c|5 +
 src/gallium/state_trackers/wgl/stw_pixelformat.c   |3 +++
 4 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_context.c 
b/src/gallium/state_trackers/wgl/stw_context.c
index f2f0264..6f74204 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -80,6 +80,9 @@ DrvCopyContext(
struct stw_context *dst;
BOOL ret = FALSE;
 
+   if (!stw_dev)
+  return FALSE;
+
pipe_mutex_lock( stw_dev-ctx_mutex );

src = stw_lookup_context_locked( dhrcSource );
@@ -107,6 +110,9 @@ DrvShareLists(
struct stw_context *ctx2;
BOOL ret = FALSE;
 
+   if (!stw_dev)
+  return FALSE;
+
pipe_mutex_lock( stw_dev-ctx_mutex );

ctx1 = stw_lookup_context_locked( dhglrc1 );
diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c 
b/src/gallium/state_trackers/wgl/stw_framebuffer.c
index 6d09501..162f827 100644
--- a/src/gallium/state_trackers/wgl/stw_framebuffer.c
+++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c
@@ -178,7 +178,7 @@ stw_call_window_proc(
if(!tls_data)
   return 0;

-   if (nCode  0)
+   if (nCode  0 || !stw_dev)
return CallNextHookEx(tls_data-hCallWndProcHook, nCode, wParam, 
lParam);
 
if (pParams-message == WM_WINDOWPOSCHANGED) {
@@ -333,6 +333,9 @@ stw_framebuffer_cleanup( void )
struct stw_framebuffer *fb;
struct stw_framebuffer *next;
 
+   if (!stw_dev)
+  return;
+
pipe_mutex_lock( stw_dev-fb_mutex );
 
fb = stw_dev-fb_head;
@@ -388,6 +391,9 @@ stw_framebuffer_from_hdc(
 {
struct stw_framebuffer *fb;
 
+   if (!stw_dev)
+  return NULL;
+
pipe_mutex_lock( stw_dev-fb_mutex );
fb = stw_framebuffer_from_hdc_locked(hdc);
pipe_mutex_unlock( stw_dev-fb_mutex );
@@ -422,6 +428,9 @@ DrvSetPixelFormat(
uint index;
struct stw_framebuffer *fb;
 
+   if (!stw_dev)
+  return FALSE;
+
index = (uint) iPixelFormat - 1;
count = stw_pixelformat_get_extended_count();
if (index = count)
@@ -476,6 +485,9 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
struct pipe_screen *screen;
struct pipe_surface *surface;
 
+   if (!stw_dev)
+  return FALSE;
+
fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
   return FALSE;
@@ -577,6 +589,9 @@ DrvSwapBuffers(
struct stw_framebuffer *fb;
struct pipe_surface *surface = NULL;
 
+   if (!stw_dev)
+  return FALSE;
+
fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
   return FALSE;
diff --git a/src/gallium/state_trackers/wgl/stw_getprocaddress.c 
b/src/gallium/state_trackers/wgl/stw_getprocaddress.c
index 8875dc2..d43a55f 100644
--- a/src/gallium/state_trackers/wgl/stw_getprocaddress.c
+++ b/src/gallium/state_trackers/wgl/stw_getprocaddress.c
@@ -34,6 +34,8 @@
 
 #include glapi/glapi.h
 #include stw_ext_gallium.h
+#include stw_device.h
+#include stw_icd.h
 
 struct stw_extension_entry
 {
@@ -73,6 +75,9 @@ DrvGetProcAddress(
 {
const struct stw_extension_entry *entry;
 
+   if (!stw_dev)
+  return NULL;
+
if (lpszProc[0] == 'w'  lpszProc[1] == 'g'  lpszProc[2] == 'l')
   for (entry = stw_extension_entries; entry-name; entry++)
  if (strcmp( lpszProc, entry-name ) == 0)
diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.c 
b/src/gallium/state_trackers/wgl/stw_pixelformat.c
index 95e1957..b88f936 100644
--- a/src/gallium/state_trackers/wgl/stw_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/stw_pixelformat.c
@@ -303,6 +303,9 @@ DrvDescribePixelFormat(
 
(void) hdc;
 
+   if (!stw_dev)
+  return 0;
+
count = stw_pixelformat_get_extended_count();
index = (uint) iPixelFormat - 1;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): gdi: Never fail at DLL load time.

2010-02-11 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 94028edfc51b44ebaab274a61b938fdcfcf3b96c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=94028edfc51b44ebaab274a61b938fdcfcf3b96c

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 16:34:43 2010 +

gdi: Never fail at DLL load time.

Windows doesn't really expect things to fail at this point -- it
will try many times until it finally gives up, worse, something bad
happens.

The WGL state tracker will gracefully decline to do work even when it
is loaded.

---

 src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c |   10 +-
 src/gallium/winsys/gdi/gdi_softpipe_winsys.c |   10 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c 
b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
index e8bc0f5..36a8a9e 100644
--- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
@@ -267,13 +267,13 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID 
lpReserved)
 {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
-  if (!stw_init(stw_winsys)) {
- return FALSE;
-  }
-  return stw_init_thread();
+  stw_init(stw_winsys);
+  stw_init_thread();
+  break;
 
case DLL_THREAD_ATTACH:
-  return stw_init_thread();
+  stw_init_thread();
+  break;
 
case DLL_THREAD_DETACH:
   stw_cleanup_thread();
diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c 
b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
index 5e0ccf3..5838a5e 100644
--- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
@@ -317,13 +317,13 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID 
lpReserved)
 {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
-  if (!stw_init(stw_winsys)) {
- return FALSE;
-  }
-  return stw_init_thread();
+  stw_init(stw_winsys);
+  stw_init_thread();
+  break;
 
case DLL_THREAD_ATTACH:
-  return stw_init_thread();
+  stw_init_thread();
+  break;
 
case DLL_THREAD_DETACH:
   stw_cleanup_thread();

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): wgl: Do not reach out and destroy contexts on cleanup.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 426f607aaa28710b131d0be223ab6e9ae49cefd6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=426f607aaa28710b131d0be223ab6e9ae49cefd6

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 11:00:22 2010 +

wgl: Do not reach out and destroy contexts on cleanup.

Simply skip cleanup when contexts are still active.

This addresses two issues:

- in some situations the ICD DLL may be unloaded before the DLL that is
  using GL contexts is, so we may receive GL calls after stw_cleanup.

- when aborting (exception, or control-c) the contexts may have been left
  in an inconsistent state and attempting to destroy can cause
  unpredictable results.

---

 src/gallium/state_trackers/wgl/stw_device.c |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_device.c 
b/src/gallium/state_trackers/wgl/stw_device.c
index 7785aba..ce6fe5f 100644
--- a/src/gallium/state_trackers/wgl/stw_device.c
+++ b/src/gallium/state_trackers/wgl/stw_device.c
@@ -152,24 +152,26 @@ stw_cleanup_thread(void)
 void
 stw_cleanup(void)
 {
-   unsigned i;
+   DHGLRC dhglrc;
 
debug_printf(%s\n, __FUNCTION__);
 
if (!stw_dev)
   return;

+   /*
+* Abort cleanup if there are still active contexts. In some situations
+* this DLL may be unloaded before the DLL that is using GL contexts is.
+*/
pipe_mutex_lock( stw_dev-ctx_mutex );
-   {
-  /* Ensure all contexts are destroyed */
-  i = handle_table_get_first_handle(stw_dev-ctx_table);
-  while (i) {
- DrvDeleteContext(i);
- i = handle_table_get_next_handle(stw_dev-ctx_table, i);
-  }
-  handle_table_destroy(stw_dev-ctx_table);
-   }
+   dhglrc = handle_table_get_first_handle(stw_dev-ctx_table);
pipe_mutex_unlock( stw_dev-ctx_mutex );
+   if (dhglrc) {
+  debug_printf(%s: contexts still active -- cleanup aborted\n, 
__FUNCTION__);
+  return;
+   }
+
+   handle_table_destroy(stw_dev-ctx_table);
 
stw_framebuffer_cleanup();


___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): svgadump: Several improvements to shader dumping.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: ea8f7bd2e40dc69dbde079a29c169c5371244aef
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ea8f7bd2e40dc69dbde079a29c169c5371244aef

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 14:09:53 2010 +

svgadump: Several improvements to shader dumping.

---

 src/gallium/drivers/svga/svgadump/svga_shader.h|   31 +-
 .../drivers/svga/svgadump/svga_shader_dump.c   |  520 +++-
 src/gallium/drivers/svga/svgadump/svga_shader_op.c |  194 
 src/gallium/drivers/svga/svgadump/svga_shader_op.h |2 +
 4 files changed, 411 insertions(+), 336 deletions(-)

diff --git a/src/gallium/drivers/svga/svgadump/svga_shader.h 
b/src/gallium/drivers/svga/svgadump/svga_shader.h
index 9217af2..5db64bf 100644
--- a/src/gallium/drivers/svga/svgadump/svga_shader.h
+++ b/src/gallium/drivers/svga/svgadump/svga_shader.h
@@ -98,21 +98,33 @@ struct sh_defi
 #define PS_TEXTURETYPE_CUBE  SVGA3DSAMP_CUBE
 #define PS_TEXTURETYPE_VOLUMESVGA3DSAMP_VOLUME
 
-struct ps_sampleinfo
+struct sh_sampleinfo
 {
unsigned unused:27;
unsigned texture_type:4;
unsigned is_reg:1;
 };
 
-struct vs_semantic
+struct sh_semantic
 {
-   unsigned usage:5;
-   unsigned unused1:11;
+   unsigned usage:4;
+   unsigned unused1:12;
unsigned usage_index:4;
-   unsigned unused2:12;
+   unsigned unused2:11;
+   unsigned is_reg:1;
 };
 
+#define SH_WRITEMASK_0  0x1
+#define SH_WRITEMASK_1  0x2
+#define SH_WRITEMASK_2  0x4
+#define SH_WRITEMASK_3  0x8
+#define SH_WRITEMASK_ALL0xf
+
+#define SH_DSTMOD_NONE  0x0
+#define SH_DSTMOD_SATURATE  0x1
+#define SH_DSTMOD_PARTIALPRECISION  0x2
+#define SH_DSTMOD_MSAMPCENTROID 0x4
+
 struct sh_dstreg
 {
unsigned number:11;
@@ -136,17 +148,12 @@ struct sh_dcl
 {
struct sh_op op;
union {
-  struct {
- struct ps_sampleinfo sampleinfo;
-  } ps;
-  struct {
- struct vs_semantic semantic;
-  } vs;
+  struct sh_sampleinfo sampleinfo;
+  struct sh_semantic semantic;
} u;
struct sh_dstreg reg;
 };
 
-
 struct sh_srcreg
 {
unsigned number:11;
diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c 
b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c
index 70e27d8..d2bfb43 100644
--- a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c
+++ b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c
@@ -40,102 +40,139 @@
 
 struct dump_info
 {
-   SVGA3dShaderVersion version;
+   uint32 version;
boolean is_ps;
+   int indent;
 };
 
-static void dump_op( struct sh_op op, const char *mnemonic )
+#define DUMP_MAX_OP_SRC 4
+
+struct dump_op
 {
-   assert( op.predicated == 0 );
-   assert( op.is_reg == 0 );
+   struct sh_op op;
+   struct sh_dstreg dst;
+   struct sh_srcreg dstind;
+   struct sh_srcreg src[DUMP_MAX_OP_SRC];
+   struct sh_srcreg srcind[DUMP_MAX_OP_SRC];
+   struct sh_srcreg p0;
+};
 
-   if (op.coissue)
-  _debug_printf( + );
-   _debug_printf( %s, mnemonic );
-   switch (op.control) {
-   case 0:
-  break;
-   case SVGA3DOPCONT_PROJECT:
-  _debug_printf( p );
-  break;
-   case SVGA3DOPCONT_BIAS:
-  _debug_printf( b );
-  break;
-   default:
-  assert( 0 );
+static void
+dump_indent(int indent)
+{
+   int i;
+
+   for (i = 0; i  indent; ++i) {
+  _debug_printf(  );
}
 }
 
-
-static void dump_comp_op( struct sh_op op, const char *mnemonic )
+static void dump_op( struct sh_op op, const char *mnemonic )
 {
assert( op.is_reg == 0 );
 
+   if (op.predicated) {
+  _debug_printf((p0) );
+   }
if (op.coissue)
   _debug_printf( + );
_debug_printf( %s, mnemonic );
-   switch (op.control) {
-   case SVGA3DOPCOMP_RESERVED0:
-  break;
-   case SVGA3DOPCOMP_GT:
-  _debug_printf(_gt);
-  break;
-   case SVGA3DOPCOMP_EQ:
-  _debug_printf(_eq);
-  break;
-   case SVGA3DOPCOMP_GE:
-  _debug_printf(_ge);
-  break;
-   case SVGA3DOPCOMP_LT:
-  _debug_printf(_lt);
-  break;
-   case SVGA3DOPCOMPC_NE:
-  _debug_printf(_ne);
+
+   switch (op.opcode) {
+   case SVGA3DOP_TEX:
+  switch (op.control) {
+  case 0:
+ break;
+  case 1 /* PROJECT */:
+ _debug_printf(p);
+ break;
+  case 2 /* BIAS */:
+ _debug_printf(b);
+ break;
+  default:
+ assert(0);
+  }
   break;
-   case SVGA3DOPCOMP_LE:
-  _debug_printf(_le);
+
+   case SVGA3DOP_IFC:
+   case SVGA3DOP_BREAKC:
+   case SVGA3DOP_SETP:
+  switch (op.control) {
+  case SVGA3DOPCOMP_GT:
+ _debug_printf(_gt);
+ break;
+  case SVGA3DOPCOMP_EQ:
+ _debug_printf(_eq);
+ break;
+  case SVGA3DOPCOMP_GE:
+ _debug_printf(_ge);
+ break;
+  case SVGA3DOPCOMP_LT:
+ _debug_printf(_lt);
+ break;
+  case SVGA3DOPCOMPC_NE:
+ _debug_printf(_ne);
+ break;
+  case SVGA3DOPCOMP_LE:
+

Mesa (master): wgl: Fail gracefully whenever 3D could not be enabled for some reason.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: e6b66210def2c10f703c2a990b9652ea5419ebbe
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6b66210def2c10f703c2a990b9652ea5419ebbe

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 16:32:23 2010 +

wgl: Fail gracefully whenever 3D could not be enabled for some reason.

---

 src/gallium/state_trackers/wgl/stw_context.c   |6 ++
 src/gallium/state_trackers/wgl/stw_framebuffer.c   |   17 -
 .../state_trackers/wgl/stw_getprocaddress.c|5 +
 src/gallium/state_trackers/wgl/stw_pixelformat.c   |3 +++
 4 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_context.c 
b/src/gallium/state_trackers/wgl/stw_context.c
index 0785d2c..c2f9c75 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -75,6 +75,9 @@ DrvCopyContext(
struct stw_context *dst;
BOOL ret = FALSE;
 
+   if (!stw_dev)
+  return FALSE;
+
pipe_mutex_lock( stw_dev-ctx_mutex );

src = stw_lookup_context_locked( dhrcSource );
@@ -102,6 +105,9 @@ DrvShareLists(
struct stw_context *ctx2;
BOOL ret = FALSE;
 
+   if (!stw_dev)
+  return FALSE;
+
pipe_mutex_lock( stw_dev-ctx_mutex );

ctx1 = stw_lookup_context_locked( dhglrc1 );
diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c 
b/src/gallium/state_trackers/wgl/stw_framebuffer.c
index 129a629..02de21c 100644
--- a/src/gallium/state_trackers/wgl/stw_framebuffer.c
+++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c
@@ -179,7 +179,7 @@ stw_call_window_proc(
if(!tls_data)
   return 0;

-   if (nCode  0)
+   if (nCode  0 || !stw_dev)
return CallNextHookEx(tls_data-hCallWndProcHook, nCode, wParam, 
lParam);
 
if (pParams-message == WM_WINDOWPOSCHANGED) {
@@ -332,6 +332,9 @@ stw_framebuffer_cleanup( void )
struct stw_framebuffer *fb;
struct stw_framebuffer *next;
 
+   if (!stw_dev)
+  return;
+
pipe_mutex_lock( stw_dev-fb_mutex );
 
fb = stw_dev-fb_head;
@@ -387,6 +390,9 @@ stw_framebuffer_from_hdc(
 {
struct stw_framebuffer *fb;
 
+   if (!stw_dev)
+  return NULL;
+
pipe_mutex_lock( stw_dev-fb_mutex );
fb = stw_framebuffer_from_hdc_locked(hdc);
pipe_mutex_unlock( stw_dev-fb_mutex );
@@ -421,6 +427,9 @@ DrvSetPixelFormat(
uint index;
struct stw_framebuffer *fb;
 
+   if (!stw_dev)
+  return FALSE;
+
index = (uint) iPixelFormat - 1;
count = stw_pixelformat_get_extended_count();
if (index = count)
@@ -475,6 +484,9 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
struct pipe_screen *screen;
struct pipe_surface *surface;
 
+   if (!stw_dev)
+  return FALSE;
+
fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
   return FALSE;
@@ -576,6 +588,9 @@ DrvSwapBuffers(
struct stw_framebuffer *fb;
struct pipe_surface *surface = NULL;
 
+   if (!stw_dev)
+  return FALSE;
+
fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
   return FALSE;
diff --git a/src/gallium/state_trackers/wgl/stw_getprocaddress.c 
b/src/gallium/state_trackers/wgl/stw_getprocaddress.c
index 8875dc2..d43a55f 100644
--- a/src/gallium/state_trackers/wgl/stw_getprocaddress.c
+++ b/src/gallium/state_trackers/wgl/stw_getprocaddress.c
@@ -34,6 +34,8 @@
 
 #include glapi/glapi.h
 #include stw_ext_gallium.h
+#include stw_device.h
+#include stw_icd.h
 
 struct stw_extension_entry
 {
@@ -73,6 +75,9 @@ DrvGetProcAddress(
 {
const struct stw_extension_entry *entry;
 
+   if (!stw_dev)
+  return NULL;
+
if (lpszProc[0] == 'w'  lpszProc[1] == 'g'  lpszProc[2] == 'l')
   for (entry = stw_extension_entries; entry-name; entry++)
  if (strcmp( lpszProc, entry-name ) == 0)
diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.c 
b/src/gallium/state_trackers/wgl/stw_pixelformat.c
index 7d4c243..b750b03 100644
--- a/src/gallium/state_trackers/wgl/stw_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/stw_pixelformat.c
@@ -302,6 +302,9 @@ DrvDescribePixelFormat(
 
(void) hdc;
 
+   if (!stw_dev)
+  return 0;
+
count = stw_pixelformat_get_extended_count();
index = (uint) iPixelFormat - 1;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gdi: Never fail at DLL load time.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 8ce747defa2dafebfa99f03913342d6aca995341
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ce747defa2dafebfa99f03913342d6aca995341

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 11 16:34:43 2010 +

gdi: Never fail at DLL load time.

Windows doesn't really expect things to fail at this point -- it
will try many times until it finally gives up, worse, something bad
happens.

The WGL state tracker will gracefully decline to do work even when it
is loaded.

---

 src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c |   10 +-
 src/gallium/winsys/gdi/gdi_softpipe_winsys.c |   10 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c 
b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
index 03dbd76..e9e5990 100644
--- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
@@ -251,13 +251,13 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID 
lpReserved)
 {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
-  if (!stw_init(stw_winsys)) {
- return FALSE;
-  }
-  return stw_init_thread();
+  stw_init(stw_winsys);
+  stw_init_thread();
+  break;
 
case DLL_THREAD_ATTACH:
-  return stw_init_thread();
+  stw_init_thread();
+  break;
 
case DLL_THREAD_DETACH:
   stw_cleanup_thread();
diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c 
b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
index 2078020..71360e5 100644
--- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
@@ -297,13 +297,13 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID 
lpReserved)
 {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
-  if (!stw_init(stw_winsys)) {
- return FALSE;
-  }
-  return stw_init_thread();
+  stw_init(stw_winsys);
+  stw_init_thread();
+  break;
 
case DLL_THREAD_ATTACH:
-  return stw_init_thread();
+  stw_init_thread();
+  break;
 
case DLL_THREAD_DETACH:
   stw_cleanup_thread();

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): wgl: Do not reach out and destroy contexts on cleanup.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: e475ae920a4f6026b78b0bbe80c83cf4060f610e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e475ae920a4f6026b78b0bbe80c83cf4060f610e

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 11:00:22 2010 +

wgl: Do not reach out and destroy contexts on cleanup.

Simply skip cleanup when contexts are still active.

This addresses two issues:

- in some situations the ICD DLL may be unloaded before the DLL that is
  using GL contexts is, so we may receive GL calls after stw_cleanup.

- when aborting (exception, or control-c) the contexts may have been left
  in an inconsistent state and attempting to destroy can cause
  unpredictable results.

---

 src/gallium/state_trackers/wgl/stw_device.c |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_device.c 
b/src/gallium/state_trackers/wgl/stw_device.c
index 7785aba..ce6fe5f 100644
--- a/src/gallium/state_trackers/wgl/stw_device.c
+++ b/src/gallium/state_trackers/wgl/stw_device.c
@@ -152,24 +152,26 @@ stw_cleanup_thread(void)
 void
 stw_cleanup(void)
 {
-   unsigned i;
+   DHGLRC dhglrc;
 
debug_printf(%s\n, __FUNCTION__);
 
if (!stw_dev)
   return;

+   /*
+* Abort cleanup if there are still active contexts. In some situations
+* this DLL may be unloaded before the DLL that is using GL contexts is.
+*/
pipe_mutex_lock( stw_dev-ctx_mutex );
-   {
-  /* Ensure all contexts are destroyed */
-  i = handle_table_get_first_handle(stw_dev-ctx_table);
-  while (i) {
- DrvDeleteContext(i);
- i = handle_table_get_next_handle(stw_dev-ctx_table, i);
-  }
-  handle_table_destroy(stw_dev-ctx_table);
-   }
+   dhglrc = handle_table_get_first_handle(stw_dev-ctx_table);
pipe_mutex_unlock( stw_dev-ctx_mutex );
+   if (dhglrc) {
+  debug_printf(%s: contexts still active -- cleanup aborted\n, 
__FUNCTION__);
+  return;
+   }
+
+   handle_table_destroy(stw_dev-ctx_table);
 
stw_framebuffer_cleanup();


___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): scons: Target Windows7.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: fea7a70a1a7cc7e5d2f6343451c48291a70dc94d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fea7a70a1a7cc7e5d2f6343451c48291a70dc94d

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 13:22:59 2010 +

scons: Target Windows7.

---

 scons/gallium.py |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 2d963a5..633b86b 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -255,8 +255,9 @@ def generate(env):
 '_WINDOWS',
 #'_UNICODE',
 #'UNICODE',
-('_WIN32_WINNT', '0x0501'), # minimum required OS version
-('WINVER', '0x0501'),
+# http://msdn.microsoft.com/en-us/library/aa383745.aspx
+('_WIN32_WINNT', '0x0601'),
+('WINVER', '0x0601'),
 # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx,
 'WIN32_LEAN_AND_MEAN',
 ]

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): wgl: Go into dormant state when DLL is unloaded unclealy.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: e541dceb67897dae1fed59fd6aeed4a320b1f03f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e541dceb67897dae1fed59fd6aeed4a320b1f03f

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 13:59:16 2010 +

wgl: Go into dormant state when DLL is unloaded unclealy.

When our DLL is unloaded, even if we leave the data structures in memory
for sake of future calls, the MS CRT will destroy the heap. Instead we
make all calls no-ops by setting stw_dev to NULL.

---

 src/gallium/state_trackers/wgl/stw_device.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_device.c 
b/src/gallium/state_trackers/wgl/stw_device.c
index ce6fe5f..e5fa6ac 100644
--- a/src/gallium/state_trackers/wgl/stw_device.c
+++ b/src/gallium/state_trackers/wgl/stw_device.c
@@ -168,6 +168,7 @@ stw_cleanup(void)
pipe_mutex_unlock( stw_dev-ctx_mutex );
if (dhglrc) {
   debug_printf(%s: contexts still active -- cleanup aborted\n, 
__FUNCTION__);
+  stw_dev = NULL;
   return;
}
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Target Windows7.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 57617c8eba7093be3da9d818389ef5f18246e4ca
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=57617c8eba7093be3da9d818389ef5f18246e4ca

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 13:22:59 2010 +

scons: Target Windows7.

---

 scons/gallium.py |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index a40a957..15aa944 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -177,8 +177,11 @@ def generate(env):
 '_WINDOWS',
 #'_UNICODE',
 #'UNICODE',
-('_WIN32_WINNT', '0x0501'), # minimum required OS version
-('WINVER', '0x0501'),
+# http://msdn.microsoft.com/en-us/library/aa383745.aspx
+('_WIN32_WINNT', '0x0601'),
+('WINVER', '0x0601'),
+# http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx,
+'WIN32_LEAN_AND_MEAN',
 ]
 if msvc and env['toolchain'] != 'winddk':
 cppdefines += [

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): wgl: Go into dormant state when DLL is unloaded unclealy.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: a80d988144efad54e7a99920f8681e28243e9e9a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a80d988144efad54e7a99920f8681e28243e9e9a

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 13:59:16 2010 +

wgl: Go into dormant state when DLL is unloaded unclealy.

When our DLL is unloaded, even if we leave the data structures in memory
for sake of future calls, the MS CRT will destroy the heap. Instead we
make all calls no-ops by setting stw_dev to NULL.

---

 src/gallium/state_trackers/wgl/stw_device.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_device.c 
b/src/gallium/state_trackers/wgl/stw_device.c
index ce6fe5f..e5fa6ac 100644
--- a/src/gallium/state_trackers/wgl/stw_device.c
+++ b/src/gallium/state_trackers/wgl/stw_device.c
@@ -168,6 +168,7 @@ stw_cleanup(void)
pipe_mutex_unlock( stw_dev-ctx_mutex );
if (dhglrc) {
   debug_printf(%s: contexts still active -- cleanup aborted\n, 
__FUNCTION__);
+  stw_dev = NULL;
   return;
}
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): svga: Report the 2d/ 3d texture sizes supported by the host.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 1ae976be4aacdc27c229b07cb14101d7c3de65de
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ae976be4aacdc27c229b07cb14101d7c3de65de

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 17:01:48 2010 +

svga: Report the 2d/3d texture sizes supported by the host.

---

 src/gallium/drivers/svga/svga_screen.c |   26 ---
 src/gallium/drivers/svga/svga_screen_texture.h |2 +-
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen.c 
b/src/gallium/drivers/svga/svga_screen.c
index cd1ed7b..3593d9a 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -104,7 +104,9 @@ svga_get_paramf(struct pipe_screen *screen, int param)
   return 80.0;
 
case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
-  return 4.0;
+  if(!sws-get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY, result))
+ return 4.0;
+  return result.u;
 
case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
   return 16.0;
@@ -131,12 +133,28 @@ svga_get_paramf(struct pipe_screen *screen, int param)
   return 1;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
   return 1;
+
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
-  return SVGA_MAX_TEXTURE_LEVELS;
+  {
+ unsigned levels = SVGA_MAX_TEXTURE_LEVELS;
+ if (sws-get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH, result))
+levels = MIN2(util_logbase2(result.u) + 1, levels);
+ else
+levels = 12 /* 2048x2048 */;
+ if (sws-get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT, result))
+levels = MIN2(util_logbase2(result.u) + 1, levels);
+ else
+levels = 12 /* 2048x2048 */;
+ return levels;
+  }
+
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
-  return 8;  /* max 128x128x128 */
+  if (!sws-get_cap(sws, SVGA3D_DEVCAP_MAX_VOLUME_EXTENT, result))
+ return 8;  /* max 128x128x128 */
+  return MIN2(util_logbase2(result.u) + 1, SVGA_MAX_TEXTURE_LEVELS);
+
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-  return SVGA_MAX_TEXTURE_LEVELS;
+  return 12 /* 2048x2048 */;
 
case PIPE_CAP_TEXTURE_MIRROR_REPEAT: /* req. for GL 1.4 */
   return 1;
diff --git a/src/gallium/drivers/svga/svga_screen_texture.h 
b/src/gallium/drivers/svga/svga_screen_texture.h
index 8cfdfea..4257b49 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.h
+++ b/src/gallium/drivers/svga/svga_screen_texture.h
@@ -38,7 +38,7 @@ struct svga_winsys_surface;
 enum SVGA3dSurfaceFormat;
 
 
-#define SVGA_MAX_TEXTURE_LEVELS 12 /* 2048x2048 */
+#define SVGA_MAX_TEXTURE_LEVELS 16
 
 
 /**

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): svga: Clamp max cube texture levels to supported max 2d levels.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 3a4068474c25d91b52c6f3eb160cf8e6640df6d8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a4068474c25d91b52c6f3eb160cf8e6640df6d8

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 21:30:33 2010 +

svga: Clamp max cube texture levels to supported max 2d levels.

---

 src/gallium/drivers/svga/svga_screen.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen.c 
b/src/gallium/drivers/svga/svga_screen.c
index 3593d9a..0bd28d3 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -154,7 +154,12 @@ svga_get_paramf(struct pipe_screen *screen, int param)
   return MIN2(util_logbase2(result.u) + 1, SVGA_MAX_TEXTURE_LEVELS);
 
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-  return 12 /* 2048x2048 */;
+  /*
+   * No mechanism to query the host, and at least limited to 2048x2048 on
+   * certain hardware.
+   */
+  return MIN2(screen-get_paramf(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
+  12.0 /* 2048x2048 */);
 
case PIPE_CAP_TEXTURE_MIRROR_REPEAT: /* req. for GL 1.4 */
   return 1;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): svga: A few more tweaks to blend color state emission.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: a1025ec041ff2700a0a58ee3586df6333caee593
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1025ec041ff2700a0a58ee3586df6333caee593

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 23:17:04 2010 +

svga: A few more tweaks to blend color state emission.

---

 src/gallium/drivers/svga/svga_pipe_blend.c |2 +-
 src/gallium/drivers/svga/svga_state_rss.c  |   16 +++-
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c 
b/src/gallium/drivers/svga/svga_pipe_blend.c
index c0cbda3..3f5d908 100644
--- a/src/gallium/drivers/svga/svga_pipe_blend.c
+++ b/src/gallium/drivers/svga/svga_pipe_blend.c
@@ -223,7 +223,7 @@ static void svga_set_blend_color( struct pipe_context *pipe,
 
svga-curr.blend_color = *blend_color;
 
-   svga-dirty |= SVGA_NEW_BLEND;
+   svga-dirty |= SVGA_NEW_BLEND_COLOR;
 }
 
 
diff --git a/src/gallium/drivers/svga/svga_state_rss.c 
b/src/gallium/drivers/svga/svga_state_rss.c
index b97e636..46a2d5e 100644
--- a/src/gallium/drivers/svga/svga_state_rss.c
+++ b/src/gallium/drivers/svga/svga_state_rss.c
@@ -26,7 +26,6 @@
 #include pipe/p_inlines.h
 #include pipe/p_defines.h
 #include util/u_math.h
-#include util/u_pack_color.h
 
 #include svga_context.h
 #include svga_state.h
@@ -103,14 +102,13 @@ static int emit_rss( struct svga_context *svga,
 
 
if (dirty  SVGA_NEW_BLEND_COLOR) {
-  unsigned color = 0;
-  ubyte r = float_to_ubyte(svga-curr.blend_color.color[0]);
-  ubyte g = float_to_ubyte(svga-curr.blend_color.color[1]);
-  ubyte b = float_to_ubyte(svga-curr.blend_color.color[2]);
-  ubyte a = float_to_ubyte(svga-curr.blend_color.color[3]);
-
-  util_pack_color_ub( r, g, b, a,
-  PIPE_FORMAT_B8G8R8A8_UNORM, color);
+  uint32 color;
+  uint32 r = float_to_ubyte(svga-curr.blend_color.color[0]);
+  uint32 g = float_to_ubyte(svga-curr.blend_color.color[1]);
+  uint32 b = float_to_ubyte(svga-curr.blend_color.color[2]);
+  uint32 a = float_to_ubyte(svga-curr.blend_color.color[3]);
+
+  color = (a  24) | (r  16) | (g  8) | b;
 
   EMIT_RS( svga, color, BLENDCOLOR, fail );
}

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): svga: Report the 2d/3d texture sizes supported by the host.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 2bb4d75f28d1b693ebef3b4fb9188db304f46234
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2bb4d75f28d1b693ebef3b4fb9188db304f46234

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 17:01:48 2010 +

svga: Report the 2d/3d texture sizes supported by the host.

---

 src/gallium/drivers/svga/svga_screen.c |   26 ---
 src/gallium/drivers/svga/svga_screen_texture.h |2 +-
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen.c 
b/src/gallium/drivers/svga/svga_screen.c
index 735cdfd..cad9b77 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -104,7 +104,9 @@ svga_get_paramf(struct pipe_screen *screen, int param)
   return SVGA_MAX_POINTSIZE;
 
case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
-  return 4.0;
+  if(!sws-get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY, result))
+ return 4.0;
+  return result.u;
 
case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
   return 16.0;
@@ -133,12 +135,28 @@ svga_get_paramf(struct pipe_screen *screen, int param)
   return 1;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
   return 1;
+
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
-  return SVGA_MAX_TEXTURE_LEVELS;
+  {
+ unsigned levels = SVGA_MAX_TEXTURE_LEVELS;
+ if (sws-get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH, result))
+levels = MIN2(util_logbase2(result.u) + 1, levels);
+ else
+levels = 12 /* 2048x2048 */;
+ if (sws-get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT, result))
+levels = MIN2(util_logbase2(result.u) + 1, levels);
+ else
+levels = 12 /* 2048x2048 */;
+ return levels;
+  }
+
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
-  return 8;  /* max 128x128x128 */
+  if (!sws-get_cap(sws, SVGA3D_DEVCAP_MAX_VOLUME_EXTENT, result))
+ return 8;  /* max 128x128x128 */
+  return MIN2(util_logbase2(result.u) + 1, SVGA_MAX_TEXTURE_LEVELS);
+
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-  return SVGA_MAX_TEXTURE_LEVELS;
+  return 12 /* 2048x2048 */;
 
case PIPE_CAP_TEXTURE_MIRROR_REPEAT: /* req. for GL 1.4 */
   return 1;
diff --git a/src/gallium/drivers/svga/svga_screen_texture.h 
b/src/gallium/drivers/svga/svga_screen_texture.h
index 43853d4..24c1f78 100644
--- a/src/gallium/drivers/svga/svga_screen_texture.h
+++ b/src/gallium/drivers/svga/svga_screen_texture.h
@@ -39,7 +39,7 @@ struct svga_winsys_surface;
 enum SVGA3dSurfaceFormat;
 
 
-#define SVGA_MAX_TEXTURE_LEVELS 12 /* 2048x2048 */
+#define SVGA_MAX_TEXTURE_LEVELS 16
 
 
 /**

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): svga: Clamp max cube texture levels to supported max 2d levels.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 6af833add2a695922400d3f641e3c7fa09c00a46
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6af833add2a695922400d3f641e3c7fa09c00a46

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 21:30:33 2010 +

svga: Clamp max cube texture levels to supported max 2d levels.

---

 src/gallium/drivers/svga/svga_screen.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen.c 
b/src/gallium/drivers/svga/svga_screen.c
index cad9b77..414ac52 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -156,7 +156,12 @@ svga_get_paramf(struct pipe_screen *screen, int param)
   return MIN2(util_logbase2(result.u) + 1, SVGA_MAX_TEXTURE_LEVELS);
 
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-  return 12 /* 2048x2048 */;
+  /*
+   * No mechanism to query the host, and at least limited to 2048x2048 on
+   * certain hardware.
+   */
+  return MIN2(screen-get_paramf(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
+  12.0 /* 2048x2048 */);
 
case PIPE_CAP_TEXTURE_MIRROR_REPEAT: /* req. for GL 1.4 */
   return 1;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): svga: A few more tweaks to blend color state emission.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: cd5d7608897a435623b26e3d5d6391734b9197e8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd5d7608897a435623b26e3d5d6391734b9197e8

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 23:17:04 2010 +

svga: A few more tweaks to blend color state emission.

---

 src/gallium/drivers/svga/svga_pipe_blend.c |2 +-
 src/gallium/drivers/svga/svga_state_rss.c  |   16 +++-
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c 
b/src/gallium/drivers/svga/svga_pipe_blend.c
index 9dd6fb0..b60117f 100644
--- a/src/gallium/drivers/svga/svga_pipe_blend.c
+++ b/src/gallium/drivers/svga/svga_pipe_blend.c
@@ -228,7 +228,7 @@ static void svga_set_blend_color( struct pipe_context *pipe,
 
svga-curr.blend_color = *blend_color;
 
-   svga-dirty |= SVGA_NEW_BLEND;
+   svga-dirty |= SVGA_NEW_BLEND_COLOR;
 }
 
 
diff --git a/src/gallium/drivers/svga/svga_state_rss.c 
b/src/gallium/drivers/svga/svga_state_rss.c
index 15ead98..107cc40 100644
--- a/src/gallium/drivers/svga/svga_state_rss.c
+++ b/src/gallium/drivers/svga/svga_state_rss.c
@@ -26,7 +26,6 @@
 #include util/u_inlines.h
 #include pipe/p_defines.h
 #include util/u_math.h
-#include util/u_pack_color.h
 
 #include svga_context.h
 #include svga_state.h
@@ -102,16 +101,15 @@ static int emit_rss( struct svga_context *svga,
}
 
if (dirty  SVGA_NEW_BLEND_COLOR) {
-  union util_color uc;
-  ubyte r = float_to_ubyte(svga-curr.blend_color.color[0]);
-  ubyte g = float_to_ubyte(svga-curr.blend_color.color[1]);
-  ubyte b = float_to_ubyte(svga-curr.blend_color.color[2]);
-  ubyte a = float_to_ubyte(svga-curr.blend_color.color[3]);
+  uint32 color;
+  uint32 r = float_to_ubyte(svga-curr.blend_color.color[0]);
+  uint32 g = float_to_ubyte(svga-curr.blend_color.color[1]);
+  uint32 b = float_to_ubyte(svga-curr.blend_color.color[2]);
+  uint32 a = float_to_ubyte(svga-curr.blend_color.color[3]);
 
-  util_pack_color_ub( r, g, b, a,
-  PIPE_FORMAT_B8G8R8A8_UNORM, uc);
+  color = (a  24) | (r  16) | (g  8) | b;
 
-  EMIT_RS( svga, uc.ui, BLENDCOLOR, fail );
+  EMIT_RS( svga, color, BLENDCOLOR, fail );
}
 
if (dirty  (SVGA_NEW_DEPTH_STENCIL | SVGA_NEW_RAST)) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: Undo bad merge from cherry-pick.

2010-02-12 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: a4865e82ef0171a5280c98f1b0ae879cf013ad8b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4865e82ef0171a5280c98f1b0ae879cf013ad8b

Author: José Fonseca jfons...@vmware.com
Date:   Fri Feb 12 23:52:18 2010 +

scons: Undo bad merge from cherry-pick.

---

 scons/gallium.py |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 15aa944..1d5e041 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -180,8 +180,6 @@ def generate(env):
 # http://msdn.microsoft.com/en-us/library/aa383745.aspx
 ('_WIN32_WINNT', '0x0601'),
 ('WINVER', '0x0601'),
-# http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx,
-'WIN32_LEAN_AND_MEAN',
 ]
 if msvc and env['toolchain'] != 'winddk':
 cppdefines += [

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): svga: Fix texture border color.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: c1a5c9bb4c3c68bea483a0a5bd77b26b150434d2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1a5c9bb4c3c68bea483a0a5bd77b26b150434d2

Author: José Fonseca jfons...@vmware.com
Date:   Sat Feb 13 09:16:57 2010 +

svga: Fix texture border color.

Also opposite ordering.

---

 src/gallium/drivers/svga/svga_pipe_sampler.c |   15 ++-
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c 
b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 9cc69c8..c1e0166 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -27,7 +27,6 @@
 #include pipe/p_defines.h
 #include util/u_math.h
 #include util/u_memory.h
-#include util/u_pack_color.h
 #include tgsi/tgsi_parse.h
 
 #include svga_context.h
@@ -112,14 +111,12 @@ svga_create_sampler_state(struct pipe_context *pipe,
cso-compare_func = sampler-compare_func;
 
{
-  ubyte r = float_to_ubyte(sampler-border_color[0]);
-  ubyte g = float_to_ubyte(sampler-border_color[1]);
-  ubyte b = float_to_ubyte(sampler-border_color[2]);
-  ubyte a = float_to_ubyte(sampler-border_color[3]);
-
-  util_pack_color_ub( r, g, b, a,
-  PIPE_FORMAT_B8G8R8A8_UNORM,
-  cso-bordercolor );
+  uint32 r = float_to_ubyte(sampler-border_color[0]);
+  uint32 g = float_to_ubyte(sampler-border_color[1]);
+  uint32 b = float_to_ubyte(sampler-border_color[2]);
+  uint32 a = float_to_ubyte(sampler-border_color[3]);
+
+  cso-bordercolor = (a  24) | (r  16) | (g  8) | b;
}
 
/* No SVGA3D support for:

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): mesa: Export GL_EXT_texture_cube_map.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 4a2b54cbdb21666f442b83024c61dafbbdd98aa7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a2b54cbdb21666f442b83024c61dafbbdd98aa7

Author: José Fonseca jfons...@vmware.com
Date:   Sat Feb 13 15:10:24 2010 +

mesa: Export GL_EXT_texture_cube_map.

Still used by some applications.

---

 src/mesa/main/extensions.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2138bfe..fd705ea 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -129,6 +129,7 @@ static const struct {
{ 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) },

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): wgl: Implement wglSwapMultipleBuffers.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 6bd6a15ab3b4a5975f21194b7da621ff6b3c45e6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6bd6a15ab3b4a5975f21194b7da621ff6b3c45e6

Author: José Fonseca jfons...@vmware.com
Date:   Sat Feb 13 15:09:46 2010 +

wgl: Implement wglSwapMultipleBuffers.

---

 src/gallium/state_trackers/wgl/opengl32.def   |2 +-
 src/gallium/state_trackers/wgl/opengl32.mingw.def |2 +-
 src/gallium/state_trackers/wgl/stw_wgl.c  |   13 +
 src/gallium/state_trackers/wgl/stw_wgl.h  |   16 
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/opengl32.def 
b/src/gallium/state_trackers/wgl/opengl32.def
index 5daa6dd..01a29d0 100644
--- a/src/gallium/state_trackers/wgl/opengl32.def
+++ b/src/gallium/state_trackers/wgl/opengl32.def
@@ -362,7 +362,7 @@ EXPORTS
wglShareLists
wglSwapBuffers
wglSwapLayerBuffers
-;  wglSwapMultipleBuffers
+   wglSwapMultipleBuffers
wglUseFontBitmapsA
wglUseFontBitmapsW
wglUseFontOutlinesA
diff --git a/src/gallium/state_trackers/wgl/opengl32.mingw.def 
b/src/gallium/state_trackers/wgl/opengl32.mingw.def
index 6ebb31a..0bceee0 100644
--- a/src/gallium/state_trackers/wgl/opengl32.mingw.def
+++ b/src/gallium/state_trackers/wgl/opengl32.mingw.def
@@ -362,7 +362,7 @@ EXPORTS
wglShareLists = wglshareli...@8
wglSwapBuffers = wglswapbuff...@4
wglSwapLayerBuffers = wglswaplayerbuff...@8
-;  wglSwapMultipleBuffers = wglswapmultiplebuff...@8
+   wglSwapMultipleBuffers = wglswapmultiplebuff...@8
wglUseFontBitmapsA = wglusefontbitma...@16
wglUseFontBitmapsW = wglusefontbitma...@16
wglUseFontOutlinesA = wglusefontoutlin...@32
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.c 
b/src/gallium/state_trackers/wgl/stw_wgl.c
index bb199fd..5fbb7bf 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.c
+++ b/src/gallium/state_trackers/wgl/stw_wgl.c
@@ -97,6 +97,19 @@ wglSwapBuffers(
 }
 
 
+WINGDIAPI DWORD WINAPI
+wglSwapMultipleBuffers(UINT n,
+   CONST WGLSWAP *ps)
+{
+   UINT i;
+
+   for (i =0; i  n; ++i)
+  wglSwapBuffers(ps-hdc);
+
+   return 0;
+}
+
+
 WINGDIAPI BOOL APIENTRY
 wglSwapLayerBuffers(
HDC hdc,
diff --git a/src/gallium/state_trackers/wgl/stw_wgl.h 
b/src/gallium/state_trackers/wgl/stw_wgl.h
index a981799..57baaf0 100644
--- a/src/gallium/state_trackers/wgl/stw_wgl.h
+++ b/src/gallium/state_trackers/wgl/stw_wgl.h
@@ -59,5 +59,21 @@ wglSetPixelFormat(HDC hdc,
   int iPixelFormat,
   CONST PIXELFORMATDESCRIPTOR *ppfd);
 
+#if defined(__MINGW32__) || (WINVER  0x0500)
+
+typedef struct _WGLSWAP
+{
+   HDC hdc;
+   UINT uiFlags;
+} WGLSWAP;
+
+#define WGL_SWAPMULTIPLE_MAX 16
+
+WINGDIAPI DWORD WINAPI
+wglSwapMultipleBuffers(UINT n,
+   CONST WGLSWAP *ps);
+
+#endif
+
 
 #endif /* STW_WGL_H_ */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Export GL_EXT_texture_cube_map.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 744994a9c6b972a737e432cf1b699f232e2c5bfd
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=744994a9c6b972a737e432cf1b699f232e2c5bfd

Author: José Fonseca jfons...@vmware.com
Date:   Sat Feb 13 15:10:24 2010 +

mesa: Export GL_EXT_texture_cube_map.

Still used by some applications.

---

 src/mesa/main/extensions.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index e132022..6ac9595 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -133,6 +133,7 @@ static const struct {
{ 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) },

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): svga: Fix texture border color.

2010-02-13 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 6b1193820f8985e2a7182fcc983fbaf17802e139
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b1193820f8985e2a7182fcc983fbaf17802e139

Author: José Fonseca jfons...@vmware.com
Date:   Sat Feb 13 09:16:57 2010 +

svga: Fix texture border color.

Also opposite ordering.

---

 src/gallium/drivers/svga/svga_pipe_sampler.c |   16 ++--
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c 
b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 2a9adfb..224c4f4 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -27,7 +27,6 @@
 #include pipe/p_defines.h
 #include util/u_math.h
 #include util/u_memory.h
-#include util/u_pack_color.h
 #include tgsi/tgsi_parse.h
 
 #include svga_context.h
@@ -97,7 +96,6 @@ svga_create_sampler_state(struct pipe_context *pipe,
 {
struct svga_context *svga = svga_context(pipe);
struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state );
-   union util_color uc;

cso-mipfilter = translate_mip_filter(sampler-min_mip_filter);
cso-magfilter = translate_img_filter( sampler-mag_img_filter );
@@ -114,14 +112,12 @@ svga_create_sampler_state(struct pipe_context *pipe,
cso-compare_func = sampler-compare_func;
 
{
-  ubyte r = float_to_ubyte(sampler-border_color[0]);
-  ubyte g = float_to_ubyte(sampler-border_color[1]);
-  ubyte b = float_to_ubyte(sampler-border_color[2]);
-  ubyte a = float_to_ubyte(sampler-border_color[3]);
-
-  util_pack_color_ub( r, g, b, a,
-  PIPE_FORMAT_B8G8R8A8_UNORM, uc);
-  cso-bordercolor = uc.ui;
+  uint32 r = float_to_ubyte(sampler-border_color[0]);
+  uint32 g = float_to_ubyte(sampler-border_color[1]);
+  uint32 b = float_to_ubyte(sampler-border_color[2]);
+  uint32 a = float_to_ubyte(sampler-border_color[3]);
+
+  cso-bordercolor = (a  24) | (r  16) | (g  8) | b;
}
 
/* No SVGA3D support for:

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): python: Pass p_format. h as-is to swig now that it has no inlines.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 04cc5055db9b418abfc6abb97b69c022abfdff2d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=04cc5055db9b418abfc6abb97b69c022abfdff2d

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 11:26:58 2010 +

python: Pass p_format.h as-is to swig now that it has no inlines.

---

 src/gallium/state_trackers/python/gallium.i  |2 +-
 src/gallium/state_trackers/python/p_format.i |  154 --
 2 files changed, 1 insertions(+), 155 deletions(-)

diff --git a/src/gallium/state_trackers/python/gallium.i 
b/src/gallium/state_trackers/python/gallium.i
index 99e177b..d45c8bb 100644
--- a/src/gallium/state_trackers/python/gallium.i
+++ b/src/gallium/state_trackers/python/gallium.i
@@ -93,7 +93,7 @@
 
 %include p_compiler.i
 %include p_defines.h;
-%include p_format.i
+%include p_format.h
 
 %include p_device.i
 %include p_context.i
diff --git a/src/gallium/state_trackers/python/p_format.i 
b/src/gallium/state_trackers/python/p_format.i
deleted file mode 100644
index 68df009..000
--- a/src/gallium/state_trackers/python/p_format.i
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * 
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * Copyright (c) 2008 VMware, Inc.
- * All Rights Reserved.
- * 
- * 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, sub license, 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 (including the
- * next paragraph) 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 NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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.
- * 
- **/
-
-/* 
- * XXX: SWIG can't parse p_format.h, so we need to duplicate the relevant 
- * declarations here 
- */
-
-%{
-#include pipe/p_format.h 
-%}
-
-enum pipe_format {
-   PIPE_FORMAT_NONE,
-   PIPE_FORMAT_A8R8G8B8_UNORM,
-   PIPE_FORMAT_X8R8G8B8_UNORM,
-   PIPE_FORMAT_B8G8R8A8_UNORM,
-   PIPE_FORMAT_B8G8R8X8_UNORM,
-   PIPE_FORMAT_A1R5G5B5_UNORM,
-   PIPE_FORMAT_A4R4G4B4_UNORM,
-   PIPE_FORMAT_R5G6B5_UNORM,
-   PIPE_FORMAT_A2B10G10R10_UNORM,
-   PIPE_FORMAT_L8_UNORM,
-   PIPE_FORMAT_A8_UNORM,
-   PIPE_FORMAT_I8_UNORM,
-   PIPE_FORMAT_A8L8_UNORM,
-   PIPE_FORMAT_L16_UNORM,
-   PIPE_FORMAT_YCBCR,
-   PIPE_FORMAT_YCBCR_REV,
-   PIPE_FORMAT_Z16_UNORM,
-   PIPE_FORMAT_Z32_UNORM,
-   PIPE_FORMAT_Z32_FLOAT,
-   PIPE_FORMAT_S8Z24_UNORM,
-   PIPE_FORMAT_Z24S8_UNORM,
-   PIPE_FORMAT_X8Z24_UNORM,
-   PIPE_FORMAT_Z24X8_UNORM,
-   PIPE_FORMAT_S8_UNORM,
-   PIPE_FORMAT_R64_FLOAT,
-   PIPE_FORMAT_R64G64_FLOAT,
-   PIPE_FORMAT_R64G64B64_FLOAT,
-   PIPE_FORMAT_R64G64B64A64_FLOAT,
-   PIPE_FORMAT_R32_FLOAT,
-   PIPE_FORMAT_R32G32_FLOAT,
-   PIPE_FORMAT_R32G32B32_FLOAT,
-   PIPE_FORMAT_R32G32B32A32_FLOAT,
-   PIPE_FORMAT_R32_UNORM,
-   PIPE_FORMAT_R32G32_UNORM,
-   PIPE_FORMAT_R32G32B32_UNORM,
-   PIPE_FORMAT_R32G32B32A32_UNORM,
-   PIPE_FORMAT_R32_USCALED,
-   PIPE_FORMAT_R32G32_USCALED,
-   PIPE_FORMAT_R32G32B32_USCALED,
-   PIPE_FORMAT_R32G32B32A32_USCALED,
-   PIPE_FORMAT_R32_SNORM,
-   PIPE_FORMAT_R32G32_SNORM,
-   PIPE_FORMAT_R32G32B32_SNORM,
-   PIPE_FORMAT_R32G32B32A32_SNORM,
-   PIPE_FORMAT_R32_SSCALED,
-   PIPE_FORMAT_R32G32_SSCALED,
-   PIPE_FORMAT_R32G32B32_SSCALED,
-   PIPE_FORMAT_R32G32B32A32_SSCALED,
-   PIPE_FORMAT_R16_UNORM,
-   PIPE_FORMAT_R16G16_UNORM,
-   PIPE_FORMAT_R16G16B16_UNORM,
-   PIPE_FORMAT_R16G16B16A16_UNORM,
-   PIPE_FORMAT_R16_USCALED,
-   PIPE_FORMAT_R16G16_USCALED,
-   PIPE_FORMAT_R16G16B16_USCALED,
-   PIPE_FORMAT_R16G16B16A16_USCALED,
-   PIPE_FORMAT_R16_SNORM,
-   PIPE_FORMAT_R16G16_SNORM,
-   PIPE_FORMAT_R16G16B16_SNORM,
-   PIPE_FORMAT_R16G16B16A16_SNORM,
-   PIPE_FORMAT_R16_SSCALED,
-   PIPE_FORMAT_R16G16_SSCALED,
-   PIPE_FORMAT_R16G16B16_SSCALED,
-   PIPE_FORMAT_R16G16B16A16_SSCALED,
-   PIPE_FORMAT_R8_UNORM,
-   PIPE_FORMAT_R8G8_UNORM,
-   PIPE_FORMAT_R8G8B8_UNORM,
-   PIPE_FORMAT_R8G8B8A8_UNORM,
-   PIPE_FORMAT_R8G8B8X8_UNORM,
-   PIPE_FORMAT_R8_USCALED,
-   PIPE_FORMAT_R8G8_USCALED,
-   PIPE_FORMAT_R8G8B8_USCALED,
-   PIPE_FORMAT_R8G8B8A8_USCALED,
-   

Mesa (master): progs/gallium/python: New home for python statetracker scripts.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 50812e633fa433937c7ba885fa334f44ec0bad58
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=50812e633fa433937c7ba885fa334f44ec0bad58

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 11:15:19 2010 +

progs/gallium/python: New home for python statetracker scripts.

---

 .../gallium}/python/retrace/README |0 
 .../gallium}/python/retrace/format.py  |0 
 .../gallium}/python/retrace/interpreter.py |0 
 .../gallium}/python/retrace/model.py   |0 
 .../gallium}/python/retrace/parse.py   |0 
 .../gallium}/python/retrace/parser.py  |0 
 .../gallium}/python/samples/gs.py  |0 
 .../gallium}/python/samples/tri.py |0 
 .../gallium}/python/tests/.gitignore   |0 
 .../gallium}/python/tests/base.py  |0 
 .../tests/regress/fragment-shader/.gitignore   |0 
 .../tests/regress/fragment-shader/frag-abs.sh  |0 
 .../tests/regress/fragment-shader/frag-add.sh  |0 
 .../tests/regress/fragment-shader/frag-cb-1d.sh|0 
 .../tests/regress/fragment-shader/frag-cb-2d.sh|0 
 .../tests/regress/fragment-shader/frag-dp3.sh  |0 
 .../tests/regress/fragment-shader/frag-dp4.sh  |0 
 .../tests/regress/fragment-shader/frag-dst.sh  |0 
 .../tests/regress/fragment-shader/frag-ex2.sh  |0 
 .../tests/regress/fragment-shader/frag-flr.sh  |0 
 .../tests/regress/fragment-shader/frag-frc.sh  |0 
 .../tests/regress/fragment-shader/frag-lg2.sh  |0 
 .../tests/regress/fragment-shader/frag-lit.sh  |0 
 .../tests/regress/fragment-shader/frag-lrp.sh  |0 
 .../tests/regress/fragment-shader/frag-mad.sh  |0 
 .../tests/regress/fragment-shader/frag-max.sh  |0 
 .../tests/regress/fragment-shader/frag-min.sh  |0 
 .../tests/regress/fragment-shader/frag-mov.sh  |0 
 .../tests/regress/fragment-shader/frag-mul.sh  |0 
 .../tests/regress/fragment-shader/frag-rcp.sh  |0 
 .../tests/regress/fragment-shader/frag-rsq.sh  |0 
 .../tests/regress/fragment-shader/frag-sge.sh  |0 
 .../tests/regress/fragment-shader/frag-slt.sh  |0 
 .../regress/fragment-shader/frag-srcmod-abs.sh |0 
 .../regress/fragment-shader/frag-srcmod-absneg.sh  |0 
 .../regress/fragment-shader/frag-srcmod-neg.sh |0 
 .../regress/fragment-shader/frag-srcmod-swz.sh |0 
 .../tests/regress/fragment-shader/frag-sub.sh  |0 
 .../tests/regress/fragment-shader/frag-xpd.sh  |0 
 .../regress/fragment-shader/fragment-shader.py |0 
 .../python/tests/regress/vertex-shader/.gitignore  |0 
 .../python/tests/regress/vertex-shader/vert-abs.sh |0 
 .../python/tests/regress/vertex-shader/vert-add.sh |0 
 .../python/tests/regress/vertex-shader/vert-arl.sh |0 
 .../python/tests/regress/vertex-shader/vert-arr.sh |0 
 .../tests/regress/vertex-shader/vert-cb-1d.sh  |0 
 .../tests/regress/vertex-shader/vert-cb-2d.sh  |0 
 .../python/tests/regress/vertex-shader/vert-dp3.sh |0 
 .../python/tests/regress/vertex-shader/vert-dp4.sh |0 
 .../python/tests/regress/vertex-shader/vert-dst.sh |0 
 .../python/tests/regress/vertex-shader/vert-ex2.sh |0 
 .../python/tests/regress/vertex-shader/vert-flr.sh |0 
 .../python/tests/regress/vertex-shader/vert-frc.sh |0 
 .../python/tests/regress/vertex-shader/vert-lg2.sh |0 
 .../python/tests/regress/vertex-shader/vert-lit.sh |0 
 .../python/tests/regress/vertex-shader/vert-lrp.sh |0 
 .../python/tests/regress/vertex-shader/vert-mad.sh |0 
 .../python/tests/regress/vertex-shader/vert-max.sh |0 
 .../python/tests/regress/vertex-shader/vert-min.sh |0 
 .../python/tests/regress/vertex-shader/vert-mov.sh |0 
 .../python/tests/regress/vertex-shader/vert-mul.sh |0 
 .../python/tests/regress/vertex-shader/vert-rcp.sh |0 
 .../python/tests/regress/vertex-shader/vert-rsq.sh |0 
 .../python/tests/regress/vertex-shader/vert-sge.sh |0 
 .../python/tests/regress/vertex-shader/vert-slt.sh |0 
 .../tests/regress/vertex-shader/vert-srcmod-abs.sh |0 
 .../regress/vertex-shader/vert-srcmod-absneg.sh|0 
 .../tests/regress/vertex-shader/vert-srcmod-neg.sh |0 
 .../tests/regress/vertex-shader/vert-srcmod-swz.sh |0 
 .../python/tests/regress/vertex-shader/vert-sub.sh |0 
 .../python/tests/regress/vertex-shader/vert-xpd.sh |0 
 .../tests/regress/vertex-shader/vertex-shader.py   |0 
 .../gallium}/python/tests/surface_copy.py  |0 
 .../gallium}/python/tests/texture_render.py|0 
 .../gallium}/python/tests/texture_sample.py|0 
 .../gallium}/python/tests/texture_transfer.py  |0 
 .../gallium}/python/tests/tree.py  |0 
 src/gallium/state_trackers/python/README  

Mesa (master): python: Tell swig how to index per-rendertarget blend state.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: f1848977e8f55e6d8cf5169520fb9b0a6c817884
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1848977e8f55e6d8cf5169520fb9b0a6c817884

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 12:06:37 2010 +

python: Tell swig how to index per-rendertarget blend state.

---

 src/gallium/state_trackers/python/p_state.i |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/python/p_state.i 
b/src/gallium/state_trackers/python/p_state.i
index 90f157e..318fe1c 100644
--- a/src/gallium/state_trackers/python/p_state.i
+++ b/src/gallium/state_trackers/python/p_state.i
@@ -44,6 +44,20 @@
 %array_class(struct pipe_stencil_state, StencilArray);
 
 
+%extend pipe_rt_blend_state
+{
+   struct pipe_rt_blend_state *
+   __getitem__(int index) 
+   {
+  if(index  0 || index = PIPE_MAX_COLOR_BUFS)
+ SWIG_exception(SWIG_ValueError, index out of bounds);
+  return $self + index;
+   fail:
+  return NULL;
+   };
+};
+
+
 %extend pipe_framebuffer_state {

pipe_framebuffer_state(void) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): trace: Fix generated XML.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 11a981fda189515d4ea51ef1709b15e7ce90507d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=11a981fda189515d4ea51ef1709b15e7ce90507d

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 12:47:40 2010 +

trace: Fix generated XML.

---

 src/gallium/drivers/trace/tr_context.c|2 +-
 src/gallium/drivers/trace/tr_dump_state.c |   27 ---
 src/gallium/drivers/trace/tr_dump_state.h |2 --
 3 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_context.c 
b/src/gallium/drivers/trace/tr_context.c
index 866e228..879778b 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -843,7 +843,7 @@ trace_context_set_constant_buffer(struct pipe_context 
*_pipe,
trace_dump_arg(ptr, pipe);
trace_dump_arg(uint, shader);
trace_dump_arg(uint, index);
-   trace_dump_arg(constant_buffer, buffer);
+   trace_dump_arg(ptr, buffer);
 
/* XXX hmm? */
if (buffer) {
diff --git a/src/gallium/drivers/trace/tr_dump_state.c 
b/src/gallium/drivers/trace/tr_dump_state.c
index a4c7255..0e485db 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -227,24 +227,6 @@ void trace_dump_clip_state(const struct pipe_clip_state 
*state)
 }
 
 
-void trace_dump_constant_buffer(const struct pipe_buffer *state)
-{
-   if (!trace_dumping_enabled_locked())
-  return;
-
-   if(!state) {
-  trace_dump_null();
-  return;
-   }
-
-   trace_dump_struct_begin(pipe_constant_buffer);
-
-   trace_dump_reference(state-reference);
-
-   trace_dump_struct_end();
-}
-
-
 void trace_dump_shader_state(const struct pipe_shader_state *state)
 {
static char str[8192];
@@ -322,6 +304,10 @@ void trace_dump_depth_stencil_alpha_state(const struct 
pipe_depth_stencil_alpha_
 
 static void trace_dump_rt_blend_state(const struct pipe_rt_blend_state *state)
 {
+   trace_dump_struct_begin(pipe_rt_blend_state);
+
+   trace_dump_member(uint, state, blend_enable);
+
trace_dump_member(uint, state, rgb_func);
trace_dump_member(uint, state, rgb_src_factor);
trace_dump_member(uint, state, rgb_dst_factor);
@@ -332,11 +318,13 @@ static void trace_dump_rt_blend_state(const struct 
pipe_rt_blend_state *state)
 
trace_dump_member(uint, state, colormask);
 
+   trace_dump_struct_end();
 }
 
 void trace_dump_blend_state(const struct pipe_blend_state *state)
 {
unsigned valid_entries = 1;
+
if (!trace_dumping_enabled_locked())
   return;
 
@@ -354,10 +342,11 @@ void trace_dump_blend_state(const struct pipe_blend_state 
*state)
 
trace_dump_member(bool, state, independent_blend_enable);
 
+   trace_dump_member_begin(rt);
if (state-independent_blend_enable)
   valid_entries = PIPE_MAX_COLOR_BUFS;
-
trace_dump_struct_array(rt_blend_state, state-rt, valid_entries);
+   trace_dump_member_end();
 
trace_dump_struct_end();
 }
diff --git a/src/gallium/drivers/trace/tr_dump_state.h 
b/src/gallium/drivers/trace/tr_dump_state.h
index 825519d..3400367 100644
--- a/src/gallium/drivers/trace/tr_dump_state.h
+++ b/src/gallium/drivers/trace/tr_dump_state.h
@@ -47,8 +47,6 @@ void trace_dump_scissor_state(const struct pipe_scissor_state 
*state);
 
 void trace_dump_clip_state(const struct pipe_clip_state *state);
 
-void trace_dump_constant_buffer(const struct pipe_buffer *state);
-
 void trace_dump_token(const struct tgsi_token *token);
 
 void trace_dump_shader_state(const struct pipe_shader_state *state);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): python/retrace: Interpret pipe_screen::context_create().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 4ab3f0edef438334d70d26381e3b2acdc48b176b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4ab3f0edef438334d70d26381e3b2acdc48b176b

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 12:48:11 2010 +

python/retrace: Interpret pipe_screen::context_create().

---

 progs/gallium/python/retrace/interpreter.py |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/progs/gallium/python/retrace/interpreter.py 
b/progs/gallium/python/retrace/interpreter.py
index 7277701..a34122e 100755
--- a/progs/gallium/python/retrace/interpreter.py
+++ b/progs/gallium/python/retrace/interpreter.py
@@ -272,6 +272,10 @@ class Screen(Object):
 def get_paramf(self, param):
 pass
 
+def context_create(self):
+context = self.real.context_create()
+return Context(self.interpreter, context)
+
 def is_format_supported(self, format, target, tex_usage, geom_flags):
 return self.real.is_format_supported(format, target, tex_usage, 
geom_flags)
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): makefiles: Don' t complaint about changing configs if the same one is reselected.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: c3168e050eabff55e12485c8648f4cf0744182c1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3168e050eabff55e12485c8648f4cf0744182c1

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:15:49 2010 +

makefiles: Don't complaint about changing configs if the same one is reselected.

Otherwise it creates unnecessary pain when automating builds in a build
server/farm.

---

 Makefile |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 3a9c92b..ea5751d 100644
--- a/Makefile
+++ b/Makefile
@@ -173,11 +173,14 @@ sunos5-v9 \
 sunos5-v9-static \
 sunos5-v9-cc-g++ \
 ultrix-gcc:
-   @ if test -f configs/current || test -L configs/current ; then \
-   echo Please run 'make realclean' before changing configs ; \
-   exit 1 ; \
+   @ if test -f configs/current -o -L configs/current; then \
+   if ! cmp configs/$@ configs/current  /dev/null; then \
+   echo Please run 'make realclean' before changing 
configs ; \
+   exit 1 ; \
+   fi ; \
+   else \
+   cd configs  rm -f current  ln -s $@ current ; \
fi
-   (cd configs  rm -f current  ln -s $@ current)
$(MAKE) default
 
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Use util_format_name().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: d468791cc8307f8aaed72ccec78b504d7922de42
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d468791cc8307f8aaed72ccec78b504d7922de42

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:24:43 2010 +

mesa: Use util_format_name().

---

 src/mesa/state_tracker/st_draw.c   |2 +-
 src/mesa/state_tracker/st_format.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 34df4d4..f72f564 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -596,7 +596,7 @@ st_draw_vbo(GLcontext *ctx,
  printf(vlements[%d].vbuffer_index = %u\n, i, 
velements[i].vertex_buffer_index);
  printf(vlements[%d].src_offset = %u\n, i, velements[i].src_offset);
  printf(vlements[%d].nr_comps = %u\n, i, velements[i].nr_components);
- printf(vlements[%d].format = %s\n, i, 
pf_name(velements[i].src_format));
+ printf(vlements[%d].format = %s\n, i, 
util_format_name(velements[i].src_format));
   }
}
 #endif
diff --git a/src/mesa/state_tracker/st_format.c 
b/src/mesa/state_tracker/st_format.c
index 3ffc2ae..851c16f 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -85,7 +85,7 @@ st_get_format_info(enum pipe_format format, struct 
pipe_format_info *pinfo)
if (desc-layout == UTIL_FORMAT_LAYOUT_ARITH ||
desc-layout == UTIL_FORMAT_LAYOUT_ARRAY) {
 #if 0
-  printf(%s\n, pf_name( format ) );
+  printf(%s\n, util_format_name( format ) );
 #endif
 
   /* Data type */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): trace: Use util_format_name().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 6f5e0539dc681b800bd08d14221751d0f3484280
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f5e0539dc681b800bd08d14221751d0f3484280

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:25:06 2010 +

trace: Use util_format_name().

---

 src/gallium/drivers/trace/tr_dump_state.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_dump_state.c 
b/src/gallium/drivers/trace/tr_dump_state.c
index 0e485db..7cbf705 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -28,6 +28,7 @@
 
 #include pipe/p_compiler.h
 #include util/u_memory.h
+#include util/u_format.h
 #include tgsi/tgsi_dump.h
 
 #include tr_dump.h
@@ -39,7 +40,7 @@ void trace_dump_format(enum pipe_format format)
if (!trace_dumping_enabled_locked())
   return;
 
-   trace_dump_enum(pf_name(format) );
+   trace_dump_enum(util_format_name(format) );
 }
 
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): llvmpipe: Use util_format_name().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 9189d04cdb55dd5d4d5d78d1a7edab30d4c25340
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9189d04cdb55dd5d4d5d78d1a7edab30d4c25340

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:26:37 2010 +

llvmpipe: Use util_format_name().

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c 
b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 15c10d8..b7ae426 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -861,7 +861,7 @@ generate_variant(struct llvmpipe_context *lp,
 
   tgsi_dump(shader-base.tokens, 0);
   if(key-depth.enabled) {
- debug_printf(depth.format = %s\n, pf_name(key-zsbuf_format));
+ debug_printf(depth.format = %s\n, 
util_format_name(key-zsbuf_format));
  debug_printf(depth.func = %s\n, debug_dump_func(key-depth.func, 
TRUE));
  debug_printf(depth.writemask = %u\n, key-depth.writemask);
   }
@@ -885,7 +885,7 @@ generate_variant(struct llvmpipe_context *lp,
  if(key-sampler[i].format) {
 debug_printf(sampler[%u] = \n, i);
 debug_printf(  .format = %s\n,
- pf_name(key-sampler[i].format));
+ util_format_name(key-sampler[i].format));
 debug_printf(  .target = %s\n,
  debug_dump_tex_target(key-sampler[i].target, TRUE));
 debug_printf(  .pot = %u %u %u\n,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nv: Use util_format_name().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: db2df0aa9b49e006de4fcfc4a0bab32ad0a30173
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=db2df0aa9b49e006de4fcfc4a0bab32ad0a30173

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:26:30 2010 +

nv: Use util_format_name().

---

 src/gallium/drivers/nv30/nv30_fragtex.c|4 +++-
 src/gallium/drivers/nv30/nv30_vbo.c|5 +++--
 src/gallium/drivers/nv40/nv40_fragtex.c|4 +++-
 src/gallium/drivers/nv40/nv40_vbo.c|5 +++--
 src/gallium/drivers/nv50/nv50_state_validate.c |6 --
 src/gallium/drivers/nv50/nv50_vbo.c|3 +--
 6 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/nv30/nv30_fragtex.c 
b/src/gallium/drivers/nv30/nv30_fragtex.c
index 0cc3172..9f4a104 100644
--- a/src/gallium/drivers/nv30/nv30_fragtex.c
+++ b/src/gallium/drivers/nv30/nv30_fragtex.c
@@ -1,3 +1,5 @@
+#include util/u_format.h
+
 #include nv30_context.h
 #include nouveau/nouveau_util.h
 
@@ -50,7 +52,7 @@ nv30_fragtex_format(uint pipe_format)
tf++;
}
 
-   NOUVEAU_ERR(unknown texture format %s\n, pf_name(pipe_format));
+   NOUVEAU_ERR(unknown texture format %s\n, 
util_format_name(pipe_format));
return NULL;
 }
 
diff --git a/src/gallium/drivers/nv30/nv30_vbo.c 
b/src/gallium/drivers/nv30/nv30_vbo.c
index f406fa0..e48823a 100644
--- a/src/gallium/drivers/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nv30/nv30_vbo.c
@@ -1,6 +1,7 @@
 #include pipe/p_context.h
 #include pipe/p_state.h
 #include util/u_inlines.h
+#include util/u_format.h
 
 #include nv30_context.h
 #include nv30_state.h
@@ -34,7 +35,7 @@ nv30_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, 
unsigned *ncomp)
*fmt = NV34TCL_VTXFMT_TYPE_USHORT;
break;
default:
-   NOUVEAU_ERR(Unknown format %s\n, pf_name(pipe));
+   NOUVEAU_ERR(Unknown format %s\n, util_format_name(pipe));
return 1;
}
 
@@ -60,7 +61,7 @@ nv30_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, 
unsigned *ncomp)
*ncomp = 4;
break;
default:
-   NOUVEAU_ERR(Unknown format %s\n, pf_name(pipe));
+   NOUVEAU_ERR(Unknown format %s\n, util_format_name(pipe));
return 1;
}
 
diff --git a/src/gallium/drivers/nv40/nv40_fragtex.c 
b/src/gallium/drivers/nv40/nv40_fragtex.c
index aad9198..7a28d57 100644
--- a/src/gallium/drivers/nv40/nv40_fragtex.c
+++ b/src/gallium/drivers/nv40/nv40_fragtex.c
@@ -1,3 +1,5 @@
+#include util/u_format.h
+
 #include nv40_context.h
 
 #define _(m,tf,ts0x,ts0y,ts0z,ts0w,ts1x,ts1y,ts1z,ts1w,sx,sy,sz,sw)
\
@@ -53,7 +55,7 @@ nv40_fragtex_format(uint pipe_format)
tf++;
}
 
-   NOUVEAU_ERR(unknown texture format %s\n, pf_name(pipe_format));
+   NOUVEAU_ERR(unknown texture format %s\n, 
util_format_name(pipe_format));
return NULL;
 }
 
diff --git a/src/gallium/drivers/nv40/nv40_vbo.c 
b/src/gallium/drivers/nv40/nv40_vbo.c
index f2048eb..7812460 100644
--- a/src/gallium/drivers/nv40/nv40_vbo.c
+++ b/src/gallium/drivers/nv40/nv40_vbo.c
@@ -1,6 +1,7 @@
 #include pipe/p_context.h
 #include pipe/p_state.h
 #include util/u_inlines.h
+#include util/u_format.h
 
 #include nv40_context.h
 #include nv40_state.h
@@ -34,7 +35,7 @@ nv40_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, 
unsigned *ncomp)
*fmt = NV40TCL_VTXFMT_TYPE_USHORT;
break;
default:
-   NOUVEAU_ERR(Unknown format %s\n, pf_name(pipe));
+   NOUVEAU_ERR(Unknown format %s\n, util_format_name(pipe));
return 1;
}
 
@@ -60,7 +61,7 @@ nv40_vbo_format_to_hw(enum pipe_format pipe, unsigned *fmt, 
unsigned *ncomp)
*ncomp = 4;
break;
default:
-   NOUVEAU_ERR(Unknown format %s\n, pf_name(pipe));
+   NOUVEAU_ERR(Unknown format %s\n, util_format_name(pipe));
return 1;
}
 
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c 
b/src/gallium/drivers/nv50/nv50_state_validate.c
index 0be6abb..efab94c 100644
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -20,6 +20,8 @@
  * SOFTWARE.
  */
 
+#include util/u_format.h
+
 #include nv50_context.h
 #include nouveau/nouveau_stateobj.h
 
@@ -79,7 +81,7 @@ nv50_state_validate_fb(struct nv50_context *nv50)
NV50_CBUF_FORMAT_CASE(R16G16_UNORM);
default:
NOUVEAU_ERR(A unknown format %s\n,
-   pf_name(fb-cbufs[i]-format));
+   util_format_name(fb-cbufs[i]-format));
so_data(so, NV50TCL_RT_FORMAT_X8R8G8B8_UNORM);
break;
}
@@ -116,7 +118,7 @@ nv50_state_validate_fb(struct 

Mesa (master): util: Use util_format_name().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: c667a5b95dd971629784b26adf13bd6b211f6f55
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c667a5b95dd971629784b26adf13bd6b211f6f55

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:26:51 2010 +

util: Use util_format_name().

---

 src/gallium/auxiliary/util/u_debug.c |  119 +-
 1 files changed, 1 insertions(+), 118 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index 4821b8a..688083d 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -288,130 +288,13 @@ debug_dump_flags(const struct debug_named_value *names,
 }
 
 
-static const struct debug_named_value pipe_format_names[] = {
-#ifdef DEBUG
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_NONE),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A8R8G8B8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_X8R8G8B8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_B8G8R8A8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_B8G8R8X8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A1R5G5B5_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A4R4G4B4_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R5G6B5_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A2B10G10R10_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_L8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_I8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A8L8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_L16_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_YCBCR),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_YCBCR_REV),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_Z16_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_Z32_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_Z32_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_S8Z24_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_Z24S8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_X8Z24_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_Z24X8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_S8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R64_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R64G64_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R64G64B64_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R64G64B64A64_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_FLOAT),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R32G32B32A32_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R16G16B16A16_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8A8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8X8_UNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8A8_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8X8_USCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8A8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8B8X8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_B6G5R5_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_A8B8G8R8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_X8B8G8R8_SNORM),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8_SSCALED),
-   DEBUG_NAMED_VALUE(PIPE_FORMAT_R8G8_SSCALED),
-   

Mesa (master): draw: Use util_format_name().

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 13701aae40d8edb5b38be5fb04739f74c1fc8001
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13701aae40d8edb5b38be5fb04739f74c1fc8001

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:27:00 2010 +

draw: Use util_format_name().

---

 src/gallium/auxiliary/draw/draw_pt.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt.c 
b/src/gallium/auxiliary/draw/draw_pt.c
index f5ed32d..341353f 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -310,7 +310,7 @@ draw_arrays_instanced(struct draw_context *draw,
   debug_printf(Elements:\n);
   for (i = 0; i  draw-pt.nr_vertex_elements; i++) {
  debug_printf(  format=%s comps=%u\n,
-  pf_name(draw-pt.vertex_element[i].src_format),
+  util_format_name(draw-pt.vertex_element[i].src_format),
   draw-pt.vertex_element[i].nr_components);
   }
   debug_printf(Buffers:\n);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallium: Remove previously forgotten pf_name() prototype.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: fd3237c97d33863f8eb3d1383d26ec79b67f0774
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd3237c97d33863f8eb3d1383d26ec79b67f0774

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:28:17 2010 +

gallium: Remove previously forgotten pf_name() prototype.

---

 src/gallium/include/pipe/p_format.h |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/gallium/include/pipe/p_format.h 
b/src/gallium/include/pipe/p_format.h
index 2894e13..f33b063 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -165,11 +165,6 @@ enum pipe_format {
PIPE_FORMAT_COUNT
 };
 
-/**
- * Builds pipe format name from format token.
- */
-extern const char *pf_name( enum pipe_format format );
-
 
 enum pipe_video_chroma_format
 {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Add missing include.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: db18996d3da4009a7a031e3444b5cd688e12dc22
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=db18996d3da4009a7a031e3444b5cd688e12dc22

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 13:28:29 2010 +

mesa: Add missing include.

---

 src/mesa/state_tracker/st_draw.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index f72f564..4b48c16 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -56,6 +56,7 @@
 #include pipe/p_context.h
 #include pipe/p_defines.h
 #include util/u_inlines.h
+#include util/u_format.h
 
 
 static GLuint double_types[4] = {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): gallivm: s/debug_dump_/util_dump_/

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: da8de038da2c581d98083f8f5f59d17fc1dce25f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=da8de038da2c581d98083f8f5f59d17fc1dce25f

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 15:20:57 2010 +

gallivm: s/debug_dump_/util_dump_/

---

 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 57c2b76..e268862 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -35,7 +35,7 @@
 #include pipe/p_defines.h
 #include pipe/p_state.h
 #include util/u_debug.h
-#include util/u_debug_dump.h
+#include util/u_dump.h
 #include util/u_memory.h
 #include util/u_math.h
 #include util/u_format.h
@@ -173,7 +173,7 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld,
case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
   /* FIXME */
   _debug_printf(llvmpipe: failed to translate texture wrap mode %s\n,
-debug_dump_tex_wrap(wrap_mode, TRUE));
+util_dump_tex_wrap(wrap_mode, TRUE));
   coord = lp_build_max(int_coord_bld, coord, int_coord_bld-zero);
   coord = lp_build_min(int_coord_bld, coord, length_minus_one);
   break;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Rename u_debug_dump.[ch] - u_dump.[ch].

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: c16a8e0dd552dc7a5f95169da983e6164fc1492e
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c16a8e0dd552dc7a5f95169da983e6164fc1492e

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 15:20:34 2010 +

util: Rename u_debug_dump.[ch] - u_dump.[ch].

I have more plans for this than mere debugging -- it will be an helper
to provide human readible representations of all gallium state for
the python state tracker.

---

 src/gallium/auxiliary/Makefile |2 +-
 src/gallium/auxiliary/SConscript   |2 +-
 .../auxiliary/util/{u_debug_dump.h = u_dump.h}|   17 ++--
 .../util/{u_debug_dump.c = u_dump_defines.c}  |   93 ++--
 4 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index 507ca6e..3f96da6 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -91,9 +91,9 @@ C_SOURCES = \
translate/translate.c \
translate/translate_cache.c \
util/u_debug.c \
-   util/u_debug_dump.c \
util/u_debug_symbol.c \
util/u_debug_stack.c \
+   util/u_dump_defines.c \
util/u_bitmask.c \
util/u_blit.c \
util/u_blitter.c \
diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript
index 9709344..f226f46 100644
--- a/src/gallium/auxiliary/SConscript
+++ b/src/gallium/auxiliary/SConscript
@@ -131,10 +131,10 @@ source = [
 'util/u_cache.c',
 'util/u_cpu_detect.c',
 'util/u_debug.c',
-'util/u_debug_dump.c',
 'util/u_debug_memory.c',
 'util/u_debug_stack.c',
 'util/u_debug_symbol.c',
+'util/u_dump_defines.c',
 'util/u_dl.c',
 'util/u_draw_quad.c',
 'util/u_format.c',
diff --git a/src/gallium/auxiliary/util/u_debug_dump.h 
b/src/gallium/auxiliary/util/u_dump.h
similarity index 80%
rename from src/gallium/auxiliary/util/u_debug_dump.h
rename to src/gallium/auxiliary/util/u_dump.h
index 19b130a..ddccc54 100644
--- a/src/gallium/auxiliary/util/u_debug_dump.h
+++ b/src/gallium/auxiliary/util/u_dump.h
@@ -45,26 +45,29 @@ extern C {
 #endif
 
 
+#define UTIL_DUMP_INVALID_NAME invalid
+
+
 const char *
-debug_dump_blend_factor(unsigned value, boolean shortened);
+util_dump_blend_factor(unsigned value, boolean shortened);
 
 const char *
-debug_dump_blend_func(unsigned value, boolean shortened);
+util_dump_blend_func(unsigned value, boolean shortened);
 
 const char *
-debug_dump_func(unsigned value, boolean shortened);
+util_dump_func(unsigned value, boolean shortened);
 
 const char *
-debug_dump_tex_target(unsigned value, boolean shortened);
+util_dump_tex_target(unsigned value, boolean shortened);
 
 const char *
-debug_dump_tex_wrap(unsigned value, boolean shortened);
+util_dump_tex_wrap(unsigned value, boolean shortened);
 
 const char *
-debug_dump_tex_mipfilter(unsigned value, boolean shortened);
+util_dump_tex_mipfilter(unsigned value, boolean shortened);
 
 const char *
-debug_dump_tex_filter(unsigned value, boolean shortened);
+util_dump_tex_filter(unsigned value, boolean shortened);
 
 
 /* FIXME: Move the other debug_dump_xxx functions out of u_debug.h into here. 
*/
diff --git a/src/gallium/auxiliary/util/u_debug_dump.c 
b/src/gallium/auxiliary/util/u_dump_defines.c
similarity index 69%
rename from src/gallium/auxiliary/util/u_debug_dump.c
rename to src/gallium/auxiliary/util/u_dump_defines.c
index 61624d0..96a2256 100644
--- a/src/gallium/auxiliary/util/u_debug_dump.c
+++ b/src/gallium/auxiliary/util/u_dump_defines.c
@@ -28,15 +28,12 @@
 
 #include util/u_memory.h
 #include util/u_debug.h 
-#include util/u_debug_dump.h 
-
-
-#define DEBUG_DUMP_INVALID_NAME invalid
+#include util/u_dump.h
 
 
 #if 0
 static const char *
-debug_dump_strip_prefix(const char *name,
+util_dump_strip_prefix(const char *name,
 const char *prefix) 
 {
const char *stripped;
@@ -55,30 +52,30 @@ debug_dump_strip_prefix(const char *name,
 #endif
 
 static const char *
-debug_dump_enum_continuous(unsigned value, 
+util_dump_enum_continuous(unsigned value,
unsigned num_names,
const char **names)
 {
if (value = num_names)
-  return DEBUG_DUMP_INVALID_NAME;
+  return UTIL_DUMP_INVALID_NAME;
return names[value];
 }
 
 
-#define DEFINE_DEBUG_DUMP_CONTINUOUS(_name) \
+#define DEFINE_UTIL_DUMP_CONTINUOUS(_name) \
const char * \
-   debug_dump_##_name(unsigned value, boolean shortened) \
+   util_dump_##_name(unsigned value, boolean shortened) \
{ \
   if(shortened) \
- return debug_dump_enum_continuous(value, 
Elements(debug_dump_##_name##_short_names), debug_dump_##_name##_short_names); \
+ return util_dump_enum_continuous(value, 
Elements(util_dump_##_name##_short_names), util_dump_##_name##_short_names); \
   else \
- return debug_dump_enum_continuous(value, 

Mesa (master): llvmpipe: s/debug_dump_/util_dump_/

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: abdcdb3db73316c5ebca88bda04b90b6659782e8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=abdcdb3db73316c5ebca88bda04b90b6659782e8

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 15:21:06 2010 +

llvmpipe: s/debug_dump_/util_dump_/

---

 src/gallium/drivers/llvmpipe/lp_state_blend.c |2 +-
 src/gallium/drivers/llvmpipe/lp_state_fs.c|   34 
 src/gallium/drivers/llvmpipe/lp_test.h|2 +-
 src/gallium/drivers/llvmpipe/lp_test_blend.c  |   24 +-
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c 
b/src/gallium/drivers/llvmpipe/lp_state_blend.c
index 8bb89f9..4ee2847 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c
@@ -33,7 +33,7 @@
 
 #include util/u_memory.h
 #include util/u_math.h
-#include util/u_debug_dump.h
+#include util/u_dump.h
 #include draw/draw_context.h
 #include lp_screen.h
 #include lp_context.h
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c 
b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index b7ae426..90dae3f 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -65,7 +65,7 @@
 #include util/u_inlines.h
 #include util/u_memory.h
 #include util/u_format.h
-#include util/u_debug_dump.h
+#include util/u_dump.h
 #include os/os_time.h
 #include pipe/p_shader_tokens.h
 #include draw/draw_context.h
@@ -862,23 +862,23 @@ generate_variant(struct llvmpipe_context *lp,
   tgsi_dump(shader-base.tokens, 0);
   if(key-depth.enabled) {
  debug_printf(depth.format = %s\n, 
util_format_name(key-zsbuf_format));
- debug_printf(depth.func = %s\n, debug_dump_func(key-depth.func, 
TRUE));
+ debug_printf(depth.func = %s\n, util_dump_func(key-depth.func, 
TRUE));
  debug_printf(depth.writemask = %u\n, key-depth.writemask);
   }
   if(key-alpha.enabled) {
- debug_printf(alpha.func = %s\n, debug_dump_func(key-alpha.func, 
TRUE));
+ debug_printf(alpha.func = %s\n, util_dump_func(key-alpha.func, 
TRUE));
  debug_printf(alpha.ref_value = %f\n, key-alpha.ref_value);
   }
   if(key-blend.logicop_enable) {
  debug_printf(blend.logicop_func = %u\n, key-blend.logicop_func);
   }
   else if(key-blend.rt[0].blend_enable) {
- debug_printf(blend.rgb_func = %s\n,   debug_dump_blend_func  
(key-blend.rt[0].rgb_func, TRUE));
- debug_printf(rgb_src_factor = %s\n,   
debug_dump_blend_factor(key-blend.rt[0].rgb_src_factor, TRUE));
- debug_printf(rgb_dst_factor = %s\n,   
debug_dump_blend_factor(key-blend.rt[0].rgb_dst_factor, TRUE));
- debug_printf(alpha_func = %s\n,   debug_dump_blend_func  
(key-blend.rt[0].alpha_func, TRUE));
- debug_printf(alpha_src_factor = %s\n, 
debug_dump_blend_factor(key-blend.rt[0].alpha_src_factor, TRUE));
- debug_printf(alpha_dst_factor = %s\n, 
debug_dump_blend_factor(key-blend.rt[0].alpha_dst_factor, TRUE));
+ debug_printf(blend.rgb_func = %s\n,   util_dump_blend_func  
(key-blend.rt[0].rgb_func, TRUE));
+ debug_printf(rgb_src_factor = %s\n,   
util_dump_blend_factor(key-blend.rt[0].rgb_src_factor, TRUE));
+ debug_printf(rgb_dst_factor = %s\n,   
util_dump_blend_factor(key-blend.rt[0].rgb_dst_factor, TRUE));
+ debug_printf(alpha_func = %s\n,   util_dump_blend_func  
(key-blend.rt[0].alpha_func, TRUE));
+ debug_printf(alpha_src_factor = %s\n, 
util_dump_blend_factor(key-blend.rt[0].alpha_src_factor, TRUE));
+ debug_printf(alpha_dst_factor = %s\n, 
util_dump_blend_factor(key-blend.rt[0].alpha_dst_factor, TRUE));
   }
   debug_printf(blend.colormask = 0x%x\n, key-blend.rt[0].colormask);
   for(i = 0; i  PIPE_MAX_SAMPLERS; ++i) {
@@ -887,23 +887,23 @@ generate_variant(struct llvmpipe_context *lp,
 debug_printf(  .format = %s\n,
  util_format_name(key-sampler[i].format));
 debug_printf(  .target = %s\n,
- debug_dump_tex_target(key-sampler[i].target, TRUE));
+ util_dump_tex_target(key-sampler[i].target, TRUE));
 debug_printf(  .pot = %u %u %u\n,
  key-sampler[i].pot_width,
  key-sampler[i].pot_height,
  key-sampler[i].pot_depth);
 debug_printf(  .wrap = %s %s %s\n,
- debug_dump_tex_wrap(key-sampler[i].wrap_s, TRUE),
- debug_dump_tex_wrap(key-sampler[i].wrap_t, TRUE),
- debug_dump_tex_wrap(key-sampler[i].wrap_r, TRUE));
+ util_dump_tex_wrap(key-sampler[i].wrap_s, TRUE),
+ util_dump_tex_wrap(key-sampler[i].wrap_t, TRUE),
+ util_dump_tex_wrap(key-sampler[i].wrap_r, TRUE));
   

Mesa (master): scons: Control caching via new SCONS_CACHE_DIR environment variable.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: fe889a89d28293d8f98b2cd730efc58785ceb5d8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe889a89d28293d8f98b2cd730efc58785ceb5d8

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 15:34:39 2010 +

scons: Control caching via new SCONS_CACHE_DIR environment variable.

This serves several purposes:
- disable caching in situations were is it useless or undesired
- share caches among all trees
- simplify purging the cache (when it's a single location)
- move the cache out of the tree, since that slows downs IDEs considerably

To retain previous behavior just define do

  export SCONS_CACHE_DIR=$PWD/build/cache

before invoking scons.

---

 scons/gallium.py |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 1d5e041..925effc 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -155,7 +155,9 @@ def generate(env):
 # different scons versions building the same source file
 env['build'] = build_dir
 env.SConsignFile(os.path.join(build_dir, '.sconsign'))
-env.CacheDir('build/cache')
+if 'SCONS_CACHE_DIR' in os.environ:
+print 'scons: Using build cache in %s.' % 
(os.environ['SCONS_CACHE_DIR'],)
+env.CacheDir(os.environ['SCONS_CACHE_DIR'])
 env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf')
 env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 
'config.log')
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): os: Make streams abstract.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 2b4575f16d24a212b9a43cbd4a9966b3668e4b32
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b4575f16d24a212b9a43cbd4a9966b3668e4b32

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 16:55:04 2010 +

os: Make streams abstract.

Also replace windows kernel stream with null implementation. It was
severely limited and no easy means to test it now.

---

 src/gallium/auxiliary/Makefile|2 +-
 src/gallium/auxiliary/SConscript  |2 +-
 src/gallium/auxiliary/os/os_stream.h  |   55 ++--
 src/gallium/auxiliary/os/os_stream_null.c |   72 +
 src/gallium/auxiliary/os/os_stream_stdc.c |   71 ++
 src/gallium/auxiliary/os/os_stream_wd.c   |  222 -
 6 files changed, 160 insertions(+), 264 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index 3f96da6..aea2123 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -50,7 +50,7 @@ C_SOURCES = \
indices/u_unfilled_gen.c \
os/os_misc.c \
os/os_stream_stdc.c \
-   os/os_stream_wd.c \
+   os/os_stream_null.c \
os/os_time.c \
pipebuffer/pb_buffer_malloc.c \
pipebuffer/pb_bufmgr_alt.c \
diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript
index f226f46..c8a3ecf 100644
--- a/src/gallium/auxiliary/SConscript
+++ b/src/gallium/auxiliary/SConscript
@@ -84,7 +84,7 @@ source = [
 'indices/u_unfilled_gen.c',
 'os/os_misc.c',
 'os/os_stream_stdc.c',
-'os/os_stream_wd.c',
+'os/os_stream_null.c',
 'os/os_time.c',
 'pipebuffer/pb_buffer_fenced.c',
 'pipebuffer/pb_buffer_malloc.c',
diff --git a/src/gallium/auxiliary/os/os_stream.h 
b/src/gallium/auxiliary/os/os_stream.h
index bf30e65..8232b0f 100644
--- a/src/gallium/auxiliary/os/os_stream.h
+++ b/src/gallium/auxiliary/os/os_stream.h
@@ -37,25 +37,54 @@
 #include pipe/p_compiler.h
 
 
-struct os_stream;
-
-
 /**
- * Create a stream
- * @param filename relative or absolute path (necessary for windows)  
- * @param optional maximum file size (0 for a growable size).
+ * OS stream (FILE, socket, etc) abstraction.
  */
+struct os_stream
+{
+   void
+   (*close)(struct os_stream *stream);
+
+   boolean
+   (*write)(struct os_stream *stream, const void *data, size_t size);
+
+   void
+   (*flush)(struct os_stream *stream);
+};
+
+
+static INLINE void
+os_stream_close(struct os_stream *stream)
+{
+   stream-close(stream);
+}
+
+
+static INLINE boolean
+os_stream_write(struct os_stream *stream, const void *data, size_t size)
+{
+   return stream-write(stream, data, size);
+}
+
+
+static INLINE void
+os_stream_flush(struct os_stream *stream)
+{
+   stream-flush(stream);
+}
+
+
 struct os_stream *
-os_stream_create(const char *filename, size_t max_size);
+os_file_stream_create(const char *filename);
+
 
-boolean
-os_stream_write(struct os_stream *stream, const void *data, size_t size);
+struct os_stream *
+os_null_stream_create(void);
 
-void
-os_stream_flush(struct os_stream *stream);
 
-void
-os_stream_close(struct os_stream *stream);
+#if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
+#define os_file_stream_create(_filename) os_null_stream_create()
+#endif
 
 
 #endif /* _OS_STREAM_H_ */
diff --git a/src/gallium/auxiliary/os/os_stream_null.c 
b/src/gallium/auxiliary/os/os_stream_null.c
new file mode 100644
index 000..b55ce9c
--- /dev/null
+++ b/src/gallium/auxiliary/os/os_stream_null.c
@@ -0,0 +1,72 @@
+/**
+ *
+ * Copyright 2008-2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * 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, sub license, 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 (including the
+ * next paragraph) 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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.
+ *
+ **/
+
+/**
+ * @file
+ * Stream implementation for the Windows Display driver.
+ */
+
+#include os_memory.h

Mesa (master): util: Update for os_stream changes.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 323c6f8a2e449c46e1d67c55c45fb243445e575c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=323c6f8a2e449c46e1d67c55c45fb243445e575c

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 16:55:25 2010 +

util: Update for os_stream changes.

---

 src/gallium/auxiliary/util/u_debug.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c 
b/src/gallium/auxiliary/util/u_debug.c
index 688083d..858d52c 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -590,7 +590,7 @@ debug_dump_float_rgba_bmp(const char *filename,
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
 
-   stream = os_stream_create(filename, bmfh.bfSize);
+   stream = os_file_stream_create(filename);
if(!stream)
   goto error1;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): trace: Update for os_stream changes.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: dbc7b3da3ec7a2202b1d3b1f08a3d77e195cf3b1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbc7b3da3ec7a2202b1d3b1f08a3d77e195cf3b1

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 16:55:38 2010 +

trace: Update for os_stream changes.

---

 src/gallium/drivers/trace/tr_dump.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_dump.c 
b/src/gallium/drivers/trace/tr_dump.c
index 8de451c..1affafd 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -250,7 +250,7 @@ boolean trace_dump_trace_begin()
 
if(!stream) {
 
-  stream = os_stream_create(filename, 0);
+  stream = os_file_stream_create(filename);
   if(!stream)
  return FALSE;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): os: Fix bad calloc.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 33682e551036abcef4fb6d55aab15a25a58c5457
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=33682e551036abcef4fb6d55aab15a25a58c5457

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:03:10 2010 +

os: Fix bad calloc.

---

 src/gallium/auxiliary/os/os_stream_stdc.c |   11 +--
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_stream_stdc.c 
b/src/gallium/auxiliary/os/os_stream_stdc.c
index 9a62799..9e7ed71 100644
--- a/src/gallium/auxiliary/os/os_stream_stdc.c
+++ b/src/gallium/auxiliary/os/os_stream_stdc.c
@@ -60,9 +60,6 @@ os_stdc_stream_close(struct os_stream *_stream)
 {
struct os_stdc_stream *stream = os_stdc_stream(_stream);
 
-   if(!stream)
-  return;
-   
fclose(stream-file);
 
free(stream);
@@ -74,9 +71,6 @@ os_stdc_stream_write(struct os_stream *_stream, const void 
*data, size_t size)
 {
struct os_stdc_stream *stream = os_stdc_stream(_stream);
 
-   if(!stream)
-  return FALSE;
-   
return fwrite(data, size, 1, stream-file) == size ? TRUE : FALSE;
 }
 
@@ -86,9 +80,6 @@ os_stdc_stream_flush(struct os_stream *_stream)
 {
struct os_stdc_stream *stream = os_stdc_stream(_stream);
 
-   if(!stream)
-  return;
-   
fflush(stream-file);
 }
 
@@ -98,7 +89,7 @@ os_file_stream_create(const char *filename)
 {
struct os_stdc_stream *stream;
 
-   stream = (struct os_stdc_stream *)calloc(1, sizeof(struct os_stream));
+   stream = (struct os_stdc_stream *)calloc(1, sizeof(*stream));
if(!stream)
   goto no_stream;
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): os: Complement/improve stream inline helpers.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 78200989d353d979dfea584460c5338e35575aea
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=78200989d353d979dfea584460c5338e35575aea

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:04:04 2010 +

os: Complement/improve stream inline helpers.

---

 src/gallium/auxiliary/os/os_stream.h |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_stream.h 
b/src/gallium/auxiliary/os/os_stream.h
index 8232b0f..2ce5b18 100644
--- a/src/gallium/auxiliary/os/os_stream.h
+++ b/src/gallium/auxiliary/os/os_stream.h
@@ -56,6 +56,9 @@ struct os_stream
 static INLINE void
 os_stream_close(struct os_stream *stream)
 {
+   if (!stream)
+  return;
+
stream-close(stream);
 }
 
@@ -63,10 +66,24 @@ os_stream_close(struct os_stream *stream)
 static INLINE boolean
 os_stream_write(struct os_stream *stream, const void *data, size_t size)
 {
+   if (!stream)
+  return FALSE;
return stream-write(stream, data, size);
 }
 
 
+static INLINE boolean
+os_stream_write_str(struct os_stream *stream, const char *str)
+{
+   size_t size;
+   if (!stream)
+  return FALSE;
+   for(size = 0; str[size]; ++size)
+  ;
+   return stream-write(stream, str, size);
+}
+
+
 static INLINE void
 os_stream_flush(struct os_stream *stream)
 {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): os: Add a growable string stream.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 64606231b8101316e5ec51a0e71294c0a96b005f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=64606231b8101316e5ec51a0e71294c0a96b005f

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:07:21 2010 +

os: Add a growable string stream.

---

 src/gallium/auxiliary/Makefile   |1 +
 src/gallium/auxiliary/SConscript |1 +
 src/gallium/auxiliary/os/os_stream.h |   11 ++
 src/gallium/auxiliary/os/os_stream_str.c |  166 ++
 4 files changed, 179 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index aea2123..34f5df7 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -50,6 +50,7 @@ C_SOURCES = \
indices/u_unfilled_gen.c \
os/os_misc.c \
os/os_stream_stdc.c \
+   os/os_stream_str.c \
os/os_stream_null.c \
os/os_time.c \
pipebuffer/pb_buffer_malloc.c \
diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript
index c8a3ecf..680c4a1 100644
--- a/src/gallium/auxiliary/SConscript
+++ b/src/gallium/auxiliary/SConscript
@@ -84,6 +84,7 @@ source = [
 'indices/u_unfilled_gen.c',
 'os/os_misc.c',
 'os/os_stream_stdc.c',
+'os/os_stream_str.c',
 'os/os_stream_null.c',
 'os/os_time.c',
 'pipebuffer/pb_buffer_fenced.c',
diff --git a/src/gallium/auxiliary/os/os_stream.h 
b/src/gallium/auxiliary/os/os_stream.h
index 2ce5b18..3423b84 100644
--- a/src/gallium/auxiliary/os/os_stream.h
+++ b/src/gallium/auxiliary/os/os_stream.h
@@ -99,6 +99,17 @@ struct os_stream *
 os_null_stream_create(void);
 
 
+struct os_stream *
+os_str_stream_create(size_t initial_size);
+
+
+const char *
+os_str_stream_get(struct os_stream *stream);
+
+char *
+os_str_stream_get_and_close(struct os_stream *stream);
+
+
 #if defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
 #define os_file_stream_create(_filename) os_null_stream_create()
 #endif
diff --git a/src/gallium/auxiliary/os/os_stream_str.c 
b/src/gallium/auxiliary/os/os_stream_str.c
new file mode 100644
index 000..a288479
--- /dev/null
+++ b/src/gallium/auxiliary/os/os_stream_str.c
@@ -0,0 +1,166 @@
+/**
+ *
+ * Copyright 2008-2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * 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, sub license, 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 (including the
+ * next paragraph) 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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.
+ *
+ **/
+
+/**
+ * @file
+ * Stream implementation based on the Standard C Library.
+ */
+
+#include pipe/p_config.h
+
+#include os_memory.h
+#include os_stream.h
+
+
+struct os_str_stream
+{
+   struct os_stream base;
+
+   char *str;
+
+   size_t size;
+   size_t written;
+};
+
+
+static INLINE struct os_str_stream *
+os_str_stream(struct os_stream *stream)
+{
+   return (struct os_str_stream *)stream;
+}
+
+
+static void
+os_str_stream_close(struct os_stream *_stream)
+{
+   struct os_str_stream *stream = os_str_stream(_stream);
+
+   os_free(stream-str);
+
+   os_free(stream);
+}
+
+
+static boolean
+os_str_stream_write(struct os_stream *_stream, const void *data, size_t size)
+{
+   struct os_str_stream *stream = os_str_stream(_stream);
+   size_t minimum_size;
+   boolean ret = TRUE;
+
+   minimum_size = stream-written + size + 1;
+   if (stream-size  minimum_size) {
+  size_t new_size = stream-size;
+  char * new_str;
+
+  do {
+ new_size *= 2;
+  } while (new_size  minimum_size);
+
+  new_str = os_realloc(stream-str, stream-size, new_size);
+  if (new_str) {
+ stream-str = new_str;
+ stream-size = new_size;
+  }
+  else {
+ size = stream-size - stream-written - 1;
+ ret = FALSE;
+  }
+   }
+
+   memcpy(stream-str + stream-written, data, size);
+   stream-written += size;
+
+   return ret;
+}
+
+
+static void

Mesa (master): python: Pretty-printing of blend state.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: c2b0484e58765eadb7afc676ecffd80ebc1cbe5b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2b0484e58765eadb7afc676ecffd80ebc1cbe5b

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:24:08 2010 +

python: Pretty-printing of blend state.

---

 src/gallium/state_trackers/python/gallium.i |4 +++-
 src/gallium/state_trackers/python/p_state.i |   16 
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/python/gallium.i 
b/src/gallium/state_trackers/python/gallium.i
index d45c8bb..ffb084e 100644
--- a/src/gallium/state_trackers/python/gallium.i
+++ b/src/gallium/state_trackers/python/gallium.i
@@ -41,13 +41,15 @@
 #include pipe/p_screen.h
 #include pipe/p_context.h
 #include pipe/p_shader_tokens.h
-#include cso_cache/cso_context.h
+#include os/os_stream.h
 #include util/u_inlines.h
 #include util/u_draw_quad.h
 #include util/u_tile.h
 #include util/u_math.h
 #include util/u_format.h
+#include util/u_dump.h
 #include util/u_memory.h
+#include cso_cache/cso_context.h
 #include tgsi/tgsi_text.h
 #include tgsi/tgsi_dump.h
 
diff --git a/src/gallium/state_trackers/python/p_state.i 
b/src/gallium/state_trackers/python/p_state.i
index 318fe1c..b80e46b 100644
--- a/src/gallium/state_trackers/python/p_state.i
+++ b/src/gallium/state_trackers/python/p_state.i
@@ -58,6 +58,22 @@
 };
 
 
+%extend pipe_blend_state
+{
+   %cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1));
+   void __str__(char **STRING, int *LENGTH)
+   {
+  struct os_stream *stream;
+
+  stream = os_str_stream_create(1);
+  util_dump_blend_state(stream, $self);
+
+  *STRING = os_str_stream_get_and_close(stream);
+  *LENGTH = strlen(*STRING);
+   }
+};
+
+
 %extend pipe_framebuffer_state {

pipe_framebuffer_state(void) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Helper functions to dump all state objects.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 165b824343e5b416f8dec16f744ffaf39aea
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=165b824343e5b416f8dec16f744ffaf39aea

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:20:42 2010 +

util: Helper functions to dump all state objects.

---

 src/gallium/auxiliary/Makefile|1 +
 src/gallium/auxiliary/SConscript  |1 +
 src/gallium/auxiliary/util/u_dump.h   |   88 
 src/gallium/auxiliary/util/u_dump_state.c |  699 +
 4 files changed, 789 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index 34f5df7..7e4335f 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -95,6 +95,7 @@ C_SOURCES = \
util/u_debug_symbol.c \
util/u_debug_stack.c \
util/u_dump_defines.c \
+   util/u_dump_state.c \
util/u_bitmask.c \
util/u_blit.c \
util/u_blitter.c \
diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript
index 680c4a1..e13ac91 100644
--- a/src/gallium/auxiliary/SConscript
+++ b/src/gallium/auxiliary/SConscript
@@ -136,6 +136,7 @@ source = [
 'util/u_debug_stack.c',
 'util/u_debug_symbol.c',
 'util/u_dump_defines.c',
+'util/u_dump_state.c',
 'util/u_dl.c',
 'util/u_draw_quad.c',
 'util/u_format.c',
diff --git a/src/gallium/auxiliary/util/u_dump.h 
b/src/gallium/auxiliary/util/u_dump.h
index ddccc54..cad0b35 100644
--- a/src/gallium/auxiliary/util/u_dump.h
+++ b/src/gallium/auxiliary/util/u_dump.h
@@ -48,6 +48,17 @@ extern C {
 #define UTIL_DUMP_INVALID_NAME invalid
 
 
+struct os_stream;
+
+
+/*
+ * p_defines.h
+ *
+ * XXX: These functions don't really dump anything -- just translate into
+ * strings so a verb better than dump should be used instead, in order to
+ * free up the namespace to the true dumper functions.
+ */
+
 const char *
 util_dump_blend_factor(unsigned value, boolean shortened);
 
@@ -70,6 +81,83 @@ const char *
 util_dump_tex_filter(unsigned value, boolean shortened);
 
 
+/*
+ * p_state.h, through an os_stream
+ */
+
+void
+util_dump_template(struct os_stream *stream,
+   const struct pipe_texture *templat);
+
+void
+util_dump_rasterizer_state(struct os_stream *stream,
+   const struct pipe_rasterizer_state *state);
+
+void
+util_dump_poly_stipple(struct os_stream *stream,
+   const struct pipe_poly_stipple *state);
+
+void
+util_dump_viewport_state(struct os_stream *stream,
+ const struct pipe_viewport_state *state);
+
+void
+util_dump_scissor_state(struct os_stream *stream,
+const struct pipe_scissor_state *state);
+
+void
+util_dump_clip_state(struct os_stream *stream,
+ const struct pipe_clip_state *state);
+
+void
+util_dump_shader_state(struct os_stream *stream,
+   const struct pipe_shader_state *state);
+
+void
+util_dump_depth_stencil_alpha_state(struct os_stream *stream,
+const struct 
pipe_depth_stencil_alpha_state *state);
+
+void
+util_dump_rt_blend_state(struct os_stream *stream,
+ const struct pipe_rt_blend_state *state);
+
+void
+util_dump_blend_state(struct os_stream *stream,
+  const struct pipe_blend_state *state);
+
+void
+util_dump_blend_color(struct os_stream *stream,
+  const struct pipe_blend_color *state);
+
+void
+util_dump_stencil_ref(struct os_stream *stream,
+  const struct pipe_stencil_ref *state);
+
+void
+util_dump_framebuffer_state(struct os_stream *stream,
+const struct pipe_framebuffer_state *state);
+
+void
+util_dump_sampler_state(struct os_stream *stream,
+const struct pipe_sampler_state *state);
+
+void
+util_dump_surface(struct os_stream *stream,
+  const struct pipe_surface *state);
+
+void
+util_dump_transfer(struct os_stream *stream,
+   const struct pipe_transfer *state);
+
+void
+util_dump_vertex_buffer(struct os_stream *stream,
+const struct pipe_vertex_buffer *state);
+
+void
+util_dump_vertex_element(struct os_stream *stream,
+ const struct pipe_vertex_element *state);
+
+
 /* FIXME: Move the other debug_dump_xxx functions out of u_debug.h into here. 
*/
 
 
diff --git a/src/gallium/auxiliary/util/u_dump_state.c 
b/src/gallium/auxiliary/util/u_dump_state.c
new file mode 100644
index 000..5ba9136
--- /dev/null
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -0,0 +1,699 @@
+/**
+ *
+ * Copyright 2008-2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated 

Mesa (master): trace: No need to dump reference counts.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: d422310498f10bcf59c69faf04d8d4588303efc0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d422310498f10bcf59c69faf04d8d4588303efc0

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:25:01 2010 +

trace: No need to dump reference counts.

---

 src/gallium/drivers/trace/tr_dump_state.c |   13 -
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_dump_state.c 
b/src/gallium/drivers/trace/tr_dump_state.c
index 7cbf705..ee6a6e7 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -44,17 +44,6 @@ void trace_dump_format(enum pipe_format format)
 }
 
 
-static void trace_dump_reference(const struct pipe_reference *reference)
-{
-   if (!trace_dumping_enabled_locked())
-  return;
-
-   trace_dump_struct_begin(pipe_reference);
-   trace_dump_member(int, reference, count);
-   trace_dump_struct_end();
-}
-
-
 void trace_dump_template(const struct pipe_texture *templat)
 {
if (!trace_dumping_enabled_locked())
@@ -447,8 +436,6 @@ void trace_dump_surface(const struct pipe_surface *state)
 
trace_dump_struct_begin(pipe_surface);
 
-   trace_dump_reference(state-reference);
-
trace_dump_member(format, state, format);
trace_dump_member(uint, state, width);
trace_dump_member(uint, state, height);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Avoid dumping masked state. Other minor improvements.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: d70c76907519592b723df915e8a71a7bf88c1197
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d70c76907519592b723df915e8a71a7bf88c1197

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:54:22 2010 +

util: Avoid dumping masked state. Other minor improvements.

---

 src/gallium/auxiliary/util/u_dump.h   |5 ++
 src/gallium/auxiliary/util/u_dump_state.c |   66 
 2 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_dump.h 
b/src/gallium/auxiliary/util/u_dump.h
index cad0b35..379f18e 100644
--- a/src/gallium/auxiliary/util/u_dump.h
+++ b/src/gallium/auxiliary/util/u_dump.h
@@ -51,6 +51,11 @@ extern C {
 struct os_stream;
 
 
+/* Duplicated here for convenience */
+extern struct os_stream *
+os_log_stream;
+
+
 /*
  * p_defines.h
  *
diff --git a/src/gallium/auxiliary/util/u_dump_state.c 
b/src/gallium/auxiliary/util/u_dump_state.c
index 5ba9136..eaf4ec9 100644
--- a/src/gallium/auxiliary/util/u_dump_state.c
+++ b/src/gallium/auxiliary/util/u_dump_state.c
@@ -450,8 +450,10 @@ util_dump_depth_stencil_alpha_state(struct os_stream 
*stream, const struct pipe_
util_dump_member_begin(stream, depth);
util_dump_struct_begin(stream, pipe_depth_state);
util_dump_member(stream, bool, state-depth, enabled);
-   util_dump_member(stream, bool, state-depth, writemask);
-   util_dump_member(stream, uint, state-depth, func);
+   if (state-depth.enabled) {
+  util_dump_member(stream, bool, state-depth, writemask);
+  util_dump_member(stream, enum_func, state-depth, func);
+   }
util_dump_struct_end(stream);
util_dump_member_end(stream);
 
@@ -461,12 +463,14 @@ util_dump_depth_stencil_alpha_state(struct os_stream 
*stream, const struct pipe_
   util_dump_elem_begin(stream);
   util_dump_struct_begin(stream, pipe_stencil_state);
   util_dump_member(stream, bool, state-stencil[i], enabled);
-  util_dump_member(stream, enum_func, state-stencil[i], func);
-  util_dump_member(stream, uint, state-stencil[i], fail_op);
-  util_dump_member(stream, uint, state-stencil[i], zpass_op);
-  util_dump_member(stream, uint, state-stencil[i], zfail_op);
-  util_dump_member(stream, uint, state-stencil[i], valuemask);
-  util_dump_member(stream, uint, state-stencil[i], writemask);
+  if (state-stencil[i].enabled) {
+ util_dump_member(stream, enum_func, state-stencil[i], func);
+ util_dump_member(stream, uint, state-stencil[i], fail_op);
+ util_dump_member(stream, uint, state-stencil[i], zpass_op);
+ util_dump_member(stream, uint, state-stencil[i], zfail_op);
+ util_dump_member(stream, uint, state-stencil[i], valuemask);
+ util_dump_member(stream, uint, state-stencil[i], writemask);
+  }
   util_dump_struct_end(stream);
   util_dump_elem_end(stream);
}
@@ -476,8 +480,10 @@ util_dump_depth_stencil_alpha_state(struct os_stream 
*stream, const struct pipe_
util_dump_member_begin(stream, alpha);
util_dump_struct_begin(stream, pipe_alpha_state);
util_dump_member(stream, bool, state-alpha, enabled);
-   util_dump_member(stream, enum_func, state-alpha, func);
-   util_dump_member(stream, float, state-alpha, ref_value);
+   if (state-alpha.enabled) {
+  util_dump_member(stream, enum_func, state-alpha, func);
+  util_dump_member(stream, float, state-alpha, ref_value);
+   }
util_dump_struct_end(stream);
util_dump_member_end(stream);
 
@@ -490,14 +496,15 @@ util_dump_rt_blend_state(struct os_stream *stream, const 
struct pipe_rt_blend_st
util_dump_struct_begin(stream, pipe_rt_blend_state);
 
util_dump_member(stream, uint, state, blend_enable);
-
-   util_dump_member(stream, enum_blend_func, state, rgb_func);
-   util_dump_member(stream, enum_blend_factor, state, rgb_src_factor);
-   util_dump_member(stream, enum_blend_factor, state, rgb_dst_factor);
-
-   util_dump_member(stream, enum_blend_func, state, alpha_func);
-   util_dump_member(stream, enum_blend_factor, state, alpha_src_factor);
-   util_dump_member(stream, enum_blend_factor, state, alpha_dst_factor);
+   if (state-blend_enable) {
+  util_dump_member(stream, enum_blend_func, state, rgb_func);
+  util_dump_member(stream, enum_blend_factor, state, rgb_src_factor);
+  util_dump_member(stream, enum_blend_factor, state, rgb_dst_factor);
+
+  util_dump_member(stream, enum_blend_func, state, alpha_func);
+  util_dump_member(stream, enum_blend_factor, state, alpha_src_factor);
+  util_dump_member(stream, enum_blend_factor, state, alpha_dst_factor);
+   }
 
util_dump_member(stream, uint, state, colormask);
 
@@ -519,15 +526,18 @@ util_dump_blend_state(struct os_stream *stream, const 
struct pipe_blend_state *s
util_dump_member(stream, bool, state, dither);
 
util_dump_member(stream, bool, state, logicop_enable);
-   util_dump_member(stream, enum_func, state, logicop_func);
-

Mesa (master): os: A stream for debug logging.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 270279ac997e2a7b4e57c122b8ae217195271f72
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=270279ac997e2a7b4e57c122b8ae217195271f72

Author: José Fonseca jfons...@vmware.com
Date:   Sun Feb 14 23:53:42 2010 +

os: A stream for debug logging.

Just a wrapper around os_log_message. Although it would probably make
more sense to be the other way around.

Also some comment fixes.

---

 src/gallium/auxiliary/Makefile|1 +
 src/gallium/auxiliary/SConscript  |1 +
 src/gallium/auxiliary/os/os_stream.h  |4 ++
 src/gallium/auxiliary/os/os_stream_log.c  |   81 +
 src/gallium/auxiliary/os/os_stream_null.c |2 +-
 src/gallium/auxiliary/os/os_stream_str.c  |2 +-
 6 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile
index 7e4335f..ff76951 100644
--- a/src/gallium/auxiliary/Makefile
+++ b/src/gallium/auxiliary/Makefile
@@ -49,6 +49,7 @@ C_SOURCES = \
indices/u_indices_gen.c \
indices/u_unfilled_gen.c \
os/os_misc.c \
+   os/os_stream_log.c \
os/os_stream_stdc.c \
os/os_stream_str.c \
os/os_stream_null.c \
diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript
index e13ac91..b531ad2 100644
--- a/src/gallium/auxiliary/SConscript
+++ b/src/gallium/auxiliary/SConscript
@@ -83,6 +83,7 @@ source = [
 'indices/u_indices_gen.c',
 'indices/u_unfilled_gen.c',
 'os/os_misc.c',
+'os/os_stream_log.c',
 'os/os_stream_stdc.c',
 'os/os_stream_str.c',
 'os/os_stream_null.c',
diff --git a/src/gallium/auxiliary/os/os_stream.h 
b/src/gallium/auxiliary/os/os_stream.h
index 3423b84..693a062 100644
--- a/src/gallium/auxiliary/os/os_stream.h
+++ b/src/gallium/auxiliary/os/os_stream.h
@@ -99,6 +99,10 @@ struct os_stream *
 os_null_stream_create(void);
 
 
+extern struct os_stream *
+os_log_stream;
+
+
 struct os_stream *
 os_str_stream_create(size_t initial_size);
 
diff --git a/src/gallium/auxiliary/os/os_stream_log.c 
b/src/gallium/auxiliary/os/os_stream_log.c
new file mode 100644
index 000..7cc2028
--- /dev/null
+++ b/src/gallium/auxiliary/os/os_stream_log.c
@@ -0,0 +1,81 @@
+/**
+ *
+ * Copyright 2008-2010 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * 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, sub license, 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 (including the
+ * next paragraph) 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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.
+ *
+ **/
+
+/**
+ * @file
+ * Debug logging stream implementation.
+ */
+
+#include os_memory.h
+#include os_misc.h
+#include os_stream.h
+
+
+static void
+os_log_stream_close(struct os_stream *stream)
+{
+   (void)stream;
+}
+
+
+static boolean
+os_log_stream_write(struct os_stream *stream, const void *data, size_t size)
+{
+   char *str;
+
+   str = os_malloc(size + 1);
+   if (!str)
+  return FALSE;
+
+   memcpy(str, data, size);
+   str[size] = 0;
+
+   os_log_message(str);
+
+   os_free(str);
+
+   return TRUE;
+}
+
+
+static void
+os_log_stream_flush(struct os_stream *stream)
+{
+   (void)stream;
+}
+
+
+static struct os_stream
+os_log_stream_struct = {
+   os_log_stream_close,
+   os_log_stream_write,
+   os_log_stream_flush
+};
+
+
+struct os_stream *
+os_log_stream = os_log_stream_struct;
diff --git a/src/gallium/auxiliary/os/os_stream_null.c 
b/src/gallium/auxiliary/os/os_stream_null.c
index b55ce9c..128c4e8 100644
--- a/src/gallium/auxiliary/os/os_stream_null.c
+++ b/src/gallium/auxiliary/os/os_stream_null.c
@@ -27,7 +27,7 @@
 
 /**
  * @file
- * Stream implementation for the Windows Display driver.
+ * Null stream implementation.
  */
 
 #include os_memory.h
diff --git a/src/gallium/auxiliary/os/os_stream_str.c 
b/src/gallium/auxiliary/os/os_stream_str.c
index a288479..b5c7270 100644
--- a/src/gallium/auxiliary/os/os_stream_str.c
+++ 

Mesa (master): trace: Fix constant buffer unwrapping.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 1fc94ab3dffa742ac0197368f0136432954c328f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fc94ab3dffa742ac0197368f0136432954c328f

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 00:19:22 2010 +

trace: Fix constant buffer unwrapping.

Pointer unwrapping should happen before dump the pointer, so that
the real pipe driver pointers are shown, instead of the trace driver's.

---

 src/gallium/drivers/trace/tr_context.c |   13 -
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_context.c 
b/src/gallium/drivers/trace/tr_context.c
index 879778b..df40fba 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -835,8 +835,10 @@ trace_context_set_constant_buffer(struct pipe_context 
*_pipe,
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx-pipe;
 
-   if (buffer)
+   if (buffer) {
   trace_screen_user_buffer_update(_pipe-screen, buffer);
+  buffer = trace_buffer_unwrap(tr_ctx, buffer);
+   }
 
trace_dump_call_begin(pipe_context, set_constant_buffer);
 
@@ -845,14 +847,7 @@ trace_context_set_constant_buffer(struct pipe_context 
*_pipe,
trace_dump_arg(uint, index);
trace_dump_arg(ptr, buffer);
 
-   /* XXX hmm? */
-   if (buffer) {
-  struct pipe_buffer *_buffer;
-  _buffer = trace_buffer_unwrap(tr_ctx, buffer);
-  pipe-set_constant_buffer(pipe, shader, index, _buffer);
-   } else {
-  pipe-set_constant_buffer(pipe, shader, index, buffer);
-   }
+   pipe-set_constant_buffer(pipe, shader, index, buffer);
 
trace_dump_call_end();
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): trace: Dump blend state as a binary blob.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: dcdf94c87c087186f963b6e201b2989c61a76ef0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcdf94c87c087186f963b6e201b2989c61a76ef0

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 00:22:29 2010 +

trace: Dump blend state as a binary blob.

Gallium interfaces are too fluid -- XML or not is just too much work
trying to accommodate for differences in traces.

SWIG generated bindings are also full of quirks, making unmarshalling
the XML from too hard.

Finally, this is the first step for faster tracing.

---

 src/gallium/drivers/trace/tr_dump_state.c |   38 +
 1 files changed, 1 insertions(+), 37 deletions(-)

diff --git a/src/gallium/drivers/trace/tr_dump_state.c 
b/src/gallium/drivers/trace/tr_dump_state.c
index ee6a6e7..6da186a 100644
--- a/src/gallium/drivers/trace/tr_dump_state.c
+++ b/src/gallium/drivers/trace/tr_dump_state.c
@@ -292,29 +292,8 @@ void trace_dump_depth_stencil_alpha_state(const struct 
pipe_depth_stencil_alpha_
trace_dump_struct_end();
 }
 
-static void trace_dump_rt_blend_state(const struct pipe_rt_blend_state *state)
-{
-   trace_dump_struct_begin(pipe_rt_blend_state);
-
-   trace_dump_member(uint, state, blend_enable);
-
-   trace_dump_member(uint, state, rgb_func);
-   trace_dump_member(uint, state, rgb_src_factor);
-   trace_dump_member(uint, state, rgb_dst_factor);
-
-   trace_dump_member(uint, state, alpha_func);
-   trace_dump_member(uint, state, alpha_src_factor);
-   trace_dump_member(uint, state, alpha_dst_factor);
-
-   trace_dump_member(uint, state, colormask);
-
-   trace_dump_struct_end();
-}
-
 void trace_dump_blend_state(const struct pipe_blend_state *state)
 {
-   unsigned valid_entries = 1;
-
if (!trace_dumping_enabled_locked())
   return;
 
@@ -323,22 +302,7 @@ void trace_dump_blend_state(const struct pipe_blend_state 
*state)
   return;
}
 
-   trace_dump_struct_begin(pipe_blend_state);
-
-   trace_dump_member(bool, state, dither);
-
-   trace_dump_member(bool, state, logicop_enable);
-   trace_dump_member(uint, state, logicop_func);
-
-   trace_dump_member(bool, state, independent_blend_enable);
-
-   trace_dump_member_begin(rt);
-   if (state-independent_blend_enable)
-  valid_entries = PIPE_MAX_COLOR_BUFS;
-   trace_dump_struct_array(rt_blend_state, state-rt, valid_entries);
-   trace_dump_member_end();
-
-   trace_dump_struct_end();
+   trace_dump_bytes(state, sizeof *state);
 }
 
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): python: Reconstruct blend state objects from binary blobs.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: e918519fe916da727eb051367f57b26dbd9ec870
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e918519fe916da727eb051367f57b26dbd9ec870

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 00:22:59 2010 +

python: Reconstruct blend state objects from binary blobs.

---

 src/gallium/state_trackers/python/p_state.i |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/python/p_state.i 
b/src/gallium/state_trackers/python/p_state.i
index b80e46b..5afe4d4 100644
--- a/src/gallium/state_trackers/python/p_state.i
+++ b/src/gallium/state_trackers/python/p_state.i
@@ -60,6 +60,23 @@
 
 %extend pipe_blend_state
 {
+   pipe_blend_state(void)
+   {
+  return CALLOC_STRUCT(pipe_blend_state);
+   }
+
+   %cstring_input_binary(const char *STRING, unsigned LENGTH);
+   pipe_blend_state(const char *STRING, unsigned LENGTH)
+   {
+  struct pipe_blend_state *state;
+  state = CALLOC_STRUCT(pipe_framebuffer_state);
+  if (state) {
+ LENGTH = MIN2(sizeof *state, LENGTH);
+ memcpy(state, STRING, LENGTH);
+  }
+  return state;
+   }
+
%cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1));
void __str__(char **STRING, int *LENGTH)
{

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): python/retrace: Reconstruct blend state from binary blobs.

2010-02-14 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 21fe86b036451bb8352ed6aa0774d49f45fcd417
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=21fe86b036451bb8352ed6aa0774d49f45fcd417

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 00:25:43 2010 +

python/retrace: Reconstruct blend state from binary blobs.

---

 progs/gallium/python/retrace/interpreter.py |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/progs/gallium/python/retrace/interpreter.py 
b/progs/gallium/python/retrace/interpreter.py
index a34122e..2db71a2 100755
--- a/progs/gallium/python/retrace/interpreter.py
+++ b/progs/gallium/python/retrace/interpreter.py
@@ -376,6 +376,9 @@ class Context(Object):
 pass
 
 def create_blend_state(self, state):
+if isinstance(state, str):
+state = gallium.Blend(state)
+sys.stdout.write('\t%s\n' % state)
 return state
 
 def bind_blend_state(self, state):

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): wgl: Be lenient when sharing contexts.

2010-02-15 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 672f6bb5455bb473ee5daf24d737c861f26a9325
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=672f6bb5455bb473ee5daf24d737c861f26a9325

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 19:34:38 2010 +

wgl: Be lenient when sharing contexts.

My first reading of MS docs was wrong. It says:

  All rendering contexts of a shared display list must use an identical
  pixel format. Otherwise the results depend on the implementation of
  OpenGL used.

That is, it is OK to share contexts with different pixel formats.

Adobe Premiere Pro tries to do that: share lists between a rgbx8 and a
rgba8 pixel format.

---

 src/gallium/state_trackers/wgl/stw_context.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_context.c 
b/src/gallium/state_trackers/wgl/stw_context.c
index 6f74204..5075f39 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -118,8 +118,7 @@ DrvShareLists(
ctx1 = stw_lookup_context_locked( dhglrc1 );
ctx2 = stw_lookup_context_locked( dhglrc2 );
 
-   if (ctx1  ctx2 
-   ctx1-iPixelFormat == ctx2-iPixelFormat) { 
+   if (ctx1  ctx2) {
   ret = _mesa_share_state(ctx2-st-ctx, ctx1-st-ctx);
}
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): scons: A less magic way of not building progs by default.

2010-02-15 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 8c7d39cc8319864d43c4a8143d09cbc09c7371ff
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c7d39cc8319864d43c4a8143d09cbc09c7371ff

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 20:48:24 2010 +

scons: A less magic way of not building progs by default.

The problem with the old way is that passing 'progs/subdir' as argument
would fail.

---

 SConstruct |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/SConstruct b/SConstruct
index 964af7e..ea63b90 100644
--- a/SConstruct
+++ b/SConstruct
@@ -225,9 +225,10 @@ SConscript(
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
 )
 
-if 'progs' in COMMAND_LINE_TARGETS:
-SConscript(
-'progs/SConscript',
-variant_dir = os.path.join('progs', env['build']),
-duplicate = 0 # 
http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
-)
+env.Default('src')
+
+SConscript(
+'progs/SConscript',
+variant_dir = os.path.join('progs', env['build']),
+duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): wgl: Be lenient when sharing contexts.

2010-02-15 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: 33cf477c37535e39858b26caa282e167f1ab04d8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=33cf477c37535e39858b26caa282e167f1ab04d8

Author: José Fonseca jfons...@vmware.com
Date:   Mon Feb 15 19:34:38 2010 +

wgl: Be lenient when sharing contexts.

My first reading of MS docs was wrong. It says:

  All rendering contexts of a shared display list must use an identical
  pixel format. Otherwise the results depend on the implementation of
  OpenGL used.

That is, it is OK to share contexts with different pixel formats.

Adobe Premiere Pro tries to do that: share lists between a rgbx8 and a
rgba8 pixel format.

---

 src/gallium/state_trackers/wgl/stw_context.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_context.c 
b/src/gallium/state_trackers/wgl/stw_context.c
index c2f9c75..05ccd5f 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -113,8 +113,7 @@ DrvShareLists(
ctx1 = stw_lookup_context_locked( dhglrc1 );
ctx2 = stw_lookup_context_locked( dhglrc2 );
 
-   if (ctx1  ctx2 
-   ctx1-iPixelFormat == ctx2-iPixelFormat) { 
+   if (ctx1  ctx2) {
   ret = _mesa_share_state(ctx2-st-ctx, ctx1-st-ctx);
}
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert progs/redbook: Temporarily disable the demos that extensions not part of windows to fix build .

2010-02-16 Thread Jose Fonseca
Module: Mesa
Branch: master
Commit: b0f9717105301ee85afee0d03ee7e62e3e883326
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0f9717105301ee85afee0d03ee7e62e3e883326

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 16 11:23:18 2010 +

Revert progs/redbook: Temporarily disable the demos that extensions not part 
of windows to fix build.

This reverts commit 1587eff1b6d6ab74c302ca2ccb767d917ce3b1dd.

---

 progs/redbook/SConscript |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/progs/redbook/SConscript b/progs/redbook/SConscript
index df7e8da..750ad36 100644
--- a/progs/redbook/SConscript
+++ b/progs/redbook/SConscript
@@ -14,8 +14,8 @@ progs = [
 'checker',
 'clip',
 'colormat',
-#'combiner',
-#'convolution',
+'combiner',
+'convolution',
 'cube',
 'cubemap',
 'depthcue',
@@ -24,29 +24,29 @@ progs = [
 'drawf',
 'feedback',
 'fog',
-#'fogcoord',
+'fogcoord',
 'fogindex',
 'font',
 'hello',
-#'histogram',
+'histogram',
 'image',
 'light',
 'lines',
 'list',
 'material',
-#'minmax',
+'minmax',
 'mipmap',
 'model',
 'movelight',
 'multisamp',
-#'multitex',
-#'mvarray',
+'multitex',
+'mvarray',
 'nurbs',
 'pickdepth',
 'picksquare',
 'plane',
 'planet',
-#'pointp',
+'pointp',
 'polyoff',
 'polys',
 'quadric',
@@ -56,7 +56,7 @@ progs = [
 'scene',
 'sceneflat',
 'select',
-#'shadowmap',
+'shadowmap',
 'smooth',
 'stencil',
 'stroke',
@@ -71,7 +71,7 @@ progs = [
 'texprox',
 'texsub',
 'texturesurf',
-#'texture3d',
+'texture3d',
 'torus',
 'trim',
 'unproject',

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): vbo: Ensure vertices are always unmapped before the context is flushed.

2010-02-16 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: af2023e31cde5ad2cf8ce740e20a98c4cbab37ce
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=af2023e31cde5ad2cf8ce740e20a98c4cbab37ce

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 16 12:21:55 2010 +

vbo: Ensure vertices are always unmapped before the context is flushed.

Purpose is two fold:

- when doing user-space memory management mapping a buffer stored in the
  graphics aperture effectively pins it there, increasing the likelyhood
  of failure of validating other buffers when flushing

- certain hardware/platform combinations do not allow a buffer to be
  simultaneously mapped and validated

This fixes assertion failures in HL Uplink with the svga driver, where
vbo was holding a map to a buffer which was also referred in the command
stream.

Note: this a non-invasive fix and shouldn't be just cherry-picked into
master as-is -- a cleaner fix for this problem should be searched.

---

 src/mesa/main/context.h  |8 
 src/mesa/state_tracker/st_draw.c |2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index c3be106..5a4f860 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -207,8 +207,8 @@ _mesa_Flush( void );
 do {   \
if (MESA_VERBOSE  VERBOSE_STATE)   \
   _mesa_debug(ctx, FLUSH_VERTICES in %s\n, MESA_FUNCTION);\
-   if (ctx-Driver.NeedFlush  FLUSH_STORED_VERTICES)  \
-  ctx-Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES);   \
+   if (ctx-Driver.NeedFlush)  \
+  ctx-Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES | 
FLUSH_UPDATE_CURRENT); \
ctx-NewState |= newstate;  \
 } while (0)
 
@@ -226,8 +226,8 @@ do {
\
 do {   \
if (MESA_VERBOSE  VERBOSE_STATE)   \
   _mesa_debug(ctx, FLUSH_CURRENT in %s\n, MESA_FUNCTION);\
-   if (ctx-Driver.NeedFlush  FLUSH_UPDATE_CURRENT)   \
-  ctx-Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT);\
+   if (ctx-Driver.NeedFlush)  \
+  ctx-Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES | 
FLUSH_UPDATE_CURRENT);\
ctx-NewState |= newstate;  \
 } while (0)
 
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index d3b22db..823c72d 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -404,6 +404,7 @@ setup_interleaved_attribs(GLcontext *ctx,
 vbuffer-buffer_offset = 0;
  }
  else {
+assert(!bufobj-Pointer);
 vbuffer-buffer = NULL;
 pipe_buffer_reference(vbuffer-buffer, stobj-buffer);
 vbuffer-buffer_offset = pointer_to_offset(low);
@@ -460,6 +461,7 @@ setup_non_interleaved_attribs(GLcontext *ctx,
  assert(stobj-buffer);
  /*printf(stobj %u = %p\n, attr, (void*) stobj);*/
 
+ assert(!bufobj-Pointer);
  vbuffer[attr].buffer = NULL;
  pipe_buffer_reference(vbuffer[attr].buffer, stobj-buffer);
  vbuffer[attr].buffer_offset = 
pointer_to_offset(arrays[mesaAttr]-Ptr);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): pipebuffer: Don' t synchronize when checking for buffer overflows.

2010-02-16 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 2077f375c7e3a45044b62ae45e779d9201ca39f7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2077f375c7e3a45044b62ae45e779d9201ca39f7

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 16 15:51:34 2010 +

pipebuffer: Don't synchronize when checking for buffer overflows.

To avoid masking synchronization issues in debug builds.

---

 src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c 
b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
index 8f74180..a64f2ea 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
@@ -179,7 +179,9 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf)
 {
uint8_t *map;

-   map = pb_map(buf-buffer, PIPE_BUFFER_USAGE_CPU_READ);
+   map = pb_map(buf-buffer,
+PIPE_BUFFER_USAGE_CPU_READ |
+PIPE_BUFFER_USAGE_UNSYNCHRONIZED);
assert(map);
if(map) {
   boolean underflow, overflow;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): svga: Remove unused buffer download code.

2010-02-17 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 3b724f91c5312888b7fe86a957cbd511cd808c34
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b724f91c5312888b7fe86a957cbd511cd808c34

Author: José Fonseca jfons...@vmware.com
Date:   Tue Feb 16 16:43:53 2010 +

svga: Remove unused buffer download code.

Unnecessary now that we never destroy buffer storage.

---

 src/gallium/drivers/svga/svga_screen_buffer.c |   40 -
 src/gallium/drivers/svga/svga_screen_buffer.h |5 ---
 2 files changed, 0 insertions(+), 45 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c 
b/src/gallium/drivers/svga/svga_screen_buffer.c
index 6a58ff2..cb4de42 100644
--- a/src/gallium/drivers/svga/svga_screen_buffer.c
+++ b/src/gallium/drivers/svga/svga_screen_buffer.c
@@ -288,8 +288,6 @@ svga_buffer_upload_flush(struct svga_context *svga,
sbuf-hw.svga = NULL;
sbuf-hw.boxes = NULL;
 
-   sbuf-host_written = TRUE;
-
/* Decrement reference count */
pipe_buffer_reference((struct pipe_buffer **)sbuf, NULL);
 }
@@ -419,44 +417,6 @@ svga_buffer_map_range( struct pipe_screen *screen,
   if(!sbuf-hw.buf) {
  if(svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK)
 return NULL;
- 
- /* Populate the hardware storage if the host surface pre-existed */
- if(sbuf-host_written) {
-SVGA3dSurfaceDMAFlags flags;
-enum pipe_error ret;
-struct pipe_fence_handle *fence = NULL;
-
-assert(sbuf-handle);
-
-SVGA_DBG(DEBUG_DMA|DEBUG_PERF, dma from sid %p (buffer), bytes %u 
- %u\n, 
- sbuf-handle, 0, sbuf-base.size);
-
-memset(flags, 0, sizeof flags);
-
-ret = SVGA3D_BufferDMA(ss-swc,
-   sbuf-hw.buf,
-   sbuf-handle,
-   SVGA3D_READ_HOST_VRAM,
-   sbuf-base.size,
-   0,
-   flags);
-if(ret != PIPE_OK) {
-   ss-swc-flush(ss-swc, NULL);
-   
-   ret = SVGA3D_BufferDMA(ss-swc,
-  sbuf-hw.buf,
-  sbuf-handle,
-  SVGA3D_READ_HOST_VRAM,
-  sbuf-base.size,
-  0,
-  flags);
-   assert(ret == PIPE_OK);
-}
-
-ss-swc-flush(ss-swc, fence);
-sws-fence_finish(sws, fence, 0);
-sws-fence_reference(sws, fence, NULL);
- }
   }
  
   map = sws-buffer_map(sws, sbuf-hw.buf, usage);
diff --git a/src/gallium/drivers/svga/svga_screen_buffer.h 
b/src/gallium/drivers/svga/svga_screen_buffer.h
index 448ac10..e0e1b22 100644
--- a/src/gallium/drivers/svga/svga_screen_buffer.h
+++ b/src/gallium/drivers/svga/svga_screen_buffer.h
@@ -135,11 +135,6 @@ struct svga_buffer
 */
struct svga_winsys_surface *handle;

-   /**
-* Whether the host has been ever written.
-*/
-   boolean host_written;
-
struct {
   unsigned count;
   boolean writing;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): mesa: Take back some assertions.

2010-02-17 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 13cd4298fb8fd447f86ca92d7571e5c13b5ff9f6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13cd4298fb8fd447f86ca92d7571e5c13b5ff9f6

Author: José Fonseca jfons...@vmware.com
Date:   Wed Feb 17 20:02:32 2010 +

mesa: Take back some assertions.

It seems there are still some places where draw can happen with mapped
buffers... Remove the assertions since there is not much more than can
be done at this moment.

This partially reverts commit af2023e31cde5ad2cf8ce740e20a98c4cbab37ce.

---

 src/mesa/state_tracker/st_draw.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 823c72d..d3b22db 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -404,7 +404,6 @@ setup_interleaved_attribs(GLcontext *ctx,
 vbuffer-buffer_offset = 0;
  }
  else {
-assert(!bufobj-Pointer);
 vbuffer-buffer = NULL;
 pipe_buffer_reference(vbuffer-buffer, stobj-buffer);
 vbuffer-buffer_offset = pointer_to_offset(low);
@@ -461,7 +460,6 @@ setup_non_interleaved_attribs(GLcontext *ctx,
  assert(stobj-buffer);
  /*printf(stobj %u = %p\n, attr, (void*) stobj);*/
 
- assert(!bufobj-Pointer);
  vbuffer[attr].buffer = NULL;
  pipe_buffer_reference(vbuffer[attr].buffer, stobj-buffer);
  vbuffer[attr].buffer_offset = 
pointer_to_offset(arrays[mesaAttr]-Ptr);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (mesa_7_7_branch): svga: Temporarily create a sw vertex buf when failed to create a hw buf.

2010-02-18 Thread Jose Fonseca
Module: Mesa
Branch: mesa_7_7_branch
Commit: 770945cff48bef2d0552aba39ee0fd7b8740dc14
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=770945cff48bef2d0552aba39ee0fd7b8740dc14

Author: José Fonseca jfons...@vmware.com
Date:   Thu Feb 18 18:11:50 2010 +

svga: Temporarily create a sw vertex buf when failed to create a hw buf.

Many apps don't check the return of map buffer so it is better not to
fail.

---

 src/gallium/drivers/svga/svga_screen_buffer.c |   27 ++--
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c 
b/src/gallium/drivers/svga/svga_screen_buffer.c
index cb4de42..a4db1d9 100644
--- a/src/gallium/drivers/svga/svga_screen_buffer.c
+++ b/src/gallium/drivers/svga/svga_screen_buffer.c
@@ -409,18 +409,31 @@ svga_buffer_map_range( struct pipe_screen *screen,
struct svga_buffer *sbuf = svga_buffer( buf );
void *map;
 
-   if(sbuf-swbuf) {
+   if (!sbuf-swbuf  !sbuf-hw.buf) {
+  if (svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) {
+ /*
+  * We can't create a hardware buffer big enough, so create a malloc
+  * buffer instead.
+  */
+
+ debug_printf(%s: failed to allocate %u KB of DMA, splitting DMA 
transfers\n,
+  __FUNCTION__,
+  (sbuf-base.size + 1023)/1024);
+
+ sbuf-swbuf = align_malloc(sbuf-base.size, sbuf-base.alignment);
+  }
+   }
+
+   if (sbuf-swbuf) {
   /* User/malloc buffer */
   map = sbuf-swbuf;
}
-   else {
-  if(!sbuf-hw.buf) {
- if(svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK)
-return NULL;
-  }
- 
+   else if (sbuf-hw.buf) {
   map = sws-buffer_map(sws, sbuf-hw.buf, usage);
}
+   else {
+  map = NULL;
+   }
 
if(map) {
   pipe_mutex_lock(ss-swc_mutex);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit


<    3   4   5   6   7   8   9   10   11   12   >