summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/intel_allocator.c2
-rw-r--r--lib/intel_batchbuffer.c3
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;