From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Chery, Nanley G" <nanley.g.chery@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"Ghuge, Sagar" <sagar.ghuge@intel.com>,
Xi Ruoyao <xry111@xry111.site>,
"Souza, Jose" <jose.souza@intel.com>
Subject: Re: [PATCH 4/4] drm/uapi/fourcc: Document the Intel clear color alignment better
Date: Mon, 13 Jan 2025 18:38:27 +0200 [thread overview]
Message-ID: <Z4VBg59XVgxDqKKP@intel.com> (raw)
In-Reply-To: <MN0PR11MB5987217695BB98F25B39645ADC1C2@MN0PR11MB5987.namprd11.prod.outlook.com>
On Fri, Jan 10, 2025 at 03:43:35PM +0000, Chery, Nanley G wrote:
> > -----Original Message-----
> > From: Ville Syrjala <ville.syrjala@linux.intel.com>
> > Sent: Friday, November 29, 2024 1:50 AM
> > To: intel-gfx@lists.freedesktop.org
> > Cc: Ghuge, Sagar <sagar.ghuge@intel.com>; Chery, Nanley G <nanley.g.chery@intel.com>; Xi Ruoyao <xry111@xry111.site>
> > Subject: [PATCH 4/4] drm/uapi/fourcc: Document the Intel clear color alignment better
> >
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Document the fact that the Intel clear color offset and pitch
> > must be 64 byte aligned.
> >
>
> Documenting this new flexibility raises some questions. Particularly, how can userspace make use of the 64B alignment given that there are old kernels which require the 4K alignment?
I suppose we should document that part as well. And maybe
after a few years we can drop the 4k part, or something.
I did add cc:stable to the alignment patch so hopefully
after a while most kernels people actually use will
expect 64 byte alignment.
I've pushed everything except this last patch to
drm-intel-next. I'll try to reword this part a bit and
repost.
>
> -Nanley
>
> > Cc: Sagar Ghuge <sagar.ghuge@intel.com>
> > Cc: Nanley Chery <nanley.g.chery@intel.com>
> > Cc: Xi Ruoyao <xry111@xry111.site>
> > Link: https://gitlab.freedesktop.org/mesa/mesa/-/commit/17f97a69c13832a6c1b0b3aad45b06f07d4b852f
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > include/uapi/drm/drm_fourcc.h | 27 ++++++++++++++-------------
> > 1 file changed, 14 insertions(+), 13 deletions(-)
> >
> > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> > index 70f3b00b0681..8234db1f484a 100644
> > --- a/include/uapi/drm/drm_fourcc.h
> > +++ b/include/uapi/drm/drm_fourcc.h
> > @@ -598,7 +598,7 @@ extern "C" {
> > * compression.
> > *
> > * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear
> > - * and at index 1. The clear color is stored at index 2, and the pitch should
> > + * and at index 1. The clear color is stored at index 2, and the offset and pitch must
> > * be 64 bytes aligned. The clear color structure is 256 bits. The first 128 bits
> > * represents Raw Clear Color Red, Green, Blue and Alpha color each represented
> > * by 32 bits. The raw clear color is consumed by the 3d engine and generates
> > @@ -652,7 +652,7 @@ extern "C" {
> > * outside of the GEM object in a reserved memory area dedicated for the
> > * storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
> > * main surface pitch is required to be a multiple of four Tile 4 widths. The
> > - * clear color is stored at plane index 1 and the pitch should be 64 bytes
> > + * clear color is stored at plane index 1, and the offset and pitch must be 64 bytes
> > * aligned. The format of the 256 bits of clear color data matches the one used
> > * for the I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC modifier, see its description
> > * for details.
> > @@ -688,17 +688,18 @@ extern "C" {
> > * compression.
> > *
> > * The main surface is tile4 and is at plane index 0 whereas CCS is linear
> > - * and at index 1. The clear color is stored at index 2, and the pitch should
> > - * be ignored. The clear color structure is 256 bits. The first 128 bits
> > - * represents Raw Clear Color Red, Green, Blue and Alpha color each represented
> > - * by 32 bits. The raw clear color is consumed by the 3d engine and generates
> > - * the converted clear color of size 64 bits. The first 32 bits store the Lower
> > - * Converted Clear Color value and the next 32 bits store the Higher Converted
> > - * Clear Color value when applicable. The Converted Clear Color values are
> > - * consumed by the DE. The last 64 bits are used to store Color Discard Enable
> > - * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line
> > - * corresponds to an area of 4x1 tiles in the main surface. The main surface
> > - * pitch is required to be a multiple of 4 tile widths.
> > + * and at index 1. The clear color is stored at index 2, and the offset and
> > + * pitch must be 64 bytes aligned. The clear color structure is 256 bits.
> > + * The first 128 bits represents Raw Clear Color Red, Green, Blue and Alpha
> > + * color each represented by 32 bits. The raw clear color is consumed by the
> > + * 3d engine and generates the converted clear color of size 64 bits. The
> > + * first 32 bits store the Lower Converted Clear Color value and the next 32
> > + * bits store the Higher Converted Clear Color value when applicable. The
> > + * Converted Clear Color values are consumed by the DE. The last 64 bits are
> > + * used to store Color Discard Enable and Depth Clear Value Valid which are
> > + * ignored by the DE. A CCS cache line corresponds to an area of 4x1 tiles in
> > + * the main surface. The main surface pitch is required to be a multiple of
> > + * 4 tile widths.
> > */
> > #define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)
> >
> > --
> > 2.45.2
>
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-01-13 16:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-29 6:50 [PATCH 0/4] drm/i915/fb: Deal with Mesa clear color alignment regression Ville Syrjala
2024-11-29 6:50 ` [PATCH 1/4] drm/i915/fb: Relax clear color alignment to 64 bytes Ville Syrjala
2024-11-29 13:45 ` Xi Ruoyao
2024-11-29 6:50 ` [PATCH 2/4] drm/i915/fb: Add debug spew for misaligned CC plane Ville Syrjala
2024-11-29 6:50 ` [PATCH 3/4] drm/i915/fb: Check that the clear color fits within the BO Ville Syrjala
2024-11-29 6:50 ` [PATCH 4/4] drm/uapi/fourcc: Document the Intel clear color alignment better Ville Syrjala
2025-01-10 15:43 ` Chery, Nanley G
2025-01-13 16:38 ` Ville Syrjälä [this message]
2024-11-29 7:11 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/fb: Deal with Mesa clear color alignment regression Patchwork
2024-11-29 7:11 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-29 7:27 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-29 8:45 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/fb: Deal with Mesa clear color alignment regression (rev2) Patchwork
2024-11-29 8:45 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-29 8:57 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-29 11:17 ` ✗ i915.CI.Full: failure " Patchwork
2025-01-07 19:44 ` [PATCH 0/4] drm/i915/fb: Deal with Mesa clear color alignment regression Souza, Jose
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=Z4VBg59XVgxDqKKP@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=nanley.g.chery@intel.com \
--cc=sagar.ghuge@intel.com \
--cc=xry111@xry111.site \
/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.