diff mbox series

[16/29] vmsvga: Add framework code for SVGA command to raise interrupt

Message ID 1533815202-11967-17-git-send-email-liran.alon@oracle.com (mailing list archive)
State New, archived
Headers show
Series : vmsvga: Various fixes and enhancements | expand

Commit Message

Liran Alon Aug. 9, 2018, 11:46 a.m. UTC
From: Leonid Shatz <leonid.shatz@oracle.com>

Should not change semantics.
This is done as a preparation for future patches.

Signed-off-by: Leonid Shatz <leonid.shatz@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
---
 hw/display/vmware_vga.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 4e4f6f8eec42..ce5b8814ac91 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -718,6 +718,7 @@  static void vmsvga_fifo_run(struct vmsvga_state_s *s)
     struct vmsvga_cursor_definition_s cursor;
     uint32_t cmd_start;
     bool cmd_ignored;
+    bool irq_pending = false;
 
     len = vmsvga_fifo_length(s);
     while (len > 0 && --maxloop > 0) {
@@ -920,6 +921,13 @@  static void vmsvga_fifo_run(struct vmsvga_state_s *s)
     }
 
     s->syncing = 0;
+
+    /* Need to raise irq ? */
+    if (irq_pending && (s->irq_status & s->irq_mask)) {
+        struct pci_vmsvga_state_s *pci_vmsvga
+            = container_of(s, struct pci_vmsvga_state_s, chip);
+        pci_set_irq(PCI_DEVICE(pci_vmsvga), 1);
+    }
 }
 
 static uint32_t vmsvga_index_read(void *opaque, uint32_t address)