[PATCH xserver v2] xwayland: Pretend we support viewport in vidmode
Hans de Goede
hdegoede at redhat.com
Mon Mar 21 09:19:37 UTC 2016
Hi,
On 21-03-16 09:53, Olivier Fourdan wrote:
> Some games (namely openttd) will raise an XError and fail with a
> BadValue if their request to XF86VidModeSetViewPort fails.
>
> Support only the default zoom and viewport, fail for everything else.
>
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Looks good to me:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Regards,
Hans
> ---
> v2: Support only the default zoom and viewport.
>
> hw/xwayland/xwayland-vidmode.c | 19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c
> index 6d70e39..0bcd114 100644
> --- a/hw/xwayland/xwayland-vidmode.c
> +++ b/hw/xwayland/xwayland-vidmode.c
> @@ -208,15 +208,26 @@ xwlVidModeDeleteModeline(ScreenPtr pScreen, DisplayModePtr mode)
> static Bool
> xwlVidModeZoomViewport(ScreenPtr pScreen, int zoom)
> {
> - /* Unsupported for now */
> - return FALSE;
> + /* Support only no zoom */
> + return (zoom == 1);
> }
>
> static Bool
> xwlVidModeSetViewPort(ScreenPtr pScreen, int x, int y)
> {
> - /* Unsupported for now */
> - return FALSE;
> + RROutputPtr output;
> + RRCrtcPtr crtc;
> +
> + output = RRFirstOutput(pScreen);
> + if (output == NULL)
> + return FALSE;
> +
> + crtc = output->crtc;
> + if (crtc == NULL)
> + return FALSE;
> +
> + /* Support only default viewport */
> + return (x == crtc->x && y == crtc->y);
> }
>
> static Bool
>
More information about the xorg-devel
mailing list