diff options
| author | Yash Ladani <yash.ladani@amd.com> | 2022-12-07 23:06:31 -0800 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-04-10 09:03:22 -0700 |
| commit | 6c5efc3e01c770341c52f31e1ed7d81b7ce7d625 (patch) | |
| tree | 65912e6b94d4ee5f06a4be48871bfc8b5f5ac50d /meta-xilinx-core/recipes-graphics | |
| parent | 1d8f0c9985be7d5488abb93acaa8ee76d2b04a05 (diff) | |
| download | meta-xilinx-6c5efc3e01c770341c52f31e1ed7d81b7ce7d625.tar.gz | |
mali400: Added patch for compatibility with 6.1 kernel
Added 0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch
which has register_shrinker API changes and DMA_BUF Import
to make mali400 compilation compatible with 6.1 kernel.
Signed-off-by: Yash Ladani <yash.ladani@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-graphics')
2 files changed, 68 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali.bb b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali.bb index 28586976..0ec3cf7d 100644 --- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali.bb +++ b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali.bb | |||
| @@ -31,6 +31,7 @@ SRC_URI = " \ | |||
| 31 | file://0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch \ | 31 | file://0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch \ |
| 32 | file://0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch \ | 32 | file://0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch \ |
| 33 | file://0024-Use-community-device-tree-names.patch \ | 33 | file://0024-Use-community-device-tree-names.patch \ |
| 34 | file://0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch \ | ||
| 34 | " | 35 | " |
| 35 | SRC_URI[md5sum] = "85ea110dd6675c70b7d01af87ec9633c" | 36 | SRC_URI[md5sum] = "85ea110dd6675c70b7d01af87ec9633c" |
| 36 | SRC_URI[sha256sum] = "7a67127341d17640c1fff5dad80258fb2a37c8a2121b81525fe2327e4532ce2b" | 37 | SRC_URI[sha256sum] = "7a67127341d17640c1fff5dad80258fb2a37c8a2121b81525fe2327e4532ce2b" |
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch new file mode 100644 index 00000000..f3bcd4f1 --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | From d4fcb32f8dc85d01c6e0dc8e5d85c7ed43f0866c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Yash Ladani <yash.ladani@amd.com> | ||
| 3 | Date: Tue, 6 Dec 2022 00:52:53 -0800 | ||
| 4 | Subject: [PATCH] Import DMA_BUF module and update register_shrinker function | ||
| 5 | for kernel 5.16 or higher | ||
| 6 | |||
| 7 | Added MODULE_IMPORT_NS(DMA_BUF) for kernel version 5.16 or higher. | ||
| 8 | register_shrinker function call now requires two arguments | ||
| 9 | for kernel 5.16 or higher updated this function call. | ||
| 10 | |||
| 11 | Signed-off-by: Yash Ladani <yash.ladani@amd.com> | ||
| 12 | --- | ||
| 13 | linux/mali_memory_dma_buf.c | 4 ++++ | ||
| 14 | linux/mali_memory_os_alloc.c | 5 ++++- | ||
| 15 | linux/mali_memory_secure.c | 4 ++++ | ||
| 16 | 3 files changed, 12 insertions(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c | ||
| 19 | index fcdcaac..72e28a8 100644 | ||
| 20 | --- a/linux/mali_memory_dma_buf.c | ||
| 21 | +++ b/linux/mali_memory_dma_buf.c | ||
| 22 | @@ -34,6 +34,10 @@ | ||
| 23 | #include "mali_memory_virtual.h" | ||
| 24 | #include "mali_pp_job.h" | ||
| 25 | |||
| 26 | +#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0) | ||
| 27 | +MODULE_IMPORT_NS(DMA_BUF); | ||
| 28 | +#endif | ||
| 29 | + | ||
| 30 | /* | ||
| 31 | * Map DMA buf attachment \a mem into \a session at virtual address \a virt. | ||
| 32 | */ | ||
| 33 | diff --git a/linux/mali_memory_os_alloc.c b/linux/mali_memory_os_alloc.c | ||
| 34 | index 7de3920..5bf08f8 100644 | ||
| 35 | --- a/linux/mali_memory_os_alloc.c | ||
| 36 | +++ b/linux/mali_memory_os_alloc.c | ||
| 37 | @@ -801,8 +801,11 @@ _mali_osk_errcode_t mali_mem_os_init(void) | ||
| 38 | dma_set_attr(DMA_ATTR_WRITE_COMBINE, &dma_attrs_wc); | ||
| 39 | #endif | ||
| 40 | |||
| 41 | +#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0) | ||
| 42 | + register_shrinker(&mali_mem_os_allocator.shrinker, "mali"); | ||
| 43 | +#else | ||
| 44 | register_shrinker(&mali_mem_os_allocator.shrinker); | ||
| 45 | - | ||
| 46 | +#endif | ||
| 47 | return _MALI_OSK_ERR_OK; | ||
| 48 | } | ||
| 49 | |||
| 50 | diff --git a/linux/mali_memory_secure.c b/linux/mali_memory_secure.c | ||
| 51 | index cebd1c8..a9d932f 100644 | ||
| 52 | --- a/linux/mali_memory_secure.c | ||
| 53 | +++ b/linux/mali_memory_secure.c | ||
| 54 | @@ -20,6 +20,10 @@ | ||
| 55 | #endif | ||
| 56 | #include <linux/dma-buf.h> | ||
| 57 | |||
| 58 | +#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0) | ||
| 59 | +MODULE_IMPORT_NS(DMA_BUF); | ||
| 60 | +#endif | ||
| 61 | + | ||
| 62 | _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd) | ||
| 63 | { | ||
| 64 | struct dma_buf *buf; | ||
| 65 | -- | ||
| 66 | 2.17.1 | ||
| 67 | |||
