summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_buffer.h6
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_buffer.c28
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_r300.c8
3 files changed, 31 insertions, 11 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_buffer.h b/src/gallium/winsys/radeon/drm/radeon_buffer.h
index da13e4d36a4..73cb6a579b4 100644
--- a/src/gallium/winsys/radeon/drm/radeon_buffer.h
+++ b/src/gallium/winsys/radeon/drm/radeon_buffer.h
@@ -64,11 +64,13 @@ struct pb_manager *
radeon_drm_bufmgr_create(struct radeon_libdrm_winsys *rws);
boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf,
- uint32_t rd, uint32_t wd);
+ enum r300_buffer_domain rd,
+ enum r300_buffer_domain wd);
void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf,
- uint32_t rd, uint32_t wd,
+ enum r300_buffer_domain rd,
+ enum r300_buffer_domain wd,
uint32_t flags);
struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr,
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
index efe82026b43..ee1b9ede257 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
@@ -339,27 +339,45 @@ void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
}
}
+static uint32_t gem_domain(enum r300_buffer_domain dom)
+{
+ uint32_t res = 0;
+
+ if (dom & R300_DOMAIN_GTT)
+ res |= RADEON_GEM_DOMAIN_GTT;
+ if (dom & R300_DOMAIN_VRAM)
+ res |= RADEON_GEM_DOMAIN_VRAM;
+ return res;
+}
+
boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf,
- uint32_t rd, uint32_t wd)
+ enum r300_buffer_domain rd,
+ enum r300_buffer_domain wd)
{
struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
+ uint32_t gem_rd = gem_domain(rd);
+ uint32_t gem_wd = gem_domain(wd);
+
radeon_cs_space_add_persistent_bo(buf->mgr->rws->cs, buf->bo,
- rd, wd);
+ gem_rd, gem_wd);
return TRUE;
}
void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf,
- uint32_t rd, uint32_t wd,
+ enum r300_buffer_domain rd,
+ enum r300_buffer_domain wd,
uint32_t flags)
{
struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
int retval;
+ uint32_t gem_rd = gem_domain(rd);
+ uint32_t gem_wd = gem_domain(wd);
retval = radeon_cs_write_reloc(buf->mgr->rws->cs,
- buf->bo, rd, wd, flags);
+ buf->bo, gem_rd, gem_wd, flags);
if (retval) {
debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n",
- buf, rd, wd, flags);
+ buf, gem_rd, gem_wd, flags);
}
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index 4cf21ff72bf..70ae01a694b 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -173,8 +173,8 @@ static void radeon_set_flush_cb(struct r300_winsys_screen *rws,
static boolean radeon_add_buffer(struct r300_winsys_screen *rws,
struct r300_winsys_buffer *buf,
- uint32_t rd,
- uint32_t wd)
+ enum r300_buffer_domain rd,
+ enum r300_buffer_domain wd)
{
struct pb_buffer *_buf = radeon_pb_buffer(buf);
@@ -229,8 +229,8 @@ static void radeon_write_cs_table(struct r300_winsys_screen *rws,
static void radeon_write_cs_reloc(struct r300_winsys_screen *rws,
struct r300_winsys_buffer *buf,
- uint32_t rd,
- uint32_t wd,
+ enum r300_buffer_domain rd,
+ enum r300_buffer_domain wd,
uint32_t flags)
{
struct pb_buffer *_buf = radeon_pb_buffer(buf);