This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: Re: [PATCH 2/2] Virtual frame buffer: user space backend

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: Re: [PATCH 2/2] Virtual frame buffer: user space backend
From: Anthony Liguori <anthony@xxxxxxxxxxxxx>
Date: Fri, 07 Jul 2006 13:50:59 -0500
Delivery-date: Fri, 07 Jul 2006 11:55:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <87ac80ghox.fsf@xxxxxxxxxxxxxxxxx> <871wtcghmr.fsf@xxxxxxxxxxxxxxxxx> <3d8eece20607070957p2d6bb1e5o7febaa5ca124429d@xxxxxxxxxxxxxx> <pan.2006.> <3d8eece20607071133m10b3a279hac1229bdcdf38bf4@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Pan/ (As She Crawled Across the Table (Debian GNU/Linux))
On Fri, 07 Jul 2006 19:33:24 +0100, Christian Limpach wrote:

> Well, I can only guess what you were thinking when you wrote the
> framebuffer code, but isn't the current code merging updates to a single
> update at the configured framerate and aren't you doing that to avoid
> flooding the ring?  And if that's the case, wouldn't communicating the
> linear offsets have the same problems?

It's no so much flooding the ring, but what to do when the ring is full. 
The idea would be to push updates on the ring until it's full, and then
start storing the largest update.  It's just laziness to avoid buffering
within the driver.

> We think that having a dirty bitmap as part of the frontend/backend
> protocol would be a good thing and are planning to use the same protocol
> with dirty bit scanning in the pagetables mapping the video ram of HVM
> guests.

Actually, a shared dirty bitmap is exactly what I wanted to do for the
next phase :-)

> It would work like this: - have a page with two dirty bitmaps,
> each 64bit by 128 plus and indicator which bitmap is the active bitmap
> from the frontends point of view
> - [1] frontend records dirty information in the active bitmap - timer or
> external event causes backend to check if the indicator has changed - if
> not, then it either synchronously requests the frontend to switch bitmap
> or waits some more
> - backend then scans/clears the inactive bitmap - backend requests
> frontend to set a timer a few ms before the next time the backend wants to
> scan a bitmap - when the frontend's timer fires, frontend switches bitmap
> and updates the indicator

Since the best we can do is page granularity (for now), why not just have
a bitmap represent the dirty pages?  Instead of switching bitmaps, why not
just have the backend and frontend share a bitmap and do atomic get/sets
on it?

For instance, when the front-end timer goes off, it walks the dirty
page list, and sets the bit of the corresponding page *after* calling
zap_page_range and before releasing the lock.

The back-end has it's own timer (which may or may not be the same as the
front-end).  It walks through and does an atomic test-and-set to 0.  With
the QEMU VNC code, it would then mark all tiles that fall within this
page.  Those tiles happen to be 16x1 right now.

Not requiring communication back and forth between the domains is pretty
useful I think (especially if dom0 is on a different PCPU).

Plus, I think the size of your tiling probably depends on however the
backend is exposing things.  Having tiles <= 16x16 is pretty useful for
implementing Hextile in VNC for instance.

We could even have the bitmap size be specified by the front-end.  This
way it could be set for 4k right now, but in the future, to something like
32 bytes.

I think the key point is to have the bitmap represent linear regions of
framebuffer memory instead of logical rectangles within the current

Just some random thoughts..


Anthony Liguori

> - go back to [1]
> This allows the backend to control the rate at which it wants to scan the
> bitmap without having to synchronously ask the frontend to flush the
> bitmap it is updating.
> We tile the screen in upto 64 vertical strips and upto 128 horizontal
> strips.  We could move the indicator outside of this page and get finer
> grained updates.
>     christian

Xen-devel mailing list