From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/i915_crc: Use system memory buffer on integrated platforms
Date: Wed, 1 Feb 2023 16:41:15 +0100 [thread overview]
Message-ID: <20230201154115.xftfmerf5sidbdpb@kamilkon-desk1> (raw)
In-Reply-To: <20230201132657.575932-2-zbigniew.kempczynski@intel.com>
On 2023-02-01 at 14:26:56 +0100, Zbigniew Kempczyński wrote:
> Previous assumption crc32 will be calculated only on discrete is
> not valid anymore - MTL supports extended ALU SHL/SHR instructions
> so we can calculate crc there as well.
>
> Instead of enforcing local memory as target of buffers involved
> in calculations use system memory on integrated.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
LGTM,
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
--
Kamil
> ---
> lib/i915/i915_crc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/i915/i915_crc.c b/lib/i915/i915_crc.c
> index 70b84a815a..cdd3cef6df 100644
> --- a/lib/i915/i915_crc.c
> +++ b/lib/i915/i915_crc.c
> @@ -244,10 +244,11 @@ uint32_t i915_crc32(int i915, uint64_t ahnd, const intel_ctx_t *ctx,
> uint64_t bb_offset, table_offset, data_offset;
> uint32_t bb, table, crc, table_size = 4096;
> uint32_t *ptr;
> + uint32_t region = gem_has_lmem(i915) ? REGION_LMEM(0) : REGION_SMEM;
>
> igt_assert(data_size % 4 == 0);
>
> - table = gem_create_in_memory_regions(i915, table_size, REGION_LMEM(0));
> + table = gem_create_in_memory_regions(i915, table_size, region);
> gem_write(i915, table, 0, igt_crc32_tab, sizeof(igt_crc32_tab));
>
> table_offset = get_offset(ahnd, table, table_size, 0);
> @@ -261,7 +262,7 @@ uint32_t i915_crc32(int i915, uint64_t ahnd, const intel_ctx_t *ctx,
> obj[1].flags = EXEC_OBJECT_PINNED;
> obj[1].handle = data_handle;
>
> - bb = gem_create_in_memory_regions(i915, BBSIZE, REGION_LMEM(0));
> + bb = gem_create_in_memory_regions(i915, BBSIZE, region);
> bb_offset = get_offset(ahnd, bb, BBSIZE, 0);
> fill_batch(i915, bb, bb_offset, table_offset, data_offset, data_size);
> obj[2].offset = bb_offset;
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-02-01 15:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 13:26 [igt-dev] [PATCH i-g-t 0/2] Unblock crc32 calculation Zbigniew Kempczyński
2023-02-01 13:26 ` [igt-dev] [PATCH i-g-t 1/2] lib/i915_crc: Use system memory buffer on integrated platforms Zbigniew Kempczyński
2023-02-01 15:41 ` Kamil Konieczny [this message]
2023-02-01 13:26 ` [igt-dev] [PATCH i-g-t 2/2] lib/i915_crc: Use graphics version to determine ALU SHL/SHR caps Zbigniew Kempczyński
2023-02-01 15:44 ` Kamil Konieczny
2023-02-02 8:38 ` Zbigniew Kempczyński
2023-02-01 13:57 ` [igt-dev] ✓ Fi.CI.BAT: success for Unblock crc32 calculation Patchwork
2023-02-01 14:59 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-02-01 15:13 ` [igt-dev] [PATCH i-g-t 0/2] " Das, Nirmoy
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=20230201154115.xftfmerf5sidbdpb@kamilkon-desk1 \
--to=kamil.konieczny@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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