From: Kenneth Graunke <kenneth.w.graunke@intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
Matt Roper <matthew.d.roper@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
"Chery, Nanley G" <nanley.g.chery@intel.com>,
"Saarinen, Jani" <jani.saarinen@intel.com>,
"Souza, Jose" <jose.souza@intel.com>,
"Mathew, Alwin" <alwin.mathew@intel.com>,
"Zhang, Jianxun" <jianxun.zhang@intel.com>,
"Syrjala, Ville" <ville.syrjala@linux.intel.com>,
"Nikula, Jani" <jani.nikula@intel.com>
Subject: Re: [RFC PATCH 0/3] Introducing I915_FORMAT_MOD_4_TILED_XE2_CCS Modifier for Xe2
Date: Fri, 10 May 2024 17:58:34 -0700 [thread overview]
Message-ID: <22290768.EfDdHjke4D@mizzik> (raw)
In-Reply-To: <20240507225657.GI5615@mdroper-desk1.amr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 3403 bytes --]
On Tuesday, May 7, 2024 3:56:57 PM PDT Matt Roper wrote:
> On Mon, May 06, 2024 at 09:52:35PM +0300, Juha-Pekka Heikkila wrote:
> > These patches introduce I915_FORMAT_MOD_4_TILED_XE2_CCS modifier, which,
> > from the kernel's perspective, behaves similarly to
`I915_FORMAT_MOD_4_TILED`.
> > This new modifier is primarily intended for user space to effectively
monitor
> > compression status, especially when dealing with a mix of compressed and
> > uncompressed buffers.
> >
> > The addition of this modifier facilitates user space in managing
compression
> > status, particularly when utilizing both compressed and uncompressed
buffers
> > concurrently. To leverage compression for these buffers, user space
> > applications must configure the appropriate Page Attribute Table (PAT)
index.
> > Display engine will treat all Tile4 as if it were compressed under all
> > circumstances on Xe2 architecture.
>
> I may have missed some discussion about this, but I thought the previous
> consensus was that we didn't want/need new modifiers for compression on
> Xe2? If a userspace client (or the display hardware) receives a buffer
> of unknown origin and unknown compression status, it's always fine to
> select a compressed PAT when binding the buffer to read since even for
> uncompressed buffers the CCS metadata will accurately reflect the
> compression status. Unlike Xe1, where generating content without
> compression enabled would leave random garbage in the FlatCCS area, Xe2
> will set the corresponding FlatCCS to '0x0' for each block, indicating
> uncompressed data.
>
> Can you explain more what the benefit of handling these modifiers
> explicitly is?
>
>
> Matt
Thanks, Matt! I'm a bit late in getting up to speed with the Xe2 compression
changes; this is really good information.
As I understand it...all blocks on the GPU behave in the way you mentioned,
where generating uncompressed data via the GPU will set FlatCCS = 0, so you
can assume a compressed PAT entry and everything works.
One snag is...I've heard that CPU access doesn't work that way. So, if you
mmap a buffer on the CPU, and write data with the CPU, then I think we're back
to the "FlatCCS contains uninitialized garbage" case, where it's unsafe to
assume a compressed PAT. And... we don't really know when sharing buffers
whether the other side is going to want to do CPU access.
It would be really nice to assume compression by default, though, which got me
thinking: if we mmap a buffer via DRM_XE_GEM_MMAP_OFFSET, could xe.ko disable
compression for us? So, resolve any outstanding CCS data, and then switch any
PAT entries to uncompressed. Mapping would block until that resolve is done.
It could leave compression off forever (once you CPU map a buffer, it's never
compressed again). Or it could turn CCS back on when map count reaches 0 (but
frankly I'm not sure that's terribly important, and sounds more complex).
As I understand it, at least on discrete GPUs, the kernel already has to do
something similar for eviction, when migrating BOs to system memory (which
doesn't support compression). So this would be doing basically the same
"resolve and disable CCS" step the kernel can presumably already do, but now
on mmap as well.
What do you think? Viable? Crazy? Have I missed something?
--Ken
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-05-11 0:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 18:52 [RFC PATCH 0/3] Introducing I915_FORMAT_MOD_4_TILED_XE2_CCS Modifier for Xe2 Juha-Pekka Heikkila
2024-05-06 18:52 ` [RFC PATCH 1/3] drm/fourcc: define Intel Xe2 related tile4 ccs modifier Juha-Pekka Heikkila
2024-06-04 15:54 ` Chery, Nanley G
2024-05-06 18:52 ` [RFC PATCH 2/3] drm/xe/display: allow creation of case I915_FORMAT_MOD_4_TILED_XE2_CCS type framebuffer Juha-Pekka Heikkila
2024-05-07 16:07 ` Ville Syrjälä
2024-05-07 16:41 ` Juha-Pekka Heikkila
2024-05-06 18:52 ` [RFC PATCH 3/3] drm/i915/display: " Juha-Pekka Heikkila
2024-05-07 16:06 ` Ville Syrjälä
2024-05-07 16:43 ` Juha-Pekka Heikkila
2024-05-06 23:53 ` ✓ CI.Patch_applied: success for Introducing I915_FORMAT_MOD_4_TILED_XE2_CCS Modifier for Xe2 Patchwork
2024-05-06 23:53 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-06 23:54 ` ✓ CI.KUnit: success " Patchwork
2024-05-07 0:06 ` ✓ CI.Build: " Patchwork
2024-05-07 0:09 ` ✓ CI.Hooks: " Patchwork
2024-05-07 0:10 ` ✗ CI.checksparse: warning " Patchwork
2024-05-07 0:56 ` ✓ CI.BAT: success " Patchwork
2024-05-07 5:48 ` ✓ CI.FULL: " Patchwork
2024-05-07 22:56 ` [RFC PATCH 0/3] " Matt Roper
2024-05-08 13:08 ` Juha-Pekka Heikkila
2024-05-11 0:58 ` Kenneth Graunke [this message]
2024-05-14 9:25 ` Joonas Lahtinen
2024-05-14 16:51 ` Thomas Hellström
2024-07-19 20:17 ` Zhang, Jianxun
2024-07-23 22:51 ` Chery, Nanley G
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=22290768.EfDdHjke4D@mizzik \
--to=kenneth.w.graunke@intel.com \
--cc=alwin.mathew@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=jani.saarinen@intel.com \
--cc=jianxun.zhang@intel.com \
--cc=jose.souza@intel.com \
--cc=juhapekka.heikkila@gmail.com \
--cc=matthew.d.roper@intel.com \
--cc=nanley.g.chery@intel.com \
--cc=ville.syrjala@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