linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: Deepak Rawat <drawat.floss@gmail.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] drm/hyperv: Fix double mouse pointers
Date: Wed, 15 Sep 2021 06:59:18 +0000	[thread overview]
Message-ID: <BYAPR21MB1270C4427C264D14F151A0CCBFDB9@BYAPR21MB1270.namprd21.prod.outlook.com> (raw)
In-Reply-To: <CAHFnvW0iX1FMTcJzQQtjHGosavSJ6-9wkRb7C0Ljv3c+BBUEXQ@mail.gmail.com>

> From: Deepak Rawat <drawat.floss@gmail.com>
> Sent: Tuesday, September 14, 2021 8:59 AM
> ...
> > +/* Send mouse pointer info to host */
> > +int hyperv_send_ptr(struct hv_device *hdev)
> > +{
> > +       struct synthvid_msg msg;
> > +
> > +       memset(&msg, 0, sizeof(struct synthvid_msg));
> > +       msg.vid_hdr.type = SYNTHVID_POINTER_POSITION;
> > +       msg.vid_hdr.size = sizeof(struct synthvid_msg_hdr) +
> > +               sizeof(struct synthvid_pointer_position);
> > +       msg.ptr_pos.is_visible = 1;
> 
> "is_visible" should be 0 since you want to hide the pointer. Maybe
> better, accept these from the caller.

According to my test, "is_visible = 0" doesn't work, i.e. can't hide the
unwanted HW mouse poiner. It looks like the field is for some very old
legacy Windows VMs like Windows Vista.

Haiyang also replied in another email, saying "is_visible = 0" doesn't
work.

> > +       msg.ptr_pos.video_output = 0;
> > +       msg.ptr_pos.image_x = 0;
> > +       msg.ptr_pos.image_y = 0;
> > +       hyperv_sendpacket(hdev, &msg);
> > +
> > +       memset(&msg, 0, sizeof(struct synthvid_msg));
> > +       msg.vid_hdr.type = SYNTHVID_POINTER_SHAPE;
> > +       msg.vid_hdr.size = sizeof(struct synthvid_msg_hdr) +
> > +               sizeof(struct synthvid_pointer_shape);
> > +       msg.ptr_shape.part_idx = SYNTHVID_CURSOR_COMPLETE;
> > +       msg.ptr_shape.is_argb = 1;
> > +       msg.ptr_shape.width = 1;
> > +       msg.ptr_shape.height = 1;
> > +       msg.ptr_shape.hot_x = 0;
> > +       msg.ptr_shape.hot_y = 0;
> > +       msg.ptr_shape.data[0] = 0;
> > +       msg.ptr_shape.data[1] = 1;
> > +       msg.ptr_shape.data[2] = 1;
> > +       msg.ptr_shape.data[3] = 1;
> > +       hyperv_sendpacket(hdev, &msg);
> > +
> 
> Is it necessary to send SYNTHVID_POINTER_SHAPE here? Perhaps we should

According to my test, yes. If I don't send a SYNTHVID_POINTER_SHAPE message,
the unwanted mouse pointer can't be hidden. As we know, the protocol between
the VSC and the VSP is not well documented to us. I can ask Hyper-V
team for some clarification on this, but it's probably we can just use the current
version of hiding the mouse pointer as-is -- this has been used for 10+ years
in the hyperv_fb driver without any issue. :-)

> separate SYNTHVID_POINTER_POSITION and SYNTHVID_POINTER_SHAPE into
> different functions.

Since the 2 messages are only used here, I suggest we keep it as-is.

Thanks,
-- Dexuan

  parent reply	other threads:[~2021-09-15  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 18:26 [PATCH] drm/hyperv: Fix double mouse pointers Dexuan Cui
2021-09-13 19:39 ` Haiyang Zhang
2021-09-14 15:59 ` Deepak Rawat
2021-09-14 16:05   ` Haiyang Zhang
2021-09-15  6:59   ` Dexuan Cui [this message]
2021-09-16 16:17     ` Deepak Rawat
2021-09-16 17:15       ` Dexuan Cui

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=BYAPR21MB1270C4427C264D14F151A0CCBFDB9@BYAPR21MB1270.namprd21.prod.outlook.com \
    --to=decui@microsoft.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=drawat.floss@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haiyangz@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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).