dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915/overlay: Remove redundant drm_rect_visible() use
@ 2023-03-25 17:27 Arthur Grillo
  2024-03-04 11:13 ` Ville Syrjälä
  0 siblings, 1 reply; 2+ messages in thread
From: Arthur Grillo @ 2023-03-25 17:27 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: tvrtko.ursulin, tales.aparecida, lucas.demarchi, mairacanal,
	rodrigo.vivi, andrealmeid, Arthur Grillo

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drm/i915/overlay: Remove redundant drm_rect_visible() use
  2023-03-25 17:27 [PATCH v2] drm/i915/overlay: Remove redundant drm_rect_visible() use Arthur Grillo
@ 2024-03-04 11:13 ` Ville Syrjälä
  0 siblings, 0 replies; 2+ messages in thread
From: Ville Syrjälä @ 2024-03-04 11:13 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: intel-gfx, dri-devel, mairacanal, andrealmeid, tales.aparecida,
	daniel, airlied, jani.nikula, joonas.lahtinen, rodrigo.vivi,
	tvrtko.ursulin, lucas.demarchi

On Sat, Mar 25, 2023 at 02:27:19PM -0300, Arthur Grillo wrote:
> 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>

Sorry, looks like I completely missed this.
Now push the drm-intel-next. Thanks.

> ---
> 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

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-04 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 17:27 [PATCH v2] drm/i915/overlay: Remove redundant drm_rect_visible() use Arthur Grillo
2024-03-04 11:13 ` Ville Syrjälä

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).