{"id":818695,"url":"http://patchwork.ozlabs.org/api/patches/818695/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1506437019-17946-4-git-send-email-owen.smith@citrix.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1506437019-17946-4-git-send-email-owen.smith@citrix.com>","list_archive_url":null,"date":"2017-09-26T14:43:39","name":"[3/3,v4] xenfb: Add [feature|request]-raw-pointer","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"6f67257fbbdfe8421577896e672ce0828a10ea6a","submitter":{"id":64781,"url":"http://patchwork.ozlabs.org/api/people/64781/?format=json","name":"Owen Smith","email":"owen.smith@citrix.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1506437019-17946-4-git-send-email-owen.smith@citrix.com/mbox/","series":[{"id":5156,"url":"http://patchwork.ozlabs.org/api/series/5156/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=5156","date":"2017-09-26T14:43:39","name":"xenfb: Enablement for Windows PV HID frontend","version":4,"mbox":"http://patchwork.ozlabs.org/series/5156/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/818695/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/818695/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1kNz3FMWz9t6C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 00:49:06 +1000 (AEST)","from localhost ([::1]:47946 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwrAW-0005MZ-Fk\n\tfor incoming@patchwork.ozlabs.org; Tue, 26 Sep 2017 10:49:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42287)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <prvs=435739c2e=owen.smith@citrix.com>)\n\tid 1dwrAC-0005Lu-K2\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 10:48:45 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <prvs=435739c2e=owen.smith@citrix.com>)\n\tid 1dwrA9-0003at-I5\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 10:48:44 -0400","from smtp02.citrix.com ([66.165.176.63]:45580)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)\n\t(envelope-from <prvs=435739c2e=owen.smith@citrix.com>)\n\tid 1dwrA9-0003Zn-9u\n\tfor qemu-devel@nongnu.org; Tue, 26 Sep 2017 10:48:41 -0400"],"X-IronPort-AV":"E=Sophos;i=\"5.42,441,1500940800\"; d=\"scan'208\";a=\"449270648\"","From":"Owen Smith <owen.smith@citrix.com>","To":"<sstabellini@kernel.org>, <anthony.perard@citrix.com>,\n\t<kraxel@redhat.com>","Date":"Tue, 26 Sep 2017 14:43:39 +0000","Message-ID":"<1506437019-17946-4-git-send-email-owen.smith@citrix.com>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1506437019-17946-1-git-send-email-owen.smith@citrix.com>","References":"<1506437019-17946-1-git-send-email-owen.smith@citrix.com>","MIME-Version":"1.0","Content-Type":"text/plain","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"66.165.176.63","Subject":"[Qemu-devel] [PATCH 3/3 v4] xenfb: Add [feature|request]-raw-pointer","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"xen-devel@lists.xenproject.org, qemu-devel@nongnu.org,\n\tOwen Smith <owen.smith@citrix.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Writes \"feature-raw-pointer\" during init to indicate the backend\ncan pass raw unscaled values for absolute axes to the frontend.\nFrontends set \"request-raw-pointer\" to indicate the backend should\nnot attempt to scale absolute values to console size.\n\"request-raw-pointer\" is only valid if \"request-abs-pointer\" is\nalso set. Raw unscaled pointer values are in the range [0, 0x7fff]\n\nSigned-off-by: Owen Smith <owen.smith@citrix.com>\n---\n hw/display/xenfb.c | 37 ++++++++++++++++++++++++-------------\n 1 file changed, 24 insertions(+), 13 deletions(-)","diff":"diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c\nindex 33361b4..29428ae 100644\n--- a/hw/display/xenfb.c\n+++ b/hw/display/xenfb.c\n@@ -52,6 +52,7 @@ struct common {\n struct XenInput {\n     struct common c;\n     int abs_pointer_wanted; /* Whether guest supports absolute pointer */\n+    int raw_pointer_wanted; /* Whether guest supports raw (unscaled) pointer */\n     QemuInputHandlerState *qkbd;\n     QemuInputHandlerState *qmou;\n     int mouse_axes[INPUT_AXIS__MAX];\n@@ -264,21 +265,23 @@ static void xenfb_mouse_sync(DeviceState *dev)\n                             in->abs_pointer_wanted);\n \n     if (in->abs_pointer_wanted) {\n-        QemuConsole *con = qemu_console_lookup_by_index(0);\n-        DisplaySurface *surface;\n-        int dw, dh;\n-\n-        if (!con) {\n-            xen_pv_printf(&in->c.xendev, 0, \"No QEMU console available\");\n-            return;\n-        }\n+        if (!in->raw_pointer_wanted) {\n+            QemuConsole *con = qemu_console_lookup_by_index(0);\n+            DisplaySurface *surface;\n+            int dw, dh;\n+\n+            if (!con) {\n+                xen_pv_printf(&in->c.xendev, 0, \"No QEMU console available\");\n+                return;\n+            }\n \n-        surface = qemu_console_surface(con);\n-        dw = surface_width(surface);\n-        dh = surface_height(surface);\n+            surface = qemu_console_surface(con);\n+            dw = surface_width(surface);\n+            dh = surface_height(surface);\n \n-        dx = dx * (dw - 1) / 0x7fff;\n-        dy = dy * (dh - 1) / 0x7fff;\n+            dx = dx * (dw - 1) / 0x7fff;\n+            dy = dy * (dh - 1) / 0x7fff;\n+        }\n \n         xenfb_send_position(in, dx, dy, dz);\n     } else {\n@@ -312,6 +315,7 @@ static QemuInputHandler xenfb_rel_mouse = {\n static int input_init(struct XenDevice *xendev)\n {\n     xenstore_write_be_int(xendev, \"feature-abs-pointer\", 1);\n+    xenstore_write_be_int(xendev, \"feature-raw-pointer\", 1);\n     return 0;\n }\n \n@@ -335,6 +339,13 @@ static void input_connected(struct XenDevice *xendev)\n                              &in->abs_pointer_wanted) == -1) {\n         in->abs_pointer_wanted = 0;\n     }\n+    if (xenstore_read_fe_int(xendev, \"request-raw-pointer\",\n+                             &in->raw_pointer_wanted) == -1) {\n+        in->raw_pointer_wanted = 0;\n+    }\n+    if (in->raw_pointer_wanted && !in->abs_pointer_wanted) {\n+        xen_pv_printf(xendev, 0, \"raw pointer set without absolute pointer.\");\n+    }\n \n     if (in->qkbd) {\n         qemu_input_handler_unregister(in->qkbd);\n","prefixes":["3/3","v4"]}