st/nine: skip position checks in SetCursorPosition()
authorAndre Heider <a.heider@gmail.com>
Thu, 11 Apr 2019 06:42:47 +0000 (08:42 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Sat, 20 Apr 2019 11:06:29 +0000 (13:06 +0200)
For HW cursors, "cursor.pos" doesn't hold the current position of the
pointer, just the position of the last call to SetCursorPosition().

Skip the check against stale values and bump the d3dadapter9 drm version
to expose this change of behaviour.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
include/d3dadapter/drm.h
src/gallium/state_trackers/nine/device9.c

index 647f017fc7f2feec5871667ff87f3c0f92552e57..6939dd4f239247ba2b1cf03b0d085708cc005881 100644 (file)
 #define D3DADAPTER9DRM_NAME "drm"
 /* current version */
 #define D3DADAPTER9DRM_MAJOR 0
-#define D3DADAPTER9DRM_MINOR 1
+#define D3DADAPTER9DRM_MINOR 2
 
 /* version 0.0: Initial release
  *         0.1: All IDirect3D objects can be assumed to have a pointer to the
- *              internal vtable in second position of the structure */
+ *              internal vtable in second position of the structure
+ *         0.2: IDirect3DDevice9_SetCursorPosition always calls
+ *              ID3DPresent_SetCursorPos for hardware cursors
+ */
 
 struct D3DAdapter9DRM
 {
index db1c3a1d23dfd470da6f91c240028827fb57416a..0b1fe59cb707a64cc91e1edde020e25e91cf09d2 100644 (file)
@@ -793,9 +793,11 @@ NineDevice9_SetCursorPosition( struct NineDevice9 *This,
 
     DBG("This=%p X=%d Y=%d Flags=%d\n", This, X, Y, Flags);
 
-    if (This->cursor.pos.x == X &&
-        This->cursor.pos.y == Y)
-        return;
+    /* present >= v1.4 handles this itself */
+    if (This->minor_version_num < 4) {
+        if (This->cursor.pos.x == X && This->cursor.pos.y == Y)
+            return;
+    }
 
     This->cursor.pos.x = X;
     This->cursor.pos.y = Y;