We are currently experiencing downtime impacting viewing & cloning the Mesa repo, and some GitLab pages returning 503. Please see #freedesktop on IRC for more updates.

Commit b4324c6a authored by Kenneth Graunke's avatar Kenneth Graunke

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's avatarKenneth Graunke <kenneth@whitecape.org>
Tested-by: Jason Ekstrand's avatarJason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent 35e99244
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment