summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_sprite.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-05-03 13:22:14 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-05-04 11:09:54 +0200
commitf96bdf564f3e7511aecdd4c35cc18ac5e0750a2f (patch)
treee0b610aaad29b30bf9af55abbb72821b43c0307f /drivers/gpu/drm/i915/intel_sprite.c
parent6f96f2000ac27b0f5f769b0bc2f0440ebfa1c3a3 (diff)
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
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index dbdcf85032df..e17c26a1cff1 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1003,7 +1003,7 @@ intel_check_sprite_plane(struct intel_plane *plane,
drm_mode_get_hv_timing(&crtc_state->base.mode,
&clip.x2, &clip.y2);
- state->base.visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale);
+ state->base.visible = drm_rect_clip_scaled(src, dst, &clip);
crtc_x = dst->x1;
crtc_y = dst->y1;