[win32/vd_agent 3/4] introduce turn_monitor_off method of WDDM interface

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

 



Adding method 'turn_monitor_off' to WDDM interface.
It sends QXL_ESCAPE_MONITOR_CONFIG escape with zeroed
display size to qxl-wddm-dod driver.

Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
---
 vdagent/display_configuration.cpp | 18 ++++++++++++++++++
 vdagent/display_configuration.h   |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/vdagent/display_configuration.cpp b/vdagent/display_configuration.cpp
index f535a38..4577db2 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -489,6 +489,24 @@ bool WDDMInterface::update_monitor_config(LPCTSTR device_name, DisplayMode* disp
 
 }
 
+bool WDDMInterface::turn_monitor_off(LPCTSTR device_name)
+{
+    vd_printf("for %S", device_name);
+    if (!_send_monitors_config)
+    {
+        vd_printf("do nothing as _send_monitors_config is off");
+        return false;
+    }
+
+    WDDMMonitorConfigEscape wddm_escape(NULL);
+    if (escape(device_name, &wddm_escape, sizeof(wddm_escape))) {
+        return true;
+    }
+
+    vd_printf("%S failed", device_name);
+    return false;
+}
+
 LONG WDDMInterface::update_display_settings()
 {
     LONG error(0);
diff --git a/vdagent/display_configuration.h b/vdagent/display_configuration.h
index 81fabfe..756303e 100644
--- a/vdagent/display_configuration.h
+++ b/vdagent/display_configuration.h
@@ -153,7 +153,7 @@ public:
     bool update_monitor_config(LPCTSTR device_name, DisplayMode* mode, DEVMODE* dev_mode);
     bool update_dev_mode_position(LPCTSTR device_name, DEVMODE * dev_mode, LONG x, LONG y);
     void update_config_path();
-
+    bool turn_monitor_off(LPCTSTR device_name);
 private:
     bool init_d3d_api();
     D3D_HANDLE adapter_handle(LPCTSTR device_name);
-- 
2.16.1.windows.4

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




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