diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2022-05-24 13:18:36 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2022-05-25 13:25:38 +0200 |
commit | aa0c811ebcd27a0f330f60ae5c4aff35178d6abf (patch) | |
tree | 637a07febd2d42bf18d2396460095cd5a96300d5 /lib | |
parent | 1b5f7f139660ac27f3c8b4c4a2d23fdd9430ccab (diff) |
lib/intel_batchbuffer: Use detected start offset in intel-bb instead 0x0
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.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/intel_allocator.c | 2 | ||||
-rw-r--r-- | lib/intel_batchbuffer.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c index 340b8882..7882e484 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 fbf4f16d..36cb5504 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; |