From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Shankar, Uma" <uma.shankar@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915/dsb: Correct DSB command buffer cache coherency settings
Date: Fri, 13 Oct 2023 16:48:17 +0300 [thread overview]
Message-ID: <ZSlKoSr2WMp8eQM8@intel.com> (raw)
In-Reply-To: <DM4PR11MB63604202F27DECE62EA33E99F4D3A@DM4PR11MB6360.namprd11.prod.outlook.com>
On Thu, Oct 12, 2023 at 09:40:23PM +0000, Shankar, Uma wrote:
>
>
> > -----Original Message-----
> > From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville
> > Syrjala
> > Sent: Monday, October 9, 2023 6:52 PM
> > To: intel-gfx@lists.freedesktop.org
> > Subject: [Intel-gfx] [PATCH 2/4] drm/i915/dsb: Correct DSB command buffer
> > cache coherency settings
> >
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > The display engine does not snoop the caches so shoukd to mark the DSB
>
> Nit: Typo here
>
> I am not sure on the cache behaviour so someone from core can also ack.
> To me , looks logically correct.
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Thanks. This series is now merged. Fingers crossed DSB will behave
nicely...
>
> > command buffer as I915_CACHE_NONE.
> > i915_gem_object_create_internal() always gives us I915_CACHE_LLC on LLC
> > platforms. And to make things 100% correct we should also clflush at the end, if
> > necessary.
> >
> > Note that currently this is a non-issue as we always write the command buffer
> > through a WC mapping, so a cache flush is not actually needed. But we might
> > actually want to consider a WB mapping since we also end up reading from the
> > command buffer (in the indexed reg write handling). Either that or we should do
> > something else to avoid those reads (might actually be even more sensible on
> > DGFX since we end up reading over PCIe). But we should measure the overhead
> > first...
> >
> > Anyways, no real harm in adding the belts and suspenders here so that the code
> > will work correctly regardless of how we map the buffer. If we do get a WC
> > mapping (as we request)
> > i915_gem_object_flush_map() will be a nop. Well, apart form a wmb() which may
> > just flush the WC buffer a bit earlier than would otherwise happen (at the latest
> > the mmio accesses would trigger the WC flush).
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_dsb.c | 15 +++++++++++----
> > 1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c
> > b/drivers/gpu/drm/i915/display/intel_dsb.c
> > index 7410ba3126f9..78b6fe24dcd8 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> > @@ -316,6 +316,8 @@ void intel_dsb_finish(struct intel_dsb *dsb)
> > DSB_FORCE_DEWAKE, 0);
> >
> > intel_dsb_align_tail(dsb);
> > +
> > + i915_gem_object_flush_map(dsb->vma->obj);
> > }
> >
> > static int intel_dsb_dewake_scanline(const struct intel_crtc_state *crtc_state)
> > @@ -462,13 +464,18 @@ struct intel_dsb *intel_dsb_prepare(const struct
> > intel_crtc_state *crtc_state,
> > /* ~1 qword per instruction, full cachelines */
> > size = ALIGN(max_cmds * 8, CACHELINE_BYTES);
> >
> > - if (HAS_LMEM(i915))
> > + if (HAS_LMEM(i915)) {
> > obj = i915_gem_object_create_lmem(i915, PAGE_ALIGN(size),
> >
> > I915_BO_ALLOC_CONTIGUOUS);
> > - else
> > + if (IS_ERR(obj))
> > + goto out_put_rpm;
> > + } else {
> > obj = i915_gem_object_create_internal(i915, PAGE_ALIGN(size));
> > - if (IS_ERR(obj))
> > - goto out_put_rpm;
> > + if (IS_ERR(obj))
> > + goto out_put_rpm;
> > +
> > + i915_gem_object_set_cache_coherency(obj,
> > I915_CACHE_NONE);
> > + }
> >
> > vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, 0);
> > if (IS_ERR(vma)) {
> > --
> > 2.41.0
>
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-10-13 13:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 13:22 [Intel-gfx] [PATCH 1/4] drm/i915/dsb: Allocate command buffer from local memory Ville Syrjala
2023-10-09 13:22 ` [Intel-gfx] [PATCH 2/4] drm/i915/dsb: Correct DSB command buffer cache coherency settings Ville Syrjala
2023-10-12 21:40 ` Shankar, Uma
2023-10-13 13:48 ` Ville Syrjälä [this message]
2023-10-09 13:22 ` [Intel-gfx] [PATCH 3/4] drm/i915/dsb: Re-instate DSB for LUT updates Ville Syrjala
2023-10-09 13:22 ` [Intel-gfx] [PATCH 4/4] drm/i915: Do state check for color management changes Ville Syrjala
2023-10-09 20:48 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915/dsb: Allocate command buffer from local memory Patchwork
2023-10-09 21:02 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-10 2:26 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-12 21:22 ` [Intel-gfx] [PATCH 1/4] " Shankar, Uma
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=ZSlKoSr2WMp8eQM8@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=uma.shankar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.