[PATCH] randr: Fix logic in RRPointerToNearestCrtc

David Ung davidu at nvidia.com
Mon Jul 28 13:19:12 PDT 2014

thanks, do you need me to re-upload another patch with the modify message? and will you be doing the actual commit?
I am new to xorg submission.

From: Keith Packard [keithp at keithp.com]
Sent: Monday, July 28, 2014 1:07 PM
To: David Ung; xorg-devel at lists.x.org
Subject: RE: [PATCH] randr: Fix logic in RRPointerToNearestCrtc

* PGP Signed by an unknown key

David Ung <davidu at nvidia.com> writes:

>>> 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.
> but its more that dx/dy off-by-one.
> previously best_dx/dy is always positive, if x > scan_width,
> when you call SetCursorPosition, the cursor's x position is gonna be
> even further away from the crtc's right edge.


> RRPointerToNearestCrtc is suppose to snap to the nearest Crtc,
> but best_x and best_y is always positive, hence when calling
> SetCursorPosition it will make the cursor even further away.
> Correct delta x/y to allow negative values and also use
>  "width/height -1" in the calculation.  Also choose the closest Crtc
> by setting the "best" value.

Thanks. That describes the patch better.

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

keith.packard at intel.com

* Unknown Key
* 0x00000011
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

More information about the xorg-devel mailing list