diff options
| author | Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | 2019-07-10 16:10:45 -0700 |
|---|---|---|
| committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2019-12-13 13:27:02 -0800 |
| commit | dfdaf5360d105db23718dbfaa3d5b94f195f233f (patch) | |
| tree | ff113b6bd7fea989935c1f259c4b0ffa5dc309ed | |
| parent | 3ce7063666504951db56761b08ec371a19ec689d (diff) | |
| download | meta-xilinx-dfdaf5360d105db23718dbfaa3d5b94f195f233f.tar.gz | |
kernel-module-mali: Upgrade the kernel space driver to r9p0
Upgrade the Mali-400 kernel space driver to r9p0. Key features:
-Support linux kernel 4.19
-Added incremental features upgrade details for the DDk revision
Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
4 files changed, 4 insertions, 217 deletions
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb index be9e7197..c86fb2ec 100644 --- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb +++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb | |||
| @@ -3,10 +3,10 @@ SECTION = "kernel/modules" | |||
| 3 | 3 | ||
| 4 | LICENSE = "GPLv2" | 4 | LICENSE = "GPLv2" |
| 5 | LIC_FILES_CHKSUM = " \ | 5 | LIC_FILES_CHKSUM = " \ |
| 6 | file://linux/license/gpl/mali_kernel_license.h;md5=436192a2c5cfd47df0ad1987dffc4ae6 \ | 6 | file://linux/license/gpl/mali_kernel_license.h;md5=f5af2d61f4c1eb262cb6a557aaa1070a \ |
| 7 | " | 7 | " |
| 8 | 8 | ||
| 9 | PV = "r8p0-01rel0" | 9 | PV = "r9p0-01rel0" |
| 10 | 10 | ||
| 11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
| 12 | https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-${PV}.tgz \ | 12 | https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-${PV}.tgz \ |
| @@ -16,9 +16,6 @@ SRC_URI = " \ | |||
| 16 | file://0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch \ | 16 | file://0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch \ |
| 17 | file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \ | 17 | file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \ |
| 18 | file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch \ | 18 | file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch \ |
| 19 | file://0007-Replace-__GFP_REPEAT-by-__GFP_RETRY_MAYFAIL.patch \ | ||
| 20 | file://0008-mali_internal_sync-Rename-wait_queue_t-with-wait_que.patch \ | ||
| 21 | file://0009-mali_memory_swap_alloc.c-Rename-global_page_state-wi.patch \ | ||
| 22 | file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \ | 19 | file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \ |
| 23 | file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\ | 20 | file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\ |
| 24 | file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\ | 21 | file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\ |
| @@ -26,8 +23,8 @@ SRC_URI = " \ | |||
| 26 | file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\ | 23 | file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\ |
| 27 | file://0015-fix-driver-failed-to-check-map-error.patch \ | 24 | file://0015-fix-driver-failed-to-check-map-error.patch \ |
| 28 | " | 25 | " |
| 29 | SRC_URI[md5sum] = "8f04ae86957fd56197ad5a9d017b84ff" | 26 | SRC_URI[md5sum] = "85ea110dd6675c70b7d01af87ec9633c" |
| 30 | SRC_URI[sha256sum] = "bfd14fa3f75a71d4ba313534e651ca1c58dc354e882c0b39867e335882a06350" | 27 | SRC_URI[sha256sum] = "7a67127341d17640c1fff5dad80258fb2a37c8a2121b81525fe2327e4532ce2b" |
| 31 | 28 | ||
| 32 | inherit module | 29 | inherit module |
| 33 | 30 | ||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-Replace-__GFP_REPEAT-by-__GFP_RETRY_MAYFAIL.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-Replace-__GFP_REPEAT-by-__GFP_RETRY_MAYFAIL.patch deleted file mode 100644 index 6e5f5447..00000000 --- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0007-Replace-__GFP_REPEAT-by-__GFP_RETRY_MAYFAIL.patch +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | From a8190cd3b346633016d1c0096ef73e0e1ceef438 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Tue, 5 Dec 2017 09:25:15 -0800 | ||
| 4 | Subject: [PATCH 7/9] Replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL | ||
| 5 | |||
| 6 | Refer kernel patch dcda9b04713c3f6ff0875652924844fae28286ea | ||
| 7 | which replaces with a useful semantic | ||
| 8 | |||
| 9 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 10 | Upstream-Status: Pending | ||
| 11 | --- | ||
| 12 | driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | 4 ++++ | ||
| 13 | driver/src/devicedrv/mali/linux/mali_osk_notification.c | 7 ++++++- | ||
| 14 | 2 files changed, 10 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | ||
| 17 | index 5fe1270..1602371 100644 | ||
| 18 | --- linux/mali_memory_os_alloc.c | ||
| 19 | +++ b/linux/mali_memory_os_alloc.c | ||
| 20 | @@ -202,7 +202,11 @@ int mali_mem_os_alloc_pages(mali_mem_os_mem *os_mem, u32 size) | ||
| 21 | /* Allocate new pages, if needed. */ | ||
| 22 | for (i = 0; i < remaining; i++) { | ||
| 23 | dma_addr_t dma_addr; | ||
| 24 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) | ||
| 25 | + gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | __GFP_COLD; | ||
| 26 | +#else | ||
| 27 | gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD; | ||
| 28 | +#endif | ||
| 29 | int err; | ||
| 30 | |||
| 31 | #if defined(CONFIG_ARM) && !defined(CONFIG_ARM_LPAE) | ||
| 32 | diff --git a/driver/src/devicedrv/mali/linux/mali_osk_notification.c b/driver/src/devicedrv/mali/linux/mali_osk_notification.c | ||
| 33 | index b22fe68..d0c302a 100644 | ||
| 34 | --- linux/mali_osk_notification.c | ||
| 35 | +++ b/linux/mali_osk_notification.c | ||
| 36 | @@ -55,9 +55,14 @@ _mali_osk_notification_t *_mali_osk_notification_create(u32 type, u32 size) | ||
| 37 | { | ||
| 38 | /* OPT Recycling of notification objects */ | ||
| 39 | _mali_osk_notification_wrapper_t *notification; | ||
| 40 | - | ||
| 41 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) | ||
| 42 | + notification = (_mali_osk_notification_wrapper_t *)kmalloc(sizeof(_mali_osk_notification_wrapper_t) + size, | ||
| 43 | + GFP_KERNEL | __GFP_HIGH | __GFP_RETRY_MAYFAIL); | ||
| 44 | +#else | ||
| 45 | notification = (_mali_osk_notification_wrapper_t *)kmalloc(sizeof(_mali_osk_notification_wrapper_t) + size, | ||
| 46 | GFP_KERNEL | __GFP_HIGH | __GFP_REPEAT); | ||
| 47 | +#endif | ||
| 48 | + | ||
| 49 | if (NULL == notification) { | ||
| 50 | MALI_DEBUG_PRINT(1, ("Failed to create a notification object\n")); | ||
| 51 | return NULL; | ||
| 52 | -- | ||
| 53 | 2.7.4 | ||
| 54 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0008-mali_internal_sync-Rename-wait_queue_t-with-wait_que.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0008-mali_internal_sync-Rename-wait_queue_t-with-wait_que.patch deleted file mode 100644 index 592fea04..00000000 --- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0008-mali_internal_sync-Rename-wait_queue_t-with-wait_que.patch +++ /dev/null | |||
| @@ -1,108 +0,0 @@ | |||
| 1 | From 717d7899f6d8048c6b88b3c52e8a9c8afbddbb65 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Tue, 5 Dec 2017 09:48:42 -0800 | ||
| 4 | Subject: [PATCH 8/9] mali_internal_sync: Rename wait_queue_t with | ||
| 5 | wait_queue_entry_t | ||
| 6 | |||
| 7 | Refer kernel patch ac6424b981bce1c4bc55675c6ce11bfe1bbfa64f | ||
| 8 | and 2055da which replaces the struct name | ||
| 9 | |||
| 10 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 11 | Upstream-Status: Pending | ||
| 12 | --- | ||
| 13 | .../src/devicedrv/mali/linux/mali_internal_sync.c | 27 ++++++++++++++++++++-- | ||
| 14 | .../src/devicedrv/mali/linux/mali_internal_sync.h | 4 ++++ | ||
| 15 | 2 files changed, 29 insertions(+), 2 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/driver/src/devicedrv/mali/linux/mali_internal_sync.c b/driver/src/devicedrv/mali/linux/mali_internal_sync.c | ||
| 18 | index 1f2574e..957a056 100644 | ||
| 19 | --- linux/mali_internal_sync.c | ||
| 20 | +++ b/linux/mali_internal_sync.c | ||
| 21 | @@ -121,8 +121,13 @@ static void mali_internal_sync_fence_add_fence(struct mali_internal_sync_fence * | ||
| 22 | } | ||
| 23 | #endif | ||
| 24 | |||
| 25 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) | ||
| 26 | +static int mali_internal_sync_fence_wake_up_wq(wait_queue_entry_t *curr, unsigned mode, | ||
| 27 | + int wake_flags, void *key) | ||
| 28 | +#else | ||
| 29 | static int mali_internal_sync_fence_wake_up_wq(wait_queue_t *curr, unsigned mode, | ||
| 30 | int wake_flags, void *key) | ||
| 31 | +#endif | ||
| 32 | { | ||
| 33 | struct mali_internal_sync_fence_waiter *wait; | ||
| 34 | MALI_IGNORE(mode); | ||
| 35 | @@ -130,8 +135,12 @@ static int mali_internal_sync_fence_wake_up_wq(wait_queue_t *curr, unsigned mode | ||
| 36 | MALI_IGNORE(key); | ||
| 37 | |||
| 38 | wait = container_of(curr, struct mali_internal_sync_fence_waiter, work); | ||
| 39 | - list_del_init(&wait->work.task_list); | ||
| 40 | |||
| 41 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) | ||
| 42 | + list_del_init(&wait->work.entry); | ||
| 43 | +#else | ||
| 44 | + list_del_init(&wait->work.task_list); | ||
| 45 | +#endif | ||
| 46 | wait->callback(wait->work.private, wait); | ||
| 47 | return 1; | ||
| 48 | } | ||
| 49 | @@ -498,7 +507,11 @@ void mali_internal_sync_fence_waiter_init(struct mali_internal_sync_fence_waiter | ||
| 50 | MALI_DEBUG_ASSERT_POINTER(waiter); | ||
| 51 | MALI_DEBUG_ASSERT_POINTER(callback); | ||
| 52 | |||
| 53 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) | ||
| 54 | + INIT_LIST_HEAD(&waiter->work.entry); | ||
| 55 | +#else | ||
| 56 | INIT_LIST_HEAD(&waiter->work.task_list); | ||
| 57 | +#endif | ||
| 58 | waiter->callback = callback; | ||
| 59 | } | ||
| 60 | |||
| 61 | @@ -560,8 +573,13 @@ int mali_internal_sync_fence_wait_async(struct mali_internal_sync_fence *sync_fe | ||
| 62 | spin_lock_irqsave(&sync_fence->wq.lock, flags); | ||
| 63 | err = sync_fence->fence->ops->signaled(sync_fence->fence); | ||
| 64 | |||
| 65 | - if (0 == err) | ||
| 66 | + if (0 == err){ | ||
| 67 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) | ||
| 68 | + __add_wait_queue_entry_tail(&sync_fence->wq, &waiter->work); | ||
| 69 | +#else | ||
| 70 | __add_wait_queue_tail(&sync_fence->wq, &waiter->work); | ||
| 71 | +#endif | ||
| 72 | + } | ||
| 73 | spin_unlock_irqrestore(&sync_fence->wq.lock, flags); | ||
| 74 | |||
| 75 | return err; | ||
| 76 | @@ -578,8 +596,13 @@ int mali_internal_sync_fence_cancel_async(struct mali_internal_sync_fence *sync_ | ||
| 77 | MALI_DEBUG_ASSERT_POINTER(waiter); | ||
| 78 | |||
| 79 | spin_lock_irqsave(&sync_fence->wq.lock, flags); | ||
| 80 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) | ||
| 81 | + if (!list_empty(&waiter->work.entry)) | ||
| 82 | + list_del_init(&waiter->work.entry); | ||
| 83 | +#else | ||
| 84 | if (!list_empty(&waiter->work.task_list)) | ||
| 85 | list_del_init(&waiter->work.task_list); | ||
| 86 | +#endif | ||
| 87 | else | ||
| 88 | ret = -ENOENT; | ||
| 89 | spin_unlock_irqrestore(&sync_fence->wq.lock, flags); | ||
| 90 | diff --git a/driver/src/devicedrv/mali/linux/mali_internal_sync.h b/driver/src/devicedrv/mali/linux/mali_internal_sync.h | ||
| 91 | index a5655c7..70f29f9 100644 | ||
| 92 | --- linux/mali_internal_sync.h | ||
| 93 | +++ b/linux/mali_internal_sync.h | ||
| 94 | @@ -112,7 +112,11 @@ typedef void (*mali_internal_sync_callback_t)(struct mali_internal_sync_fence *s | ||
| 95 | struct mali_internal_sync_fence_waiter *waiter); | ||
| 96 | |||
| 97 | struct mali_internal_sync_fence_waiter { | ||
| 98 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) | ||
| 99 | + wait_queue_entry_t work; | ||
| 100 | +#else | ||
| 101 | wait_queue_t work; | ||
| 102 | +#endif | ||
| 103 | mali_internal_sync_callback_t callback; | ||
| 104 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) | ||
| 105 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) | ||
| 106 | -- | ||
| 107 | 2.7.4 | ||
| 108 | |||
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-mali_memory_swap_alloc.c-Rename-global_page_state-wi.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-mali_memory_swap_alloc.c-Rename-global_page_state-wi.patch deleted file mode 100644 index 3445512c..00000000 --- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0009-mali_memory_swap_alloc.c-Rename-global_page_state-wi.patch +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | From 478de18bf513ecad419d25981e7b66c78126752c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 3 | Date: Tue, 5 Dec 2017 09:58:36 -0800 | ||
| 4 | Subject: [PATCH 9/9] mali_memory_swap_alloc.c: Rename global_page_state with | ||
| 5 | global_zone_page_state | ||
| 6 | |||
| 7 | Refer Kernel commit c41f012ade0b95b0a6e25c7150673e0554736165 | ||
| 8 | Which simply renames without any functional changes | ||
| 9 | |||
| 10 | Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com> | ||
| 11 | Upstream-Status: Pending | ||
| 12 | --- | ||
| 13 | driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c | 10 +++++++++- | ||
| 14 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_swap_alloc.c | ||
| 17 | index a54faca..e122b4c 100644 | ||
| 18 | --- linux/mali_memory_swap_alloc.c | ||
| 19 | +++ b/linux/mali_memory_swap_alloc.c | ||
| 20 | @@ -248,7 +248,11 @@ static void mali_mem_swap_swapped_bkend_pool_shrink(_mali_mem_swap_pool_shrink_t | ||
| 21 | } | ||
| 22 | |||
| 23 | /* Get system free pages number. */ | ||
| 24 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) | ||
| 25 | + system_free_size = global_zone_page_state(NR_FREE_PAGES) * PAGE_SIZE; | ||
| 26 | +#else | ||
| 27 | system_free_size = global_page_state(NR_FREE_PAGES) * PAGE_SIZE; | ||
| 28 | +#endif | ||
| 29 | last_gpu_utilization = _mali_ukk_utilization_gp_pp(); | ||
| 30 | |||
| 31 | if ((last_gpu_utilization < gpu_utilization_threshold_value) | ||
| 32 | @@ -575,8 +579,12 @@ int mali_mem_swap_alloc_pages(mali_mem_swap *swap_mem, u32 size, u32 *bkend_idx) | ||
| 33 | |||
| 34 | list_add_tail(&m_page->list, &swap_mem->pages); | ||
| 35 | } | ||
| 36 | - | ||
| 37 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) | ||
| 38 | + system_free_size = global_zone_page_state(NR_FREE_PAGES) * PAGE_SIZE; | ||
| 39 | +#else | ||
| 40 | system_free_size = global_page_state(NR_FREE_PAGES) * PAGE_SIZE; | ||
| 41 | +#endif | ||
| 42 | + | ||
| 43 | |||
| 44 | if ((system_free_size < mali_mem_swap_out_threshold_value) | ||
| 45 | && (mem_backend_swapped_pool_size > (mali_mem_swap_out_threshold_value >> 2)) | ||
| 46 | -- | ||
| 47 | 2.7.4 | ||
| 48 | |||
