diff options
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm.h | 16 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_buffer.c | 24 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_r300.c | 6 |
3 files changed, 17 insertions, 29 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm.h b/src/gallium/winsys/radeon/drm/radeon_drm.h index 2dc077c0521..78451b6f011 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm.h @@ -37,22 +37,6 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, struct drm_create_screen_arg *arg); -boolean radeon_buffer_from_texture(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride); - -boolean radeon_handle_from_buffer(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_buffer* buffer, - unsigned* handle); - -boolean radeon_global_handle_from_buffer(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_buffer* buffer, - unsigned* handle); - void radeon_destroy_drm_api(struct drm_api* api); /* Guess at whether this chipset should use r300g. diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c index 5fd20cc7754..c9179a3620a 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c @@ -72,9 +72,9 @@ radeon_drm_buffer_map(struct pb_buffer *_buf, struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); int write = 0; - if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { - if ((_buf->base.usage & PIPE_BUFFER_USAGE_VERTEX) || - (_buf->base.usage & PIPE_BUFFER_USAGE_INDEX)) + if (flags & PIPE_TRANSFER_DONTBLOCK) { + if ((_buf->base.usage & PIPE_BIND_VERTEX_BUFFER) || + (_buf->base.usage & PIPE_BIND_INDEX_BUFFER)) if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs)) return NULL; } @@ -82,7 +82,7 @@ radeon_drm_buffer_map(struct pb_buffer *_buf, if (buf->bo->ptr != NULL) return buf->bo->ptr; - if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { + if (flags & PIPE_TRANSFER_DONTBLOCK) { uint32_t domain; if (radeon_bo_is_busy(buf->bo, &domain)) return NULL; @@ -92,7 +92,7 @@ radeon_drm_buffer_map(struct pb_buffer *_buf, buf->mgr->rws->flush_cb(buf->mgr->rws->flush_data); } - if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { + if (flags & PIPE_TRANSFER_WRITE) { write = 1; } @@ -148,16 +148,20 @@ static uint32_t radeon_domain_from_usage(unsigned usage) { uint32_t domain = 0; - if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) { + if (usage & PIPE_BIND_RENDER_TARGET) { domain |= RADEON_GEM_DOMAIN_VRAM; } - if (usage & PIPE_BUFFER_USAGE_PIXEL) { + if (usage & PIPE_BIND_DEPTH_STENCIL) { domain |= RADEON_GEM_DOMAIN_VRAM; } - if (usage & PIPE_BUFFER_USAGE_VERTEX) { + if (usage & PIPE_BIND_SAMPLER_VIEW) { + domain |= RADEON_GEM_DOMAIN_VRAM; + } + /* also need BIND_BLIT_SOURCE/DESTINATION ? */ + if (usage & PIPE_BIND_VERTEX_BUFFER) { domain |= RADEON_GEM_DOMAIN_GTT; } - if (usage & PIPE_BUFFER_USAGE_INDEX) { + if (usage & PIPE_BIND_INDEX_BUFFER) { domain |= RADEON_GEM_DOMAIN_GTT; } @@ -187,7 +191,7 @@ struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager pipe_reference_init(&buf->base.base.reference, 1); buf->base.base.alignment = 0; - buf->base.base.usage = PIPE_BUFFER_USAGE_PIXEL; + buf->base.base.usage = PIPE_BIND_SAMPLER_VIEW; buf->base.base.size = 0; buf->base.vtbl = &radeon_drm_buffer_vtbl; buf->mgr = mgr; diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c index 935c1d84d02..735b93bc779 100644 --- a/src/gallium/winsys/radeon/drm/radeon_r300.c +++ b/src/gallium/winsys/radeon/drm/radeon_r300.c @@ -42,10 +42,10 @@ radeon_r300_winsys_buffer_create(struct r300_winsys_screen *rws, desc.alignment = alignment; desc.usage = usage; - if (usage & PIPE_BUFFER_USAGE_CONSTANT) + if (usage & PIPE_BIND_CONSTANT_BUFFER) provider = ws->mman; - else if ((usage & PIPE_BUFFER_USAGE_VERTEX) || - (usage & PIPE_BUFFER_USAGE_INDEX)) + else if ((usage & PIPE_BIND_VERTEX_BUFFER) || + (usage & PIPE_BIND_INDEX_BUFFER)) provider = ws->cman; else provider = ws->kman; |