[PATCH] randr: Fix logic in RRPointerToNearestCrtc

Keith Packard keithp at keithp.com
Mon Jul 28 12:14:21 PDT 2014

David Ung <davidu at nvidia.com> writes:

> ping?
> ________________________________________
> From: David Ung [davidu at nvidia.com]
> Sent: Thursday, July 17, 2014 5:19 PM
> To: xorg-devel at lists.x.org
> Cc: David Ung
> Subject: [PATCH] randr: Fix logic in RRPointerToNearestCrtc
> RRPointerToNearestCrtc is suppose to snap to the nearest Crtc,
> but the code is buggy.  Correct the calculation of delta x/y
> values and choose the closest Crtc.

This comment isn't terribly descriptive of the problems it's
solving. There are two -- one where the dx/dy values end up off-by-one
and another where it's simply forgetting to actually set the 'best' value.

> +        dist = abs(dx) + abs(dy);

You don't need abs here; dx and dy are always positive.

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/20140728/1dba96bd/attachment.sig>

More information about the xorg-devel mailing list