From 2afc46fa74ce7730f766a3370d323c6b59694186 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Thu, 23 Jul 2009 20:13:15 +0200 Subject: radeon: fix KMS shadowfb for r6xx and newer hw. We need to map front buffer and also to avoid EXA initialization when falling back to shadowfb on newer r6xx/r7xx when KMS is enabled. --- src/radeon_kms.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 8a14f881..148386b1 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -543,7 +543,9 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen, pScrn->defaultVisual)) return FALSE; miSetPixmapDepths (); - info->directRenderingEnabled = radeon_dri2_screen_init(pScreen); + info->directRenderingEnabled = FALSE; + if (info->r600_shadow_fb == FALSE) + info->directRenderingEnabled = radeon_dri2_screen_init(pScreen); front_ptr = info->FB; @@ -689,6 +691,8 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen, if (info->r600_shadow_fb == TRUE) { if (!shadowSetup(pScreen)) { + xf86DrvMsg(scrnIndex, X_ERROR, + "Shadowfb initialization failed\n"); return FALSE; } } @@ -811,9 +815,11 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) xf86DrvMsg(pScreen->myNum, X_ERROR, "Memory map already initialized\n"); return FALSE; } - info->accel_state->exa = exaDriverAlloc(); - if (info->accel_state->exa == NULL) - return FALSE; + if (info->r600_shadow_fb == FALSE) { + info->accel_state->exa = exaDriverAlloc(); + if (info->accel_state->exa == NULL) + return FALSE; + } screen_size = RADEON_ALIGN(pScrn->virtualY, 16) * stride; { @@ -849,6 +855,11 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen) info->front_bo = radeon_bo_open(info->bufmgr, 0, screen_size, 0, RADEON_GEM_DOMAIN_VRAM, 0); + if (info->r600_shadow_fb == TRUE) { + if (radeon_bo_map(info->front_bo, 1)) { + ErrorF("Failed to map cursor buffer memory\n"); + } + } 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); -- cgit v1.2.3