[Spice-devel] [RFC qxl-win 1/2] display: add pdev->use_async

Alon Levy alevy at redhat.com
Wed Sep 21 06:13:33 PDT 2011


---
 display/driver.c |    1 +
 display/qxldd.h  |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index de1f714..5c4578c 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -719,6 +719,7 @@ static BOOL PrepareHardware(PDev *pdev)
     }
 
     pdev->pci_revision = dev_info.pci_revision;
+    pdev->use_async = (pdev->pci_revision >= QXL_REVISION_STABLE_V10);
     pdev->cmd_ring = dev_info.cmd_ring;
     pdev->cursor_ring = dev_info.cursor_ring;
     pdev->release_ring = dev_info.release_ring;
diff --git a/display/qxldd.h b/display/qxldd.h
index 6482e8a..c1a509f 100644
--- a/display/qxldd.h
+++ b/display/qxldd.h
@@ -287,6 +287,7 @@ typedef struct PDev {
     HSEMAPHORE io_sem;
     PUCHAR memslot_del_port;
     PUCHAR flush_release_port;
+    UINT32 use_async;
 
     UINT8* primary_memory_start;
     UINT32 primary_memory_size;
@@ -448,7 +449,7 @@ static _inline RingItem *RingGetTail(PDev *pdev, Ring *ring)
  */
 static _inline void async_io(PDev *pdev, asyncable_t op, UCHAR val)
 {
-    if (pdev->pci_revision >= QXL_REVISION_STABLE_V10) {
+    if (pdev->use_async) {
         EngAcquireSemaphore(pdev->io_sem);
         WRITE_PORT_UCHAR(pdev->asyncable[op][ASYNC], val);
         WAIT_FOR_EVENT(pdev, pdev->io_cmd_event, NULL);
-- 
1.7.6.2



More information about the Spice-devel mailing list