summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-12-17 14:30:23 +1000
committerDave Airlie <airlied@redhat.com>2009-12-21 08:06:21 +1000
commit4b05c47ac657f9a93d76221269761ed64c81f716 (patch)
treefd2f017a2234011cca93cc9d2cbbe216991ff909 /src
parent1d620800bd79290967fa487decf798e318c45f25 (diff)
radeon: use new libdrm api
Diffstat (limited to 'src')
-rw-r--r--src/r600_exa.c9
-rw-r--r--src/radeon_exa.c3
-rw-r--r--src/radeon_exa_funcs.c9
3 files changed, 8 insertions, 13 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 634e6cac..6a132bb5 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -2027,7 +2027,7 @@ R600UploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
driver_priv = exaGetPixmapDriverPrivate(pDst);
/* If we know the BO won't be busy, don't bother */
- if (driver_priv->bo->cref == 1 &&
+ if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs) &&
!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
return FALSE;
@@ -2097,11 +2097,8 @@ R600DownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
driver_priv = exaGetPixmapDriverPrivate(pSrc);
/* If we know the BO won't end up in VRAM anyway, don't bother */
- if (driver_priv->bo->cref > 1) {
- src_domain = driver_priv->bo->space_accounted & 0xffff;
- if (!src_domain)
- src_domain = driver_priv->bo->space_accounted >> 16;
-
+ if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+ src_domain = radeon_bo_get_src_domain(driver_priv->bo);
if ((src_domain & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM)) ==
(RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM))
src_domain = 0;
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index bff6ec05..97733c3b 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -341,6 +341,7 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_exa_pixmap_priv *driver_priv;
int ret;
@@ -356,7 +357,7 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
return FALSE;
/* if we have more refs than just the BO then flush */
- if (driver_priv->bo->cref > 1)
+ if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs))
radeon_cs_flush_indirect(pScrn);
/* flush IB */
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index 61c7427d..6d2522a6 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -484,7 +484,7 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
#endif
/* If we know the BO won't be busy, don't bother */
- if (driver_priv->bo->cref == 1 &&
+ if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs) &&
!radeon_bo_is_busy(driver_priv->bo, &dst_domain)) {
#if X_BYTE_ORDER == X_BIG_ENDIAN
/* Can't return FALSE here if we need to swap bytes */
@@ -582,11 +582,8 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
#endif
/* If we know the BO won't end up in VRAM anyway, don't bother */
- if (driver_priv->bo->cref > 1) {
- src_domain = driver_priv->bo->space_accounted & 0xffff;
- if (!src_domain)
- src_domain = driver_priv->bo->space_accounted >> 16;
-
+ if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+ src_domain = radeon_bo_get_src_domain(driver_priv->bo);
if ((src_domain & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM)) ==
(RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM))
src_domain = 0;