From nobody Tue Sep 16 20:11:18 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB1E6C4332F for ; Thu, 29 Dec 2022 13:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiL2NRy (ORCPT ); Thu, 29 Dec 2022 08:17:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiL2NRu (ORCPT ); Thu, 29 Dec 2022 08:17:50 -0500 Received: from AUS01-SY4-obe.outbound.protection.outlook.com (mail-sy4aus01olkn2143.outbound.protection.outlook.com [40.92.62.143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81BF811C0E for ; Thu, 29 Dec 2022 05:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RtHXxbgjEDfjUrYg6rKZkM71Z07k+F8ftf9nifGa5/EBSEZYPYloLn1/Wu1LnqJRsc3AsLIw0VnzhEcAFihEzCPotE4zMdUZ7VtMQ9wOO7PflzRJEGwXUuDlzaM04X9Yc6Yl16HoJWI1uoJQ6u9uTyHSFHFC1KoaiUe10F+iTpxPyAOSTrjsmRqGSxRXQS7uoEynIOuezE9Xt+EZW2y+VxHOfAS2EfO/Zub+Myj9CQJRLQp4t9bUZIBB8VgIC2eYxfa47/7SI3dvAwG7bMzG0V5zFacV+HMsLm/9mrXEexHUFIjfjB6a7omQ85jAuB0GInbbvliuJgIAdCVCXx9T7g== 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=YvF/Vo3Y5xYm4eFKAn45sD0QcwmRdFyDM91cf0tk0hk=; b=V+d8dnVGfBeSyJGeB5GQaFd1XcPWBm5/o7h/1k5M8pi5tEczNXBkrXvuyYOtoI6m2qqnbsg4nCNJ9tDlaE4QpIGvcz6KcbKez7IVlQ89vtxWHrO6HHcUNR28FRhkFKXNkapxEIU/KZaIOrmGsiX/j2cxQaDtbjPEXKgEqnZ3h/3Nu4Bm9iySjxmaahw4WASGYxXHpmtJJnkyt6HBRiNYwmWpnBrxodBCRsM5W31/cRrmrZTaC362exujPGAs/yTAO0gQFhL41jqIicAWk37Ty154oBaqjPSpYtBkP8E3cQE9o3n41st+v29TbBFG/ECIdsBkXscTtk2eiBqWAVWTdg== 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=YvF/Vo3Y5xYm4eFKAn45sD0QcwmRdFyDM91cf0tk0hk=; b=rhitbfnkqG/V2/26OnRiG5IQgZdvSQEb7/xyR+TG3uqEFYyvRg0AGNTsFeGh6fcu2KZ4rNoHAmqUmEzORPnMUfpQnocjk+v6tnJnUNufWHcYA6HgYkXbkYtj8RXc6xv7Hl+on+dbeOjnjpKDgU509vOZaD9WBeii4cnA1AtFhBBzARgRDCfk5wuLFJHtSs4mBMUxoqt05YwceBfFKuE1GmYP+vhMj07rteSBAJHs3ziZBlPDKnHxlPhR5NH1zvSlJiqKFUDfiZnY+YfQ5cEKblYR2KbBYQI3Djt20aCsLOyhqUzjDazJ4odvPJenQBWKWx8Qqj+3DJbhX4z1o8lTeQ== 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:17: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:17:42 +0000 From: qi zhou To: "matthew.auld@intel.com" , open list , "zhi.a.wang@intel.com" , "jani.nikula@linux.intel.com" , "joonas.lahtinen@linux.intel.com" , "rodrigo.vivi@intel.com" , "tvrtko.ursulin@linux.intel.com" , "airlied@gmail.com" , "daniel@ffwll.ch" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "intel-gvt-dev@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" Subject: [PATCH] fix gvtg cursor position if it is negative Thread-Topic: [PATCH] fix gvtg cursor position if it is negative Thread-Index: AQHZG4eUlO6VebNR50mtjCIRm5fqpw== Date: Thu, 29 Dec 2022 13:17:42 +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: [5xJU6W118WwbNM8E5fh8u8XHZuVsIdVC] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SYZP282MB3252:EE_|SY4P282MB2869:EE_ x-ms-office365-filtering-correlation-id: d61abdd3-5ee1-48c0-df62-08dae99f1187 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: u9QBmfx3w5UG1ZgCnuqloR/esemKrnf0bYRqIwZiP0IA4rY5cWCo2COKRLj7CKkXAMe9HkcQDOhb3x5Dhq4UkF2gM5jhPHlHr2x8QFU/AB/eLnBEF3wANRzcmpXmcHQ0NtqaGcEimy+USPwP/Vz9yNwc834jc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7?= Content-Transfer-Encoding: quoted-printable 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: d61abdd3-5ee1-48c0-df62-08dae99f1187 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Dec 2022 13:17:42.8911 (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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From 8d2a0c2c265119cb481deab825ea59c9605f3bd8 Mon Sep 17 00:00:00 2001 From: Qi Zhou Date: Thu, 29 Dec 2022 20:15:51 +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 --- drivers/gpu/drm/i915/gvt/dmabuf.c | 5 ++--- drivers/gpu/drm/i915/gvt/dmabuf.h | 4 ++-- include/uapi/linux/vfio.h | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/d= mabuf.c index 355f1c0e8664..b91122b33222 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.c +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c @@ -299,9 +299,8 @@ static int vgpu_get_plane_info(struct drm_device *dev, info->stride =3D c.width * (c.bpp / 8); info->drm_format =3D c.drm_format; info->drm_format_mod =3D 0; - info->x_pos =3D c.x_pos; - info->y_pos =3D c.y_pos; - + info->x_pos =3D c.x_sign ? -c.x_pos : c.x_pos; + info->y_pos =3D c.y_sign ? -c.y_pos : c.y_pos; if (validate_hotspot(&c)) { info->x_hot =3D c.x_hot; info->y_hot =3D c.y_hot; diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.h b/drivers/gpu/drm/i915/gvt/d= mabuf.h index 3dcdb6570eda..4103106d7cc2 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.h +++ b/drivers/gpu/drm/i915/gvt/dmabuf.h @@ -41,8 +41,8 @@ struct intel_vgpu_fb_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 */ struct intel_vgpu_dmabuf_obj *obj; diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 23105eb036fa..a9b93251ac7f 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/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 { --=20 2.25.1