summaryrefslogtreecommitdiff
path: root/src/uxa
diff options
context:
space:
mode:
authorLyude <cpaul@redhat.com>2016-03-23 15:44:37 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-24 18:51:58 +0000
commit03bed1c7ba838af9aa6ab722aeaa070aa4cc70e3 (patch)
tree6942a625d0e8aafc1f541e04ef6eb19b1438be6c /src/uxa
parentc186d4dda3b62b73af3caf2883a9cedfd97e3b45 (diff)
uxa: Restore old bo on failure
When we fail to do a modeset, we need to make sure that we restore the previous bo in the event that it's changed. Otherwise we'll crash the X server the next time we do a pageflip. This fixes an issue with panning crashing the X server if a user tries to set a large panning resolution such as 5200x3200, and the GPU doesn't have enough memory to handle the bo due to being in UXA mode. Signed-off-by: Lyude <cpaul@redhat.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/uxa')
-rw-r--r--src/uxa/intel_uxa.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/uxa/intel_uxa.c b/src/uxa/intel_uxa.c
index 590ff5d1..830f094b 100644
--- a/src/uxa/intel_uxa.c
+++ b/src/uxa/intel_uxa.c
@@ -1068,7 +1068,7 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
PixmapPtr pixmap;
intel_screen_private *intel = intel_get_screen_private(scrn);
- dri_bo *bo = intel->front_buffer;
+ dri_bo *bo = intel->front_buffer, *old_bo;
int old_width, old_height, old_pitch;
if (!uxa_resources_init(screen))
@@ -1081,6 +1081,7 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
old_width = pixmap->drawable.width;
old_height = pixmap->drawable.height;
old_pitch = pixmap->devKind;
+ old_bo = intel_uxa_get_pixmap_bo(pixmap);
if (!screen->ModifyPixmapHeader(pixmap,
scrn->virtualX,
@@ -1102,6 +1103,9 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
err:
screen->ModifyPixmapHeader(pixmap,
old_width, old_height, -1, -1, old_pitch, NULL);
+ if (old_bo)
+ intel_uxa_set_pixmap_bo(pixmap, old_bo);
+
return FALSE;
}