diff options
author | Dave Airlie <[email protected]> | 2011-06-07 15:40:20 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-06-08 11:47:01 +1000 |
commit | 745abb53cf3f97600eed2e27361b82eb9727c41d (patch) | |
tree | d884a63ded56df4915ca2c74bcd909fed4705703 | |
parent | e66053d01c011e3bdcf1cdab8ea9224b868ae246 (diff) |
r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_hw_context.c | 13 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_priv.h | 16 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 7386c002659..1d398bf9d7a 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -949,16 +949,9 @@ void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags, bo->last_flush = (bo->last_flush | flush_flags) & flush_mask; } -void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *rbo) +void r600_context_get_reloc(struct r600_context *ctx, struct r600_bo *rbo) { - struct radeon_bo *bo; - - bo = rbo->bo; - assert(bo != NULL); - if (bo->reloc) { - *pm4 = bo->reloc_id; - return; - } + struct radeon_bo *bo = rbo->bo; bo->reloc = &ctx->reloc[ctx->creloc]; bo->reloc_id = ctx->creloc * sizeof(struct r600_reloc) / 4; ctx->reloc[ctx->creloc].handle = bo->handle; @@ -968,8 +961,6 @@ void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *r radeon_bo_reference(ctx->radeon, &ctx->bo[ctx->creloc], bo); rbo->fence = ctx->radeon->fence; ctx->creloc++; - /* set PKT3 to point to proper reloc */ - *pm4 = bo->reloc_id; } void r600_context_reg(struct r600_context *ctx, diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index 16deab60c96..082370ae106 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -156,7 +156,7 @@ int radeon_bo_fixed_map(struct radeon *radeon, struct radeon_bo *bo); * r600_hw_context.c */ int r600_context_init_fence(struct r600_context *ctx); -void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *rbo); +void r600_context_get_reloc(struct r600_context *ctx, struct r600_bo *rbo); void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags, unsigned flush_mask, struct r600_bo *rbo); struct r600_bo *r600_context_reg_bo(struct r600_context *ctx, unsigned offset); @@ -173,6 +173,20 @@ void r600_context_reg(struct r600_context *ctx, unsigned mask); void r600_init_cs(struct r600_context *ctx); int r600_resource_init(struct r600_context *ctx, struct r600_range *range, unsigned offset, unsigned nblocks, unsigned stride, struct r600_reg *reg, int nreg, unsigned offset_base); + +static INLINE void r600_context_bo_reloc(struct r600_context *ctx, u32 *pm4, struct r600_bo *rbo) +{ + struct radeon_bo *bo = rbo->bo; + + assert(bo != NULL); + + if (!bo->reloc) + r600_context_get_reloc(ctx, rbo); + + /* set PKT3 to point to proper reloc */ + *pm4 = bo->reloc_id; +} + /* * r600_bo.c */ |