diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2014-12-09 14:38:39 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2014-12-11 11:26:19 -0800 |
commit | b4324c6a2382dc96295bdb061316f699e4ffabb9 (patch) | |
tree | b44997258aa32a9defeb59bb91a5664e889f422e /hw | |
parent | 35e9924484ec7bafb749c88ed7f78e6a71f8dfb3 (diff) |
modesetting: Move ModifyPixmapHeader calls out of if/else branches.
Both branches called ModifyPixmapHeader with essentially the same
parameters. By using new_pixels in the shadowfb case, we can make
them completely the same, and move them out a level, for simplicity.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/drivers/modesetting/drmmode_display.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index fddbaff96..f88148d71 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -1231,22 +1231,18 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) if (!new_pixels) goto fail; - if (!drmmode->shadow_enable) - screen->ModifyPixmapHeader(ppix, width, height, -1, -1, - pitch, new_pixels); - else { - void *new_shadow; + if (drmmode->shadow_enable) { uint32_t size = scrn->displayWidth * scrn->virtualY * ((scrn->bitsPerPixel + 7) >> 3); - new_shadow = calloc(1, size); - if (new_shadow == NULL) + new_pixels = calloc(1, size); + if (new_pixels == NULL) goto fail; free(drmmode->shadow_fb); - drmmode->shadow_fb = new_shadow; - screen->ModifyPixmapHeader(ppix, width, height, -1, -1, - pitch, drmmode->shadow_fb); + drmmode->shadow_fb = new_pixels; } + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, new_pixels); + #ifdef GLAMOR if (drmmode->glamor) { if (!glamor_egl_create_textured_screen(screen, |