[igt-dev] [PATCH i-g-t v4 11/15] lib/intel_allocator: treat default_alignment as the minimum
Matthew Auld
matthew.auld at intel.com
Thu Oct 19 14:41:02 UTC 2023
If something overrides the default alignment, we should only apply the
alignment if it is larger than the default_alignment.
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: José Roberto de Souza <jose.souza at intel.com>
Cc: Pallavi Mishra <pallavi.mishra at intel.com>
---
lib/intel_allocator.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
index e5b9457b8..d94043016 100644
--- a/lib/intel_allocator.c
+++ b/lib/intel_allocator.c
@@ -586,6 +586,9 @@ static int handle_request(struct alloc_req *req, struct alloc_resp *resp)
case REQ_ALLOC:
if (!req->alloc.alignment)
req->alloc.alignment = ial->default_alignment;
+ else
+ req->alloc.alignment = max(ial->default_alignment,
+ req->alloc.alignment);
resp->response_type = RESP_ALLOC;
resp->alloc.offset = ial->alloc(ial,
--
2.41.0
More information about the igt-dev
mailing list