From patchwork Thu Dec 29 13:19:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: qi zhou X-Patchwork-Id: 13083499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0DB94C4332F for ; Thu, 29 Dec 2022 13:25:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAsu2-0003Wm-4K; Thu, 29 Dec 2022 08:24:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAsu0-0003WE-Bu for qemu-devel@nongnu.org; Thu, 29 Dec 2022 08:24:56 -0500 Received: from mail-sy4aus01olkn20815.outbound.protection.outlook.com ([2a01:111:f403:7005::815] helo=AUS01-SY4-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAsty-0002oL-8E for qemu-devel@nongnu.org; Thu, 29 Dec 2022 08:24:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qtr5Fc1CeFgTcfKALWR2GyFQHWtvl/7w5Rq3xOzPnwsufV1DFVNJA/RtvULz/6H9mY3ODyaGRKKVnkTaU+6eXNi6q/PRiZ3mL/2HPDug5aAfMeDZg+EqmPSx292qg9zN2DT7AyRi6lT1HvODHIKwkz/YHZnuOQiAXKLtiUbOVFnLSepM/hrnr1Ua5eh8Ov3rPs899EGZXyyKfgJsx4X8kb+AG4V+Py6sYVsPrEpu4wKr74bSddoMf7abLdhIpFkiigqoThlPm5DUtUd/W4Ng8wcx+kYNrXQ3YwIRkFAxsiiK1O94Q7SCHc9vNB3gsBneesQ0gWoupTXrELFhqIoOhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EoCRohe5/O2Tam+9l3tS53ntblHMCpUGiRjg7So8Vsw=; b=I8COouZv3FDHFWF+KUmmALHrSBJnAQzQbqymt+MZznIAzlfZPNUaQUka1pxgpZcJIlqrAgvPMqUKRl9Nrx0Vzrh8bitKL+cjpBQmy4oz+wY4QaQWHt0VTLY1DZDpnT80VwHrat0APoBkGffwmqrkNd2gKnv6VyZjggYzbTeW3PUBelsB6rHZYTEshZxpvGsHmgvyPYizK9mFBHl9qpheUU4vzM81OBT2tpnDQSawapBggY1pFdnYE6b+RaXzFIXrbY9wx8c0xF7QONAcPZikOvh3kMrdibQC68BW9kvuwD9w+gRDx/M4U8DVU3JV+igomzD0G+8G3V9joTFnw5eeJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EoCRohe5/O2Tam+9l3tS53ntblHMCpUGiRjg7So8Vsw=; b=vSJKEJVxK6BGAN0TY64bNj5MOnHGKgKZzDWguaDQo54+jI00ZPQSdNa2PM2opdCRfhmV4c2u6aArPK2PuhXXuKAJBd7g9IxYVELbEfwAyeqBQT4MMYhE18CEOlOs+S3BU7k9CjLUlGindJ9zMp88O8pggnbnNyRkJnJ2dO9T6/XohCFFzt2vbz8/SgV9tQ4lHQ21lEox6BvcEa0uyb3FnXNbYLPbpi4HQcmhSWbhPfo88s42VMDAf/fYg4qz0ZeHPjE8qWNc9ieKZR3JcCMkuQ3E0ONRMHnZ9XUVOBBGMELKgSfDSfxQVq4CbcPsxIVxEN5/2sayZzGqvVAetXMJQw== Received: from SYZP282MB3252.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:169::6) by SY4P282MB2869.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:15c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.17; Thu, 29 Dec 2022 13:19:43 +0000 Received: from SYZP282MB3252.AUSP282.PROD.OUTLOOK.COM ([fe80::3021:4e2f:269f:86a2]) by SYZP282MB3252.AUSP282.PROD.OUTLOOK.COM ([fe80::3021:4e2f:269f:86a2%6]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 13:19:43 +0000 From: qi zhou To: "qemu-devel@nongnu.org" , qi zhou Subject: [PATCH] fix gvtg cursor position if it is negative Thread-Topic: [PATCH] fix gvtg cursor position if it is negative Thread-Index: AQHZG4gkCslX+v8O2ku4IcEAac+4tg== Date: Thu, 29 Dec 2022 13:19:43 +0000 Message-ID: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [7R5Ui3fxFaq7xhmBcCAmwtUWDTiBYK8U] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SYZP282MB3252:EE_|SY4P282MB2869:EE_ x-ms-office365-filtering-correlation-id: 16e7f1dc-efdf-4835-e5d7-08dae99f598a x-ms-exchange-slblob-mailprops: EgT5Wr3QDKz918u76bcdvRMWUZXhBQCAzk+KFi//9swbnAKLvLLIDJyklyNeMRFBqU6FJjpf+n7svQVxBALH+hrUeg5xU1DGgyTho9kFg3VWt9+KIn3FI+t8Hld6h7pdkl2/8MVnNd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mWA+sNEjaa1D7hfHHUF6GJyFoCzdC0XepvYEXIqdKv236Z65xsmpPhY+qyF1wwRIC1CTftZj3fuRNPbBOBqpeSZ5pqcdT+zyGJ/pb+rNTqbK4916Iz+ymHxrB5azGiYNaNhi3e+rS1FtnfMIuuerFSI3Yn6eMnFbORBHhQFaLR3usOL7QR7s9F0KCaaKzYFPuAefUv96NvD0NemeqLTDfEVFK57venyw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?MvyoDP8cvASoeJocoz8zZJX?= =?iso-8859-1?q?qF4To+MFx66gECntxcA8DJh+gdm+3g0URKFI5b7wYypxXwHujK+yamXL0e/D?= =?iso-8859-1?q?hLkrGZ8o+NzxMFnUdjdLH8NxVURREFiwreJZc8PRC1doxgiqpfWKmQrIVGeQ?= =?iso-8859-1?q?/2Rbg/3UCUbbPsykgqCmCj+rw0rx461YQQtxB4wTYp1EYIyHfmRU+Von8xY1?= =?iso-8859-1?q?eoHSdIkVY4S8+4wzIinfeFthk5j2Ynix5hooglQMmqS+H1OiyLRkqYfCBYgZ?= =?iso-8859-1?q?gc+LqxePSTWctoi842DhwYkjY2WuVRC2GckSf3pnEVTEdATB4CAYcDN+HCKW?= =?iso-8859-1?q?NIks7WFYt8UkU3U+Bw3Qd50aWl5sFxm5ZmlyX1OV41kovVzz40v3ux7ntbOh?= =?iso-8859-1?q?Z48aGv7IN8SG52wUEUkDSt8NyBcZ5jRvVbzba5/D9iAzNhgbuK4qO6EU+B6X?= =?iso-8859-1?q?ezkTzEFdezmBFgT+59Agvn14XpIbYF8KF3Akisia78C0KM2SfqFPQLF7bVcR?= =?iso-8859-1?q?vS25TfK2X88Rtm6qRa1yzlETNdsPl2Yjam9EeG4pg2JJaPHk1IgR5r1+wjXS?= =?iso-8859-1?q?eFyqSm9eklCbZ1b02vmHYci5mTmFqV/js5xgwOPKJUCtbg7BfGqSz3eAAiyv?= =?iso-8859-1?q?D6oF/I7qt9iZaZQVmSeBV5lvX7gBWZ6wyoWP3HVkW4g+LdAD2ndWDFzosOqu?= =?iso-8859-1?q?6xNmoiCkLhPnM7SNgz0a48Cz8q5Ubft3VFPPjU62dS7D8UjkHFpjcKBLsbmg?= =?iso-8859-1?q?+Q/MQ10Rvej2Wx9+rNLZ0RcpO47ptOjqD+cqNvMR0znyKi5OhO+GdvdQvvmx?= =?iso-8859-1?q?Ec8aeDTFPL92nVrNkjwyq3Dkb4WYKwk5rx6hgTCiE2Bf2CrfrbfWmVHlHsar?= =?iso-8859-1?q?/Wi7q1tbs8hF12XLux4EhuxXwt2+XwJ+tr6Jtnfj/U8p9jvqAEfX9q9wDAbI?= =?iso-8859-1?q?LmzNW3lU4FDS2mrpQQbXOzyx5sKutq9oPdizIuHmCppGgYDtSDeJmKOZxLnP?= =?iso-8859-1?q?NFsDZJBgBlutz+9hCuEf9j7OyCjup1bcRgXTNaNBr/qrvrw2efHNvq2D7Ib8?= =?iso-8859-1?q?ZLVUcrEvq3q+wGwM5hisbrpR/4wGzkkCCYr8+lOFgvR45gzQ3gVLS3FKKdn2?= =?iso-8859-1?q?rqujJnQpDUOT8xVXsgf9dpw+OLUkJJueBSVL/dHputyCKUUaVy17TW26MiI9?= =?iso-8859-1?q?8gZLCU3pQjicEITkHh+LtEAV99hasvLh3b6ItZccH6iln2SP5+v1wGkgkIcW?= =?iso-8859-1?q?2IOOzM2dXWKhni3bA4Fwxv0+/NAsdB4jCoHW0mAGnp4paaCi42gqu2CeP?= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SYZP282MB3252.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 16e7f1dc-efdf-4835-e5d7-08dae99f598a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Dec 2022 13:19:43.7224 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY4P282MB2869 Received-SPF: pass client-ip=2a01:111:f403:7005::815; envelope-from=ATMGND@OUTLOOK.COM; helo=AUS01-SY4-obe.outbound.protection.outlook.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.998, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From 4f14d6216d3f05f01ffe419ff0baeebe416a3e58 Mon Sep 17 00:00:00 2001 From: Qi Zhou Date: Thu, 29 Dec 2022 20:25:06 +0800 Subject: [PATCH] fix gvtg cursor position if it is negative It is valid if position of cursor is negative(not hotspot coordinates). for example: precision section, resize, move, north east arrow... Signed-off-by: Qi Zhou Signed-off-by: Qi Zhou --- include/hw/vfio/vfio-common.h | 6 ++++-- include/ui/console.h | 4 ++-- include/ui/gtk.h | 2 +- linux-headers/linux/vfio.h | 4 ++-- ui/console.c | 2 +- ui/dbus-listener.c | 2 +- ui/egl-headless.c | 2 +- ui/gtk-egl.c | 2 +- ui/spice-display.c | 2 +- 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index e573f5a9f1..8048816176 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -166,8 +166,10 @@ typedef struct VFIOGroup { typedef struct VFIODMABuf { QemuDmaBuf buf; - uint32_t pos_x, pos_y, pos_updates; - uint32_t hot_x, hot_y, hot_updates; + int32_t pos_x, pos_y; + uint32_t pos_updates; + uint32_t hot_x, hot_y; + uint32_t hot_updates; int dmabuf_id; QTAILQ_ENTRY(VFIODMABuf) next; } VFIODMABuf; diff --git a/include/ui/console.h b/include/ui/console.h index e400ee9fa7..589d0fd621 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -264,7 +264,7 @@ typedef struct DisplayChangeListenerOps { uint32_t hot_x, uint32_t hot_y); /* optional */ void (*dpy_gl_cursor_position)(DisplayChangeListener *dcl, - uint32_t pos_x, uint32_t pos_y); + int32_t pos_x, int32_t pos_y); /* optional */ void (*dpy_gl_release_dmabuf)(DisplayChangeListener *dcl, QemuDmaBuf *dmabuf); @@ -362,7 +362,7 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con, void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf, bool have_hot, uint32_t hot_x, uint32_t hot_y); void dpy_gl_cursor_position(QemuConsole *con, - uint32_t pos_x, uint32_t pos_y); + int32_t pos_x, int32_t pos_y); void dpy_gl_release_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf); void dpy_gl_update(QemuConsole *con, diff --git a/include/ui/gtk.h b/include/ui/gtk.h index ae0f53740d..bb28360185 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -182,7 +182,7 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl, QemuDmaBuf *dmabuf, bool have_hot, uint32_t hot_x, uint32_t hot_y); void gd_egl_cursor_position(DisplayChangeListener *dcl, - uint32_t pos_x, uint32_t pos_y); + int32_t pos_x, int32_t pos_y); void gd_egl_flush(DisplayChangeListener *dcl, uint32_t x, uint32_t y, uint32_t w, uint32_t h); void gd_egl_scanout_flush(DisplayChangeListener *dcl, diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index ede44b5572..646db069b8 100644 --- a/linux-headers/linux/vfio.h +++ b/linux-headers/linux/vfio.h @@ -720,8 +720,8 @@ struct vfio_device_gfx_plane_info { __u32 height; /* height of plane */ __u32 stride; /* stride of plane */ __u32 size; /* size of plane in bytes, align on page*/ - __u32 x_pos; /* horizontal position of cursor plane */ - __u32 y_pos; /* vertical position of cursor plane*/ + __s32 x_pos; /* horizontal position of cursor plane */ + __s32 y_pos; /* vertical position of cursor plane*/ __u32 x_hot; /* horizontal position of cursor hotspot */ __u32 y_hot; /* vertical position of cursor hotspot */ union { diff --git a/ui/console.c b/ui/console.c index 9ff9217f9b..8dffacf07d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2049,7 +2049,7 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf, } void dpy_gl_cursor_position(QemuConsole *con, - uint32_t pos_x, uint32_t pos_y) + int32_t pos_x, int32_t pos_y) { DisplayState *s = con->ds; DisplayChangeListener *dcl; diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index f9fc8eda51..43c00b7a75 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -188,7 +188,7 @@ static void dbus_cursor_dmabuf(DisplayChangeListener *dcl, } static void dbus_cursor_position(DisplayChangeListener *dcl, - uint32_t pos_x, uint32_t pos_y) + int32_t pos_x, int32_t pos_y) { DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl); diff --git a/ui/egl-headless.c b/ui/egl-headless.c index 7a30fd9777..7a03b08d46 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -110,7 +110,7 @@ static void egl_cursor_dmabuf(DisplayChangeListener *dcl, } static void egl_cursor_position(DisplayChangeListener *dcl, - uint32_t pos_x, uint32_t pos_y) + int32_t pos_x, int32_t pos_y) { egl_dpy *edpy = container_of(dcl, egl_dpy, dcl); diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index e84431790c..a454402212 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -286,7 +286,7 @@ void gd_egl_cursor_dmabuf(DisplayChangeListener *dcl, } void gd_egl_cursor_position(DisplayChangeListener *dcl, - uint32_t pos_x, uint32_t pos_y) + int32_t pos_x, int32_t pos_y) { VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl); diff --git a/ui/spice-display.c b/ui/spice-display.c index 494168e7fe..347c3917bf 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -1002,7 +1002,7 @@ static void qemu_spice_gl_cursor_dmabuf(DisplayChangeListener *dcl, } static void qemu_spice_gl_cursor_position(DisplayChangeListener *dcl, - uint32_t pos_x, uint32_t pos_y) + int32_t pos_x, int32_t pos_y) { SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);