From 66bbafb6f9d44da3baddac6d948ba361182dde2a Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Thu, 20 Aug 2009 17:57:37 +0300 Subject: radeon: Check from kernel if dma buffer is idle. This makes sure that objects are leaving wait list only when they are processed by gpu. Signed-off-by: Pauli Nieminen --- src/mesa/drivers/dri/radeon/radeon_bo_legacy.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/drivers/dri/radeon/radeon_bo_legacy.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index b1cc155f71a..a10c6b73abc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -542,6 +542,18 @@ static int bo_unmap(struct radeon_bo *bo) return 0; } +static int bo_is_busy(struct radeon_bo *bo, uint32_t *domain) +{ + *domain = 0; + if (bo->domains & RADEON_GEM_DOMAIN_GTT) + *domain = RADEON_GEM_DOMAIN_GTT; + else + *domain = RADEON_GEM_DOMAIN_CPU; + if (legacy_is_pending(bo)) + return -EBUSY; + else + return 0; +} static int bo_is_static(struct radeon_bo *bo) { @@ -559,6 +571,7 @@ static struct radeon_bo_funcs bo_legacy_funcs = { bo_is_static, NULL, NULL, + bo_is_busy }; static int bo_vram_validate(struct radeon_bo *bo, -- cgit v1.2.3