diff options
author | Dave Airlie <airlied@redhat.com> | 2010-03-21 18:25:31 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-03-21 19:39:28 +1000 |
commit | ff1c7baad241dd722341023806e00a07606de206 (patch) | |
tree | c28ddc5c0fe705546ffa6ae3c29922a2a72e2272 /src/gallium/winsys/drm/radeon/core/radeon_r300.c | |
parent | 0dab3189e1d100a9a2487f7aff45589b423c386c (diff) |
r300g: add bufmgr cached for vertex/index buffers.
This adds the cached bufmgr for vertex/index buffers on top of the kernel
manager.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/gallium/winsys/drm/radeon/core/radeon_r300.c')
-rw-r--r-- | src/gallium/winsys/drm/radeon/core/radeon_r300.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index 5b82a776a8..62d66d31dc 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -44,6 +44,9 @@ radeon_r300_winsys_buffer_create(struct r300_winsys_screen *rws, if (usage & PIPE_BUFFER_USAGE_CONSTANT) provider = ws->mman; + else if ((usage & PIPE_BUFFER_USAGE_VERTEX) || + (usage & PIPE_BUFFER_USAGE_INDEX)) + provider = ws->cman; else provider = ws->kman; buffer = provider->create_buffer(provider, size, &desc); @@ -260,6 +263,7 @@ radeon_winsys_destroy(struct r300_winsys_screen *rws) struct radeon_libdrm_winsys *ws = (struct radeon_libdrm_winsys *)rws; radeon_cs_destroy(ws->cs); + ws->cman->destroy(ws->cman); ws->kman->destroy(ws->kman); ws->mman->destroy(ws->mman); @@ -281,6 +285,10 @@ radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws) if (!ws->kman) goto fail; + ws->cman = pb_cache_manager_create(ws->kman, 100000); + if (!ws->cman) + goto fail; + ws->mman = pb_malloc_bufmgr_create(); if (!ws->mman) goto fail; @@ -325,7 +333,8 @@ fail: if (ws->bom) radeon_bo_manager_gem_dtor(ws->bom); - + if (ws->cman) + ws->cman->destroy(ws->cman); if (ws->kman) ws->kman->destroy(ws->kman); if (ws->mman) |