lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Dec 2022 13:17:42 +0000
From:   qi zhou <atmgnd@...look.com>
To:     "matthew.auld@...el.com" <matthew.auld@...el.com>,
        open list <linux-kernel@...r.kernel.org>,
        "zhi.a.wang@...el.com" <zhi.a.wang@...el.com>,
        "jani.nikula@...ux.intel.com" <jani.nikula@...ux.intel.com>,
        "joonas.lahtinen@...ux.intel.com" <joonas.lahtinen@...ux.intel.com>,
        "rodrigo.vivi@...el.com" <rodrigo.vivi@...el.com>,
        "tvrtko.ursulin@...ux.intel.com" <tvrtko.ursulin@...ux.intel.com>,
        "airlied@...il.com" <airlied@...il.com>,
        "daniel@...ll.ch" <daniel@...ll.ch>,
        "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
        "cohuck@...hat.com" <cohuck@...hat.com>,
        "intel-gvt-dev@...ts.freedesktop.org" 
        <intel-gvt-dev@...ts.freedesktop.org>,
        "intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: [PATCH] fix gvtg cursor position if it is negative

>From 8d2a0c2c265119cb481deab825ea59c9605f3bd8 Mon Sep 17 00:00:00 2001
From: Qi Zhou <atmgnd@...look.com>
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 <atmgnd@...look.com>
---
 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/dmabuf.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 = c.width * (c.bpp / 8);
 		info->drm_format = c.drm_format;
 		info->drm_format_mod = 0;
-		info->x_pos = c.x_pos;
-		info->y_pos = c.y_pos;
-
+		info->x_pos = c.x_sign ? -c.x_pos : c.x_pos;
+		info->y_pos = c.y_sign ? -c.y_pos : c.y_pos;
 		if (validate_hotspot(&c)) {
 			info->x_hot = c.x_hot;
 			info->y_hot = c.y_hot;
diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.h b/drivers/gpu/drm/i915/gvt/dmabuf.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 {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ