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.h3
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_buffer.c20
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_r300.c5
3 files changed, 21 insertions, 7 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_buffer.h b/src/gallium/winsys/radeon/drm/radeon_buffer.h
index 8782d675df2..b48b6358e01 100644
--- a/src/gallium/winsys/radeon/drm/radeon_buffer.h
+++ b/src/gallium/winsys/radeon/drm/radeon_buffer.h
@@ -86,5 +86,6 @@ void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr);
boolean radeon_drm_bufmgr_get_handle(struct pb_buffer *_buf,
struct winsys_handle *whandle);
-boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf);
+boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf,
+ enum r300_reference_domain domain);
#endif
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
index c9179a3620a..9824ada5b33 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
@@ -381,13 +381,25 @@ void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf,
}
}
-boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf)
+boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf,
+ enum r300_reference_domain domain)
{
struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
- uint32_t domain;
+ uint32_t tmp;
+
+ if (domain & R300_REF_CS) {
+ if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs)) {
+ return TRUE;
+ }
+ }
+
+ if (domain & R300_REF_HW) {
+ if (radeon_bo_is_busy(buf->bo, &tmp)) {
+ return TRUE;
+ }
+ }
- return (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs) ||
- radeon_bo_is_busy(buf->bo, &domain));
+ return FALSE;
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index d1e65f87c36..2fcf7cf9821 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -111,11 +111,12 @@ static void radeon_r300_winsys_buffer_reference(struct r300_winsys_screen *rws,
}
static boolean radeon_r300_winsys_is_buffer_referenced(struct r300_winsys_screen *rws,
- struct r300_winsys_buffer *buf)
+ struct r300_winsys_buffer *buf,
+ enum r300_reference_domain domain)
{
struct pb_buffer *_buf = radeon_pb_buffer(buf);
- return radeon_drm_bufmgr_is_buffer_referenced(_buf);
+ return radeon_drm_bufmgr_is_buffer_referenced(_buf, domain);
}
static struct r300_winsys_buffer *radeon_r300_winsys_buffer_from_handle(struct r300_winsys_screen *rws,