qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 8/9] spice: simple display
Date: Thu, 19 Aug 2010 19:23:42 +0400 (MSD)	[thread overview]
Message-ID: <alpine.LNX.2.00.1008191922390.5362@linmac> (raw)
In-Reply-To: <4C6D4221.8080504@codemonkey.ws>

On Thu, 19 Aug 2010, Anthony Liguori wrote:

> On 08/19/2010 07:40 AM, Gerd Hoffmann wrote:
> > With that patch applied you'll actually see the guests screen in the
> > spice client.  This does *not* bring qxl and full spice support though.
> > This is basically the qxl vga mode made more generic, so it plays
> > together with any qemu-emulated gfx card.  You can display stdvga or
> > cirrus via spice client.  You can have both vnc and spice enabled and
> > clients connected at the same time.
[..snip..]

> > +
> > +void qemu_spice_destroy_update(SimpleSpiceDisplay *sdpy, SimpleSpiceUpdate
> > *update)
> > +{
> > +    qemu_free(update->bitmap);
> > +    qemu_free(update);
> > +}
> > +
> > +void qemu_spice_create_host_memslot(SimpleSpiceDisplay *ssd)
> > +{
> > +    QXLDevMemSlot memslot;
> > +
> > +    if (debug)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> >    
> 
> a dprintf() would better fit qemu's style.

A dprintf is a POSIX function.

> 
> > +    memset(&memslot, 0, sizeof(memslot));
> > +    memslot.slot_group_id = MEMSLOT_GROUP_HOST;
> > +    memslot.virt_end = ~0;
> > +    ssd->worker->add_memslot(ssd->worker,&memslot);
> > +}
> > +
> > +void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd)
> > +{
> > +    QXLDevSurfaceCreate surface;
> > +
> > +    if (debug)
> > +        fprintf(stderr, "%s: %dx%d\n", __FUNCTION__,
> > +                ds_get_width(ssd->ds), ds_get_height(ssd->ds));
> > +
> > +    surface.format     = SPICE_SURFACE_FMT_32_xRGB;
> > +    surface.width      = ds_get_width(ssd->ds);
> > +    surface.height     = ds_get_height(ssd->ds);
> > +    surface.stride     = -surface.width * 4;
> > +    surface.mouse_mode = 0;
> > +    surface.flags      = 0;
> > +    surface.type       = 0;
> > +    surface.mem        = (intptr_t)ssd->buf;
> > +    surface.group_id   = MEMSLOT_GROUP_HOST;
> > +    ssd->worker->create_primary_surface(ssd->worker, 0,&surface);
> > +}
> > +
> > +void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd)
> > +{
> > +    if (debug)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +
> > +    ssd->worker->destroy_primary_surface(ssd->worker, 0);
> > +}
> > +
> > +void qemu_spice_vm_change_state_handler(void *opaque, int running, int
> > reason)
> > +{
> > +    SimpleSpiceDisplay *ssd = opaque;
> > +
> > +    if (running) {
> > +        ssd->worker->start(ssd->worker);
> > +    } else {
> > +        ssd->worker->stop(ssd->worker);
> > +    }
> > +    ssd->running = running;
> > +}
> > +
> > +/* display listener callbacks */
> > +
> > +void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
> > +                               int x, int y, int w, int h)
> > +{
> > +    QXLRect update_area;
> > +
> > +    if (debug>  1)
> > +        fprintf(stderr, "%s: x %d y %d w %d h %d\n", __FUNCTION__, x, y, w,
> > h);
> > +    update_area.left = x,
> > +    update_area.right = x + w;
> > +    update_area.top = y;
> > +    update_area.bottom = y + h;
> > +
> > +    pthread_mutex_lock(&ssd->lock);
> > +    if (qemu_spice_rect_is_empty(&ssd->dirty)) {
> > +        ssd->notify++;
> > +    }
> > +    qemu_spice_rect_union(&ssd->dirty,&update_area);
> > +    pthread_mutex_unlock(&ssd->lock);
> > +}
> > +
> > +void qemu_spice_display_resize(SimpleSpiceDisplay *ssd)
> > +{
> > +    if (debug)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +
> > +    pthread_mutex_lock(&ssd->lock);
> > +    memset(&ssd->dirty, 0, sizeof(ssd->dirty));
> > +    pthread_mutex_unlock(&ssd->lock);
> > +
> > +    qemu_spice_destroy_host_primary(ssd);
> > +    qemu_spice_create_host_primary(ssd);
> > +    qemu_pf_conv_put(ssd->conv);
> > +    ssd->conv = NULL;
> > +
> > +    pthread_mutex_lock(&ssd->lock);
> > +    memset(&ssd->dirty, 0, sizeof(ssd->dirty));
> > +    ssd->notify++;
> > +    pthread_mutex_unlock(&ssd->lock);
> > +}
> > +
> > +void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd)
> > +{
> > +    if (debug>  2)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +    vga_hw_update();
> > +    if (ssd->notify) {
> > +        ssd->notify = 0;
> > +        ssd->worker->wakeup(ssd->worker);
> > +        if (debug>  1)
> > +            fprintf(stderr, "%s: notify\n", __FUNCTION__);
> > +    }
> > +}
> > +
> > +/* spice display interface callbacks */
> > +
> > +static void interface_attach_worker(QXLInstance *sin, QXLWorker
> > *qxl_worker)
> > +{
> > +    SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
> > +
> > +    if (debug)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +    ssd->worker = qxl_worker;
> > +}
> > +
> > +static void interface_set_compression_level(QXLInstance *sin, int level)
> > +{
> > +    if (debug)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +    /* nothing to do */
> > +}
> > +
> > +static void interface_set_mm_time(QXLInstance *sin, uint32_t mm_time)
> > +{
> > +    if (debug>  2)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +    /* nothing to do */
> > +}
> > +
> > +static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
> > +{
> > +    SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
> > +
> > +    info->memslot_gen_bits = MEMSLOT_GENERATION_BITS;
> > +    info->memslot_id_bits  = MEMSLOT_SLOT_BITS;
> > +    info->num_memslots = NUM_MEMSLOTS;
> > +    info->num_memslots_groups = NUM_MEMSLOTS_GROUPS;
> > +    info->internal_groupslot_id = 0;
> > +    info->qxl_ram_size = ssd->bufsize;
> > +    info->n_surfaces = NUM_SURFACES;
> > +}
> > +
> > +static int interface_get_command(QXLInstance *sin, struct QXLCommandExt
> > *ext)
> > +{
> > +    SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
> > +    SimpleSpiceUpdate *update;
> > +
> > +    if (debug>  2)
> > +        fprintf(stderr, "%s:\n", __FUNCTION__);
> > +    update = qemu_spice_create_update(ssd);
[..snip..]

-- 
mailto:av1474@comtv.ru

  reply	other threads:[~2010-08-19 15:24 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19 12:40 [Qemu-devel] [PATCH 0/9] initial spice support Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 1/9] add pflib: PixelFormat conversion library Gerd Hoffmann
2010-08-19 14:04   ` Anthony Liguori
2010-08-19 15:34     ` Gerd Hoffmann
2010-08-19 19:09       ` Anthony Liguori
2010-08-20 10:38         ` Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 2/9] configure: add logging Gerd Hoffmann
2010-08-19 14:05   ` Anthony Liguori
2010-08-19 15:44     ` Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 3/9] add spice into the configure file Gerd Hoffmann
2010-08-19 14:06   ` Anthony Liguori
2010-08-19 12:40 ` [Qemu-devel] [PATCH 4/9] configure: require spice 0.5.3 Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 5/9] spice: core bits Gerd Hoffmann
2010-08-19 14:19   ` Anthony Liguori
2010-08-20 11:54     ` Gerd Hoffmann
2010-08-25 12:37     ` Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 6/9] spice: add keyboard Gerd Hoffmann
2010-08-19 14:24   ` Anthony Liguori
2010-08-20 12:34     ` Gerd Hoffmann
2010-08-20 13:18       ` Anthony Liguori
2010-08-20 13:56         ` Gerd Hoffmann
2010-08-20 14:15           ` Daniel P. Berrange
2010-08-20 14:49             ` Gerd Hoffmann
2010-08-20 15:01               ` Daniel P. Berrange
2010-08-19 12:40 ` [Qemu-devel] [PATCH 7/9] spice: add mouse Gerd Hoffmann
2010-08-19 14:25   ` Anthony Liguori
2010-08-20 12:42     ` Gerd Hoffmann
2010-08-20 13:19       ` Anthony Liguori
2010-08-20 14:03         ` Gerd Hoffmann
2010-08-20 14:37           ` Anthony Liguori
2010-08-19 12:40 ` [Qemu-devel] [PATCH 8/9] spice: simple display Gerd Hoffmann
2010-08-19 14:39   ` Anthony Liguori
2010-08-19 15:23     ` malc [this message]
2010-08-19 15:34       ` Anthony Liguori
2010-08-19 15:36         ` malc
2010-08-19 19:03           ` Anthony Liguori
2010-08-19 19:10             ` malc
2010-08-19 15:40         ` Alexander Graf
2010-08-25 11:09           ` Gerd Hoffmann
2010-08-19 16:05     ` Gerd Hoffmann
2010-08-19 19:00       ` Anthony Liguori
2010-08-19 12:40 ` [Qemu-devel] [PATCH 9/9] spice: add tablet support Gerd Hoffmann
2010-08-19 14:40   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1008191922390.5362@linmac \
    --to=av1474@comtv.ru \
    --cc=anthony@codemonkey.ws \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).