intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Nikita Kiryushin <kiryushin@ancud.ru>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Manasi Navare <manasi.d.navare@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH] drm/i915: Remove unneeded double drm_rect_visible call in check_overlay_dst
Date: Mon, 4 Mar 2024 13:11:17 +0200	[thread overview]
Message-ID: <ZeWsVXhj1AUD4q3G@intel.com> (raw)
In-Reply-To: <ecfb0f31-a454-4a51-9fb8-9cd0aca3195c@ancud.ru>

On Fri, Mar 01, 2024 at 09:56:41PM +0300, Nikita Kiryushin wrote:
> On 2/29/24 15:30, Ville Syrjälä wrote:
> > I prefer the current way where we have no side effects in
> > the if statement.
> >
> 
> This seem like a valid concern from readability and maintainability 
> standpoint. My patch was aimed mostly at performance and maintainability 
> using tools: some more pedantic analyzers are sensitive to non-checked 
> return values (as of now, drm_rect_intersect is ignored).
> 
> Would it be a better idea to make an update to the patch with second 
> drm_rect_visible call changed to an appropriately named state flag set 
> with drm_rect_intersect result?

I was thinking of maybe removing that drm_rect_visible() from
drm_rect_intersect() entirely, but looks like it's used fairly
extensively, so would require a bunch of work.

But now that I though about this I recalled that there was an earlier
patch trying to do exactly what you suggested in this patch. And looks
like there was a second version posted which I completely missed:
https://patchwork.freedesktop.org/series/115605/

While that does still have drm_rect_intersect() with its side effects
inside the if() I don't find it quite as objectionable since it's the
only thing in there. So it's a bit more obvious what is happening.
I've gone and merged that one.

Thanks for the patch regardless. At least I reminded me to look at the
earlier attempt ;)

> 
> BTW, the original patch somehow got mangled while it made its way to the 
> patchwork: source list line in patch got broken, which permits the patch 
> from being applied (the original version did not have that line break). 
> Any ideas how to prevent this happening with the second version of patch 
> (in case the idea is viable)?

-- 
Ville Syrjälä
Intel

      reply	other threads:[~2024-03-04 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 18:32 [PATCH] drm/i915: Remove unneeded double drm_rect_visible call in check_overlay_dst Nikita Kiryushin
2024-02-29 12:30 ` Ville Syrjälä
2024-03-01 18:56   ` Nikita Kiryushin
2024-03-04 11:11     ` Ville Syrjälä [this message]

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=ZeWsVXhj1AUD4q3G@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kiryushin@ancud.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=manasi.d.navare@intel.com \
    --cc=rodrigo.vivi@intel.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).