diff options
author | Michel Dänzer <daenzer@vmware.com> | 2011-04-04 17:37:12 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2011-04-05 14:13:08 +0200 |
commit | cc7d1fa39da40a532fcdbe6c7924ca47a879e66a (patch) | |
tree | f820be4a92909a4324f3899c14dd4410b51c4dd2 /src/radeon_exa.c | |
parent | f0b7d7b449cc77bb2b281d81108507f8bc2e6018 (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.c')
-rw-r--r-- | src/radeon_exa.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 1c647b94..c11c938a 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -130,6 +130,13 @@ static Bool RADEONPixmapIsColortiled(PixmapPtr pPix) { RINFO_FROM_SCREEN(pPix->drawable.pScreen); +#ifdef XF86DRM_MODE + if (info->cs) { + /* Taken care of by the kernel relocation handling */ + return FALSE; + } +#endif + /* This doesn't account for the back buffer, which we may want to wrap in * a pixmap at some point for the purposes of DRI buffer moves. */ @@ -308,7 +315,6 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index) #endif Bool flush = FALSE; int ret; - uint32_t tiling_flags = 0, pitch = 0; #if X_BYTE_ORDER == X_BIG_ENDIAN /* May need to handle byte swapping in DownloadFrom/UploadToScreen */ @@ -320,12 +326,8 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index) if (!driver_priv) return FALSE; - /* check if we are tiled */ - ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch); - if (ret) - return FALSE; /* untile in DFS/UTS */ - if (tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO)) + if (driver_priv->tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO)) return FALSE; /* if we have more refs than just the BO then flush */ @@ -505,8 +507,8 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height, return NULL; } - if (tiling) - radeon_bo_set_tiling(new_priv->bo, tiling, *new_pitch); + if (tiling && !radeon_bo_set_tiling(new_priv->bo, tiling, *new_pitch)) + new_priv->tiling_flags = tiling; return new_priv; } @@ -536,11 +538,15 @@ void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo) driver_priv = exaGetPixmapDriverPrivate(pPix); if (driver_priv) { + uint32_t pitch; + if (driver_priv->bo) radeon_bo_unref(driver_priv->bo); radeon_bo_ref(bo); driver_priv->bo = bo; + + radeon_bo_get_tiling(bo, &driver_priv->tiling_flags, &pitch); } } |