diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2019-11-18 18:06:28 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2019-11-25 18:46:56 +0100 |
commit | 9ba13bac9dd076f166ff0d063fc144b904a40d12 (patch) | |
tree | 5694325970b83ab8a069f7f29d39c99b93722b38 /hw/xfree86/drivers/modesetting | |
parent | 327df450ffcf5bda5b4254db0208d355860d1010 (diff) |
modesetting: Clear new screen pixmap storage on RandR resize
Fixes random garbage being visible intermittently.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86/drivers/modesetting')
-rw-r--r-- | hw/xfree86/drivers/modesetting/drmmode_display.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 5f9e78662..8a9dc2d80 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -1799,6 +1799,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) &drmmode_crtc->prime_pixmap); } +static void +drmmode_clear_pixmap(PixmapPtr pixmap) +{ + ScreenPtr screen = pixmap->drawable.pScreen; + GCPtr gc; + + gc = GetScratchGC(pixmap->drawable.depth, screen); + if (gc) { + miClearDrawable(&pixmap->drawable, gc); + FreeScratchGC(gc); + } +} + static void * drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { @@ -3190,6 +3203,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height) if (!drmmode_glamor_handle_new_screen_pixmap(drmmode)) goto fail; + drmmode_clear_pixmap(ppix); + for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; |