qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] qemu VGA endian swap low level drawing changes
Date: Sun, 06 Jul 2014 13:08:06 +0200	[thread overview]
Message-ID: <53B92E16.20604@suse.de> (raw)
In-Reply-To: <1404641621.29546.253.camel@pasglop>


On 06.07.14 12:13, Benjamin Herrenschmidt wrote:
> On Sun, 2014-07-06 at 17:22 +1000, Benjamin Herrenschmidt wrote:
>>   - With SDL, the cursor quickly goes bonkers, starts jumping around all
>> over the place, I'm not sure what exactly is going on here. It starts ok
>> but as soon as one does a too fast movement, it's dead.
> At least this one also happens with gtk and appears to be the guest (NT4)
> "warping" the cursor to the edges of the screen as soon as you start moving
> too quickly. I'm not quite sure what's going on yet, so far I've seen us
> send reasonable deltas down. I *suspect* it might have to do with NT's
> own mouse acceleration scheme.
>
> The way we do the relative mouse stuff, we more/less assume that the diff
> we send down gets applied "as is". It's not and thus we warp which causes
> funny artifacts and when it gets too big, things get nasty inside NT4 itself
> as far as I can tell (but I may well have missed something).
>
> The problem is that when using relative mouses, we can't really assume that
> there is any relationship between the absolute position of the host cursor
> vs. the guest cursor, we should only operate in deltas and even then, we
> probably want to dampen them to compensate for the guest own acceleration.

The guest's own acceleration can easily be non-linear, so we can't 
really tell. However, FWIW we basically have 2 modes

   1) absolute pointing device (usb tablet for example or vmmouse)
   2) relative pointing device

In case 1, we can keep using the host cursor, and just tell the guest 
where exactly the cursor is in absolute coordinates. This works very 
well with VNC too ;).

In case 2, we can't tell anything at all. We can calculate the delta and 
hope for the best. That's why with any backend that supports it, we 
enable mouse grabbing here. In mouse grabbing mode we behave like any 
game that may do whatever it likes with the mouse delta information.

> But that means that the guest HW cursor is never quite where the host cursor
> is. So unless the guest draws its own (or something like VNC can draw one),
> we have a problem.

VNC can explicitly draw the host cursor at specific locations IIRC. You 
can just send a packet where the cursor is at the moment. I don't know 
about SDL or GTK+ though.

> I'm thinking that for relative mouse, we should probably draw a cursor ourselves
> by moving / drawing the cursor pixmap on top of the display pixmap at the UI
> backend (gtk/SDL) level... Or am I missing a big part of the puzzle ?

Can't we just always draw it ourselves with a second surface on top of 
our normal guest screen? Then we can make the "real cursor" for GTK+ / 
SDL / VNC be a 100% alpha cursor as soon as we enable this self-drawn 
surface and can expose hardware pointers that the respective backend 
couldn't support.

For example, IIRC VNC only supports 1-bit cursors. We certainly want 
more fancy ones :).


Alex

  reply	other threads:[~2014-07-06 11:08 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  3:07 [Qemu-devel] [RFC] qemu VGA endian swap low level drawing changes Benjamin Herrenschmidt
2014-06-17  4:40 ` Paolo Bonzini
2014-06-17  4:59   ` Benjamin Herrenschmidt
2014-06-17  5:36     ` Paolo Bonzini
2014-06-17  6:06       ` Benjamin Herrenschmidt
2014-06-17  9:18       ` Alexey Kardashevskiy
2014-06-17  9:26         ` Alexander Graf
2014-06-17 10:00         ` Greg Kurz
2014-06-17 10:09           ` Benjamin Herrenschmidt
2014-06-17 10:19             ` Peter Maydell
2014-06-17 10:57               ` Benjamin Herrenschmidt
2014-06-17 11:40             ` Greg Kurz
2014-06-17 11:53               ` Benjamin Herrenschmidt
2014-06-17 12:05                 ` Peter Maydell
2014-06-17 10:45 ` Gerd Hoffmann
2014-06-17 11:08   ` Peter Maydell
2014-06-17 11:24     ` Gerd Hoffmann
2014-06-17 11:42       ` Peter Maydell
2014-06-19 12:33         ` Gerd Hoffmann
2014-06-19 13:01           ` Paolo Bonzini
2014-06-17 11:15   ` Benjamin Herrenschmidt
2014-06-17 11:57     ` Gerd Hoffmann
2014-06-17 21:32       ` Benjamin Herrenschmidt
2014-06-17 22:12         ` Peter Maydell
2014-06-17 22:55           ` Benjamin Herrenschmidt
2014-06-17 23:05             ` Alexander Graf
2014-06-17 23:16               ` Benjamin Herrenschmidt
2014-06-18 11:18         ` Gerd Hoffmann
2014-06-18 13:03           ` Benjamin Herrenschmidt
2014-06-19  9:36             ` Gerd Hoffmann
2014-06-21  5:37               ` Benjamin Herrenschmidt
2014-06-22  2:10                 ` Benjamin Herrenschmidt
2014-06-23  1:13                   ` Benjamin Herrenschmidt
2014-06-30 11:14                   ` Gerd Hoffmann
2014-06-30 12:32                     ` Benjamin Herrenschmidt
2014-07-01  8:20                       ` Gerd Hoffmann
2014-07-01  8:26                         ` Alexander Graf
2014-07-01  8:31                           ` Paolo Bonzini
2014-07-01  9:07                             ` Gerd Hoffmann
2014-07-01  9:19                               ` Paolo Bonzini
2014-07-01 11:15                                 ` Gerd Hoffmann
2014-07-01 11:23                                   ` Benjamin Herrenschmidt
2014-07-02  9:19                                     ` Benjamin Herrenschmidt
2014-07-02  9:21                                       ` Benjamin Herrenschmidt
2014-07-02 12:12                                       ` Gerd Hoffmann
2014-07-02 12:16                                         ` Benjamin Herrenschmidt
2014-07-06  2:19                                         ` Benjamin Herrenschmidt
2014-07-06  5:49                                           ` Benjamin Herrenschmidt
2014-07-06  6:46                                             ` Benjamin Herrenschmidt
2014-07-06  7:05                                               ` Benjamin Herrenschmidt
2014-07-06  7:22                                                 ` Benjamin Herrenschmidt
2014-07-06  8:15                                                   ` Benjamin Herrenschmidt
2014-07-06 10:13                                                   ` Benjamin Herrenschmidt
2014-07-06 11:08                                                     ` Alexander Graf [this message]
2014-07-06 11:13                                                       ` Peter Maydell
2014-07-06 11:23                                                         ` Benjamin Herrenschmidt
2014-07-06 13:09                                                           ` Peter Maydell
2014-07-06 20:56                                                             ` Benjamin Herrenschmidt
2014-07-07  0:08                                                               ` Benjamin Herrenschmidt
2014-07-07 10:13                                                       ` Gerd Hoffmann
2014-07-07  9:38                                                   ` Gerd Hoffmann
2014-07-06  5:53                                           ` Benjamin Herrenschmidt
2014-07-01 12:06                                   ` Paolo Bonzini
2014-07-01  8:59                           ` Gerd Hoffmann
2014-07-01  9:35                           ` Benjamin Herrenschmidt
2014-07-01  9:33                         ` Benjamin Herrenschmidt

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=53B92E16.20604@suse.de \
    --to=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=kraxel@redhat.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).