From 2ff5448bcca8cba4b62026d5493cb08aaf2838d8 Mon Sep 17 00:00:00 2001
From: marha <marha@users.sourceforge.net>
Date: Wed, 18 Jul 2012 08:33:31 +0200
Subject: fontconfig mesa xserver git update 18 Jul 2012

---
 mesalib/src/gallium/auxiliary/Makefile.sources    |  2 +-
 mesalib/src/gallium/auxiliary/util/u_cpu_detect.h | 12 +++++++++++
 mesalib/src/gallium/auxiliary/util/u_format_etc.c | 25 +----------------------
 mesalib/src/gallium/auxiliary/util/u_math.h       | 14 +++++++++++++
 4 files changed, 28 insertions(+), 25 deletions(-)

(limited to 'mesalib/src/gallium')

diff --git a/mesalib/src/gallium/auxiliary/Makefile.sources b/mesalib/src/gallium/auxiliary/Makefile.sources
index 28a176d68..2807c780d 100644
--- a/mesalib/src/gallium/auxiliary/Makefile.sources
+++ b/mesalib/src/gallium/auxiliary/Makefile.sources
@@ -165,6 +165,7 @@ GALLIVM_SOURCES := \
         gallivm/lp_bld_conv.c \
         gallivm/lp_bld_flow.c \
         gallivm/lp_bld_format_aos.c \
+        gallivm/lp_bld_format_aos_array.c \
         gallivm/lp_bld_format_soa.c \
         gallivm/lp_bld_format_yuv.c \
         gallivm/lp_bld_gather.c \
@@ -187,7 +188,6 @@ GALLIVM_SOURCES := \
         gallivm/lp_bld_type.c \
         draw/draw_llvm.c \
         draw/draw_llvm_sample.c \
-        draw/draw_llvm_translate.c \
         draw/draw_vs_llvm.c \
         draw/draw_pt_fetch_shade_pipeline_llvm.c
 
diff --git a/mesalib/src/gallium/auxiliary/util/u_cpu_detect.h b/mesalib/src/gallium/auxiliary/util/u_cpu_detect.h
index 856e8d7a0..b44d9d9a0 100644
--- a/mesalib/src/gallium/auxiliary/util/u_cpu_detect.h
+++ b/mesalib/src/gallium/auxiliary/util/u_cpu_detect.h
@@ -35,9 +35,16 @@
 #ifndef _UTIL_CPU_DETECT_H
 #define _UTIL_CPU_DETECT_H
 
+
 #include "pipe/p_compiler.h"
 #include "pipe/p_config.h"
 
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+
 struct util_cpu_caps {
    unsigned nr_cpus;
 
@@ -66,4 +73,9 @@ util_cpu_caps;
 void util_cpu_detect(void);
 
 
+#ifdef	__cplusplus
+}
+#endif
+
+
 #endif /* _UTIL_CPU_DETECT_H */
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_etc.c b/mesalib/src/gallium/auxiliary/util/u_format_etc.c
index 7500e1ed6..f909b1608 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format_etc.c
+++ b/mesalib/src/gallium/auxiliary/util/u_format_etc.c
@@ -13,30 +13,7 @@
 void
 util_format_etc1_rgb8_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
 {
-   const unsigned bw = 4, bh = 4, bs = 8, comps = 4;
-   struct etc1_block block;
-   unsigned x, y, i, j;
-
-   for (y = 0; y < height; y += bh) {
-      const uint8_t *src = src_row;
-
-      for (x = 0; x < width; x+= bw) {
-         etc1_parse_block(&block, src);
-
-         for (j = 0; j < bh; j++) {
-            uint8_t *dst = dst_row + (y + j) * dst_stride + x * comps;
-            for (i = 0; i < bw; i++) {
-               etc1_fetch_texel(&block, i, j, dst);
-               dst[3] = 255;
-               dst += comps;
-            }
-         }
-
-         src += bs;
-      }
-
-      src_row += src_stride;
-   }
+   etc1_unpack_rgba8888(dst_row, dst_stride, src_row, src_stride, width, height);
 }
 
 void
diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h
index f35c35ffe..90b421ed8 100644
--- a/mesalib/src/gallium/auxiliary/util/u_math.h
+++ b/mesalib/src/gallium/auxiliary/util/u_math.h
@@ -477,6 +477,20 @@ unsigned ffs( unsigned u )
 
 #endif /* FFS_DEFINED */
 
+/**
+ * Find last bit set in a word.  The least significant bit is 1.
+ * Return 0 if no bits are set.
+ */
+static INLINE unsigned util_last_bit(unsigned u)
+{
+   unsigned r = 0;
+   while (u) {
+       r++;
+       u >>= 1;
+   }
+   return r;
+}
+
 
 /* Destructively loop over all of the bits in a mask as in:
  *
-- 
cgit v1.2.3