Merge remote-tracking branch 'origin/master' into pipe-video
authorChristian König <deathsimple@vodafone.de>
Sat, 7 May 2011 12:11:40 +0000 (14:11 +0200)
committerChristian König <deathsimple@vodafone.de>
Sat, 7 May 2011 12:11:40 +0000 (14:11 +0200)
Conflicts:
src/gallium/drivers/r600/r600_state.c

12 files changed:
1  2 
configure.ac
src/gallium/auxiliary/util/u_format.csv
src/gallium/drivers/r600/Makefile
src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_inlines.h
src/gallium/drivers/r600/r600_texture.c
src/gallium/include/pipe/p_defines.h
src/gallium/winsys/r600/drm/r600_bo.c
src/gallium/winsys/r600/drm/r600_hw_context.c
src/mesa/state_tracker/st_format.c

diff --cc configure.ac
Simple merge
Simple merge
Simple merge
index 8646b9f49059420fac210a94ee96a5e63f30f80b,3f979cf170f0c53742db6cacbec58c2cd08693b1..b9084c953ee69af77f67fd9adae66f4747e94d79
@@@ -780,17 -769,36 +774,36 @@@ static void r600_cb(struct r600_pipe_co
                S_0280A0_NUMBER_TYPE(ntype) |
                S_0280A0_ENDIAN(endian);
  
-       color_info_mask = 0xFFFFFFFF & ~S_0280A0_BLEND_CLAMP(1);
-       /* on R600 this can't be set if BLEND_CLAMP isn't set,
-          if BLEND_FLOAT32 is set of > 11 bits in a UNORM or SNORM */
-       if (desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS && desc->channel[i].size < 12) {
-               //TODO: Seems to work on RV710, but i have no idea what to do between R600-RV710
-               if (rctx->family < CHIP_RV710) {
-                       color_info |= S_0280A0_BLEND_CLAMP(1);
-                       color_info_mask |= S_0280A0_BLEND_CLAMP(1);
-               }
-               color_info |= S_0280A0_SOURCE_FORMAT(V_0280A0_EXPORT_NORM);
+       /* EXPORT_NORM is an optimzation that can be enabled for better
+        * performance in certain cases
+        */
+       if (rctx->family < CHIP_RV770) {
+               /* EXPORT_NORM can be enabled if:
+                * - 11-bit or smaller UNORM/SNORM/SRGB
+                * - BLEND_CLAMP is enabled
+                * - BLEND_FLOAT32 is disabled
+                */
++              // TODO get BLEND_CLAMP state from rasterizer state
+               if (desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS &&
+                   (desc->channel[i].size < 12 &&
+                    desc->channel[i].type != UTIL_FORMAT_TYPE_FLOAT &&
+                    ntype != V_0280A0_NUMBER_UINT &&
+                    ntype != V_0280A0_NUMBER_SINT) &&
+                   G_0280A0_BLEND_CLAMP(color_info) &&
+                   !G_0280A0_BLEND_FLOAT32(color_info))
+                       color_info |= S_0280A0_SOURCE_FORMAT(V_0280A0_EXPORT_NORM);
+       } else {
+               /* EXPORT_NORM can be enabled if:
+                * - 11-bit or smaller UNORM/SNORM/SRGB
+                * - 16-bit or smaller FLOAT
+                */
+               if (desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS &&
+                   ((desc->channel[i].size < 12 &&
+                     desc->channel[i].type != UTIL_FORMAT_TYPE_FLOAT &&
+                     ntype != V_0280A0_NUMBER_UINT && ntype != V_0280A0_NUMBER_SINT) ||
+                   (desc->channel[i].size < 17 &&
+                    desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT)))
+                       color_info |= S_0280A0_SOURCE_FORMAT(V_0280A0_EXPORT_NORM);
        }
  
        r600_pipe_state_add_reg(rstate,
                                (offset + r600_bo_offset(bo[0])) >> 8, 0xFFFFFFFF, bo[0]);
        r600_pipe_state_add_reg(rstate,
                                R_0280A0_CB_COLOR0_INFO + cb * 4,
-                               color_info, color_info_mask, NULL);
 -                              color_info, 0xFFFFFFFF, bo[0]);
++                              color_info, ~S_0280A0_BLEND_CLAMP(1), NULL);
        r600_pipe_state_add_reg(rstate,
                                R_028060_CB_COLOR0_SIZE + cb * 4,
                                S_028060_PITCH_TILE_MAX(pitch) |
Simple merge
Simple merge
index 935ac07802eabf2d7a4e0691fcd9138e7009cdd2,0514bbeaba3b088d7af45c7afc5e37b00dd79ec1..34ea2a6bacb7708c5a88ef3d660b89fd30cf072a
@@@ -1124,17 -1145,16 +1145,18 @@@ void r600_context_block_emit_dirty(stru
                if (block->pm4_bo_index[j]) {
                        /* find relocation */
                        id = block->pm4_bo_index[j];
 -                      r600_context_bo_reloc(ctx,
 -                                      &block->pm4[block->reloc[id].bo_pm4_index],
 -                                      block->reloc[id].bo);
 -                      r600_context_bo_flush(ctx,
 -                                      block->reloc[id].flush_flags,
 -                                      block->reloc[id].flush_mask,
 -                                      block->reloc[id].bo);
 +                      if (block->reloc[id].bo) {
 +                              r600_context_bo_reloc(ctx,
 +                                              &block->pm4[block->reloc[id].bo_pm4_index],
 +                                              block->reloc[id].bo);
 +                              r600_context_bo_flush(ctx,
 +                                              block->reloc[id].flush_flags,
 +                                              block->reloc[id].flush_mask,
 +                                              block->reloc[id].bo);
 +                      }
                }
        }
+       ctx->flags &= ~R600_CONTEXT_CHECK_EVENT_FLUSH;
        memcpy(&ctx->pm4[ctx->pm4_cdwords], block->pm4, block->pm4_ndwords * 4);
        ctx->pm4_cdwords += block->pm4_ndwords;
  
Simple merge