r600g: deinline some large functions.
authorDave Airlie <airlied@redhat.com>
Tue, 19 Apr 2011 00:04:02 +0000 (10:04 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 19 Apr 2011 00:12:20 +0000 (10:12 +1000)
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/winsys/r600/drm/r600_hw_context.c
src/gallium/winsys/r600/drm/r600_priv.h

index 9aa9cefdd565211674b5f573e50686b9d89cda8b..63258d65c2458a26d11c1b71231b1cc714018ee9 100644 (file)
@@ -838,6 +838,42 @@ void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *r
        *pm4 = bo->reloc_id;
 }
 
+void r600_context_reg(struct r600_context *ctx,
+                     unsigned offset, unsigned value,
+                     unsigned mask)
+{
+       struct r600_range *range;
+       struct r600_block *block;
+       unsigned id;
+
+       range = &ctx->range[CTX_RANGE_ID(ctx, offset)];
+       block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
+       id = (offset - block->start_offset) >> 2;
+       block->reg[id] &= ~mask;
+       block->reg[id] |= value;
+       if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
+               ctx->pm4_dirty_cdwords += block->pm4_ndwords;
+               block->status |= R600_BLOCK_STATUS_ENABLED;
+               block->status |= R600_BLOCK_STATUS_DIRTY;
+               LIST_ADDTAIL(&block->list,&ctx->dirty);
+       }
+}
+
+void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block,
+                             int dirty, int index)
+{
+       if (dirty && (index + 1) > block->nreg_dirty)
+               block->nreg_dirty = index + 1;
+
+       if ((dirty != (block->status & R600_BLOCK_STATUS_DIRTY)) || !(block->status & R600_BLOCK_STATUS_ENABLED)) {
+
+               block->status |= R600_BLOCK_STATUS_ENABLED;
+               block->status |= R600_BLOCK_STATUS_DIRTY;
+               ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+               LIST_ADDTAIL(&block->list,&ctx->dirty);
+       }
+}
+
 void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_state *state)
 {
        struct r600_range *range;
@@ -1055,6 +1091,46 @@ struct r600_bo *r600_context_reg_bo(struct r600_context *ctx, unsigned offset)
        return NULL;
 }
 
+void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block)
+{
+       int id;
+
+       if (block->nreg_dirty == 0 && block->nbo == 0 && !(block->flags & REG_FLAG_DIRTY_ALWAYS)) {
+               goto out;
+       }
+
+       for (int j = 0; j < block->nreg; j++) {
+               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);
+               }
+       }
+       memcpy(&ctx->pm4[ctx->pm4_cdwords], block->pm4, block->pm4_ndwords * 4);
+       ctx->pm4_cdwords += block->pm4_ndwords;
+
+       if (block->nreg_dirty != block->nreg && block->nbo == 0 && !(block->flags & REG_FLAG_DIRTY_ALWAYS)) {
+               int new_dwords = block->nreg_dirty;
+               uint32_t oldword, newword;
+               ctx->pm4_cdwords -= block->pm4_ndwords;
+               newword = oldword = ctx->pm4[ctx->pm4_cdwords];
+               newword &= PKT_COUNT_C;
+               newword |= PKT_COUNT_S(new_dwords);
+               ctx->pm4[ctx->pm4_cdwords] = newword;
+               ctx->pm4_cdwords += new_dwords + 2;
+       }
+out:
+       block->status ^= R600_BLOCK_STATUS_DIRTY;
+       block->nreg_dirty = 0;
+       LIST_DELINIT(&block->list);
+}
+
 void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw)
 {
        struct r600_bo *cb[8];
index b48287d7d14839d54b0d680b3d1a2134c4d4370f..ed0f3e584d3befdf1fbc48c2bdfb3b2735a3e7c3 100644 (file)
@@ -155,6 +155,13 @@ void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
 struct r600_bo *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);
 void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset);
+void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block);
+void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block,
+                             int dirty, int index);
+
+void r600_context_reg(struct r600_context *ctx,
+                     unsigned offset, unsigned value,
+                     unsigned mask);
 /*
  * r600_bo.c
  */
@@ -179,82 +186,6 @@ struct r600_bo *r600_bomgr_bo_create(struct r600_bomgr *mgr,
 #define CTX_RANGE_ID(ctx, offset) (((offset) >> (ctx)->hash_shift) & 255)
 #define CTX_BLOCK_ID(ctx, offset) ((offset) & ((1 << (ctx)->hash_shift) - 1))
 
-static void inline r600_context_reg(struct r600_context *ctx,
-                                       unsigned offset, unsigned value,
-                                       unsigned mask)
-{
-       struct r600_range *range;
-       struct r600_block *block;
-       unsigned id;
-
-       range = &ctx->range[CTX_RANGE_ID(ctx, offset)];
-       block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
-       id = (offset - block->start_offset) >> 2;
-       block->reg[id] &= ~mask;
-       block->reg[id] |= value;
-       if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
-               ctx->pm4_dirty_cdwords += block->pm4_ndwords;
-               block->status |= R600_BLOCK_STATUS_ENABLED;
-               block->status |= R600_BLOCK_STATUS_DIRTY;
-               LIST_ADDTAIL(&block->list,&ctx->dirty);
-       }
-}
-
-static inline void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block,
-                                           int dirty, int index)
-{
-       if (dirty && (index + 1) > block->nreg_dirty)
-               block->nreg_dirty = index + 1;
-
-       if ((dirty != (block->status & R600_BLOCK_STATUS_DIRTY)) || !(block->status & R600_BLOCK_STATUS_ENABLED)) {
-
-               block->status |= R600_BLOCK_STATUS_ENABLED;
-               block->status |= R600_BLOCK_STATUS_DIRTY;
-               ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
-               LIST_ADDTAIL(&block->list,&ctx->dirty);
-       }
-}
-
-static inline void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block)
-{
-       int id;
-
-       if (block->nreg_dirty == 0 && block->nbo == 0 && !(block->flags & REG_FLAG_DIRTY_ALWAYS)) {
-               goto out;
-       }
-
-       for (int j = 0; j < block->nreg; j++) {
-               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);
-               }
-       }
-       memcpy(&ctx->pm4[ctx->pm4_cdwords], block->pm4, block->pm4_ndwords * 4);
-       ctx->pm4_cdwords += block->pm4_ndwords;
-
-       if (block->nreg_dirty != block->nreg && block->nbo == 0 && !(block->flags & REG_FLAG_DIRTY_ALWAYS)) {
-               int new_dwords = block->nreg_dirty;
-               uint32_t oldword, newword;
-               ctx->pm4_cdwords -= block->pm4_ndwords;
-               newword = oldword = ctx->pm4[ctx->pm4_cdwords];
-               newword &= PKT_COUNT_C;
-               newword |= PKT_COUNT_S(new_dwords);
-               ctx->pm4[ctx->pm4_cdwords] = newword;
-               ctx->pm4_cdwords += new_dwords + 2;
-       }
-out:
-       block->status ^= R600_BLOCK_STATUS_DIRTY;
-       block->nreg_dirty = 0;
-       LIST_DELINIT(&block->list);
-}
-
 /*
  * radeon_bo.c
  */