Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
@ 2023-09-20 17:54 Pallavi Mishra
  2023-09-20 19:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork
  2023-09-20 19:24 ` [Intel-xe] [PATCH] " Lucas De Marchi
  0 siblings, 2 replies; 7+ messages in thread
From: Pallavi Mishra @ 2023-09-20 17:54 UTC (permalink / raw)
  To: intel-xe; +Cc: stuart.summers, matthew.d.roper

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE
@ 2023-09-20 21:32 Pallavi Mishra
  2023-09-25 16:54 ` Lucas De Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Pallavi Mishra @ 2023-09-20 21:32 UTC (permalink / raw)
  To: intel-xe; +Cc: stuart.summers, matthew.d.roper, lucas.demarchi

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

v2: move size alignment under else condition (Lucas)

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

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index c5e4d04c4d58..59c57430918b 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1218,6 +1218,7 @@ struct xe_bo *__xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
 		flags |= XE_BO_INTERNAL_64K;
 		alignment = SZ_64K >> PAGE_SHIFT;
 	} else {
+		size = ALIGN(size, PAGE_SIZE);
 		alignment = SZ_4K >> PAGE_SHIFT;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-25 16:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20 17:54 [Intel-xe] [PATCH] drm/xe: Align size to PAGE_SIZE Pallavi Mishra
2023-09-20 19:14 ` [Intel-xe] ✗ CI.Patch_applied: failure for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox