summaryrefslogtreecommitdiff
path: root/src/drmmode_display.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-09-12 18:54:33 +0900
committerMichel Dänzer <michel@daenzer.net>2016-09-21 16:25:25 +0900
commit8523a733b6a5de6116a6332fefc871d4c32652d8 (patch)
treeda2201680ea4e4772c84760cdd7df281ddb97064 /src/drmmode_display.c
parent53be26b00e83f871f0afd39caa5a7a1d6ec4aea1 (diff)
Propagate failure from radeon_set_pixmap_bo
(Ported from amdgpu commits c315c00e44afc91a7c8e2eab5af836d9643ebb88 and 0d42082108c264568e2aadd15ace70e72388bc65)
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r--src/drmmode_display.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index a8d43865..89922d6d 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -126,12 +126,11 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
if (!(*pScreen->ModifyPixmapHeader)(pixmap, width, height,
depth, bpp, pitch, NULL)) {
- return NULL;
+ goto fail;
}
if (!info->use_glamor)
exaMoveInPixmap(pixmap);
- radeon_set_pixmap_bo(pixmap, bo);
if (info->ChipFamily >= CHIP_FAMILY_R600) {
surface = radeon_get_pixmap_surface(pixmap);
if (surface && psurf)
@@ -163,22 +162,25 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
surface->flags |= RADEON_SURF_SET(RADEON_SURF_MODE_2D, MODE);
}
if (radeon_surface_best(info->surf_man, surface)) {
- return NULL;
+ goto fail;
}
if (radeon_surface_init(info->surf_man, surface)) {
- return NULL;
+ goto fail;
}
}
}
- if (info->use_glamor &&
- !radeon_glamor_create_textured_pixmap(pixmap,
- radeon_get_pixmap_private(pixmap))) {
- pScreen->DestroyPixmap(pixmap);
- return NULL;
- }
+ if (!radeon_set_pixmap_bo(pixmap, bo))
+ goto fail;
- return pixmap;
+ if (!info->use_glamor ||
+ radeon_glamor_create_textured_pixmap(pixmap,
+ radeon_get_pixmap_private(pixmap)))
+ return pixmap;
+
+fail:
+ pScreen->DestroyPixmap(pixmap);
+ return NULL;
}
static void drmmode_destroy_bo_pixmap(PixmapPtr pixmap)
@@ -2121,7 +2123,6 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
goto fail;
if (!info->r600_shadow_fb) {
- radeon_set_pixmap_bo(ppix, info->front_bo);
psurface = radeon_get_pixmap_surface(ppix);
*psurface = info->front_surface;
screen->ModifyPixmapHeader(ppix,
@@ -2145,6 +2146,11 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
if (info->use_glamor)
radeon_glamor_create_screen_resources(scrn->pScreen);
+ if (!info->r600_shadow_fb) {
+ if (!radeon_set_pixmap_bo(ppix, info->front_bo))
+ goto fail;
+ }
+
/* Clear new buffer */
gc = GetScratchGC(ppix->drawable.depth, scrn->pScreen);
force = info->accel_state->force;