summaryrefslogtreecommitdiff
path: root/src/radeon_exa_funcs.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2011-04-04 17:37:12 +0200
committerMichel Dänzer <michel@daenzer.net>2011-04-05 14:13:08 +0200
commitcc7d1fa39da40a532fcdbe6c7924ca47a879e66a (patch)
treef820be4a92909a4324f3899c14dd4410b51c4dd2 /src/radeon_exa_funcs.c
parentf0b7d7b449cc77bb2b281d81108507f8bc2e6018 (diff)
EXA: Cache BO tiling flags.
Calling into the kernel every time is quite expensive, and nobody else should ever change the tiling flags. There's still more to do along the same lines for >= R6xx.
Diffstat (limited to 'src/radeon_exa_funcs.c')
-rw-r--r--src/radeon_exa_funcs.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index e8c55718..b6767f08 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -474,7 +474,6 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
Bool flush = TRUE;
Bool r;
int i;
- uint32_t tiling_flags = 0, pitch = 0;
if (bpp < 8)
return FALSE;
@@ -483,10 +482,6 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
if (!driver_priv || !driver_priv->bo)
return FALSE;
- ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
- if (ret)
- ErrorF("radeon_bo_get_tiling failed\n");
-
#if X_BYTE_ORDER == X_BIG_ENDIAN
switch (bpp) {
case 32:
@@ -501,7 +496,7 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
/* If we know the BO won't be busy, don't bother with a scratch */
copy_dst = driver_priv->bo;
copy_pitch = pDst->devKind;
- if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+ if (!(driver_priv->tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
flush = FALSE;
if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
@@ -580,7 +575,6 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
int ret;
Bool flush = FALSE;
Bool r;
- uint32_t tiling_flags = 0, pitch = 0;
if (bpp < 8)
return FALSE;
@@ -589,10 +583,6 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
if (!driver_priv || !driver_priv->bo)
return FALSE;
- ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
- if (ret)
- ErrorF("radeon_bo_get_tiling failed\n");
-
#if X_BYTE_ORDER == X_BIG_ENDIAN
switch (bpp) {
case 32:
@@ -607,7 +597,7 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
/* If we know the BO won't end up in VRAM anyway, don't bother with a scratch */
copy_src = driver_priv->bo;
copy_pitch = pSrc->devKind;
- if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+ if (!(driver_priv->tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
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)) ==