# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1233150093 0
# Node ID c9783c08495c56337dec371582b3f948e3b5ed8d
# Parent 83b71f4b5cb216d09856391d8616ee2cb6525c73
xenfb: fix xenfb_update_screen bogus rect
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
drivers/xen/fbfront/xenfb.c | 47 ++++++++++++++++++++++----------------------
1 files changed, 24 insertions(+), 23 deletions(-)
diff -r 83b71f4b5cb2 -r c9783c08495c drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c Tue Jan 20 13:28:35 2009 +0000
+++ b/drivers/xen/fbfront/xenfb.c Wed Jan 28 13:41:33 2009 +0000
@@ -213,17 +213,23 @@ static void xenfb_update_screen(struct x
if (xenfb_queue_full(info))
return;
+ spin_lock_irqsave(&info->dirty_lock, flags);
+ if (info->dirty){
+ info->dirty = 0;
+ y1 = info->y1;
+ y2 = info->y2;
+ x1 = info->x1;
+ x2 = info->x2;
+ info->x1 = info->y1 = INT_MAX;
+ info->x2 = info->y2 = 0;
+ } else {
+ spin_unlock_irqrestore(&info->dirty_lock, flags);
+ return;
+ }
+ spin_unlock_irqrestore(&info->dirty_lock, flags);
+
mutex_lock(&info->mm_lock);
-
- spin_lock_irqsave(&info->dirty_lock, flags);
- y1 = info->y1;
- y2 = info->y2;
- x1 = info->x1;
- x2 = info->x2;
- info->x1 = info->y1 = INT_MAX;
- info->x2 = info->y2 = 0;
- spin_unlock_irqrestore(&info->dirty_lock, flags);
-
+
list_for_each_entry(map, &info->mappings, link) {
if (!map->faults)
continue;
@@ -262,10 +268,7 @@ static int xenfb_thread(void *data)
while (!kthread_should_stop()) {
xenfb_handle_resize_dpy(info);
- if (info->dirty) {
- info->dirty = 0;
- xenfb_update_screen(info);
- }
+ xenfb_update_screen(info);
wait_event_interruptible(info->wq,
kthread_should_stop() || info->dirty);
try_to_freeze();
@@ -665,15 +668,6 @@ static int __devinit xenfb_probe(struct
ret = xenfb_connect_backend(dev, info);
if (ret < 0)
goto error;
-
- /* FIXME should this be delayed until backend XenbusStateConnected? */
- info->kthread = kthread_run(xenfb_thread, info, "xenfb thread");
- if (IS_ERR(info->kthread)) {
- ret = PTR_ERR(info->kthread);
- info->kthread = NULL;
- xenbus_dev_fatal(dev, ret, "register_framebuffer");
- goto error;
- }
return 0;
@@ -839,6 +833,13 @@ static void xenfb_backend_changed(struct
"feature-resize", "%d", &val) < 0)
val = 0;
info->feature_resize = val;
+
+ info->kthread = kthread_run(xenfb_thread, info, "xenfb thread");
+ if (IS_ERR(info->kthread)) {
+ info->kthread = NULL;
+ xenbus_dev_fatal(dev, PTR_ERR(info->kthread),
+ "register_framebuffer");
+ }
break;
case XenbusStateClosing:
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|