qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Alon Levy <alevy@redhat.com>
Cc: hdegoede@redhat.com, uril@redhat.com, qemu-devel@nongnu.org,
	gleb@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 1/4] qxl/spice-display: move pipe to ssd
Date: Wed, 16 Mar 2011 17:39:32 +0100	[thread overview]
Message-ID: <4D80E7C4.80808@redhat.com> (raw)
In-Reply-To: <1300290769-31155-2-git-send-email-alevy@redhat.com>

On 03/16/11 16:52, Alon Levy wrote:
> This moves the int pipe[2] and pthread_t main data from the
> PCIQXLDevice struct to the SimpleSpiceDisplay. This will let us
> reuse it in the next patch for both -spice with no -qxl usage and
> for vga mode from qxl.
> 
> Also move the pipe creation function (which is effectively completely rewritten
> by this patch anyways) from hw/qxl.c to ui/spice-display.c, since
> spice-display will depend on it after the next patch and qemu can be build
> with ui/spice-display.c in combination with no hw/qxl.c.
> ---
>  hw/qxl.c           |   22 +++++-----------------
>  hw/qxl.h           |    4 ----
>  ui/spice-display.c |   21 +++++++++++++++++++++
>  ui/spice-display.h |    8 ++++++++
>  4 files changed, 34 insertions(+), 21 deletions(-)
> 
> diff --git a/hw/qxl.c b/hw/qxl.c
> index fe4212b..201698f 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -1062,7 +1062,7 @@ static void pipe_read(void *opaque)
>      int len;
>  
>      do {
> -        len = read(d->pipe[0], &dummy, sizeof(dummy));
> +        len = read(d->ssd.pipe[0], &dummy, sizeof(dummy));
>      } while (len == sizeof(dummy));
>      qxl_set_irq(d);
>  }
> @@ -1078,10 +1078,11 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
>      if ((old_pending & le_events) == le_events) {
>          return;
>      }
> -    if (pthread_self() == d->main) {
> +    if (pthread_self() == d->ssd.main) {
> +        /* running in io_thread thread */
[snip]
> diff --git a/ui/spice-display.h b/ui/spice-display.h
> index aef0464..3e6cf7c 100644
> --- a/ui/spice-display.h
> +++ b/ui/spice-display.h
> @@ -43,6 +43,11 @@ typedef struct SimpleSpiceDisplay {
>      QXLRect dirty;
>      int notify;
>      int running;
> +
> +    /* thread signaling - used both in qxl (in vga mode
> +     * and in native mode) and without qxl */
> +    pthread_t          main;
> +    int                pipe[2];     /* to iothread */
>  } SimpleSpiceDisplay;

This really should be using QemuThread rather than pthread_t directly. I
am not quite sure what impact it will have on the use of pthread_self()
above, there might be a need for an additional wrapper there.

Cheers,
Jes

  parent reply	other threads:[~2011-03-16 16:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 15:52 [Qemu-devel] [PATCH v3 0/4] qxl: implement vga mode without locks Alon Levy
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 1/4] qxl/spice-display: move pipe to ssd Alon Levy
2011-03-16 15:58   ` Hans de Goede
2011-03-16 16:39   ` Jes Sorensen [this message]
2011-03-16 16:42     ` Alon Levy
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 2/4] qxl: implement get_command in vga mode without locks Alon Levy
2011-03-16 16:00   ` [Qemu-devel] " Hans de Goede
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 3/4] qxl/spice: remove qemu_mutex_{un, }lock_iothread around dispatcher Alon Levy
2011-03-16 16:01   ` [Qemu-devel] " Hans de Goede
2011-03-16 15:52 ` [Qemu-devel] [PATCH v3 4/4] hw/qxl-render: drop cursor locks, replace with pipe Alon Levy
2011-03-16 16:02   ` [Qemu-devel] " Hans de Goede
2011-03-16 16:48   ` [Qemu-devel] " Jes Sorensen
2011-03-17  9:32     ` Alon Levy
2011-03-17  9:48       ` Jes Sorensen
2011-03-17 10:27         ` Alon Levy
2011-03-17 10:29           ` Jes Sorensen
2011-03-17 10:45             ` Alon Levy
2011-03-17 14:19               ` Jes Sorensen
2011-03-17 15:08                 ` Alon Levy

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=4D80E7C4.80808@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=alevy@redhat.com \
    --cc=gleb@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=uril@redhat.com \
    /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).