]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
pvfb: PVFB frontend can send bogus screen updates
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 6 Dec 2007 17:44:12 +0000 (17:44 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 6 Dec 2007 17:44:12 +0000 (17:44 +0000)
The PVFB frontend can get confused and send a screen update to the
backend when the screen is actually clean.  Such an update asks for
the impossible rectangle (x1, x2, y1, y2) = (INT_MAX, 0, INT_MAX, 0).
Fix by setting the dirty flag in the obvious place: when the dirty
rectangle is grown.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
linux-2.6.18-xen changeset:   311:ca05cf1a9bdc2c7604b95fd085fa5abe067c969a
linux-2.6.18-xen date:        Fri Nov 16 16:55:46 2007 +0000

linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c

index 3118233539b0d78251535b55f1e67962e13468a2..49bfe5295b1667cb458002f9339bd8b4a2052706 100644 (file)
@@ -201,6 +201,11 @@ static void xenfb_update_screen(struct xenfb_info *info)
 
        mutex_unlock(&info->mm_lock);
 
+       if (x2 < x1 || y2 < y1) {
+               printk("xenfb_update_screen bogus rect %d %d %d %d\n",
+                      x1, x2, y1, y2);
+               WARN_ON(1);
+       }
        xenfb_do_update(info, x1, y1, x2 - x1, y2 - y1);
 }
 
@@ -252,7 +257,6 @@ static int xenfb_setcolreg(unsigned regno, unsigned red, unsigned green,
 static void xenfb_timer(unsigned long data)
 {
        struct xenfb_info *info = (struct xenfb_info *)data;
-       info->dirty = 1;
        wake_up(&info->wq);
 }
 
@@ -272,6 +276,7 @@ static void __xenfb_refresh(struct xenfb_info *info,
                info->x1 = x1;
        if (info->x2 < x2)
                info->x2 = x2;
+       info->dirty = 1;
 
        if (timer_pending(&info->refresh))
                return;