[PATCH] xrandr: allow disconnecting of offload and outputs

Aaron Plattner aplattner at nvidia.com
Mon May 6 12:55:59 PDT 2013


Maybe use None instead of 0 for the XIDs?  I'm not too offended by the 
zeros there, so

Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
Tested-by: Aaron Plattner <aplattner at nvidia.com>

Thanks for sending this out -- sorry I didn't get around to it last week.

On 05/02/2013 05:05 PM, Dave Airlie wrote:
> Before the lookup code passing a 0 XID would disconnect,
> this fixes it backup.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>   xrandr.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/xrandr.c b/xrandr.c
> index 305308c..d5727b2 100644
> --- a/xrandr.c
> +++ b/xrandr.c
> @@ -2446,6 +2446,8 @@ find_provider (name_t *name)
>   {
>       int i;
>
> +    if ((name->kind & name_xid) && name->xid == 0)
> +	return NULL;
>       for (i = 0; i < num_providers; i++) {
>   	provider_t *p = &providers[i];
>   	name_kind_t common = name->kind & p->provider.kind;
> @@ -3228,7 +3230,7 @@ main (int argc, char **argv)
>   	provider = find_provider (&provider_name);
>   	source = find_provider(&output_source_provider_name);
>
> -	XRRSetProviderOutputSource(dpy, provider->provider.xid, source->provider.xid);
> +	XRRSetProviderOutputSource(dpy, provider->provider.xid, source ? source->provider.xid : 0);
>       }
>       if (provsetoffsink)
>       {
> @@ -3243,7 +3245,7 @@ main (int argc, char **argv)
>   	provider = find_provider (&provider_name);
>   	sink = find_provider(&offload_sink_provider_name);
>
> -	XRRSetProviderOffloadSink(dpy, provider->provider.xid, sink->provider.xid);
> +	XRRSetProviderOffloadSink(dpy, provider->provider.xid, sink ? sink->provider.xid : 0);
>       }
>       if (setit_1_2)
>       {
>

-- 
Aaron


More information about the xorg-devel mailing list