diff options
author | Dave Airlie <airlied@redhat.com> | 2009-11-20 09:23:31 +1000 |
---|---|---|
committer | Dave Airlie <airlied@itt42.(none)> | 2009-11-20 10:15:00 +1000 |
commit | eb9bc133fc426e67b397e661bfd22bf62009d9d3 (patch) | |
tree | 1761fdfecb03962f078c594cad757ce601fc32f2 /src/radeon_kms.c | |
parent | f7f58ef4c042e492618665a6c5555e8e67387ab3 (diff) |
kms: recalculate the flush limits after screen resize.
When we resize the front buffer we need to reduce the flush limits
appropriately.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 8e46a8a2..5a4255f9 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -946,13 +946,31 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Front buffer size: %dK\n", info->front_bo->size/1024); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Remaining VRAM size (used for pixmaps): %dK\n", remain_size_bytes/1024); + radeon_kms_update_vram_limit(pScrn, screen_size); + return TRUE; +} - /* set the emit limit at 90% of VRAM */ - remain_size_bytes = (remain_size_bytes / 10) * 9; +void radeon_kms_update_vram_limit(ScrnInfoPtr pScrn, int new_fb_size) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + RADEONInfoPtr info = RADEONPTR(pScrn); + int remain_size_bytes; + int total_size_bytes; + int c; + for (c = 0; c < xf86_config->num_crtc; c++) { + if (info->cursor_bo[c] != NULL) { + total_size_bytes += (64 * 4 * 64); + } + } + + total_size_bytes += new_fb_size; + remain_size_bytes = info->vram_size - new_fb_size; + remain_size_bytes = (remain_size_bytes / 10) * 9; radeon_cs_set_limit(info->cs, RADEON_GEM_DOMAIN_VRAM, remain_size_bytes); - return TRUE; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VRAM usage limit set to %dK\n", remain_size_bytes / 1024); } + #endif |