Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1845352pxb; Thu, 16 Sep 2021 17:41:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSH9uTFo0+NOfCJj1ZfCZPuWGyHjLXigP0gYnjZybi5T3C/Zagt+AtaWoM+bhPYNGHssrm X-Received: by 2002:a17:906:cc57:: with SMTP id mm23mr9353237ejb.540.1631839281639; Thu, 16 Sep 2021 17:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631839281; cv=none; d=google.com; s=arc-20160816; b=hC7bKbcDf+x78FsaKwyLR1TK/oA4IbFA284fLqhDm9NTSMHwC9fW4HfK6mVgGR5MYT VQEwj91TGb4bcY4vWyik6GF5v6qjYb5+QRJuMFhyTnnuN7czXbPXOCOUk7fAeMuSDSWL 1JYx9DF5lhmzbX9pJBjlr+WnuPTufEK07xRHkQEMmbz/DHtmQDAqKZzw9V/NbVOJLR6F xVmIucBzSvHDcK665Tkl10RVpNjmaZA/SZN/e+UgS4kjmIzZYmGVSI0k+ZAEmgH5hL1e VIpe8h/dCfPPmfwJMC7RRty12xVWtvzoXf7w7tq8aLHXX2pKBkYiIgLAcPETfjH/NmbE ZDNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9bNXzT+QjdczaR0NrtTvu7baFnr9KybQD65y/vUcaD8=; b=bQlBbFin9bKMv+pzOhO+OuZ3w+XP79jtO9aUnegkXX6JlmopPEoT0hTFCyMPffcCph FTtgfXoPj3ad0P+vBwxukRJycllSTYqVRHmvNNXNVzehMdVxrsiRA3nZYqBgBlHe/Gf8 adWIgVEjCIthpdaZlL6Ih7LCGCcFpA+4hAHsYZUdaipVJhoZS++4HScAuXBWGFhaqQqr 5H4NqFUdoT8A8GsDp4a7EnABVZl57FCWuAVXbgL76XWxkcLa66ikSaGi1QsoaujIkByS bJLP5hW76F6EEZ4srkQMIdTYO4hRsf3lRKx9XUtMiOff14db61ZFffiZOjdj7ZLnhz2x YfKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WbzRt/2S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si4927365ede.481.2021.09.16.17.40.54; Thu, 16 Sep 2021 17:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WbzRt/2S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244923AbhIPRGF (ORCPT + 99 others); Thu, 16 Sep 2021 13:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347849AbhIPRAo (ORCPT ); Thu, 16 Sep 2021 13:00:44 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 533D3C0363CE; Thu, 16 Sep 2021 09:17:24 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id ay33so8045326qkb.10; Thu, 16 Sep 2021 09:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9bNXzT+QjdczaR0NrtTvu7baFnr9KybQD65y/vUcaD8=; b=WbzRt/2SFYXzgn8/y8QfQ7UAZErvt4gH4M35TM24D3BawYcEwMA3SqYkqrE29LEaqB y+7curn9JBBi0dUk1oPYcmuY/tq/H2nwVga8lOkUd9zozL8Y0Fumyr+l90XPU3v6eQXr H1yqBJhL0rWzBNYYc3PiABr9Ri4F476YWnXZNs49aQ7CCaQ9Xh/pSheeRXe68aSb+MLI f8X6zLQI3vVDCVYPMZuJWuFpzPHXZj0HdOyrGj/9Pi2xDG9daQgWLSdKpgu/I8YjYqsP YwIkwhYuTPa1DSZ/pHeU8qws7sEIej9K8FAUl+759UG41h24FR1RuOCaFmPmmrtdLgfI jUzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9bNXzT+QjdczaR0NrtTvu7baFnr9KybQD65y/vUcaD8=; b=OlZmHOX2q7EmiYBj1ocr6JKe8n4GHZsuT27rjAM7Y9i2OEzqMMnxHEmkgs7tm0J27S TIe1XcfiSkETqDo9jIkmwkOaHhoI0CqxAZ8pHqYyaieoNE444uz4xhOutxGaWQq3MPxY i1TGFILH4y+JjU2hDsJLfIJ3tGeuKchX0YbFcev4n3lBDesi6cDk6inc7ylXILw7Ycpo kajwuHGvOQmEbY0a79qGDbrdZBHBhEo24XtcE42UC0mH+9tYsnpb/kMP7gmX41WNuvw3 4n6l5i7ZmfWbrKqK8wA0Mznm7dCXosF03Mo1jKZ3uB/k3ACKOypnmLzPiOyJDjk6M9I7 K4fw== X-Gm-Message-State: AOAM530pUwvsCySkpaouUR9SUMEwRf/FHUyqsgfQqViYCi5NjwiiG/A8 uPcAOW6Bu9lvlzOOrJJdQBL5jbuTV+LcBiVZAgM+scYadUwlZw== X-Received: by 2002:a25:9906:: with SMTP id z6mr7954873ybn.373.1631809043295; Thu, 16 Sep 2021 09:17:23 -0700 (PDT) MIME-Version: 1.0 References: <20210913182645.17075-1-decui@microsoft.com> In-Reply-To: From: Deepak Rawat Date: Thu, 16 Sep 2021 09:17:12 -0700 Message-ID: Subject: Re: [PATCH] drm/hyperv: Fix double mouse pointers To: Dexuan Cui Cc: Haiyang Zhang , David Airlie , Daniel Vetter , Thomas Zimmermann , "dri-devel@lists.freedesktop.org" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI Dexuan, thanks for confirming. Could you please add this as a comment to the function. Reviewed-by: Deepak Rawat On Tue, Sep 14, 2021 at 11:59 PM Dexuan Cui wrote: > > > From: Deepak Rawat > > 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