r600g: remove unused flush code
authorMarek Olšák <maraeo@gmail.com>
Mon, 30 Jan 2012 07:34:13 +0000 (08:34 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 31 Jan 2012 22:12:30 +0000 (23:12 +0100)
src/gallium/drivers/r600/r600_hw_context.c
src/gallium/drivers/r600/r600_hw_context_priv.h
src/gallium/winsys/radeon/drm/radeon_drm_bo.h
src/gallium/winsys/radeon/drm/radeon_winsys.h

index d571df707343e57b4a8e30681481775f2d1dae0c..5e6447dceaacec2483f6f25dc57bf0b48363d6a3 100644 (file)
@@ -971,29 +971,6 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
        }
 }
 
-void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
-                               unsigned flush_mask, struct r600_resource *bo)
-{
-       struct radeon_winsys_cs *cs = ctx->cs;
-       uint64_t va = 0;
-
-       /* if bo has already been flushed */
-       if (!(~bo->cs_buf->last_flush & flush_flags)) {
-               bo->cs_buf->last_flush &= flush_mask;
-               return;
-       }
-
-       va = r600_resource_va(&ctx->screen->screen, (void *)bo);
-       cs->buf[cs->cdw++] = PKT3(PKT3_SURFACE_SYNC, 3, 0);
-       cs->buf[cs->cdw++] = flush_flags;
-       cs->buf[cs->cdw++] = (bo->buf->size + 255) >> 8;
-       cs->buf[cs->cdw++] = va >> 8;
-       cs->buf[cs->cdw++] = 0x0000000A;
-       cs->buf[cs->cdw++] = PKT3(PKT3_NOP, 0, 0);
-       cs->buf[cs->cdw++] = r600_context_bo_reloc(ctx, bo, RADEON_USAGE_WRITE);
-       bo->cs_buf->last_flush = (bo->cs_buf->last_flush | flush_flags) & flush_mask;
-}
-
 void r600_context_dirty_block(struct r600_context *ctx,
                              struct r600_block *block,
                              int dirty, int index)
@@ -1074,9 +1051,6 @@ void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_
 
        if (state == NULL) {
                block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_RESOURCE_DIRTY);
-               if (block->reloc[1].bo)
-                       block->reloc[1].bo->cs_buf->binding &= ~BO_BOUND_TEXTURE;
-
                pipe_resource_reference((struct pipe_resource**)&block->reloc[1].bo, NULL);
                pipe_resource_reference((struct pipe_resource**)&block->reloc[2].bo, NULL);
                LIST_DELINIT(&block->list);
@@ -1121,7 +1095,6 @@ void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_
                        block->reloc[1].bo_usage = state->bo_usage[0];
                        pipe_resource_reference((struct pipe_resource**)&block->reloc[2].bo, &state->bo[1]->b.b.b);
                        block->reloc[2].bo_usage = state->bo_usage[1];
-                       state->bo[0]->cs_buf->binding |= BO_BOUND_TEXTURE;
                }
 
                if (is_vertex)
@@ -1275,10 +1248,6 @@ void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *
                                if (reloc->bo) {
                                        block->pm4[reloc->bo_pm4_index] =
                                                        r600_context_bo_reloc(ctx, reloc->bo, reloc->bo_usage);
-                                       r600_context_bo_flush(ctx,
-                                                       reloc->flush_flags,
-                                                       reloc->flush_mask,
-                                                       reloc->bo);
                                } else {
                                        block->pm4[reloc->bo_pm4_index] = 0;
                                }
@@ -1333,10 +1302,6 @@ void r600_context_block_resource_emit_dirty(struct r600_context *ctx, struct r60
                        struct r600_block_reloc *reloc = &block->reloc[block->pm4_bo_index[j]];
                        block->pm4[reloc->bo_pm4_index] =
                                r600_context_bo_reloc(ctx, reloc->bo, reloc->bo_usage);
-                       r600_context_bo_flush(ctx,
-                                             reloc->flush_flags,
-                                             reloc->flush_mask,
-                                             reloc->bo);
                }
        }
        ctx->flags &= ~R600_CONTEXT_CHECK_EVENT_FLUSH;
@@ -1500,7 +1465,6 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
 
        /* restart */
        for (int i = 0; i < ctx->creloc; i++) {
-               ctx->bo[i]->cs_buf->last_flush = 0;
                pipe_resource_reference((struct pipe_resource**)&ctx->bo[i], NULL);
        }
        ctx->creloc = 0;
index 82cbfa7e133ffe2e89bc42225d8cdb5153e61ff7..79fa57b8c8122a31bc827fdcb7f673999de590ed 100644 (file)
@@ -51,13 +51,9 @@ struct r600_reg {
        unsigned                        flush_mask;
 };
 
-#define BO_BOUND_TEXTURE 1
-
 /*
  * r600_hw_context.c
  */
-void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
-                               unsigned flush_mask, struct r600_resource *rbo);
 struct r600_resource *r600_context_reg_bo(struct r600_context *ctx, unsigned offset);
 int r600_context_add_block(struct r600_context *ctx, const struct r600_reg *reg, unsigned nreg,
                           unsigned opcode, unsigned offset_base);
index 21cfe995510dfb8904c10c54758093c9111a804e..82ea14105df6aa4f67d605c897dd465f8e688659 100644 (file)
@@ -47,10 +47,6 @@ struct radeon_bo_desc {
 struct radeon_bo {
     struct pb_buffer base;
 
-    /* Don't move these! */
-    unsigned last_flush;
-    unsigned binding;
-
     struct radeon_bomgr *mgr;
     struct radeon_drm_winsys *rws;
 
index d33eaa7059c0ab7ff35af293cba91ebf3536e0cc..9afd7f8ac82cf06344c390de3fd31386392613dc 100644 (file)
@@ -70,15 +70,7 @@ enum radeon_bo_usage { /* bitfield */
 };
 
 struct winsys_handle;
-
-struct radeon_winsys_cs_handle {   /* for write_reloc etc. */
-    struct {
-        struct pb_buffer base;
-    } _private;
-
-    unsigned last_flush;
-    unsigned binding;
-};
+struct radeon_winsys_cs_handle;
 
 struct radeon_winsys_cs {
     unsigned cdw;  /* Number of used dwords. */