diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-10-27 12:37:42 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2010-10-27 12:40:48 -0400 |
commit | f07f9b7b61c05f2de1d61bb0e2f71bd017c8d36a (patch) | |
tree | f7091c76b5e6e7e08d9dcfffafa109847776a86c /src/radeon_kms.c | |
parent | d31046ba6c8eee9b7decc3875697d37c38bc38f3 (diff) |
kms/radeon: unify fb bo alignment handling
Previously there were 3 different paths with what should
have had duplicated code:
- EXACreatePixmap2
- Initial front buffer creation
- Randr resize
This patch attempts to unify the alignment across all 3.
This may fix tiling issues in some cases and should make
buffer pitches match for pageflipping.
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index b94544e8..e2406075 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1088,8 +1088,9 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int cpp = info->CurrentLayout.pixel_bytes; int screen_size; - int stride = pScrn->displayWidth * cpp; + int stride; int total_size_bytes = 0, remain_size_bytes; + uint32_t tiling_flags = 0; if (info->accel_state->exa != NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, "Memory map already initialized\n"); @@ -1101,7 +1102,13 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) return FALSE; } - screen_size = RADEON_ALIGN(pScrn->virtualY, 16) * stride; + /* no tiled scanout on r6xx+ yet */ + if (info->allowColorTiling) { + if (info->ChipFamily < CHIP_FAMILY_R600) + tiling_flags |= RADEON_TILING_MACRO; + } + stride = RADEON_ALIGN(pScrn->displayWidth * cpp, drmmode_get_pitch_align(pScrn, cpp, tiling_flags)); + screen_size = RADEON_ALIGN(pScrn->virtualY, drmmode_get_height_align(pScrn, tiling_flags)) * stride; { int cursor_size = 64 * 4 * 64; int c; @@ -1142,8 +1149,6 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) info->dri->textureSize = 0; if (info->front_bo == NULL) { - uint32_t tiling_flags = 0; - info->front_bo = radeon_bo_open(info->bufmgr, 0, screen_size, 0, RADEON_GEM_DOMAIN_VRAM, 0); if (info->r600_shadow_fb == TRUE) { @@ -1151,11 +1156,6 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) ErrorF("Failed to map cursor buffer memory\n"); } } - /* no tiled scanout on r6xx+ yet */ - if (info->allowColorTiling) { - if (info->ChipFamily < CHIP_FAMILY_R600) - tiling_flags |= RADEON_TILING_MACRO; - } #if X_BYTE_ORDER == X_BIG_ENDIAN switch (cpp) { case 4: |