diff options
author | Dave Airlie <airlied@redhat.com> | 2012-02-20 11:05:59 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-20 11:05:59 +0000 |
commit | 24f2790951dd4b1f1fd138f2087248a005a64e27 (patch) | |
tree | 7dd46dce4fe34718792cc04c07fa4179fe8ef0d0 | |
parent | 027a799d85a9d5cd8d599dc6f88e5a38adabe68b (diff) |
modesetting: fix shadow resizing.
if we hotplugged and output, the shadow got disabled by accident.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/drmmode_display.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index caa9f44..c004721 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -984,8 +984,21 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height) if (!new_pixels) goto fail; - screen->ModifyPixmapHeader(ppix, width, height, -1, -1, - pitch, new_pixels); + if (!drmmode->shadow_enable) + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, + pitch, new_pixels); + else { + void *new_shadow; + uint32_t size = scrn->displayWidth * scrn->virtualY * + ((scrn->bitsPerPixel + 7) >> 3); + new_shadow = calloc(1, size); + if (new_shadow == NULL) + goto fail; + free(drmmode->shadow_fb); + drmmode->shadow_fb = new_shadow; + screen->ModifyPixmapHeader(ppix, width, height, -1, -1, + pitch, drmmode->shadow_fb); + } #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,9,99,1,0) scrn->pixmapPrivate.ptr = ppix->devPrivate.ptr; |