From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Use detected start offset in intel-bb instead 0x0
Date: Tue, 24 May 2022 23:41:48 -0700 [thread overview]
Message-ID: <87r14it8pf.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20220524111836.152123-1-zbigniew.kempczynski@intel.com>
On Tue, 24 May 2022 04:18:36 -0700, Zbigniew Kempczyński wrote:
>
> On some platforms (like on ATS) 0x0 may not be available so allocator
> should be instantiated with safe start offset to avoid getting -ENOSPC.
> Change require also relaxation of automatic range selection in the
> allocator.
The patch LGTM:
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Do other callers of intel_allocator_open_full() also need to be modified to
provide a safe start offset?
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> ---
> lib/intel_allocator.c | 2 +-
> lib/intel_batchbuffer.c | 3 +++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
> index 340b888286..7882e484b5 100644
> --- a/lib/intel_allocator.c
> +++ b/lib/intel_allocator.c
> @@ -909,7 +909,7 @@ static uint64_t __intel_allocator_open_full(int fd, uint32_t ctx,
> struct alloc_resp resp;
> uint64_t gtt_size;
>
> - if (!start && !end) {
> + if (!end) {
> igt_assert_f(can_report_gtt_size(fd), "Invalid fd\n");
> gtt_size = gem_aperture_size(fd);
> if (!gem_uses_full_ppgtt(fd))
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
> index 8680c9ba93..555618e463 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -1359,6 +1359,9 @@ __intel_bb_create(int i915, uint32_t ctx, uint32_t size, bool do_relocs,
> if (!ibb->uses_full_ppgtt)
> do_relocs = true;
>
> + /* Use safe start offset instead assuming 0x0 is safe */
> + start = max_t(uint64_t, start, gem_detect_safe_start_offset(i915));
> +
> /* if relocs are set we won't use an allocator */
> if (do_relocs)
> allocator_type = INTEL_ALLOCATOR_NONE;
> --
> 2.32.0
>
next prev parent reply other threads:[~2022-05-25 6:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 11:18 [igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Use detected start offset in intel-bb instead 0x0 Zbigniew Kempczyński
2022-05-24 13:26 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-05-24 15:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-25 5:16 ` Zbigniew Kempczyński
2022-05-26 2:37 ` Vudum, Lakshminarayana
2022-05-25 6:41 ` Dixit, Ashutosh [this message]
2022-05-25 7:07 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
2022-05-25 20:24 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2022-05-26 2:37 ` 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=87r14it8pf.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.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.