diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 336f7686ed458894bd821eba2d85549cc3602bc3..eca0582580b4fd37bd65c1357265c7c855f2b058 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -754,6 +754,7 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; + ScreenPtr screen = crtc->scrn->pScreen; drmModeModeInfo kmode; int output_count = 0; uint32_t *output_ids = NULL; @@ -764,6 +765,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only) if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y)) return 1; +#ifdef GLAMOR_HAS_GBM + /* Make sure any pending drawing will be visible in a new scanout buffer */ + if (drmmode->glamor) + glamor_finish(screen); +#endif + if (ms->atomic_modeset) { drmModeAtomicReq *req = drmModeAtomicAlloc(); Bool active; @@ -1452,8 +1459,6 @@ drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) FreeScratchGC(gc); - glamor_finish(pScreen); - pScreen->canDoBGNoneRoot = TRUE; if (drmmode->fbcon_pixmap) @@ -1790,6 +1795,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) { @@ -3174,6 +3192,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]; diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index a8f1e615c8e551fa0a3f7d47bde93ef95c801de4..05944cfcbd9f6afb4fd110f68ff415956852c343 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -485,6 +485,9 @@ xf86CrtcRotate(xf86CrtcPtr crtc) if (damage) xf86CrtcDamageShadow(crtc); + else if (crtc->rotatedData && !crtc->rotatedPixmap) + /* Make sure the new rotate buffer has valid transformed contents */ + xf86RotateRedisplay(pScreen); /* All done */ return TRUE; diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 2937d9c979a1e259cca3ea2f5419cb8c40fc38da..31c2766234ddaa8a3959ce5e44c707c4aa3e889f 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -24,6 +24,7 @@ */ #include "xwayland.h" +#include "glamor.h" #include @@ -412,9 +413,7 @@ xwl_present_abort_vblank(WindowPtr present_window, static void xwl_present_flush(WindowPtr window) { - /* Only called when a Pixmap is copied instead of flipped, - * but in this case we wait on the next block_handler. - */ + glamor_block_handler(window->drawable.pScreen); } static Bool