[Spice-devel] [PATCH v2 1/6] qxl-wddm-dod: Return EDID data to the OS

Yuri Benditovich yuri.benditovich at daynix.com
Wed Feb 15 12:00:10 UTC 2017


Solves failure of HLK "Test for EDID requirements"
EDID contains capabilities and manufacturer data of
the emulated display device. Parsed EDID data presented
in the source file.

Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
---
 qxldod/QxlDod.cpp | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 104 insertions(+), 2 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index cb64209..dca263a 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -371,6 +371,95 @@ NTSTATUS QxlDod::QueryChildStatus(_Inout_ DXGK_CHILD_STATUS* pChildStatus,
     }
 }
 
+static UCHAR edid[256] =
+{
+    0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
+    0x47,0x0C,0x01,0x00,0x41,0xFA,0x38,0x78,
+    0x01,0x1B,0x01,0x04,0x6A,0x22,0x1B,0x78,
+    0xEA,0x32,0x31,0xA3,0x57,0x4C,0x9D,0x25,
+    0x11,0x50,0x54,0x04,0x43,0x00,0x31,0x4F,
+    0x45,0x4F,0x61,0x4F,0x81,0x4F,0x01,0x01,
+    0x01,0x01,0x01,0x01,0x01,0x01,0xBA,0x2C,
+    0x00,0xA0,0x50,0x00,0x25,0x40,0x30,0x20,
+    0x37,0x00,0x54,0x0E,0x11,0x00,0x00,0x1E,
+    0x00,0x00,0x00,0xFD,0x00,0x38,0x50,0x1E,
+    0x53,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x51,
+    0x58,0x4C,0x30,0x30,0x30,0x31,0x0A,0x20,
+    0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x10,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xD5,
+    0x02,0x03,0x04,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,
+};
+
+/* edid-decode:
+    Extracted contents:
+    header:          00 ff ff ff ff ff ff 00
+    serial number:   47 0c 01 00 41 fa 38 78 01 1b
+    version:         01 04
+    basic params:    6a 22 1b 78 ea
+    chroma info:     32 31 a3 57 4c 9d 25 11 50 54
+    established:     04 43 00
+    standard:        31 4f 45 4f 61 4f 81 4f 01 01 01 01 01 01 01 01
+    descriptor 1:    ba 2c 00 a0 50 00 25 40 30 20 37 00 54 0e 11 00 00 1e
+    descriptor 2:    00 00 00 fd 00 38 50 1e 53 0f 00 00 00 00 00 00 00 00
+    descriptor 3:    00 00 00 fc 00 51 58 4c 30 30 30 31 0a 20 20 20 20 20
+    descriptor 4:    00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+    extensions:      01
+    checksum:        d5
+
+    Manufacturer: QXL Model 1 Serial Number 2017000001
+    Made week 1 of 2017
+    EDID version: 1.4
+    Analog display, Input voltage level: 0.7/0.7 V
+    Blank level equals black level
+    Sync: Separate SyncOnGreen
+    Maximum image size: 34 cm x 27 cm
+    Gamma: 2.20
+    DPMS levels: Standby Suspend Off
+    RGB color display
+    First detailed timing is preferred timing
+    Established timings supported:
+    640x480 at 75Hz
+    800x600 at 75Hz
+    1024x768 at 75Hz
+    1280x1024 at 75Hz
+    Standard timings supported:
+    640x480 at 75Hz
+    800x600 at 75Hz
+    1024x768 at 75Hz
+    1280x960 at 75Hz
+    Detailed mode: Clock 114.500 MHz, 340 mm x 270 mm
+    1280 1328 1360 1440 hborder 0
+    1024 1027 1034 1061 vborder 0
+    +hsync +vsync
+    Monitor ranges: 56-80HZ vertical, 30-83kHz horizontal, max dotclock 150MHz
+    Monitor name: QXL0001
+    Dummy block
+    Has 1 extension blocks
+    Checksum: 0xd5
+
+    CEA extension block
+    Extension version: 3
+    0 bytes of CEA data
+    0 native detailed modes
+    Checksum: 0xf7
+*/
 // EDID retrieval
 NTSTATUS QxlDod::QueryDeviceDescriptor(_In_    ULONG                   ChildUid,
                                        _Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor)
@@ -380,8 +469,21 @@ NTSTATUS QxlDod::QueryDeviceDescriptor(_In_    ULONG                   ChildUid,
     QXL_ASSERT(pDeviceDescriptor != NULL);
     QXL_ASSERT(ChildUid < MAX_CHILDREN);
 
-    DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
-    return STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA;
+    if (pDeviceDescriptor->DescriptorOffset >= sizeof(edid))
+    {
+        DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s out of area\n", __FUNCTION__));
+        return STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA;
+    }
+    else
+    {
+        PVOID src = edid + pDeviceDescriptor->DescriptorOffset;
+        ULONG len = sizeof(edid) - pDeviceDescriptor->DescriptorOffset;
+        len = min(len, pDeviceDescriptor->DescriptorLength);
+        RtlMoveMemory(pDeviceDescriptor->DescriptorBuffer, src, len);
+        pDeviceDescriptor->DescriptorLength = len;
+        DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s (%d copied)\n", __FUNCTION__, len));
+        return STATUS_SUCCESS;
+    }
 }
 
 NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo)
-- 
2.7.0.windows.1



More information about the Spice-devel mailing list