diff options
author | Jerome Glisse <[email protected]> | 2010-10-04 10:25:23 -0400 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2010-10-04 17:25:19 -0400 |
commit | d22a1247d8a709cf433a6dd99b2f87a224c27d88 (patch) | |
tree | 38edcaecaa9df68ed964639d71cf036196a3b731 /src/gallium/winsys | |
parent | 294c9fce1b924beddf198a3cce738b88eabb5537 (diff) |
r600g: allow r600_bo to be a sub allocation of a big bo
Add bo offset everywhere needed if r600_bo is ever a sub bo
of a bigger bo.
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/r600/drm/evergreen_hw_context.c | 2 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_hw_context.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/winsys/r600/drm/evergreen_hw_context.c b/src/gallium/winsys/r600/drm/evergreen_hw_context.c index fadfe286921..f51b14e48ec 100644 --- a/src/gallium/winsys/r600/drm/evergreen_hw_context.c +++ b/src/gallium/winsys/r600/drm/evergreen_hw_context.c @@ -817,7 +817,7 @@ void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *dr ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_num_instances; if (draw->indices) { ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_DRAW_INDEX, 3); - ctx->pm4[ctx->pm4_cdwords++] = draw->indices_bo_offset; + ctx->pm4[ctx->pm4_cdwords++] = draw->indices_bo_offset + r600_bo_offset(draw->indices); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_num_indices; ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_draw_initiator; diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 48727b9e6bc..61e3fbcc9ab 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -967,7 +967,7 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw) ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_num_instances; if (draw->indices) { ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_DRAW_INDEX, 3); - ctx->pm4[ctx->pm4_cdwords++] = draw->indices_bo_offset; + ctx->pm4[ctx->pm4_cdwords++] = draw->indices_bo_offset + r600_bo_offset(draw->indices); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_num_indices; ctx->pm4[ctx->pm4_cdwords++] = draw->vgt_draw_initiator; @@ -1180,7 +1180,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query) /* emit begin query */ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2); ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE; - ctx->pm4[ctx->pm4_cdwords++] = query->num_results; + ctx->pm4[ctx->pm4_cdwords++] = query->num_results + r600_bo_offset(query->buffer); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0); ctx->pm4[ctx->pm4_cdwords++] = 0; @@ -1196,7 +1196,7 @@ void r600_query_end(struct r600_context *ctx, struct r600_query *query) /* emit begin query */ ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_EVENT_WRITE, 2); ctx->pm4[ctx->pm4_cdwords++] = EVENT_TYPE_ZPASS_DONE; - ctx->pm4[ctx->pm4_cdwords++] = query->num_results + 8; + ctx->pm4[ctx->pm4_cdwords++] = query->num_results + 8 + r600_bo_offset(query->buffer); ctx->pm4[ctx->pm4_cdwords++] = 0; ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0); ctx->pm4[ctx->pm4_cdwords++] = 0; |