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

Author: Marek Olšák <mar...@gmail.com>
Date:   Tue Sep 25 01:43:49 2012 +0200

r600g: fix streamout on RS780 and RS880

The latest kernel from git is required. Transform feedback (along with GL3.0)
is turned off on older kernels.

---

 src/gallium/drivers/r600/r600_hw_context.c |    9 +++++----
 src/gallium/drivers/r600/r600_pipe.c       |   12 +++++++++---
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_hw_context.c 
b/src/gallium/drivers/r600/r600_hw_context.c
index 5b93d05..8245059 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -1019,10 +1019,11 @@ void r600_context_streamout_begin(struct r600_context 
*ctx)
                           12 + /* flush_vgt_streamout */
                           6 + /* set_streamout_enable */
                           util_bitcount(buffer_en) * 7 + /* SET_CONTEXT_REG */
-                          (ctx->chip_class == R700 ? util_bitcount(buffer_en) 
* 5 : 0) + /* STRMOUT_BASE_UPDATE */
+                          (ctx->family >= CHIP_RS780 &&
+                           ctx->family <= CHIP_RV740 ? 
util_bitcount(buffer_en) * 5 : 0) + /* STRMOUT_BASE_UPDATE */
                           util_bitcount(buffer_en & 
ctx->streamout_append_bitmask) * 8 + /* STRMOUT_BUFFER_UPDATE */
                           util_bitcount(buffer_en & 
~ctx->streamout_append_bitmask) * 6 + /* STRMOUT_BUFFER_UPDATE */
-                          (ctx->family > CHIP_R600 && ctx->family < CHIP_RV770 
? 2 : 0) + /* SURFACE_BASE_UPDATE */
+                          (ctx->family > CHIP_R600 && ctx->family < CHIP_RS780 
? 2 : 0) + /* SURFACE_BASE_UPDATE */
                           ctx->num_cs_dw_streamout_end, TRUE);
 
        if (ctx->chip_class >= EVERGREEN) {
@@ -1055,7 +1056,7 @@ void r600_context_streamout_begin(struct r600_context 
*ctx)
 
                        /* R7xx requires this packet after updating BUFFER_BASE.
                         * Without this, R7xx locks up. */
-                       if (ctx->chip_class == R700) {
+                       if (ctx->family >= CHIP_RS780 && ctx->family <= 
CHIP_RV740) {
                                cs->buf[cs->cdw++] = 
PKT3(PKT3_STRMOUT_BASE_UPDATE, 1, 0);
                                cs->buf[cs->cdw++] = i;
                                cs->buf[cs->cdw++] = va >> 8;
@@ -1095,7 +1096,7 @@ void r600_context_streamout_begin(struct r600_context 
*ctx)
                }
        }
 
-       if (ctx->family > CHIP_R600 && ctx->family < CHIP_RV770) {
+       if (ctx->family > CHIP_R600 && ctx->family < CHIP_RS780) {
                cs->buf[cs->cdw++] = PKT3(PKT3_SURFACE_BASE_UPDATE, 0, 0);
                cs->buf[cs->cdw++] = update_flags;
        }
diff --git a/src/gallium/drivers/r600/r600_pipe.c 
b/src/gallium/drivers/r600/r600_pipe.c
index 70e8206..70cfe14 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -949,13 +949,19 @@ struct pipe_screen *r600_screen_create(struct 
radeon_winsys *ws)
        /* Figure out streamout kernel support. */
        switch (rscreen->chip_class) {
        case R600:
-       case EVERGREEN:
-       case CAYMAN:
-               rscreen->has_streamout = rscreen->info.drm_minor >= 14;
+               if (rscreen->family < CHIP_RS780) {
+                       rscreen->has_streamout = rscreen->info.drm_minor >= 14;
+               } else {
+                       rscreen->has_streamout = rscreen->info.drm_minor >= 23;
+               }
                break;
        case R700:
                rscreen->has_streamout = rscreen->info.drm_minor >= 17;
                break;
+       case EVERGREEN:
+       case CAYMAN:
+               rscreen->has_streamout = rscreen->info.drm_minor >= 14;
+               break;
        }
 
        if (r600_init_tiling(rscreen)) {

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

Reply via email to