summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2009-11-26 12:21:21 +0100
committerJerome Glisse <jglisse@redhat.com>2009-11-26 12:24:20 +0100
commit95385f0906f371a1ed6e60eb3e597e699c7a3222 (patch)
tree24b4adaedcde6002499c69dac8b34648e06dfdd0 /src
parent8195385d3cedf70d89ca576371af6bca5045bbd2 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c24
1 files changed, 20 insertions, 4 deletions
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-);