[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZeWsVXhj1AUD4q3G@intel.com>
Date: Mon, 4 Mar 2024 13:11:17 +0200
From: Ville Syrjälä <ville.syrjala@...ux.intel.com>
To: Nikita Kiryushin <kiryushin@...ud.ru>
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Manasi Navare <manasi.d.navare@...el.com>,
intel-gfx@...ts.freedesktop.org, intel-xe@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: Re: [PATCH] drm/i915: Remove unneeded double drm_rect_visible call
in check_overlay_dst
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
Powered by blists - more mailing lists