From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v5 06/11] lib/rendercopy_gen9: Separate xe and xe2 compression format
Date: Tue, 14 May 2024 20:25:31 +0300 [thread overview]
Message-ID: <d4c7df91-0eef-42fc-9653-4159e9300759@gmail.com> (raw)
In-Reply-To: <20240509053359.449885-7-zbigniew.kempczynski@intel.com>
On 9.5.2024 8.33, Zbigniew Kempczyński wrote:
> Xe and beyond differ how compression format is handled. For Xe it
> is 5-bit long whereas for Xe2+ this is 4-bit long field. Instead of
> artifically packing 0-15 into 5-bit field lets separate this structures
> to conform with the documentation.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> lib/gen9_render.h | 31 +++++++++++++++++++++----------
> lib/rendercopy_gen9.c | 24 ++++++++++++++++--------
> 2 files changed, 37 insertions(+), 18 deletions(-)
>
> diff --git a/lib/gen9_render.h b/lib/gen9_render.h
> index 8ed60a2a54..4c1ed4726a 100644
> --- a/lib/gen9_render.h
> +++ b/lib/gen9_render.h
> @@ -154,16 +154,27 @@ struct gen9_surface_state {
> uint32_t aux_base_addr_hi;
> } ss11;
>
> - struct {
> - /*
> - * compression_format is used only dg2 onward.
> - * prior to dg2 full ss12 is used for the address
> - * but due to alignments bits 0..6 will be zero
> - * and asserted in code to be so
> - */
> - uint32_t compression_format:5;
> - uint32_t pad0:1;
> - uint32_t clear_address:26;
> + union {
> + struct {
> + /*
> + * compression_format is used only dg2 onward.
> + * prior to dg2 full ss12 is used for the address
> + * but due to alignments bits 0..6 will be zero
> + * and asserted in code to be so
> + */
> + uint32_t compression_format:5;
> + uint32_t pad0:1;
> + uint32_t clear_address:26;
> + } xe;
> +
> + struct {
> + /*
> + * On Xe2+ compression format is 4-bit long.
> + */
> + uint32_t compression_format:4;
> + uint32_t mip_region_depth_in_log:4;
> + uint32_t pad0:24;
> + } xe2;
I'd prefer here use same naming convention as with rest of the
structure. Ie. xe would become dg2 as commented above and xe2 I figure
is likely lnl.
otherwise everything look ok, with those fixed
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> } ss12;
>
> struct {
> diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c
> index 7c7563d50c..35d79acbab 100644
> --- a/lib/rendercopy_gen9.c
> +++ b/lib/rendercopy_gen9.c
> @@ -264,7 +264,7 @@ gen9_bind_buf(struct intel_bb *ibb, const struct intel_buf *buf, int is_dst,
> igt_assert(__builtin_ctzl(address + buf->cc.offset) >= 6 &&
> (__builtin_clzl(address + buf->cc.offset) >= 16));
>
> - ss->ss12.clear_address = (address + buf->cc.offset) >> 6;
> + ss->ss12.xe.clear_address = (address + buf->cc.offset) >> 6;
> ss->ss13.clear_address_hi = (address + buf->cc.offset) >> 32;
> }
>
> @@ -274,13 +274,21 @@ gen9_bind_buf(struct intel_bb *ibb, const struct intel_buf *buf, int is_dst,
> ss->ss7.dg2.disable_support_for_multi_gpu_partial_writes = 1;
> ss->ss7.dg2.disable_support_for_multi_gpu_atomics = 1;
>
> - /*
> - * For now here is coming only 32bpp rgb format
> - * which is marked below as B8G8R8X8_UNORM = '8'
> - * If here ever arrive other formats below need to be
> - * fixed to take that into account.
> - */
> - ss->ss12.compression_format = 8;
> + if (AT_LEAST_GEN(ibb->devid, 20)) {
> + /*
> + * For Xe2+ R8G8B8A8 best compression ratio is
> + * achieved with compression format = '2'
> + */
> + ss->ss12.xe2.compression_format = 2;
> + } else {
> + /*
> + * For now here is coming only 32bpp rgb format
> + * which is marked below as B8G8R8X8_UNORM = '8'
> + * If here ever arrive other formats below need to be
> + * fixed to take that into account.
> + */
> + ss->ss12.xe.compression_format = 8;
> + }
> }
> }
>
next prev parent reply other threads:[~2024-05-14 17:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 5:33 [PATCH i-g-t v5 00/11] Add render-copy compression on Xe+ Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 01/11] lib/intel_bufops: Store devid on buffer ops creation Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 02/11] lib/intel_blt: Rename confusing fb tile to i915 tile Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 03/11] lib/intel_blt: Add i915 -> blt tile helper converter Zbigniew Kempczyński
2024-05-14 11:37 ` Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 04/11] lib/intel_bufops: Restrict tilings on non-flatccs platforms Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 05/11] lib/intel_bufops: Start supporting compression on Xe2+ Zbigniew Kempczyński
2024-05-14 17:23 ` Juha-Pekka Heikkila
2024-05-09 5:33 ` [PATCH i-g-t v5 06/11] lib/rendercopy_gen9: Separate xe and xe2 compression format Zbigniew Kempczyński
2024-05-14 17:25 ` Juha-Pekka Heikkila [this message]
2024-05-09 5:33 ` [PATCH i-g-t v5 07/11] lib/intel_cmds_info: Define tiling macros Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 08/11] lib/intel_cmds_info: Introduce render tilings Zbigniew Kempczyński
2024-05-14 17:26 ` Juha-Pekka Heikkila
2024-05-15 12:04 ` Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 09/11] lib/intel_blt: Add render tilings and compression support helper Zbigniew Kempczyński
2024-05-09 5:33 ` [PATCH i-g-t v5 10/11] tests/xe_render_copy: Add subtest which exercises compression Zbigniew Kempczyński
2024-05-14 17:26 ` Juha-Pekka Heikkila
2024-05-09 5:33 ` [PATCH i-g-t v5 11/11] tests/xe_intel_bb: Use supported tilings instead hardcoded ones Zbigniew Kempczyński
2024-05-14 17:26 ` Juha-Pekka Heikkila
2024-05-09 7:34 ` ✓ CI.xeBAT: success for Add render-copy compression on Xe+ (rev5) Patchwork
2024-05-09 7:43 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-05-10 6:17 ` Zbigniew Kempczyński
2024-05-09 16:20 ` ✗ CI.xeFULL: " 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=d4c7df91-0eef-42fc-9653-4159e9300759@gmail.com \
--to=juhapekka.heikkila@gmail.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=zbigniew.kempczynski@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.