Skip to content
Snippets Groups Projects
Commit 97260384 authored by Olivier Fourdan's avatar Olivier Fourdan :tools: Committed by Olivier Fourdan
Browse files

randr: No need to check RRGetOutputProperty() twice


The function rrGetPixmapSharingSyncProp() will check for the PRIME sync
property "PRIME Synchronization" on each output and return false if
any of the output has this property set to false.

To do so, it will call RRGetOutputProperty() twice for each output, once
with pending true and once with pending false to cover both
possibilities.

However, reading the implementation of RRGetOutputProperty(), it appears
that if the property is not pending, the code will return the current
value even if invoked with pending true.

So the second call to RRGetOutputProperty() with pending false seems
superfluous.

Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Fixes: df8e8693 - randr: Add ability to turn PRIME sync off
Reviewed-by: default avatarAlex Goins <agoins@nvidia.com>
Tested-by: default avatarAlex Goins <agoins@nvidia.com>
parent 479c8aae
No related branches found
No related tags found
1 merge request!893randr: No need to check RRGetOutputProperty() twice
......@@ -461,20 +461,12 @@ rrGetPixmapSharingSyncProp(int numOutputs, RROutputPtr * outputs)
for (o = 0; o < numOutputs; o++) {
RRPropertyValuePtr val;
/* Try pending value first, then current value */
if ((val = RRGetOutputProperty(outputs[o], syncProp, TRUE)) &&
val->data) {
if (!(*(char *) val->data))
return FALSE;
continue;
}
if ((val = RRGetOutputProperty(outputs[o], syncProp, FALSE)) &&
val->data) {
if (!(*(char *) val->data))
return FALSE;
continue;
}
}
return TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment