qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] vmmouse: replace PROP_PTR property with gpio pin to i8042
Date: Thu, 9 Feb 2012 00:48:18 +0000	[thread overview]
Message-ID: <201202090048.19347.paul@codesourcery.com> (raw)
In-Reply-To: <1328342612-25826-4-git-send-email-pbonzini@redhat.com>

> +static void i8042_isa_mouse_fake_event(void *opaque, int n, int level)
>  {
>      ISADevice *dev = opaque;
>      KBDState *s = &(DO_UPCAST(ISAKBDState, dev, dev)->kbd);
>  
> -    ps2_mouse_fake_event(s->mouse);
> +    if (level) {
> +        ps2_mouse_fake_event(s->mouse);
> +    }
>  }
>...  
> @@ -99,7 +99,7 @@ static void vmmouse_mouse_event(void *opaque, int x, int
>      /* need to still generate PS2 events to notify driver to
>         read from queue */
> -    i8042_isa_mouse_fake_event(s->ps2_mouse);
> +    qemu_set_irq(s->ps2_mouse_event, 1);
>  }

Both of these are wrong. qemu_irq represents a state. It is not an messge 
passing API.  Currently we don't discard duplicate sets, but that may change 
in the future.

If you want to convey an event via an IRQ line you need to actually cause and 
detect state changes.  i.e. i8042_isa_mouse_fake_event needs to remember the 
previous state, and only act on a low-high transition.  vmmouse_mouse_event 
should use qemu_irq_pulse.

Paul

      parent reply	other threads:[~2012-02-09  0:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04  8:03 [Qemu-devel] [PATCH 0/3] Remove PROP_PTR, part 2/4 Paolo Bonzini
2012-02-04  8:03 ` [Qemu-devel] [PATCH 1/3] smbus: fix writes Paolo Bonzini
2012-02-04  8:03 ` [Qemu-devel] [PATCH 2/3] smbus_eeprom: remove PTR property Paolo Bonzini
2012-02-04  8:03 ` [Qemu-devel] [PATCH 3/3] vmmouse: replace PROP_PTR property with gpio pin to i8042 Paolo Bonzini
2012-02-04 13:03   ` Gerhard Wiesinger
2012-02-04 13:15     ` Paolo Bonzini
2012-02-07 12:39   ` Juan Quintela
2012-02-07 12:54     ` Paolo Bonzini
2012-02-09  0:48   ` Paul Brook [this message]

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=201202090048.19347.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=pbonzini@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).