Maarten Lankhorst f96bdf564f drm/rect: Handle rounding errors in drm_rect_clip_scaled, v3.
Instead of relying on a scale which may increase rounding errors,
clip src by doing: src * (dst - clip) / dst and rounding the result
away from 1, so the new coordinates get closer to 1. We won't need
to fix up with a magic macro afterwards, because our scaling factor
will never go to the other side of 1.

Changes since v1:
- Adjust dst immediately, else drm_rect_width/height on dst gives bogus
  results.
Change since v2:
- Get rid of macros and use 64-bits math.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
[mlankhorst: Add Villes comment, and rename newsrc to tmp. (Ville)]
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180503112217.37292-3-maarten.lankhorst@linux.intel.com
2018-05-04 11:09:54 +02:00
..
2018-03-02 10:44:44 +01:00
2018-02-02 10:01:04 -08:00
2018-02-26 09:28:35 -08:00
2018-03-14 15:39:33 -04:00
2018-03-05 07:57:41 -05:00
2018-03-09 09:33:48 -08:00
2018-03-21 11:10:20 +01:00
2018-02-01 10:31:17 -08:00
2018-03-08 10:39:58 -07:00
2018-01-02 14:46:35 +01:00
2018-03-28 14:30:41 +10:00
2018-03-28 14:30:41 +10:00
2018-03-12 15:11:59 +05:30
2018-03-14 13:01:14 -07:00
2017-12-18 16:47:27 +01:00
2018-02-05 10:07:40 -08:00
2018-02-06 09:59:40 -08:00
2018-03-20 16:59:01 -07:00
2017-12-19 10:56:53 +01:00
2018-01-22 16:45:26 +01:00
2018-03-25 07:04:00 -10:00
2018-01-09 16:15:20 +01:00
2018-03-28 14:30:41 +10:00
2018-03-09 16:54:18 -08:00
2018-02-01 10:31:17 -08:00
2018-02-06 09:59:40 -08:00