diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-01-21 17:30:28 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2011-01-21 17:30:28 -0500 |
commit | fadee0409a8e13b78bbccb83dd70f590fee23d57 (patch) | |
tree | ed112884fc3b212718ecb544cbde5b1d90d086ef /src/radeon_vbo.h | |
parent | af7d81625a8cf873e6efc881489b3eda9861bd03 (diff) |
vbo: balance radeon_vbo_get() and radeon_vbo_put()
bo_ref() and bo_map() in radeon_vbo_get()
bo_unmap() and bo_unref() in radeon_vbo_put()
rather than doing the bo_map() separately in
radeon_vbo_space().
Diffstat (limited to 'src/radeon_vbo.h')
-rw-r--r-- | src/radeon_vbo.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/radeon_vbo.h b/src/radeon_vbo.h index f64930e2..583f2626 100644 --- a/src/radeon_vbo.h +++ b/src/radeon_vbo.h @@ -35,19 +35,9 @@ radeon_vbo_space(ScrnInfoPtr pScrn, vbo->vb_op_vert_size = vert_size; #if defined(XF86DRM_MODE) - if (info->cs) { - int ret; - struct radeon_bo *bo = vbo->vb_bo; - - if (!bo->ptr) { - ret = radeon_bo_map(bo, 1); - if (ret) { - FatalError("Failed to map vb %d\n", ret); - return NULL; - } - } - vb = (pointer)((char *)bo->ptr + vbo->vb_offset); - } else + if (info->cs) + vb = (pointer)((char *)vbo->vb_bo->ptr + vbo->vb_offset); + else #endif vb = (pointer)((char *)vbo->vb_ptr + vbo->vb_offset); return vb; |