From 2263f8f26fb3c4fabceac2e192e95c5d26a4d173 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Sep 2013 21:55:49 +0100 Subject: [PATCH] intel-virtual-overlay: Reset damage across modesets Some versions of the Xserver lose Damage tracking across the modeset, causing a loss of damage notifications and repainting to cease on the virtual outputs. We can workaround this by reattaching the damage every time we receive notification that the local Screen configuration changes. Reported-and-tested-by: Severin Strobl Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987 Signed-off-by: Chris Wilson --- tools/virtual.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/virtual.c b/tools/virtual.c index 257f37f3..4da2f3ab 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -1760,9 +1760,22 @@ static int display_init_damage(struct display *display) if (display->damage == 0) return EACCES; + display->flush = 1; return 0; } +static void display_reset_damage(struct display *display) +{ + Damage damage; + + damage = XDamageCreate(display->dpy, display->root, XDamageReportRawRectangles); + if (damage) { + XDamageDestroy(display->dpy, display->damage); + display->damage = damage; + display->flush = 1; + } +} + static void display_init_randr_hpd(struct display *display) { int major, minor; @@ -2632,8 +2645,10 @@ int main(int argc, char **argv) ret--; } - if (reconfigure) + if (reconfigure) { context_update(&ctx); + display_reset_damage(ctx.display); + } if (rr_update) { for (i = 0; i < ctx.nclone; i++)