diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2022-04-15 13:51:11 +0200 |
---|---|---|
committer | Olivier Fourdan <fourdan@gmail.com> | 2022-04-20 07:02:54 +0000 |
commit | 972603845eda7e382451fcd31cd5083592f83ffd (patch) | |
tree | 3a57171993541fe08fb6588863a3b3f2623fe1a0 | |
parent | 479c8aae8e6e6059f77be8de79726e7f6eac61a9 (diff) |
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: Olivier Fourdan <ofourdan@redhat.com>
Fixes: df8e86931e - randr: Add ability to turn PRIME sync off
Reviewed-by: Alex Goins <agoins@nvidia.com>
Tested-by: Alex Goins <agoins@nvidia.com>
-rw-r--r-- | randr/rrcrtc.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 3a9b620ab..cf66f8ef9 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -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; |