From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Arthur Grillo <arthurgrillo@riseup.net>
Cc: tales.aparecida@gmail.com, intel-gfx@lists.freedesktop.org,
lucas.demarchi@intel.com, dri-devel@lists.freedesktop.org,
mairacanal@riseup.net, daniel@ffwll.ch, rodrigo.vivi@intel.com,
andrealmeid@riseup.net, airlied@gmail.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915/overlay: Remove redundant drm_rect_visible() use
Date: Fri, 24 Mar 2023 23:55:36 +0200 [thread overview]
Message-ID: <ZB4cWCVPLPWTAM0H@intel.com> (raw)
In-Reply-To: <20230324142533.6357-1-arthurgrillo@riseup.net>
On Fri, Mar 24, 2023 at 11:25:33AM -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>
> ---
> drivers/gpu/drm/i915/display/intel_overlay.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
> index c12bdca8da9b..444d88f418c5 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.c
> @@ -966,9 +966,8 @@ 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) ||
> + if (!drm_rect_intersect(&clipped, &crtc_state->pipe_src) ||
> !drm_rect_equals(&clipped, &req))
Hmm. I think I like the original a bit better because there is
no hard to spot dependency between the two sides of the ||.
I suppose another option would to to replace the || with
two separate if statements.
> return -EINVAL;
>
> --
> 2.39.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-03-24 21:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 14:25 [Intel-gfx] [PATCH] drm/i915/overlay: Remove redundant drm_rect_visible() use Arthur Grillo
2023-03-24 16:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-03-24 21:55 ` Ville Syrjälä [this message]
2023-03-24 23:07 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=ZB4cWCVPLPWTAM0H@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@gmail.com \
--cc=andrealmeid@riseup.net \
--cc=arthurgrillo@riseup.net \
--cc=daniel@ffwll.ch \
--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 \
/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