if (xenfb_queue_full(info))
return;
- 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;
+ 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);
+
list_for_each_entry(map, &info->mappings, link) {
if (!map->faults)
continue;
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();
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;
error_nomem:
"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: