[RFC PATCH qxl-wddm-dod 20/28] Adding ioctl operation for updating Vdagent state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sameeh Jubran <sameeh@xxxxxxxxxx>

This patch adds a new ioctl to the driver which allows Vdagent
to update it's current state. This allowas the driver to know
when Vdgaent is running and when it is off.

Signed-off-by: Sameeh Jubran <sameeh@xxxxxxxxxx>
Signed-off-by: Dmitry Fleytman <dmitry@xxxxxxxxxx>
---
 qxldod/QxlDod.cpp            | 17 +++++++++++++++++
 qxldod/QxlDod.h              |  3 +++
 qxldod/include/qxl_windows.h |  4 ++++
 3 files changed, 24 insertions(+)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 74cd259..42c82e3 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -52,6 +52,7 @@ typedef struct _QXL_ESCAPE {
     union {
         QXLEscapeSetCustomDisplay custom_display;
         QXLHead monitor_config;
+        QXLEscapeVDAgentRunning vdagent_running;
     };
 }QXL_ESCAPE;
 
@@ -2927,6 +2928,7 @@ QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
     m_FreeOutputs = 0;
     m_Pending = 0;
     m_type = QXL_DEVICE;
+    m_VDAgentRunning = FALSE;
 }
 
 QxlDevice::~QxlDevice(void)
@@ -4520,6 +4522,11 @@ void QxlDevice::SetMonitorConfig(QXLHead * monitor_config)
         m_monitor_config->heads[0].width, m_monitor_config->heads[0].height));
     AsyncIo(QXL_IO_MONITORS_CONFIG_ASYNC, 0);
 }
+void QxlDevice::SaveVDAgentState(QXLEscapeVDAgentRunning* vdagent_running)
+{
+    PAGED_CODE();
+    m_VDAgentRunning = (vdagent_running->running == 0) ? FALSE : TRUE;
+}
 
 NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 {
@@ -4550,6 +4557,16 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
         status = STATUS_SUCCESS;
         break;
     }
+    case QXL_ESCAPE_VDAGENT_RUNNING: {
+        data_size += sizeof(QXLEscapeVDAgentRunning);
+        if (pEscape->PrivateDriverDataSize != data_size) {
+            status = STATUS_INVALID_BUFFER_SIZE;
+            break;
+    }
+        SaveVDAgentState(&pQXLEscape->vdagent_running);
+        status = STATUS_SUCCESS;
+        break;
+    }
     default:
         DbgPrint(TRACE_LEVEL_ERROR, ("%s: invalid Escape 0x%x\n", __FUNCTION__, pQXLEscape->ioctl));
         status = STATUS_INVALID_PARAMETER;
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 9bc0bdb..6c5d0f8 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -551,8 +551,11 @@ private:
     NTSTATUS UpdateChildStatus(BOOLEAN connect);
     NTSTATUS SetCustomDisplay(QXLEscapeSetCustomDisplay* custom_display);
     void SetMonitorConfig(QXLHead* monitor_config);
+    void SaveVDAgentState(QXLEscapeVDAgentRunning* vdagent_running);
 
 private:
+    BOOLEAN m_VDAgentRunning;
+
     PUCHAR m_IoBase;
     BOOLEAN m_IoMapped;
     ULONG m_IoSize;
diff --git a/qxldod/include/qxl_windows.h b/qxldod/include/qxl_windows.h
index 1f97fb7..a7e108f 100755
--- a/qxldod/include/qxl_windows.h
+++ b/qxldod/include/qxl_windows.h
@@ -4,6 +4,7 @@
 enum {
     QXL_ESCAPE_SET_CUSTOM_DISPLAY = 0x10001,
     QXL_ESCAPE_MONITOR_CONFIG,
+    QXL_ESCAPE_VDAGENT_RUNNING
 };
 
 typedef struct QXLEscapeSetCustomDisplay {
@@ -12,4 +13,7 @@ typedef struct QXLEscapeSetCustomDisplay {
     uint32_t bpp;
 } QXLEscapeSetCustomDisplay;
 
+typedef struct QXLEscapeVDAgentRunning {
+    uint32_t running;
+} QXLEscapeVDAgentRunning;
 #endif /* _H_QXL_WINDOWS */
-- 
1.8.3.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]