diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-10-03 16:33:33 +0200 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-10-03 16:33:33 +0200 |
commit | 9460ea864b12ec1fbd11c5d9a20bb5a4279d9d3d (patch) | |
tree | f5064ca63804da4240b0363441cfc1d73ca703ad /src/radeon_exa.c | |
parent | aee6b6f2c120baf477b4845ddc1a94637c31db2f (diff) |
Fix KMS on big endian machines.
Requires at least xserver 1.7 to work properly.
Also make sure the front buffer is and stays tiled if colour tiling is enabled.
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r-- | src/radeon_exa.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c index 6cf9598b..99a93a4e 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -339,10 +339,18 @@ static void RADEONFinishAccess_BE(PixmapPtr pPix, int index) #ifdef XF86DRM_MODE Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index) { - ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum]; + ScreenPtr pScreen = pPix->drawable.pScreen; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; struct radeon_exa_pixmap_priv *driver_priv; int ret; +#if X_BYTE_ORDER == X_BIG_ENDIAN + /* May need to handle byte swapping in DownloadFrom/UploadToScreen */ + if (pPix->drawable.bitsPerPixel > 8 && + pPix != pScreen->GetScreenPixmap(pScreen)) + return FALSE; +#endif + driver_priv = exaGetPixmapDriverPrivate(pPix); if (!driver_priv) return FALSE; @@ -357,6 +365,7 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index) FatalError("failed to map pixmap %d\n", ret); return FALSE; } + driver_priv->bo_mapped = TRUE; pPix->devPrivate.ptr = driver_priv->bo->ptr; @@ -368,7 +377,7 @@ void RADEONFinishAccess_CS(PixmapPtr pPix, int index) struct radeon_exa_pixmap_priv *driver_priv; driver_priv = exaGetPixmapDriverPrivate(pPix); - if (!driver_priv) + if (!driver_priv || !driver_priv->bo_mapped) return; radeon_bo_unmap(driver_priv->bo); |