[PATCH v2 3/8] randr: Add ability to turn PRIME sync off

Adam Jackson ajax at nwnk.net
Tue Jan 12 10:27:42 PST 2016

On Tue, 2016-01-05 at 13:56 -0800, Alex Goins wrote:

> If the user wishes to enable or disable PRIME synchronization after PRIME
> has already been set up, they can run 'xrandr --output  --set
> "PRIME Synchronization" <0 or 1>' at any time, it will trigger a modeset,
> tear down and setup PRIME in the configuration they requested on CRTCs
> associated with that output.

I was confused trying to find where the modeset would be triggered; the
answer is xrandr re-sets the current mode after a property change, it's
not something xserver does internally.

> +static void
> +RRFiniPrimeSyncProps(ScreenPtr pScreen)
> +{
> +    rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
> +    int i;
> +
> +    const char *syncStr = PRIME_SYNC_PROP;
> +    Atom syncProp = MakeAtom(syncStr, strlen(syncStr), FALSE);
> +    if (syncProp == None)
> +        return;
> +
> +    for (i = 0; i < pScrPriv->numOutputs; i++) {
> +        RRDeleteOutputProperty(pScrPriv->outputs[i], syncProp);
> +    }
> +}

This is sort of academic, but you're tearing down the output prop for
every output, which isn't really correct if we ever had different
sources for different outputs.  That's not really an issue since the
old per-crtc scanout pixmap work never landed [1], so we still have the
notion of _the_ screen pixmap.

But I suppose if we ever _did_ try to make that go, you could set the
property value to the XID of the source you wanted, and for
compatibility TRUE would mean "pick one".  And at that point we'd have
enough info to walk backwards to detach only the right properties at
provider destroy.

- ajax

More information about the xorg-devel mailing list