From 95385f0906f371a1ed6e60eb3e597e699c7a3222 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Thu, 26 Nov 2009 12:21:21 +0100 Subject: kms: Fix resizing when acceleration is disabled When acceleration is disabled we need to reallocate a new shadow framebuffer and we should also avoid calling any EXA function as EXA is disabled in such case. --- src/drmmode_display.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/drmmode_display.c') diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 6e54c8a6..38f73735 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1020,11 +1020,13 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height) int cpp = info->CurrentLayout.pixel_bytes; struct radeon_bo *front_bo; uint32_t tiling_flags = 0; + PixmapPtr ppix = screen->GetScreenPixmap(screen); + void *fb_shadow; if (scrn->virtualX == width && scrn->virtualY == height) return TRUE; - front_bo = radeon_get_pixmap_bo(screen->GetScreenPixmap(screen)); + front_bo = info->front_bo; radeon_cs_flush_indirect(scrn); if (front_bo) @@ -1076,9 +1078,23 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height) if (ret) goto fail; - radeon_set_pixmap_bo(screen->GetScreenPixmap(screen), info->front_bo); - screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen), - width, height, -1, -1, pitch * cpp, NULL); + if (!info->r600_shadow_fb) { + radeon_set_pixmap_bo(screen->GetScreenPixmap(screen), info->front_bo); + screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen), + width, height, -1, -1, pitch * cpp, NULL); + } else { + if (radeon_bo_map(info->front_bo, 1)) + goto fail; + fb_shadow = xcalloc(1, screen_size); + if (fb_shadow == NULL) + goto fail; + xfree(info->fb_shadow); + info->fb_shadow = fb_shadow; + screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen), + width, height, -1, -1, pitch * cpp, + info->fb_shadow); + } + scrn->pixmapPrivate.ptr = ppix->devPrivate.ptr; // xf86DrvMsg(scrn->scrnIndex, X_INFO, "New front buffer at 0x%lx\n", // info->front_bo-); -- cgit v1.2.3