From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 3/9] drm/i915/de: Introduce mmio read/write templates
Date: Fri, 6 Nov 2026 18:03:43 +0200 [thread overview]
Message-ID: <au35-6h_qwLrZH0f@intel.com> (raw)
In-Reply-To: <283ba9737e27cff4d70b7ee2ab3b0ec287d573de@intel.com>
On Fri, Nov 06, 2026 at 04:52:22PM +0200, Jani Nikula wrote:
> On Thu, 05 Nov 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > In order to eliminate runtime platform check overhead from
> > the mmio read/write functions, we'll need a good way to construct
> > optimal variants for each platform. Do that in the form of
> > __intel_de_{read,write}() that can be customized via (compile time
> > constnt) mmio_flags. The compiler will eliminate all the stuff
> > we don't want.
>
> Are the __always_inline required?
Perhaps not in practice, don't think I actually checked the
generated code without them. I put them there because I really
want to force the compiler to notice that mmio_flags is a
compile time constant and thus there is dead code to eliminate.
Dunno if I want to rely on compiler inlining heuristics for that.
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> >
> > For now there is nothing to eliminate but next we'll start
> > moving more stuff in to make that possible.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_de.c | 26 +++++++++++++++++++++++--
> > 1 file changed, 24 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_de.c b/drivers/gpu/drm/i915/display/intel_de.c
> > index 4f423a684ec2..cde2886fe2ca 100644
> > --- a/drivers/gpu/drm/i915/display/intel_de.c
> > +++ b/drivers/gpu/drm/i915/display/intel_de.c
> > @@ -163,16 +163,38 @@ u16 intel_de_read16(struct intel_display *display, intel_reg_t reg)
> > return intel_uncore_read16(__to_uncore(display), reg);
> > }
> >
> > +static __always_inline u32
> > +__intel_de_read(struct intel_display *display, intel_reg_t reg,
> > + const unsigned int mmio_flags)
> > +{
> > + u32 val;
> > +
> > + val = intel_uncore_read(__to_uncore(display), reg);
> > +
> > + return val;
> > +}
> > +
> > +static __always_inline void
> > +__intel_de_write(struct intel_display *display, intel_reg_t reg, u32 val,
> > + const unsigned int mmio_flags)
> > +{
> > + intel_uncore_write(__to_uncore(display), reg, val);
> > +}
> > +
> > +#define I9XX_MMIO_FLAGS 0
> > +
> > static u32 i9xx_mmio_read(struct intel_display *display, intel_reg_t reg)
> > {
> > - return intel_uncore_read(__to_uncore(display), reg);
> > + return __intel_de_read(display, reg, I9XX_MMIO_FLAGS);
> > }
> >
> > static void i9xx_mmio_write(struct intel_display *display, intel_reg_t reg, u32 val)
> > {
> > - intel_uncore_write(__to_uncore(display), reg, val);
> > + __intel_de_write(display, reg, val, I9XX_MMIO_FLAGS);
> > }
> >
> > +#undef I9XX_MMIO_FLAGS
> > +
> > static const struct intel_mmio_funcs i9xx_mmio_funcs = {
> > .read = i9xx_mmio_read,
> > .write = i9xx_mmio_write,
>
> --
> Jani Nikula, Intel
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2026-11-06 16:04 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 22:18 [PATCH 0/9] drm/i915/de: Work towards uncore elimination Ville Syrjala
2026-11-04 22:18 ` [PATCH 1/9] drm/i915/de: Introduce dislay->mmio and intel_de_init() Ville Syrjala
2026-11-04 22:31 ` sashiko-bot
2026-11-05 8:58 ` Jani Nikula
2026-11-05 20:03 ` Ville Syrjälä
2026-11-04 23:29 ` Michał Grzelak
2026-11-04 22:18 ` [PATCH 2/9] drm/i915/de: Convert intel_de_{read,write}() into vfuncs Ville Syrjala
2026-11-06 14:50 ` Jani Nikula
2026-11-06 15:35 ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 3/9] drm/i915/de: Introduce mmio read/write templates Ville Syrjala
2026-11-04 23:32 ` Michał Grzelak
2026-11-06 14:52 ` Jani Nikula
2026-11-06 16:03 ` Ville Syrjälä [this message]
2026-11-04 22:18 ` [PATCH 4/9] drm/i915/de: Eliminate runtime overhead from DMC wakelock on pre-LNL platforms Ville Syrjala
2026-11-06 14:53 ` Jani Nikula
2026-11-04 22:18 ` [PATCH 5/9] drm/i915/de: Introduce display->mmio.lock Ville Syrjala
2026-11-04 22:35 ` sashiko-bot
2026-11-05 9:32 ` Jani Nikula
2026-11-05 13:43 ` Ville Syrjälä
2026-11-05 13:47 ` Jani Nikula
2026-11-06 14:55 ` Jani Nikula
2026-11-04 22:18 ` [PATCH 6/9] drm/i915/uncore: Don't meddle with mmio debug upon user forcewake Ville Syrjala
2026-11-06 14:58 ` Jani Nikula
2026-11-04 22:18 ` [PATCH 7/9] drm/i915/de: Move unclaimed mmio detection into display code Ville Syrjala
2026-11-04 22:36 ` sashiko-bot
2026-11-06 16:19 ` Ville Syrjälä
2026-11-06 16:39 ` Jani Nikula
2026-11-06 17:24 ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 8/9] drm/i915/de: Stop using intel_uncore_{read,write}() Ville Syrjala
2026-11-06 15:37 ` Jani Nikula
2026-11-06 15:55 ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 9/9] drm/xe: Nuke the intel_uncore_{read,write}() wrappers Ville Syrjala
2026-11-06 15:38 ` [PATCH 9/9] drm/xe: Nuke the intel_uncore_{read, write}() wrappers Jani Nikula
2026-11-05 0:01 ` ✗ CI.checkpatch: warning for drm/i915/de: Work towards uncore elimination Patchwork
2026-11-05 0:03 ` ✓ CI.KUnit: success " Patchwork
2026-11-05 0:40 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-05 7:10 ` ✗ CI.checkpatch: warning for drm/i915/de: Work towards uncore elimination (rev2) Patchwork
2026-11-05 7:13 ` ✓ CI.KUnit: success " Patchwork
2026-11-05 7:47 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-06 1:17 ` ✓ Xe.CI.FULL: " 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=au35-6h_qwLrZH0f@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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