summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_dma.c
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2009-08-20 17:57:37 +0300
committerPauli Nieminen <suokkos@gmail.com>2009-08-23 13:39:32 +0300
commit66bbafb6f9d44da3baddac6d948ba361182dde2a (patch)
treeaf8dab98c577b013f422290f65eb2730d4f5ffe8 /src/mesa/drivers/dri/radeon/radeon_dma.c
parentbf6d0ae5980a48b24ace49030eca221dcbec163f (diff)
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 <suokkos@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_dma.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_dma.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c
index 7e6b74add8..a1835427f1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_dma.c
+++ b/src/mesa/drivers/dri/radeon/radeon_dma.c
@@ -30,6 +30,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
+#include <errno.h>
#include "radeon_common.h"
#include "main/simple_list.h"
@@ -302,7 +303,13 @@ void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes)
static int radeon_bo_is_idle(struct radeon_bo* bo)
{
- return bo->cref == 1;
+ uint32_t domain;
+ int ret = radeon_bo_is_busy(bo, &domain);
+ if (ret == -EINVAL) {
+ WARN_ONCE("Your libdrm or kernel doesn't have support for busy query.\n"
+ "This may cause small performance drop for you.\n");
+ }
+ return ret != -EBUSY;
}
void radeonReleaseDmaRegions(radeonContextPtr rmesa)