@@ -375,17 +375,37 @@ const DISPLAYCONFIG_VIDEO_SIGNAL_INFO IndirectDeviceContext::s_KnownMonitorModes
375375 { { 255 , 0 } }, // video standard and vsync divider
376376 DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE
377377 },
378+ // 800 x 600 @ 60Hz
379+ {
380+ 40 * MHZ, // pixel clock rate [Hz]
381+ { 40 * MHZ, 800 + 256 }, // fractional horizontal refresh rate [Hz]
382+ { 40 * MHZ, (800 + 256 ) * (600 + 28 ) }, // fractional vertical refresh rate [Hz]
383+ { 1920 , 1280 }, // (horizontal, vertical) active pixel resolution
384+ { 1920 + 256 , 1280 + 28 }, // (horizontal, vertical) total pixel resolution
385+ { { 255 , 0 }}, // video standard and vsync divider
386+ DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE
387+ },
378388};
379389
380390// This is a sample monitor EDID - FOR SAMPLE PURPOSES ONLY
381391const BYTE IndirectDeviceContext::s_KnownMonitorEdid[] =
382392{
383- 0x00 ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0x00 ,0x79 ,0x5E ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xA6 ,0x01 ,0x03 ,0x80 ,0x28 ,
393+ /* 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x79,0x5E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x01,0x03,0x80,0x28,
384394 0x1E,0x78,0x0A,0xEE,0x91,0xA3,0x54,0x4C,0x99,0x26,0x0F,0x50,0x54,0x20,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,
385395 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xA0,0x0F,0x20,0x00,0x31,0x58,0x1C,0x20,0x28,0x80,0x14,0x00,
386396 0x90,0x2C,0x11,0x00,0x00,0x1E,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
387397 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
388- 0x00 ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x6E
398+ 0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E */
399+
400+ 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0x00 , 0x31 , 0xD8 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
401+ 0x05 , 0x16 , 0x01 , 0x03 , 0x6D , 0x32 , 0x1C , 0x78 , 0xEA , 0x5E , 0xC0 , 0xA4 , 0x59 , 0x4A , 0x98 , 0x25 ,
402+ 0x20 , 0x50 , 0x54 , 0x00 , 0x00 , 0x00 , 0xD1 , 0xC0 , 0x01 , 0x01 , 0x01 , 0x01 , 0x01 , 0x01 , 0x01 , 0x01 ,
403+ 0x01 , 0x01 , 0x01 , 0x01 , 0x01 , 0x01 , 0x02 , 0x3A , 0x80 , 0x18 , 0x71 , 0x38 , 0x2D , 0x40 , 0x58 , 0x2C ,
404+ 0x45 , 0x00 , 0xF4 , 0x19 , 0x11 , 0x00 , 0x00 , 0x1E , 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x4C , 0x69 , 0x6E ,
405+ 0x75 , 0x78 , 0x20 , 0x23 , 0x30 , 0x0A , 0x20 , 0x20 , 0x20 , 0x20 , 0x00 , 0x00 , 0x00 , 0xFD , 0x00 , 0x3B ,
406+ 0x3D , 0x42 , 0x44 , 0x0F , 0x00 , 0x0A , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x00 , 0x00 , 0x00 , 0xFC ,
407+ 0x00 , 0x4C , 0x69 , 0x6E , 0x75 , 0x78 , 0x20 , 0x46 , 0x48 , 0x44 , 0x0A , 0x20 , 0x20 , 0x20 , 0x00 , 0x05
408+
389409};
390410
391411IndirectDeviceContext::IndirectDeviceContext (_In_ WDFDEVICE WdfDevice) :
@@ -398,6 +418,8 @@ IndirectDeviceContext::~IndirectDeviceContext()
398418 m_ProcessingThread.reset ();
399419}
400420
421+ #define NUM_VIRTUAL_DISPLAYS 5
422+
401423void IndirectDeviceContext::InitAdapter ()
402424{
403425 // ==============================
@@ -411,7 +433,7 @@ void IndirectDeviceContext::InitAdapter()
411433 AdapterCaps.Size = sizeof (AdapterCaps);
412434
413435 // Declare basic feature support for the adapter (required)
414- AdapterCaps.MaxMonitorsSupported = 1 ;
436+ AdapterCaps.MaxMonitorsSupported = NUM_VIRTUAL_DISPLAYS ;
415437 AdapterCaps.EndPointDiagnostics .Size = sizeof (AdapterCaps.EndPointDiagnostics );
416438 AdapterCaps.EndPointDiagnostics .GammaSupport = IDDCX_FEATURE_IMPLEMENTATION_NONE;
417439 AdapterCaps.EndPointDiagnostics .TransmissionType = IDDCX_TRANSMISSION_TYPE_WIRED_OTHER;
@@ -454,6 +476,12 @@ void IndirectDeviceContext::InitAdapter()
454476
455477void IndirectDeviceContext::FinishInit ()
456478{
479+ for (unsigned int i = 0 ; i < NUM_VIRTUAL_DISPLAYS; i++) {
480+ CreateMonitor (i);
481+ }
482+ }
483+
484+ void IndirectDeviceContext::CreateMonitor (unsigned int index) {
457485 // ==============================
458486 // TODO: In a real driver, the EDID should be retrieved dynamically from a connected physical monitor. The EDID
459487 // provided here is purely for demonstration, as it describes only 640x480 @ 60 Hz and 800x600 @ 60 Hz. Monitor
@@ -468,7 +496,7 @@ void IndirectDeviceContext::FinishInit()
468496 IDDCX_MONITOR_INFO MonitorInfo = {};
469497 MonitorInfo.Size = sizeof (MonitorInfo);
470498 MonitorInfo.MonitorType = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI;
471- MonitorInfo.ConnectorIndex = 0 ;
499+ MonitorInfo.ConnectorIndex = index ;
472500 MonitorInfo.MonitorDescription .Size = sizeof (MonitorInfo.MonitorDescription );
473501 MonitorInfo.MonitorDescription .Type = IDDCX_MONITOR_DESCRIPTION_TYPE_EDID;
474502 MonitorInfo.MonitorDescription .DataSize = sizeof (s_KnownMonitorEdid);
0 commit comments