Mesa (master): cell: fix the usual cell breakage

Brian Paul brianp at kemper.freedesktop.org
Mon Feb 8 14:48:03 UTC 2010


Module: Mesa
Branch: master
Commit: ebe2f7609533645e7e9c8af4a55bc0127b9bc515
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ebe2f7609533645e7e9c8af4a55bc0127b9bc515

Author: Marc Dietrich <marvin24 at gmx.de>
Date:   Sat Feb  6 15:07:48 2010 +0100

cell: fix the usual cell breakage

also update the cell config a bit

Signed-off-by: Brian Paul <brianp at vmware.com>

---

 configs/linux-cell                                 |    6 ++--
 src/gallium/drivers/cell/common.h                  |    3 +-
 src/gallium/drivers/cell/spu/spu_per_fragment_op.c |   36 ++++++++++----------
 3 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/configs/linux-cell b/configs/linux-cell
index 221655c..229ac73 100644
--- a/configs/linux-cell
+++ b/configs/linux-cell
@@ -1,6 +1,6 @@
 # linux-cell  (non-debug build)
 
-include $(TOP)/configs/default
+include $(TOP)/configs/linux
 
 CONFIG_NAME = linux-cell
 
@@ -25,10 +25,10 @@ OPT_FLAGS = -O3
 SDK = /opt/cell/sdk/usr
 
 
-CFLAGS = $(OPT_FLAGS) -Wall -Winline -Wmissing-prototypes \
+CFLAGS = $(OPT_FLAGS) -mcpu=cell -Wall -Winline -Wmissing-prototypes \
 	-fPIC -m32 -std=c99 -mabi=altivec -maltivec \
 	-I. -I$(SDK)/include \
-	-DGALLIUM_CELL -DUSE_XSHM -D_BSD_SOURCE -D_SVID_SOURCE
+	-DGALLIUM_CELL $(DEFINES)
 
 CXXFLAGS = $(CFLAGS)
 
diff --git a/src/gallium/drivers/cell/common.h b/src/gallium/drivers/cell/common.h
index aa29dcb..7f2b33c 100644
--- a/src/gallium/drivers/cell/common.h
+++ b/src/gallium/drivers/cell/common.h
@@ -36,7 +36,7 @@
 #include "pipe/p_compiler.h"
 #include "pipe/p_format.h"
 #include "pipe/p_state.h"
-
+#include <stdio.h>
 
 /** The standard assert macro doesn't seem to work reliably */
 #define ASSERT(x) \
@@ -49,7 +49,6 @@
    }
 
 
-
 #define JOIN(x, y) JOIN_AGAIN(x, y)
 #define JOIN_AGAIN(x, y) x ## y
 
diff --git a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c
index eba9f95..5328374 100644
--- a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c
+++ b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c
@@ -207,9 +207,9 @@ spu_fallback_fragment_ops(uint x, uint y,
     * If we'll need the current framebuffer/tile colors for blending
     * or logicop or colormask, fetch them now.
     */
-   if (spu.blend.blend_enable ||
+   if (spu.blend.rt[0].blend_enable ||
        spu.blend.logicop_enable ||
-       spu.blend.colormask != 0xf) {
+       spu.blend.rt[0].colormask != 0xf) {
 
 #if LINEAR_QUAD_LAYOUT /* See comments/diagram below */
       fbc0 = colorTile->ui[y][x*2+0];
@@ -228,7 +228,7 @@ spu_fallback_fragment_ops(uint x, uint y,
    /*
     * Do blending
     */
-   if (spu.blend.blend_enable) {
+   if (spu.blend.rt[0].blend_enable) {
       /* blending terms, misc regs */
       vector float term1r, term1g, term1b, term1a;
       vector float term2r, term2g, term2b, term2a;
@@ -261,7 +261,7 @@ spu_fallback_fragment_ops(uint x, uint y,
       /*
        * Compute Src RGB terms (fragment color * factor)
        */
-      switch (spu.blend.rgb_src_factor) {
+      switch (spu.blend.rt[0].rgb_src_factor) {
       case PIPE_BLENDFACTOR_ONE:
          term1r = fragR;
          term1g = fragG;
@@ -310,7 +310,7 @@ spu_fallback_fragment_ops(uint x, uint y,
       /*
        * Compute Src Alpha term (fragment alpha * factor)
        */
-      switch (spu.blend.alpha_src_factor) {
+      switch (spu.blend.rt[0].alpha_src_factor) {
       case PIPE_BLENDFACTOR_ONE:
          term1a = fragA;
          break;
@@ -338,7 +338,7 @@ spu_fallback_fragment_ops(uint x, uint y,
       /*
        * Compute Dest RGB terms (framebuffer color * factor)
        */
-      switch (spu.blend.rgb_dst_factor) {
+      switch (spu.blend.rt[0].rgb_dst_factor) {
       case PIPE_BLENDFACTOR_ONE:
          term2r = fbRGBA[0];
          term2g = fbRGBA[1];
@@ -394,7 +394,7 @@ spu_fallback_fragment_ops(uint x, uint y,
       /*
        * Compute Dest Alpha term (framebuffer alpha * factor)
        */
-      switch (spu.blend.alpha_dst_factor) {
+      switch (spu.blend.rt[0].alpha_dst_factor) {
       case PIPE_BLENDFACTOR_ONE:
          term2a = fbRGBA[3];
          break;
@@ -427,7 +427,7 @@ spu_fallback_fragment_ops(uint x, uint y,
       /*
        * Combine Src/Dest RGB terms
        */
-      switch (spu.blend.rgb_func) {
+      switch (spu.blend.rt[0].rgb_func) {
       case PIPE_BLEND_ADD:
          fragR = spu_add(term1r, term2r);
          fragG = spu_add(term1g, term2g);
@@ -460,7 +460,7 @@ spu_fallback_fragment_ops(uint x, uint y,
       /*
        * Combine Src/Dest A term
        */
-      switch (spu.blend.alpha_func) {
+      switch (spu.blend.rt[0].alpha_func) {
       case PIPE_BLEND_ADD:
          fragA = spu_add(term1a, term2a);
          break;
@@ -527,29 +527,29 @@ spu_fallback_fragment_ops(uint x, uint y,
    /*
     * Do color masking
     */
-   if (spu.blend.colormask != 0xf) {
+   if (spu.blend.rt[0].colormask != 0xf) {
       uint cmask = 0x0; /* each byte corresponds to a color channel */
 
       /* Form bitmask depending on color buffer format and colormask bits */
       switch (spu.fb.color_format) {
       case PIPE_FORMAT_A8R8G8B8_UNORM:
-         if (spu.blend.colormask & PIPE_MASK_R)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_R)
             cmask |= 0x00ff0000; /* red */
-         if (spu.blend.colormask & PIPE_MASK_G)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_G)
             cmask |= 0x0000ff00; /* green */
-         if (spu.blend.colormask & PIPE_MASK_B)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_B)
             cmask |= 0x000000ff; /* blue */
-         if (spu.blend.colormask & PIPE_MASK_A)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_A)
             cmask |= 0xff000000; /* alpha */
          break;
       case PIPE_FORMAT_B8G8R8A8_UNORM:
-         if (spu.blend.colormask & PIPE_MASK_R)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_R)
             cmask |= 0x0000ff00; /* red */
-         if (spu.blend.colormask & PIPE_MASK_G)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_G)
             cmask |= 0x00ff0000; /* green */
-         if (spu.blend.colormask & PIPE_MASK_B)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_B)
             cmask |= 0xff000000; /* blue */
-         if (spu.blend.colormask & PIPE_MASK_A)
+         if (spu.blend.rt[0].colormask & PIPE_MASK_A)
             cmask |= 0x000000ff; /* alpha */
          break;
       default:




More information about the mesa-commit mailing list