drm/i915/overlay: Remove redundant drm_rect_visible() use
authorArthur Grillo <arthurgrillo@riseup.net>
Sat, 25 Mar 2023 17:27:19 +0000 (14:27 -0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 4 Mar 2024 11:00:26 +0000 (13:00 +0200)
The drm_rect_intersect() already returns if the intersection is visible
or not, so the use of drm_rect_visible() is duplicate.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230325172719.92102-1-arthurgrillo@riseup.net
drivers/gpu/drm/i915/display/intel_overlay.c

index 2b1392d5a902745b474c2b6676db46f06b7653e7..1c2099ed5514bca462a3e62b5d6386ddcb957661 100644 (file)
@@ -972,10 +972,11 @@ static int check_overlay_dst(struct intel_overlay *overlay,
                      rec->dst_width, rec->dst_height);
 
        clipped = req;
-       drm_rect_intersect(&clipped, &crtc_state->pipe_src);
 
-       if (!drm_rect_visible(&clipped) ||
-           !drm_rect_equals(&clipped, &req))
+       if (!drm_rect_intersect(&clipped, &crtc_state->pipe_src))
+               return -EINVAL;
+
+       if (!drm_rect_equals(&clipped, &req))
                return -EINVAL;
 
        return 0;