diff --git a/src/radeon_kms.c b/src/radeon_kms.c index fbdb530..1740290 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -85,13 +85,13 @@ void radeon_cs_flush_indirect(ScrnInfoPtr pScrn) return; /* release the current VBO so we don't block on mapping it later */ - if (info->accel_state->vbo.vb_offset && info->accel_state->vbo.vb_bo) { + if (info->accel_state->vbo.vb_bo) { radeon_vbo_put(pScrn, &info->accel_state->vbo); info->accel_state->vbo.vb_start_op = -1; } /* release the current VBO so we don't block on mapping it later */ - if (info->accel_state->cbuf.vb_offset && info->accel_state->cbuf.vb_bo) { + if (info->accel_state->cbuf.vb_bo) { radeon_vbo_put(pScrn, &info->accel_state->cbuf); info->accel_state->cbuf.vb_start_op = -1; } @@ -103,19 +103,11 @@ void radeon_cs_flush_indirect(ScrnInfoPtr pScrn) radeon_vbo_flush_bos(pScrn); ret = radeon_cs_space_check_with_bo(info->cs, - accel_state->vbo.vb_bo, + NULL, RADEON_GEM_DOMAIN_GTT, 0); if (ret) ErrorF("space check failed in flush\n"); - if (accel_state->cbuf.vb_bo) { - ret = radeon_cs_space_check_with_bo(info->cs, - accel_state->cbuf.vb_bo, - RADEON_GEM_DOMAIN_GTT, 0); - if (ret) - ErrorF("space check failed in flush\n"); - } - if (info->reemit_current2d && info->state_2d.op) info->reemit_current2d(pScrn, info->state_2d.op); diff --git a/src/radeon_vbo.c b/src/radeon_vbo.c index a72224f..767bb98 100644 --- a/src/radeon_vbo.c +++ b/src/radeon_vbo.c @@ -136,6 +136,11 @@ void radeon_vbo_flush_bos(ScrnInfoPtr pScrn) if (!radeon_bo_is_idle(dma_bo->bo)) continue; + if (dma_bo->bo->ptr) { + ErrorF("bo with pointer on wait list!\n"); + continue; + } + remove_from_list(dma_bo); dma_bo->expire_counter = expire_at; insert_at_tail(&accel_state->bo_free, dma_bo); @@ -191,17 +196,17 @@ again_alloc: insert_at_head(&accel_state->bo_reserved, dma_bo); } + if (is_empty_list(&accel_state->bo_reserved)) + goto again_alloc; + + bo = first_elem(&accel_state->bo_reserved)->bo; + /* need a space check */ if (radeon_cs_space_check_with_bo(info->cs, - first_elem(&accel_state->bo_reserved)->bo, + bo, RADEON_GEM_DOMAIN_GTT, 0)) - fprintf(stderr,"failed to revalidated\n"); + ErrorF("failed to revalidate\n"); - if (is_empty_list(&accel_state->bo_reserved)) { - goto again_alloc; - } - - bo = first_elem(&accel_state->bo_reserved)->bo; return bo; }