aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1165-drm-amdkfd-Simplify-the-KFD-signal_page-structure.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1165-drm-amdkfd-Simplify-the-KFD-signal_page-structure.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1165-drm-amdkfd-Simplify-the-KFD-signal_page-structure.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1165-drm-amdkfd-Simplify-the-KFD-signal_page-structure.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1165-drm-amdkfd-Simplify-the-KFD-signal_page-structure.patch
new file mode 100644
index 00000000..4c53a4b2
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1165-drm-amdkfd-Simplify-the-KFD-signal_page-structure.patch
@@ -0,0 +1,62 @@
+From 92323a400e85ed853dfd2bb644ffa37f72854362 Mon Sep 17 00:00:00 2001
+From: Yong Zhao <yong.zhao@amd.com>
+Date: Mon, 11 Jul 2016 13:47:39 -0400
+Subject: [PATCH 1165/4131] drm/amdkfd: Simplify the KFD signal_page structure
+
+Change-Id: I24e507ad80ede76e18649229dbd613f27913db7c
+Signed-off-by: Yong Zhao <yong.zhao@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_events.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+index 6a354f3..f110eba 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+@@ -51,6 +51,9 @@ struct kfd_event_waiter {
+ uint32_t input_index;
+ };
+
++#define SLOTS_PER_PAGE KFD_SIGNAL_EVENT_LIMIT
++#define SLOT_BITMAP_LONGS BITS_TO_LONGS(SLOTS_PER_PAGE)
++
+ /* Over-complicated pooled allocator for event notification slots.
+ *
+ * Each signal event needs a 64-bit signal slot where the signaler will write a 1
+@@ -67,14 +70,9 @@ struct signal_page {
+ uint64_t __user *user_address;
+ uint32_t page_index; /* Index into the mmap aperture. */
+ unsigned int free_slots;
+- unsigned long used_slot_bitmap[0];
++ unsigned long used_slot_bitmap[SLOT_BITMAP_LONGS];
+ };
+
+-#define SLOTS_PER_PAGE KFD_SIGNAL_EVENT_LIMIT
+-#define SLOT_BITMAP_SIZE BITS_TO_LONGS(SLOTS_PER_PAGE)
+-#define BITS_PER_PAGE (ilog2(SLOTS_PER_PAGE)+1)
+-#define SIGNAL_PAGE_SIZE (sizeof(struct signal_page) + SLOT_BITMAP_SIZE * sizeof(long))
+-
+ /*
+ * For signal events, the event ID is used as the interrupt user data.
+ * For SQ s_sendmsg interrupts, this is limited to 8 bits.
+@@ -135,7 +133,7 @@ static bool allocate_signal_page(struct file *devkfd, struct kfd_process *p)
+ unsigned int slot;
+ int i;
+
+- page = kzalloc(SIGNAL_PAGE_SIZE, GFP_KERNEL);
++ page = kzalloc(sizeof(struct signal_page), GFP_KERNEL);
+ if (!page)
+ goto fail_alloc_signal_page;
+
+@@ -202,7 +200,7 @@ allocate_signal_page_dgpu(struct kfd_process *p,
+ {
+ struct signal_page *my_page;
+
+- my_page = kzalloc(SIGNAL_PAGE_SIZE, GFP_KERNEL);
++ my_page = kzalloc(sizeof(struct signal_page), GFP_KERNEL);
+ if (!my_page)
+ return false;
+
+--
+2.7.4
+