From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id A86B810E985 for ; Thu, 2 Nov 2023 17:47:35 +0000 (UTC) From: Matthew Auld To: igt-dev@lists.freedesktop.org Date: Thu, 2 Nov 2023 17:46:56 +0000 Message-ID: <20231102174700.298135-12-matthew.auld@intel.com> In-Reply-To: <20231102174700.298135-1-matthew.auld@intel.com> References: <20231102174700.298135-1-matthew.auld@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v6 11/15] lib/intel_allocator: treat default_alignment as the minimum List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: If something overrides the default alignment, we should only apply the alignment if it is larger than the default_alignment. v2 (Niranjana): - Simplify slightly Signed-off-by: Matthew Auld Cc: Zbigniew Kempczyński Cc: José Roberto de Souza Cc: Pallavi Mishra Reviewed-by: Niranjana Vishwanathapura Reviewed-by: Zbigniew Kempczyński --- lib/intel_allocator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c index e5b9457b8..96ffe40d5 100644 --- a/lib/intel_allocator.c +++ b/lib/intel_allocator.c @@ -584,8 +584,8 @@ static int handle_request(struct alloc_req *req, struct alloc_resp *resp) break; case REQ_ALLOC: - if (!req->alloc.alignment) - req->alloc.alignment = ial->default_alignment; + req->alloc.alignment = max(ial->default_alignment, + req->alloc.alignment); resp->response_type = RESP_ALLOC; resp->alloc.offset = ial->alloc(ial, -- 2.41.0