# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1233280407 -32400
# Node ID b790b287bf4740ded017a4819b37813561a7c4b6
# Parent 9ab1c319531f646c0ac3a3ee5c6038d16cd43e92
# Parent 8197c86e67294835c9d90540cf776c373664c3ef
merge with linux-2.6.18-xen.hg
---
drivers/xen/fbfront/xenfb.c | 62 ++++++++++++++++++++--------------------
drivers/xen/netback/interface.c | 7 ++++
2 files changed, 38 insertions(+), 31 deletions(-)
diff -r 9ab1c319531f -r b790b287bf47 drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c Wed Jan 28 13:07:23 2009 +0900
+++ b/drivers/xen/fbfront/xenfb.c Fri Jan 30 10:53:27 2009 +0900
@@ -61,7 +61,6 @@ struct xenfb_info
int irq;
struct xenfb_page *page;
unsigned long *mfns;
- int update_wanted; /* XENFB_TYPE_UPDATE wanted */
int feature_resize; /* Backend has resize feature */
struct xenfb_resize resize;
int resize_dpy;
@@ -208,22 +207,26 @@ static void xenfb_update_screen(struct x
int y1, y2, x1, x2;
struct xenfb_mapping *map;
- if (!info->update_wanted)
- return;
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 +265,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 +665,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;
@@ -829,16 +820,25 @@ static void xenfb_backend_changed(struct
if (dev->state != XenbusStateConnected)
goto InitWait; /* no InitWait seen yet, fudge it */
- if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
- "request-update", "%d", &val) < 0)
- val = 0;
- if (val)
- info->update_wanted = 1;
if (xenbus_scanf(XBT_NIL, dev->otherend,
"feature-resize", "%d", &val) < 0)
val = 0;
info->feature_resize = val;
+
+ if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
+ "request-update", "%d", &val) < 0)
+ val = 0;
+
+ if (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:
diff -r 9ab1c319531f -r b790b287bf47 drivers/xen/netback/interface.c
--- a/drivers/xen/netback/interface.c Wed Jan 28 13:07:23 2009 +0900
+++ b/drivers/xen/netback/interface.c Fri Jan 30 10:53:27 2009 +0900
@@ -219,6 +219,13 @@ static int map_frontend_pages(
BUG();
if (op.status) {
+ struct gnttab_unmap_grant_ref unop;
+
+ gnttab_set_unmap_op(&unop,
+ (unsigned long)netif->tx_comms_area->addr,
+ GNTMAP_host_map, netif->tx_shmem_handle);
+ VOID(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
+ &unop, 1));
DPRINTK(" Gnttab failure mapping rx_ring_ref!\n");
return op.status;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|