diff options
author | Chia-I Wu <[email protected]> | 2015-06-23 23:59:31 -0600 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2015-06-26 13:45:27 +0800 |
commit | 36d107e92cc4c1d2b60e0017dbe998af3a2e8b75 (patch) | |
tree | 6e99dec878e136e59116dd69626bceea5a6c1f30 /src/gallium/drivers/ilo/ilo_draw.c | |
parent | fbba25bba017b3dde5f6613698004b0086bdea00 (diff) |
ilo: introduce ilo_vma
This cleans up the code a bit and makes ilo_state_vector_resource_renamed()
simpler and more robust. It also allows a single bo to back mulitple VMAs.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_draw.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_draw.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/ilo/ilo_draw.c b/src/gallium/drivers/ilo/ilo_draw.c index e8e1a4cd14c..433348d9326 100644 --- a/src/gallium/drivers/ilo/ilo_draw.c +++ b/src/gallium/drivers/ilo/ilo_draw.c @@ -444,6 +444,7 @@ draw_vbo_with_sw_restart(struct ilo_context *ilo, const struct pipe_draw_info *info) { const struct ilo_ib_state *ib = &ilo->state_vector.ib; + const struct ilo_vma *vma; union { const void *ptr; const uint8_t *u8; @@ -453,10 +454,12 @@ draw_vbo_with_sw_restart(struct ilo_context *ilo, /* we will draw with IB mapped */ if (ib->state.buffer) { - u.ptr = intel_bo_map(ilo_buffer(ib->state.buffer)->bo, false); + vma = ilo_resource_get_vma(ib->state.buffer); + u.ptr = intel_bo_map(vma->bo, false); if (u.ptr) - u.u8 += ib->state.offset; + u.u8 += vma->bo_offset + ib->state.offset; } else { + vma = NULL; u.ptr = ib->state.user_buffer; } @@ -500,8 +503,8 @@ draw_vbo_with_sw_restart(struct ilo_context *ilo, #undef DRAW_VBO_WITH_SW_RESTART - if (ib->state.buffer) - intel_bo_unmap(ilo_buffer(ib->state.buffer)->bo); + if (vma) + intel_bo_unmap(vma->bo); } static bool |