From: Andrzej Hajda <andrzej.hajda@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>,
Nirmoy Das <nirmoy.das@intel.com>
Subject: [igt-dev] [PATCH 2/2] lib/intel_batchbuffer: allow GTT size be not power of 2
Date: Thu, 26 Oct 2023 17:50:30 +0200 [thread overview]
Message-ID: <20231026-gtt_size_fix-v1-2-882d0e0022ec@intel.com> (raw)
In-Reply-To: <20231026-gtt_size_fix-v1-0-882d0e0022ec@intel.com>
GTT size reported by the driver can be shorter than
the actual size due to possible reserved addresses.
Rounding it up to power of 2 should give us back
actual GTT size.
The patch is prerequisite for upcoming driver changes
introducing per context batch buffers.
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
lib/intel_batchbuffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index df82ef5f5ca..c32d04302fe 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -1675,7 +1675,7 @@ __intel_bb_add_object(struct intel_bb *ibb, uint32_t handle, uint64_t size,
offset = __intel_bb_get_offset(ibb, handle, size,
alignment);
} else {
- offset = offset & (ibb->gtt_size - 1);
+ offset = offset & (roundup_power_of_two(ibb->gtt_size) - 1);
/*
* For simple allocator check entry consistency
--
2.34.1
next prev parent reply other threads:[~2023-10-26 15:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 15:50 [igt-dev] [PATCH 0/2] lib/intel_batchbuffer: allow GTT size be not power of 2 Andrzej Hajda
2023-10-26 15:50 ` [igt-dev] [PATCH 1/2] lib/igt_aux: fix roundup_power_of_two implementation Andrzej Hajda
2023-10-27 9:01 ` Kamil Konieczny
2023-10-26 15:50 ` Andrzej Hajda [this message]
2023-10-27 9:04 ` [igt-dev] [PATCH 2/2] lib/intel_batchbuffer: allow GTT size be not power of 2 Kamil Konieczny
2023-10-26 18:33 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-10-26 18:39 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-27 8:18 ` [igt-dev] [PATCH 0/2] " Nirmoy Das
2023-10-28 3:21 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2023-10-30 8:25 ` Andrzej Hajda
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=20231026-gtt_size_fix-v1-2-882d0e0022ec@intel.com \
--to=andrzej.hajda@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=nirmoy.das@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox