[PATCH 1/2] DRI2SwapBuffers: Don't reuse swap_target variable.

Keith Packard keithp at keithp.com
Fri Apr 18 16:43:23 PDT 2014

Jamey Sharp <jamey at minilop.net> writes:

> swap_target is an out-parameter that needs to be set to the value that
> SBC will take on after this SwapBuffers request completes.
> However, it was also being used as a temporary variable to hold the MSC
> at which the SwapBuffers request got scheduled to occur. This confusion
> makes it harder to reason about whether swap_target is being set
> correctly for its out-parameter usage. (Hint: It isn't.)
> For the latter use, it makes more sense to use the existing target_msc
> variable, which already has the right value unless target_msc, divisor,
> and remainder are all 0, in which case we can set it using swap_interval
> as usual.

This seems harmless to me; the only change is that if ScheduleSwap
returns failure, *swap_target will not have been changed.

Reviewed-by: Keith Packard <keithp at keithp.com>

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140418/5ab8677c/attachment.sig>

More information about the xorg-devel mailing list