diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-11-17 17:32:41 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2010-11-17 17:32:41 -0500 |
commit | 3455a3b58532ea3ad901a317126968ab6cbb21b7 (patch) | |
tree | 716d9278bd1a0aa078100fc9293fa830272c9456 /src/radeon_exa.c | |
parent | beb7fecd0191e38fb238134ba612985062cf9770 (diff) |
radeon/kms: fix buffer base alignment for tiling
On r6xx+, 2D tiling can require larger than 4k base alignment.
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r-- | src/radeon_exa.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c index b62ff592..503d569b 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -429,7 +429,7 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height, ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; RADEONInfoPtr info = RADEONPTR(pScrn); struct radeon_exa_pixmap_priv *new_priv; - int pitch; + int pitch, base_align; uint32_t size; uint32_t tiling = 0; int cpp = bitsPerPixel / 8; @@ -462,7 +462,8 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height, } height = RADEON_ALIGN(height, drmmode_get_height_align(pScrn, tiling)); - pitch = RADEON_ALIGN(width * cpp, drmmode_get_pitch_align(pScrn, cpp, tiling)); + pitch = RADEON_ALIGN(width, drmmode_get_pitch_align(pScrn, cpp, tiling)) * cpp; + base_align = drmmode_get_base_align(pScrn, cpp, tiling); size = RADEON_ALIGN(height * pitch, RADEON_GPU_PAGE_SIZE); new_priv = calloc(1, sizeof(struct radeon_exa_pixmap_priv)); @@ -474,7 +475,7 @@ void *RADEONEXACreatePixmap2(ScreenPtr pScreen, int width, int height, *new_pitch = pitch; - new_priv->bo = radeon_bo_open(info->bufmgr, 0, size, 0, + new_priv->bo = radeon_bo_open(info->bufmgr, 0, size, base_align, RADEON_GEM_DOMAIN_VRAM, 0); if (!new_priv->bo) { free(new_priv); |