Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pallavi Mishra <pallavi.mishra@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: stuart.summers@intel.com, matthew.d.roper@intel.com
Subject: [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
Date: Wed, 20 Sep 2023 23:24:31 +0530	[thread overview]
Message-ID: <20230920175431.3381076-1-pallavi.mishra@intel.com> (raw)

Ensure alignment with PAGE_SIZE for the size parameter
passed to __xe_bo_create_locked()

Signed-off-by: Pallavi Mishra <pallavi.mishra@intel.com>
---
 drivers/gpu/drm/xe/xe_bo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 1ab682d61e3c..014d084632f2 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1199,6 +1199,9 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
 	/* Only kernel objects should set GT */
 	XE_WARN_ON(tile && type != ttm_bo_type_kernel);
 
+	if ((size & (PAGE_SIZE - 1)) != 0)
+		size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+
 	if (XE_WARN_ON(!size)) {
 		xe_bo_free(bo);
 		return ERR_PTR(-EINVAL);
-- 
2.25.1


             reply	other threads:[~2023-09-20 17:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 17:54 Pallavi Mishra [this message]
2023-09-20 19:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for drm/xe: Align size to PAGE_SIZE Patchwork
2023-09-20 19:24 ` [Intel-xe] [PATCH] " Lucas De Marchi
2023-09-20 19:30   ` Mishra, Pallavi
  -- strict thread matches above, loose matches on Subject: below --
2023-09-20 21:32 Pallavi Mishra
2023-09-25 16:54 ` Lucas De Marchi
2023-09-25 16:59   ` Lucas De Marchi

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=20230920175431.3381076-1-pallavi.mishra@intel.com \
    --to=pallavi.mishra@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=stuart.summers@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