OSDN Git Service

drm/rect: Keep the scaled clip bounded
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 Nov 2019 17:56:21 +0000 (19:56 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 Nov 2019 11:33:33 +0000 (13:33 +0200)
commit2e351705f18a80dea6398233ac21a02aff5b0597
tree502b3658e5eb462b54690d9da775df72c087e607
parent433480c1afd44f3e1e664b85063d98cefeefa0ed
drm/rect: Keep the scaled clip bounded

Limit the scaled clip to only clip at most dst_w/h pixels.
This avoids the problem with clip_scaled() not being able
to return negative values. Since new_src_w/h is now properly
bounded we can remove the clamp()s.

Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Testcase: igt/kms_selftest/drm_rect_clip_scaled_signed_vs_unsigned
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191122175623.13565-3-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@st.com>
drivers/gpu/drm/drm_rect.c