[2/2] st/nine: skip position checks in SetCursorPosition()

Submitted by Andre Heider on April 4, 2019, 10:34 a.m.

Details

Message ID 20190404103430.10705-2-a.heider@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andre Heider April 4, 2019, 10:34 a.m.
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 for present interface v1.5, so it
can do it properly itself.

Signed-off-by: Andre Heider <a.heider@gmail.com>
---
Corresponding d3d9-nine.dll patch:
https://github.com/iXit/wine-nine-standalone/commit/e095d0beb2004f69a9b917266e556920296050f7

 src/gallium/state_trackers/nine/adapter9.c | 2 +-
 src/gallium/state_trackers/nine/device9.c  | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c
index 4f648e894b8..774e3cf10dd 100644
--- a/src/gallium/state_trackers/nine/adapter9.c
+++ b/src/gallium/state_trackers/nine/adapter9.c
@@ -35,7 +35,7 @@ 
 #define DBG_CHANNEL DBG_ADAPTER
 
 /* The maximum supported present version */
-#define MAX_PRESENT_VERSION_MINOR 4
+#define MAX_PRESENT_VERSION_MINOR 5
 
 HRESULT
 NineAdapter9_ctor( struct NineAdapter9 *This,
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index db1c3a1d23d..6f9094b62c2 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -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.5 handles this itself */
+    if (This->minor_version_num < 5) {
+        if (This->cursor.pos.x == X && This->cursor.pos.y == Y)
+            return;
+    }
 
     This->cursor.pos.x = X;
     This->cursor.pos.y = Y;