[Spice-devel] [PATCH linux vdagent 02/10] Fix confusion between output index and crtc index

Lukáš Hrázký lhrazky at redhat.com
Mon Dec 17 17:05:29 UTC 2018


On Thu, 2018-12-13 at 16:46 -0600, Jonathon Jongsma wrote:
> Get the CRTC ID from the output struct rather than using the
> output_index as an index into the array of crtcs
> ---
>  src/vdagent/x11-randr.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
> index 88f723f..802af5c 100644
> --- a/src/vdagent/x11-randr.c
> +++ b/src/vdagent/x11-randr.c
> @@ -399,8 +399,15 @@ static void xrandr_disable_output(struct vdagent_x11 *x11, int output)
>          return;
>      }
>  
> +    XRROutputInfo *oinfo = x11->randr.outputs[output];
> +    if (oinfo->ncrtc == 0) {
> +        syslog(LOG_WARNING, "Output index %i doesn't have any associated CRTCs", output);
> +        return;
> +    }
> +
> +    // assume output only has a single crtc
>      s = XRRSetCrtcConfig(x11->display, x11->randr.res,
> -                         x11->randr.res->crtcs[output],
> +                         oinfo->crtcs[0],
>                           CurrentTime, 0, 0, None, RR_Rotate_0,
>                           NULL, 0);
>  

Acked-by: Lukáš Hrázký <lhrazky at redhat.com>


More information about the Spice-devel mailing list