Commit Graph

8 Commits

Author SHA1 Message Date
Frediano Ziglio
debf1fe981 Make CCD::load_api throw exception on its own
Avoid to use two different ways to handle errors.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Sameeh Jubran <sameeh@daynix.com>
2016-09-02 16:56:09 +01:00
Frediano Ziglio
b24a935335 Fails CCD initialisation if get_config_buffers detect WDDM is not present
There's no point continuing without WDDM as CCD cannot work without it.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Sameeh Jubran <sameeh@daynix.com>
2016-09-02 16:55:54 +01:00
Frediano Ziglio
67b63fe6f7 Do not print function calling vd_printf
vd_printf already print the current function

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-09-02 15:26:27 +01:00
Frediano Ziglio
6bdd83d780 Remove small possible buffer overflow
wcsncpy requires number of characters, not bytes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-09-01 15:45:11 +01:00
Sameeh Jubran
3616a7ed38 Implementing WDDM interface to support multiple monitors and arbitrary resolution
The Direct3D 9 API operates on either the Windows XP display driver
model (XPDM) or the Windows Vista display driver model (WDDM), depending
on the operating system installed.

This patch implements the WDDM interface while using the CCD API to do
so. Moreover it introduces multiple monitors support and arbitrary
resolution for Windows 10 while preserving backward compatiblity with
previous versions of Windows.

Based on a patch by Sandy Stutsman <sstutsma at redhat.com>

Signed-off-by: Dmitry Fleytman <dfleytma at redhat.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-01 12:32:59 +01:00
Sameeh Jubran
3856b1147a Initialize buffers before querying display config
The buffers and buffer sizes should be initialized and allocated. This
patch fixes a possible case where vdagent can get stuck, as the
function _pfnQueryDisplayConfig can return ERROR_INVALID_PARAMETER
if the buffers aren't intialized.
The call to free_config_buffers is superfluous because it is called
inside get_config_buffers.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-08-30 14:22:56 +01:00
Sameeh Jubran
d81d8cdbde Encapsulating XPDM implementation
The Direct3D 9 API operates on either the Windows XP display driver
model (XPDM) or the Windows Vista display driver model (WDDM), depending
on the operating system installed.

This patch encapsulates the current XPDM interface implementation into
XPDMInterface class which inherits DisplayConfig class. This patch
makes it easier to introduce WDDM interface to Vdagent in future
patches.

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-08-16 11:19:02 +01:00
Sameeh Jubran
588a7134df Introducing Windows CCD API
The Connecting and Configuring Displays (CCD) Win32 APIs
provide more control over the desktop display setup. The CCD APIs
move away from using Windows Graphics Device Interface (GDI)
concepts like view name and toward Windows Display Driver Model
(WDDM) concepts like adapter, source, and target identifiers.
More info on the CCD API can be found here:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff539590(v=vs.85).aspx

This patch introduces partial functionality from the CCD API
needed by vdagent. It is needed by vdagent in order to support
multiple monitors and arbitrary resolution on Windows 10.

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-08-16 11:19:00 +01:00