dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Arthur Grillo <arthurgrillo@riseup.net>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: tvrtko.ursulin@linux.intel.com, tales.aparecida@gmail.com,
	lucas.demarchi@intel.com, mairacanal@riseup.net,
	rodrigo.vivi@intel.com, andrealmeid@riseup.net,
	Arthur Grillo <arthurgrillo@riseup.net>
Subject: [PATCH v2] drm/i915/overlay: Remove redundant drm_rect_visible() use
Date: Sat, 25 Mar 2023 14:27:19 -0300	[thread overview]
Message-ID: <20230325172719.92102-1-arthurgrillo@riseup.net> (raw)

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>
---
v1->v2: https://lore.kernel.org/all/20230324142533.6357-1-arthurgrillo@riseup.net/
- Split the if condition.
---
 drivers/gpu/drm/i915/display/intel_overlay.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index c12bdca8da9b..d55153587cae 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -966,10 +966,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;
-- 
2.39.2


             reply	other threads:[~2023-03-25 17:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 17:27 Arthur Grillo [this message]
2024-03-04 11:13 ` [PATCH v2] drm/i915/overlay: Remove redundant drm_rect_visible() use Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230325172719.92102-1-arthurgrillo@riseup.net \
    --to=arthurgrillo@riseup.net \
    --cc=andrealmeid@riseup.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=mairacanal@riseup.net \
    --cc=rodrigo.vivi@intel.com \
    --cc=tales.aparecida@gmail.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).