[Spice-devel] [PATCH v9 1/2] Modifying ioctl structures

Frediano Ziglio fziglio at redhat.com
Tue Aug 16 16:10:41 UTC 2016


> 
> This patch modifies the Qxl ioctl structures in order
> to make them unified. Ioctls now should inherit QXL_ESCAPE
> structure.
> 
> Signed-off-by: Sameeh Jubran <sameeh at daynix.com>

Yes, but doing so with a XDDM driver will fail.
ExtEscape ABI should remain the same.
The structure with the code was done as D3D APIs does not take
a constant but just a raw buffer so the new structures should
be used just with D3DKMTEscape.

Frediano

> ---
>  vdagent/display_configuration.cpp | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/vdagent/display_configuration.cpp
> b/vdagent/display_configuration.cpp
> index 01fdbb0..cdbe5e8 100644
> --- a/vdagent/display_configuration.cpp
> +++ b/vdagent/display_configuration.cpp
> @@ -153,26 +153,26 @@ struct DISPLAYCONFIG_PATH_INFO {
>      UINT32 flags;
>  };
>  
> -struct QXLMonitorEscape {
> +struct QXLMonitorEscape : QXL_ESCAPE {
>      QXLMonitorEscape(DEVMODE* dev_mode)
>      {
> -        ZeroMemory(&_head, sizeof(_head));
> -        _head.x = dev_mode->dmPosition.x;
> -        _head.y = dev_mode->dmPosition.y;
> -        _head.width = dev_mode->dmPelsWidth;
> -        _head.height = dev_mode->dmPelsHeight;
> +        ZeroMemory(&monitor_config, sizeof(monitor_config));
> +        ioctl = QXL_ESCAPE_MONITOR_CONFIG;
> +        monitor_config.x = dev_mode->dmPosition.x;
> +        monitor_config.y = dev_mode->dmPosition.y;
> +        monitor_config.width = dev_mode->dmPelsWidth;
> +        monitor_config.height = dev_mode->dmPelsHeight;
>      }
> -    QXLHead _head;
>  };
>  
> -struct QxlCustomEscapeObj : public QXLEscapeSetCustomDisplay {
> +struct QxlCustomEscapeObj : public QXL_ESCAPE {
>      QxlCustomEscapeObj(uint32_t bitsPerPel, uint32_t width, uint32_t height)
>      {
> -        xres = width;
> -        yres = height;
> -        bpp = bitsPerPel;
> +        ioctl = QXL_ESCAPE_SET_CUSTOM_DISPLAY;
> +        custom_display.xres = width;
> +        custom_display.yres = height;
> +        custom_display.bpp = bitsPerPel;
>      }
> -    QxlCustomEscapeObj() {};
>  };
>  
>  DisplayConfig* DisplayConfig::create_config()
> @@ -252,7 +252,7 @@ bool XPDMInterface::custom_display_escape(LPCTSTR
> device_name, DEVMODE* dev_mode
>                                              dev_mode->dmPelsWidth,
>                                              dev_mode->dmPelsHeight);
>  
>      int err = ExtEscape(hdc, QXL_ESCAPE_SET_CUSTOM_DISPLAY,
> -              sizeof(QXLEscapeSetCustomDisplay), (LPCSTR) &custom_escape, 0,
> NULL);
> +              sizeof(QxlCustomEscapeObj), (LPCSTR) &custom_escape, 0, NULL);
>      if (err <= 0) {
>          vd_printf("%s: Can't set custom display, perhaps running with an
>          older driver?",
>              __FUNCTION__);
> @@ -281,7 +281,7 @@ bool XPDMInterface::update_monitor_config(LPCTSTR
> device_name, DisplayMode* mode
>          return false;
>      }
>  
> -    err = ExtEscape(hdc, QXL_ESCAPE_MONITOR_CONFIG, sizeof(QXLHead),
> +    err = ExtEscape(hdc, QXL_ESCAPE_MONITOR_CONFIG,
> sizeof(QXLMonitorEscape),
>                      (LPCSTR) &monitor_config, 0, NULL);
>      if (err < 0) {
>          vd_printf("%s: %S can't update monitor config, may have old, old
>          driver",



More information about the Spice-devel mailing list