summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core')
-rw-r--r--meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc18
-rw-r--r--meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend8
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_8.1.0.bb8
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend7
-rw-r--r--meta-xilinx-core/recipes-gnome/gtk+/gtk+3_%.bbappend6
-rw-r--r--meta-xilinx-core/recipes-graphics/libepoxy/libepoxy_%.bbappend6
-rw-r--r--meta-xilinx-core/recipes-graphics/libgles/files/egl.pc12
-rw-r--r--meta-xilinx-core/recipes-graphics/libgles/files/gbm.pc12
-rw-r--r--meta-xilinx-core/recipes-graphics/libgles/files/glesv1.pc12
-rw-r--r--meta-xilinx-core/recipes-graphics/libgles/files/glesv1_cm.pc12
-rw-r--r--meta-xilinx-core/recipes-graphics/libgles/files/glesv2.pc12
-rw-r--r--meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb199
-rw-r--r--meta-xilinx-core/recipes-graphics/libglu/libglu_%.bbappend11
-rw-r--r--meta-xilinx-core/recipes-graphics/libsdl2/libsdl2_%.bbappend6
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch47
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch52
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch35
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch47
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch90
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch35
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch31
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch153
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch33
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch34
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch156
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch17
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch47
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch146
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch32
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch36
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch92
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch37
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch38
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch33
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch91
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch67
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch46
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch95
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch81
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch29
-rw-r--r--meta-xilinx-core/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb57
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch32
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch44
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch41
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch69
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend16
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/mesa-gl_%.bbappend18
-rw-r--r--meta-xilinx-core/recipes-graphics/mesa/mesa_%.bbappend15
-rw-r--r--meta-xilinx-core/recipes-graphics/virglrenderer/virglrenderer_%.bbappend6
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch30
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch29
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/files/init54
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/files/weston.service71
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston-init.bbappend5
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston.inc15
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch50
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch32
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch47
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch199
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch23
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/systemd-notify.weston-start9
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/weston.desktop9
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/weston.pngbin2383 -> 0 bytes
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston/xwayland.weston-start5
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston_13.%.bbappend12
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bb148
-rw-r--r--meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bbappend3
-rw-r--r--meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend7
-rw-r--r--meta-xilinx-core/recipes-graphics/xwayland/xwayland_%.bbappend7
-rw-r--r--meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb1
-rw-r--r--meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules2
-rw-r--r--meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc4
72 files changed, 0 insertions, 2989 deletions
diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc
index 1837da26..904b4861 100644
--- a/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc
+++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-default.inc
@@ -34,24 +34,6 @@ UBOOT_SUFFIX ?= "bin"
34UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" 34UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
35UBOOT_ELF ?= "u-boot.elf" 35UBOOT_ELF ?= "u-boot.elf"
36 36
37# libmali is selected by DISTRO_FEATURE of libmali & MACHINE_FEATURES of mali400
38# lima is selected by DISTRO_FEATURE != libmali & MACHINE_FEATURES of mali400
39# default mesa because otherwise
40def xlnx_is_libmali_enabled(d):
41 if bb.utils.contains('MACHINE_FEATURES', 'mali400', '1', '', d) == '1':
42 if bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '', d) == '1':
43 return True
44 return False
45
46# libmali requires certain preferred providers to be selected
47PREFERRED_PROVIDER_virtual/egl ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}"
48PREFERRED_PROVIDER_virtual/libgl ?= "${@'mesa-gl' if xlnx_is_libmali_enabled(d) else 'mesa'}"
49PREFERRED_PROVIDER_virtual/libgles1 ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}"
50PREFERRED_PROVIDER_virtual/libgles2 ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}"
51PREFERRED_PROVIDER_virtual/libgles3 ?= "${@'NOT_SUPPORTED' if xlnx_is_libmali_enabled(d) else 'mesa'}"
52PREFERRED_PROVIDER_virtual/libgbm ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}"
53PREFERRED_PROVIDER_virtual/mesa ?= "${@'mesa-gl' if xlnx_is_libmali_enabled(d) else 'mesa'}"
54
55XSERVER ?= " \ 37XSERVER ?= " \
56 xserver-xorg \ 38 xserver-xorg \
57 xf86-input-evdev \ 39 xf86-input-evdev \
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend
index 81aa8e9e..0c305c78 100644
--- a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend
+++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend
@@ -9,11 +9,3 @@ SRC_URI:append = " \
9PACKAGECONFIG[fbdev-glesv2] = ",,virtual/libgles2 virtual/egl" 9PACKAGECONFIG[fbdev-glesv2] = ",,virtual/libgles2 virtual/egl"
10 10
11EXTRA_OECONF:append = "${@bb.utils.contains('DISTRO_FEATURES', 'fbdev', ' --with-flavors=fbdev-glesv2', '', d)}" 11EXTRA_OECONF:append = "${@bb.utils.contains('DISTRO_FEATURES', 'fbdev', ' --with-flavors=fbdev-glesv2', '', d)}"
12
13# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
14DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
15MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
16MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
17PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
18PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
19
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_8.1.0.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_8.1.0.bb
index 50d9922f..4679174b 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_8.1.0.bb
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_8.1.0.bb
@@ -4,14 +4,6 @@ require qemu-8.1.inc
4require qemu-xilinx-8.1.inc 4require qemu-xilinx-8.1.inc
5require qemu-alt.inc 5require qemu-alt.inc
6 6
7# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
8DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
9MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
10MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
11PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
12PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
13
14
15DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native" 7DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native"
16 8
17DEPENDS:append:libc-musl = " libucontext" 9DEPENDS:append:libc-musl = " libucontext"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend b/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend
index 04c89b83..9140060e 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu_%.bbappend
@@ -1,8 +1 @@
1require qemu-alt.inc require qemu-alt.inc
2
3# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
4DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
5MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
6MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
7PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
8PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-gnome/gtk+/gtk+3_%.bbappend b/meta-xilinx-core/recipes-gnome/gtk+/gtk+3_%.bbappend
deleted file mode 100644
index 03823f6e..00000000
--- a/meta-xilinx-core/recipes-gnome/gtk+/gtk+3_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
1# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
2DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
3MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
4MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
5PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
6PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/libepoxy/libepoxy_%.bbappend b/meta-xilinx-core/recipes-graphics/libepoxy/libepoxy_%.bbappend
deleted file mode 100644
index 03823f6e..00000000
--- a/meta-xilinx-core/recipes-graphics/libepoxy/libepoxy_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
1# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
2DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
3MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
4MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
5PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
6PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/libgles/files/egl.pc b/meta-xilinx-core/recipes-graphics/libgles/files/egl.pc
deleted file mode 100644
index 65c4c1f3..00000000
--- a/meta-xilinx-core/recipes-graphics/libgles/files/egl.pc
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: egl
7Description: MALI EGL library
8Requires.private:
9Version: 17.3
10Libs: -L${libdir} -lEGL
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/meta-xilinx-core/recipes-graphics/libgles/files/gbm.pc b/meta-xilinx-core/recipes-graphics/libgles/files/gbm.pc
deleted file mode 100644
index c40b5f4f..00000000
--- a/meta-xilinx-core/recipes-graphics/libgles/files/gbm.pc
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: gbm
7Description: MALI gbm library
8Requires.private:
9Version: 17.3
10Libs: -L${libdir} -lgbm
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/meta-xilinx-core/recipes-graphics/libgles/files/glesv1.pc b/meta-xilinx-core/recipes-graphics/libgles/files/glesv1.pc
deleted file mode 100644
index 39467f33..00000000
--- a/meta-xilinx-core/recipes-graphics/libgles/files/glesv1.pc
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv1
7Description: MALI OpenGL ES 1.1 library
8Requires.private:
9Version: 17.3
10Libs: -L${libdir} -lGLESv1_CM
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/meta-xilinx-core/recipes-graphics/libgles/files/glesv1_cm.pc b/meta-xilinx-core/recipes-graphics/libgles/files/glesv1_cm.pc
deleted file mode 100644
index 1547b4c8..00000000
--- a/meta-xilinx-core/recipes-graphics/libgles/files/glesv1_cm.pc
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: gles_cm
7Description: Mali OpenGL ES 1.1 CM library
8Requires.private:
9Version: 17.3
10Libs: -L${libdir} -lGLESv1_CM
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/meta-xilinx-core/recipes-graphics/libgles/files/glesv2.pc b/meta-xilinx-core/recipes-graphics/libgles/files/glesv2.pc
deleted file mode 100644
index a0a84f23..00000000
--- a/meta-xilinx-core/recipes-graphics/libgles/files/glesv2.pc
+++ /dev/null
@@ -1,12 +0,0 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=/usr/lib
4includedir=/usr/include
5
6Name: glesv2
7Description: MALI OpenGL ES 2.0 library
8Requires.private:
9Version: 17.3
10Libs: -L${libdir} -lGLESv2
11Libs.private: -lm -lpthread -ldl
12Cflags: -I${includedir}
diff --git a/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb b/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb
deleted file mode 100644
index e8d40311..00000000
--- a/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb
+++ /dev/null
@@ -1,199 +0,0 @@
1DESCRIPTION = "libGLES for ZynqMP with Mali 400"
2
3LICENSE = "Proprietary"
4LIC_FILES_CHKSUM = "file://EULA;md5=82e466d0ed92c5a15f568dbe6b31089c"
5
6inherit features_check update-alternatives
7
8ANY_OF_DISTRO_FEATURES = "x11 fbdev wayland"
9REQUIRED_MACHINE_FEATURES = "mali400"
10
11PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm"
12
13FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
14
15REPO ?= "git://github.com/Xilinx/mali-userspace-binaries.git;protocol=https"
16BRANCH ?= "xlnx_rel_v2024.1"
17SRCREV ?= "b3a772aad859cdadc8513b11c3e995546c20e75e"
18BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
19
20SRC_URI = " \
21 ${REPO};${BRANCHARG} \
22 file://egl.pc \
23 file://glesv1_cm.pc \
24 file://glesv1.pc \
25 file://glesv2.pc \
26 file://gbm.pc \
27 "
28
29PACKAGE_ARCH = "${MACHINE_ARCH}"
30
31S = "${UNPACKDIR}/git"
32
33# If were switching at runtime, we would need all RDEPENDS needed for all backends available
34X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes"
35X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes"
36
37# Don't install runtime dependencies for other backends unless the DISTRO supports it
38RDEPENDS:${PN} = " \
39 kernel-module-mali \
40 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \
41"
42
43# We dont build anything but we want to avoid QA warning build-deps
44DEPENDS = "\
45 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
46 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland libdrm', '', d)} \
47"
48
49
50# x11 is default, set to "fbdev" , "wayland", or "headless" if required
51MALI_BACKEND_DEFAULT ?= "x11"
52
53USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}"
54USE_FB = "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "yes", "no", d)}"
55USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}"
56
57MONOLITHIC_LIBMALI = "libMali.so.9.0"
58
59do_install() {
60 #Identify the ARCH type
61 ${TARGET_PREFIX}gcc --version > ARCH_PLATFORM
62 if grep -q aarch64 "ARCH_PLATFORM"; then
63 ARCH_PLATFORM_DIR=aarch64-linux-gnu
64 else
65 ARCH_PLATFORM_DIR=arm-linux-gnueabihf
66 fi
67
68 # install headers
69 install -d -m 0655 ${D}${includedir}/EGL
70 install -m 0644 ${S}/${PV}/glesHeaders/EGL/*.h ${D}${includedir}/EGL/
71 install -d -m 0655 ${D}${includedir}/GLES
72 install -m 0644 ${S}/${PV}/glesHeaders/GLES/*.h ${D}${includedir}/GLES/
73 install -d -m 0655 ${D}${includedir}/GLES2
74 install -m 0644 ${S}/${PV}/glesHeaders/GLES2/*.h ${D}${includedir}/GLES2/
75 install -d -m 0655 ${D}${includedir}/KHR
76 install -m 0644 ${S}/${PV}/glesHeaders/KHR/*.h ${D}${includedir}/KHR/
77
78 install -d ${D}${libdir}/pkgconfig
79 install -m 0644 ${UNPACKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc
80 install -m 0644 ${UNPACKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
81 install -m 0644 ${UNPACKDIR}/glesv1.pc ${D}${libdir}/pkgconfig/glesv1.pc
82 install -m 0644 ${UNPACKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
83
84 install -d ${D}${libdir}
85 install -d ${D}${includedir}
86
87 cp -a --no-preserve=ownership ${S}/${PV}/${ARCH_PLATFORM_DIR}/common/*.so* ${D}${libdir}
88
89 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/headless/${MONOLITHIC_LIBMALI} ${D}${libdir}/headless/${MONOLITHIC_LIBMALI}
90 ln -snf headless/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI}
91
92 if [ "${USE_FB}" = "yes" ]; then
93 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/fbdev/${MONOLITHIC_LIBMALI} ${D}${libdir}/fbdev/${MONOLITHIC_LIBMALI}
94 if [ "${MALI_BACKEND_DEFAULT}" = "fbdev" ]; then
95 ln -snf fbdev/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI}
96 fi
97 fi
98 if [ "${USE_X11}" = "yes" ]; then
99 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/x11/${MONOLITHIC_LIBMALI} ${D}${libdir}/x11/${MONOLITHIC_LIBMALI}
100 if [ "${MALI_BACKEND_DEFAULT}" = "x11" ]; then
101 ln -snf x11/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI}
102 fi
103 else
104 # We cant rely on the fact that all apps will use pkgconfig correctly
105 sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if (1)/' ${D}${includedir}/EGL/eglplatform.h
106 fi
107 if [ "${USE_WL}" = "yes" ]; then
108 install -m 0644 ${S}/${PV}/glesHeaders/GBM/gbm.h ${D}${includedir}/
109 install -m 0644 ${UNPACKDIR}/gbm.pc ${D}${libdir}/pkgconfig/gbm.pc
110 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/wayland/${MONOLITHIC_LIBMALI} ${D}${libdir}/wayland/${MONOLITHIC_LIBMALI}
111 if [ "${MALI_BACKEND_DEFAULT}" = "wayland" ]; then
112 ln -snf wayland/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI}
113 fi
114 fi
115}
116
117
118# We need separate packages to provide multiple alternatives, at this point we install
119# everything on the default one but that can be split if necessary
120PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "x11", "${PN}-x11", "", d)}"
121PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "${PN}-fbdev", "", d)}"
122PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "${PN}-wayland", "", d)}"
123PACKAGES += "${PN}-headless"
124
125# This is default/common for all alternatives
126ALTERNATIVE_LINK_NAME[libmali-xlnx] = "${libdir}/${MONOLITHIC_LIBMALI}"
127
128
129# Declare alternatives and corresponding library location
130ALTERNATIVE:${PN}-x11 = "libmali-xlnx"
131ALTERNATIVE_TARGET_libmali-xlnx-x11[libmali-xlnx] = "${libdir}/x11/${MONOLITHIC_LIBMALI}"
132
133ALTERNATIVE:${PN}-fbdev = "libmali-xlnx"
134ALTERNATIVE_TARGET_libmali-xlnx-fbdev[libmali-xlnx] = "${libdir}/fbdev/${MONOLITHIC_LIBMALI}"
135
136ALTERNATIVE:${PN}-wayland = "libmali-xlnx"
137ALTERNATIVE_TARGET_libmali-xlnx-wayland[libmali-xlnx] = "${libdir}/wayland/${MONOLITHIC_LIBMALI}"
138
139ALTERNATIVE:${PN}-headless = "libmali-xlnx"
140ALTERNATIVE_TARGET_libmali-xlnx-headless[libmali-xlnx] = "${libdir}/headless/${MONOLITHIC_LIBMALI}"
141
142# Set priorities according to what we prveiously defined
143ALTERNATIVE_PRIORITY_libmali-xlnx-x11[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "x11", "20", "10", d)}"
144ALTERNATIVE_PRIORITY_libmali-xlnx-fbdev[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "fbdev", "20", "10", d)}"
145ALTERNATIVE_PRIORITY_libmali-xlnx-wayland[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "wayland", "20", "10", d)}"
146
147# If misconfigured, fallback to headless
148ALTERNATIVE_PRIORITY_libmali-xlnx-headless[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "headless", "20", "15", d)}"
149
150
151# Package gets renamed on the debian class, but we want to keep -xlnx
152DEBIAN_NOAUTONAME:libmali-xlnx = "1"
153
154# Update alternatives will actually have separate postinst scripts (one for each package)
155# This wont work for us, so we create a common postinst script and we pass that as the general
156# libmali-xlnx postinst script, but we defer execution to run on first boot (pkg_postinst_ontarget).
157# This will avoid ldconfig removing the symbolic links when creating the root filesystem.
158python populate_packages_updatealternatives:append () {
159 # We need to remove the 'fake' libmali-xlnx before creating any links
160 libdir = d.getVar('libdir')
161 common_postinst = "#!/bin/sh\nrm " + libdir + "/${MONOLITHIC_LIBMALI}\n"
162 for pkg in (d.getVar('PACKAGES') or "").split():
163 # Not all packages provide an alternative (e.g. ${PN}-lic)
164 postinst = d.getVar('pkg_postinst:%s' % pkg)
165 if postinst:
166 old_postinst = postinst
167 new_postinst = postinst.replace('#!/bin/sh','')
168 common_postinst += new_postinst
169 d.setVar('pkg_postinst_ontarget:%s' % 'libmali-xlnx', common_postinst)
170}
171
172
173# Inhibit warnings about files being stripped
174INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
175INHIBIT_PACKAGE_STRIP = "1"
176INHIBIT_SYSROOT_STRIP = "1"
177
178RREPLACES:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
179RPROVIDES:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
180RCONFLICTS:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
181
182# These libraries shouldn't get installed in world builds unless something
183# explicitly depends upon them.
184EXCLUDE_FROM_WORLD = "1"
185FILES:${PN} += "${libdir}/*"
186
187do_package:append() {
188
189 shlibswork_dir = d.getVar('SHLIBSWORKDIR')
190 pkg_filename = d.getVar('PN') + ".list"
191 shlibs_file = os.path.join(shlibswork_dir, pkg_filename)
192 lines = ""
193 with open(shlibs_file, "r") as f:
194 lines = f.readlines()
195 with open(shlibs_file, "w") as f:
196 for line in lines:
197 if d.getVar('MALI_BACKEND_DEFAULT') in line.strip("\n"):
198 f.write(line)
199}
diff --git a/meta-xilinx-core/recipes-graphics/libglu/libglu_%.bbappend b/meta-xilinx-core/recipes-graphics/libglu/libglu_%.bbappend
deleted file mode 100644
index e824a179..00000000
--- a/meta-xilinx-core/recipes-graphics/libglu/libglu_%.bbappend
+++ /dev/null
@@ -1,11 +0,0 @@
1# OpenGL comes from libmali, adjust parameters
2MALI_DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', ' virtual/libgles2', '', d)}"
3DEPENDS:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' ${MALI_DEPENDS}', '', d)}"
4
5# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
6DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
7MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
8MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
9PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
10PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
11
diff --git a/meta-xilinx-core/recipes-graphics/libsdl2/libsdl2_%.bbappend b/meta-xilinx-core/recipes-graphics/libsdl2/libsdl2_%.bbappend
deleted file mode 100644
index 03823f6e..00000000
--- a/meta-xilinx-core/recipes-graphics/libsdl2/libsdl2_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
1# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
2DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
3MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
4MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
5PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
6PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch
deleted file mode 100644
index 3c82f602..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 6d283b9aa3f7fb761da4cb076b47a62275fc4caa Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Tue, 21 Nov 2017 03:57:25 -0800
4Subject: [PATCH 1/9] Change Makefile to be compatible with Yocto
5
6Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
7Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
8Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
9Upstream Status: Inappropriate [Xilinx specific]
10---
11 driver/src/devicedrv/mali/Makefile | 11 +++++++++--
12 1 file changed, 9 insertions(+), 2 deletions(-)
13
14diff --git a/driver/src/devicedrv/mali/Makefile b/driver/src/devicedrv/mali/Makefile
15index 5a259fe..a6dd94c 100644
16--- Makefile
17+++ b/Makefile
18@@ -89,7 +89,11 @@ endif
19 # Define host system directory
20 KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build
21
22-include $(KDIR)/.config
23+ifeq ($(O),)
24+ -include $(KDIR)/.config
25+else
26+ -include $(O)/.config
27+endif
28
29 ifeq ($(ARCH), arm)
30 # when compiling for ARM we're cross compiling
31@@ -204,9 +208,12 @@ EXTRA_DEFINES += -DMALI_MEM_SWAP_TRACKING=1
32 endif
33
34 all: $(UMP_SYMVERS_FILE)
35- $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules
36+ $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) O=$(O) modules
37 @rm $(FILES_PREFIX)__malidrv_build_info.c $(FILES_PREFIX)__malidrv_build_info.o
38
39+modules_install:
40+ $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules_install
41+
42 clean:
43 $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean
44
45--
462.7.4
47
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch
deleted file mode 100644
index 0a7b6736..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1From f27aab2b0e4d5dea9b5a0e4648c142257940c428 Mon Sep 17 00:00:00 2001
2From: Hyun Kwon <hyun.kwon@xilinx.com>
3Date: Thu, 25 Jun 2015 17:14:42 -0700
4Subject: [PATCH 2/9] staging: mali: r8p0-01rel0: Add the ZYNQ/ZYNQMP platform
5
6Add the number of PP cores that is required for Zynq/ZynqMP configuration.
7
8Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
9Signed-off-by: Michal Simek <michal.simek@xilinx.com>
10Upstream Status: Inappropriate [Xilinx specific]
11---
12 driver/src/devicedrv/mali/platform/arm/arm.c | 10 ++++++++++
13 1 file changed, 10 insertions(+)
14
15diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c
16index 4e09aca..fac99bc 100644
17--- platform/arm/arm.c
18+++ b/platform/arm/arm.c
19@@ -261,6 +261,10 @@ static struct mali_gpu_device_data mali_gpu_data = {
20 .dedicated_mem_start = 0x80000000, /* Physical start address (use 0xD0000000 for old indirect setup) */
21 .dedicated_mem_size = 0x10000000, /* 256MB */
22 #endif
23+#if defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)
24+ .fb_start = 0x00000000,
25+ .fb_size = 0xfffff000,
26+#else
27 #if defined(CONFIG_ARM64)
28 /* Some framebuffer drivers get the framebuffer dynamically, such as through GEM,
29 * in which the memory resource can't be predicted in advance.
30@@ -271,6 +275,7 @@ static struct mali_gpu_device_data mali_gpu_data = {
31 .fb_start = 0xe0000000,
32 .fb_size = 0x01000000,
33 #endif
34+#endif /* !defined(CONFIG_ARCH_ZYNQ) && !defined(CONFIG_ARCH_ZYNQMP) */
35 .control_interval = 1000, /* 1000ms */
36 .utilization_callback = mali_gpu_utilization_callback,
37 .get_clock_info = NULL,
38@@ -505,6 +510,11 @@ int mali_platform_device_init(struct platform_device *device)
39 mali_write_phys(0xC0010020, 0xA); /* Enable direct memory mapping for FPGA */
40 }
41 }
42+#elif defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)
43+
44+ MALI_DEBUG_PRINT(4, ("Registering Zynq/ZynqMP Mali-400 device\n"));
45+ num_pp_cores = 2;
46+
47 #endif
48
49 /* After kernel 3.15 device tree will default set dev
50--
512.7.4
52
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch
deleted file mode 100644
index 98aa6ac9..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From d6e44bbf8d1377f78481f611dec237e8d24baf74 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Tue, 21 Nov 2017 04:00:27 -0800
4Subject: [PATCH 3/9] staging: mali: r8p0-01rel0: Remove unused trace macros
5
6TRACE_SYSTEM_STRING is not need in each trace file anymore.
7
8Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
9Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
10Upstream Status: Pending
11---
12 driver/src/devicedrv/mali/linux/mali_linux_trace.h | 2 --
13 1 file changed, 2 deletions(-)
14
15diff --git a/driver/src/devicedrv/mali/linux/mali_linux_trace.h b/driver/src/devicedrv/mali/linux/mali_linux_trace.h
16index 7f0b19d..33cb1ca 100644
17--- linux/mali_linux_trace.h
18+++ b/linux/mali_linux_trace.h
19@@ -13,13 +13,11 @@
20
21 #include <linux/types.h>
22
23-#include <linux/stringify.h>
24 #include <linux/tracepoint.h>
25
26 #undef TRACE_SYSTEM
27 #define TRACE_SYSTEM mali
28 #ifndef TRACEPOINTS_ENABLED
29-#define TRACE_SYSTEM_STRING __stringfy(TRACE_SYSTEM)
30 #endif
31 #define TRACE_INCLUDE_PATH .
32 #define TRACE_INCLUDE_FILE mali_linux_trace
33--
342.7.4
35
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch
deleted file mode 100644
index c5c49679..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 2f5e8944357f43fbde4cb642c6ee4a699c88efb5 Mon Sep 17 00:00:00 2001
2From: Hyun Kwon <hyun.kwon@xilinx.com>
3Date: Wed, 29 Jun 2016 09:14:37 -0700
4Subject: [PATCH 4/9] staging: mali: r8p0-01rel0: Don't include
5 mali_read_phys() for zynq/zynqmp
6
7mali_read_phys() is not used with CONFIG_ARCH_ZYNQ and CONFIG_ARCH_ZYNQMP.
8
9Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
10Upstream Status: Inappropriate [Xilinx specific]
11---
12 driver/src/devicedrv/mali/platform/arm/arm.c | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c
16index fac99bc..62f9be6 100644
17--- platform/arm/arm.c
18+++ b/platform/arm/arm.c
19@@ -38,7 +38,9 @@
20 static int mali_core_scaling_enable = 0;
21
22 void mali_gpu_utilization_callback(struct mali_gpu_utilization_data *data);
23+#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP))
24 static u32 mali_read_phys(u32 phys_addr);
25+#endif
26 #if defined(CONFIG_ARCH_REALVIEW)
27 static void mali_write_phys(u32 phys_addr, u32 value);
28 #endif
29@@ -578,6 +580,7 @@ int mali_platform_device_deinit(struct platform_device *device)
30
31 #endif /* CONFIG_MALI_DT */
32
33+#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP))
34 static u32 mali_read_phys(u32 phys_addr)
35 {
36 u32 phys_addr_page = phys_addr & 0xFFFFE000;
37@@ -592,6 +595,7 @@ static u32 mali_read_phys(u32 phys_addr)
38
39 return ret;
40 }
41+#endif
42
43 #if defined(CONFIG_ARCH_REALVIEW)
44 static void mali_write_phys(u32 phys_addr, u32 value)
45--
462.7.4
47
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
deleted file mode 100644
index 3d784604..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch
+++ /dev/null
@@ -1,90 +0,0 @@
1From e67e20ec6ff0c9720d87844270421453c738066a Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Thu, 16 Feb 2017 12:15:58 -0800
4Subject: [PATCH 5/9] linux/mali_kernel_linux.c: Handle clock when probed and
5 removed
6
7This patch will handle the clock through clock
8specifier for GPU PP0 and PP1.
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
11Upstream Status: Inappropriate [Xilinx specific]
12---
13 .../src/devicedrv/mali/linux/mali_kernel_linux.c | 40 +++++++++++++++++++++-
14 1 file changed, 39 insertions(+), 1 deletion(-)
15
16diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c
17index d7893a3..f15fb56 100644
18--- linux/mali_kernel_linux.c
19+++ b/linux/mali_kernel_linux.c
20@@ -45,6 +45,14 @@
21 #if defined(CONFIG_MALI400_INTERNAL_PROFILING)
22 #include "mali_profiling_internal.h"
23 #endif
24+
25+#if defined(CONFIG_ARCH_ZYNQMP)
26+/* Initialize variables for clocks */
27+struct clk *clk_gpu;
28+struct clk *clk_gpu_pp0;
29+struct clk *clk_gpu_pp1;
30+#endif
31+
32 #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS)
33 #include "mali_osk_profiling.h"
34 #include "mali_dvfs_policy.h"
35@@ -580,7 +588,23 @@ static int mali_probe(struct platform_device *pdev)
36 }
37 #endif
38
39-
40+#if defined(CONFIG_ARCH_ZYNQMP)
41+ /* Initialize clocks for GPU and PP */
42+ clk_gpu = devm_clk_get(&pdev->dev, "gpu");
43+ if (IS_ERR(clk_gpu))
44+ return PTR_ERR(clk_gpu);
45+ clk_prepare_enable(clk_gpu);
46+
47+ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0");
48+ if (IS_ERR(clk_gpu_pp0))
49+ return PTR_ERR(clk_gpu_pp0);
50+ clk_prepare_enable(clk_gpu_pp0);
51+
52+ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1");
53+ if (IS_ERR(clk_gpu_pp1))
54+ return PTR_ERR(clk_gpu_pp1);
55+ clk_prepare_enable(clk_gpu_pp1);
56+#endif
57 if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) {
58 /* Initialize the Mali GPU HW specified by pdev */
59 if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) {
60@@ -608,6 +632,12 @@ static int mali_probe(struct platform_device *pdev)
61 _mali_osk_wq_term();
62 }
63
64+#if defined(CONFIG_ARCH_ZYNQMP)
65+ clk_disable_unprepare(clk_gpu);
66+ clk_disable_unprepare(clk_gpu_pp0);
67+ clk_disable_unprepare(clk_gpu_pp1);
68+#endif
69+
70 #ifdef CONFIG_MALI_DEVFREQ
71 mali_devfreq_term(mdev);
72 devfreq_init_failed:
73@@ -673,6 +703,14 @@ static int mali_remove(struct platform_device *pdev)
74 mali_platform_device_deinit(mali_platform_device);
75 #endif
76 mali_platform_device = NULL;
77+
78+#if defined(CONFIG_ARCH_ZYNQMP)
79+ /* Remove clock */
80+ clk_disable_unprepare(clk_gpu);
81+ clk_disable_unprepare(clk_gpu_pp0);
82+ clk_disable_unprepare(clk_gpu_pp1);
83+#endif
84+
85 return 0;
86 }
87
88--
892.7.4
90
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch
deleted file mode 100644
index 3e1745fd..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From ed7242238151c12029c566d1974058c579d8ae3d Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Wed, 25 Jan 2017 10:00:33 -0800
4Subject: [PATCH 6/9] arm.c: global variable dma_ops is removed from the kernel
5 4.7
6
7Refer kernel commit 1dccb598df549d892b6450c261da54cdd7af44b4, the global
8dma_ops variable and the special-casing for ACPI is removed , and just
9returns the dma ops that got set for the device, or the dummy_dma_ops
10if none were present.
11
12Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
13Upstream Status: Pending
14---
15 driver/src/devicedrv/mali/platform/arm/arm.c | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c
19index 62f9be6..57ca989 100644
20--- platform/arm/arm.c
21+++ b/platform/arm/arm.c
22@@ -529,8 +529,9 @@ int mali_platform_device_init(struct platform_device *device)
23 */
24 if (!device->dev.dma_mask)
25 device->dev.dma_mask = &device->dev.coherent_dma_mask;
26+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0))
27 device->dev.archdata.dma_ops = dma_ops;
28-
29+#endif
30 err = platform_device_add_data(device, &mali_gpu_data, sizeof(mali_gpu_data));
31
32 if (0 == err) {
33--
342.7.4
35
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch
deleted file mode 100644
index 98a86c88..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From 58e2c55176f1a146781430b2a570c8ce5f80d426 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Mon, 28 Aug 2017 09:40:37 -0700
4Subject: [PATCH] common/mali_pm.c: Add PM runtime barrier after removing
5 suspend
6
7Runtime PM suspend "put" results in addition of PM suspend
8API in work queue. This barrier API will remove it from
9the work queue.
10
11Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
12Upstream-Status: Pending
13---
14 driver/src/devicedrv/mali/common/mali_pm.c | 1 +
15 1 file changed, 1 insertion(+)
16
17diff --git a/driver/src/devicedrv/mali/common/mali_pm.c b/driver/src/devicedrv/mali/common/mali_pm.c
18index 858c689..62a1e5f 100644
19--- common/mali_pm.c
20+++ b/common/mali_pm.c
21@@ -301,6 +301,7 @@ void mali_pm_init_end(void)
22 }
23
24 _mali_osk_pm_dev_ref_put();
25+ _mali_osk_pm_dev_barrier();
26 }
27
28 void mali_pm_update_sync(void)
29--
302.7.4
31
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch
deleted file mode 100644
index 38ab4042..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch
+++ /dev/null
@@ -1,153 +0,0 @@
1From aeff13ad9e9ef73172a9325f669aefd3c0403dbb Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurki@xilinx.com>
3Date: Wed, 21 Feb 2018 16:52:15 -0800
4Subject: [PATCH] linux/mali_kernel_linux.c: Enable/disable clock for runtime
5 resume/suspend
6
7Enable/Disable the clock for GP,PP0 and PP1 during runtime
8resume/suspend.
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurki@xilinx.com>
11Reviewed-by: Hyun Kwon <hyunk@xilinx.com>
12Upstream Status: Inappropriate [Xilinx specific]
13---
14 .../src/devicedrv/mali/linux/mali_kernel_linux.c | 65 ++++++++++++++++++----
15 1 file changed, 54 insertions(+), 11 deletions(-)
16
17diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c
18index f15fb56..e61f33b 100644
19--- linux/mali_kernel_linux.c
20+++ b/linux/mali_kernel_linux.c
21@@ -51,6 +51,7 @@
22 struct clk *clk_gpu;
23 struct clk *clk_gpu_pp0;
24 struct clk *clk_gpu_pp1;
25+mali_bool clk_enabled;
26 #endif
27
28 #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS)
29@@ -281,6 +282,46 @@ struct file_operations mali_fops = {
30 .mmap = mali_mmap
31 };
32
33+static int mali_enable_clk(void)
34+{
35+#if defined(CONFIG_ARCH_ZYNQMP)
36+ int err = 0;
37+
38+ if (clk_enabled)
39+ return 0;
40+
41+ clk_enabled = MALI_TRUE;
42+ err = clk_prepare_enable(clk_gpu);
43+ if (err) {
44+ MALI_PRINT_ERROR(("Could not enable clock for GP\n\r"));
45+ return err;
46+ }
47+ err = clk_prepare_enable(clk_gpu_pp0);
48+ if (err) {
49+ MALI_PRINT_ERROR(("Could not enable clock for PP0\n\r"));
50+ return err;
51+ }
52+ err = clk_prepare_enable(clk_gpu_pp1);
53+ if (err) {
54+ MALI_PRINT_ERROR(("Could not enable clock for PP1\n\r"));
55+ return err;
56+ }
57+#endif
58+ return 0;
59+}
60+
61+static void mali_disable_clk(void)
62+{
63+#if defined(CONFIG_ARCH_ZYNQMP)
64+ if (clk_enabled) {
65+ clk_enabled = MALI_FALSE;
66+ clk_disable_unprepare(clk_gpu);
67+ clk_disable_unprepare(clk_gpu_pp0);
68+ clk_disable_unprepare(clk_gpu_pp1);
69+ }
70+#endif
71+}
72+
73 #if MALI_ENABLE_CPU_CYCLES
74 void mali_init_cpu_time_counters(int reset, int enable_divide_by_64)
75 {
76@@ -593,18 +634,19 @@ static int mali_probe(struct platform_device *pdev)
77 clk_gpu = devm_clk_get(&pdev->dev, "gpu");
78 if (IS_ERR(clk_gpu))
79 return PTR_ERR(clk_gpu);
80- clk_prepare_enable(clk_gpu);
81
82 clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0");
83 if (IS_ERR(clk_gpu_pp0))
84 return PTR_ERR(clk_gpu_pp0);
85- clk_prepare_enable(clk_gpu_pp0);
86
87 clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1");
88 if (IS_ERR(clk_gpu_pp1))
89 return PTR_ERR(clk_gpu_pp1);
90- clk_prepare_enable(clk_gpu_pp1);
91 #endif
92+
93+ err = mali_enable_clk();
94+ if (err)
95+ return err;
96 if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) {
97 /* Initialize the Mali GPU HW specified by pdev */
98 if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) {
99@@ -632,11 +674,6 @@ static int mali_probe(struct platform_device *pdev)
100 _mali_osk_wq_term();
101 }
102
103-#if defined(CONFIG_ARCH_ZYNQMP)
104- clk_disable_unprepare(clk_gpu);
105- clk_disable_unprepare(clk_gpu_pp0);
106- clk_disable_unprepare(clk_gpu_pp1);
107-#endif
108
109 #ifdef CONFIG_MALI_DEVFREQ
110 mali_devfreq_term(mdev);
111@@ -644,6 +681,7 @@ devfreq_init_failed:
112 mali_pm_metrics_term(mdev);
113 pm_metrics_init_failed:
114 clk_disable_unprepare(mdev->clock);
115+ mali_disable_clk();
116 clock_prepare_failed:
117 clk_put(mdev->clock);
118 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && defined(CONFIG_OF) \
119@@ -706,9 +744,7 @@ static int mali_remove(struct platform_device *pdev)
120
121 #if defined(CONFIG_ARCH_ZYNQMP)
122 /* Remove clock */
123- clk_disable_unprepare(clk_gpu);
124- clk_disable_unprepare(clk_gpu_pp0);
125- clk_disable_unprepare(clk_gpu_pp1);
126+ mali_disable_clk();
127 #endif
128
129 return 0;
130@@ -816,6 +852,8 @@ static int mali_driver_runtime_suspend(struct device *dev)
131 devfreq_suspend_device(mdev->devfreq);
132 #endif
133
134+ mali_disable_clk();
135+
136 return 0;
137 } else {
138 return -EBUSY;
139@@ -824,6 +862,11 @@ static int mali_driver_runtime_suspend(struct device *dev)
140
141 static int mali_driver_runtime_resume(struct device *dev)
142 {
143+ int err ;
144+
145+ err = mali_enable_clk();
146+ if (err)
147+ return err;
148 #ifdef CONFIG_MALI_DEVFREQ
149 struct mali_device *mdev = dev_get_drvdata(dev);
150 if (!mdev)
151--
1522.7.4
153
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch
deleted file mode 100644
index 24f0a22c..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 779b1883d56804ecd08fe7f57d6c01e3db4e893b Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Wed, 5 Dec 2018 18:07:29 -0800
4Subject: [PATCH 1/3] linux: mali_memory_os_alloc: Remove __GFP_COLD
5
6The support for Cache hot and cold pages are removed from the kernel.
7For more information refer kernel commit 453f85d43fa9ee243f0fc3ac4e1be45615301e3f
8
9Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
10Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
11Upstream Status: Pending
12---
13 driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c
17index 1602371..830e8c6 100644
18--- linux/mali_memory_os_alloc.c
19+++ b/linux/mali_memory_os_alloc.c
20@@ -202,7 +202,9 @@ 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+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
26+ gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
27+#elif LINUX_VERSION_CODE == KERNEL_VERSION(4, 14, 0)
28 gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | __GFP_COLD;
29 #else
30 gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD;
31--
322.7.4
33
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch
deleted file mode 100644
index c28a83f4..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From d20b6eb3e48e56558488dbdda98875b1aed0c29f Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Wed, 5 Dec 2018 18:13:28 -0800
4Subject: [PATCH 2/3] linux: mali_memory_secure: Add header file dma-direct.h
5
6Add dma-direct.h header, as API dma_to_phys is defined here.
7refer kernel commit ea8c64ace86647260ec4255f483e5844d62af2df
8
9Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
10Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
11Upstream Status: Pending
12---
13 driver/src/devicedrv/mali/linux/mali_memory_secure.c | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c
17index 2836b1b..4f55fa5 100644
18--- linux/mali_memory_secure.c
19+++ b/linux/mali_memory_secure.c
20@@ -13,7 +13,11 @@
21 #include "mali_memory_secure.h"
22 #include "mali_osk.h"
23 #include <linux/mutex.h>
24+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)
25+#include <linux/dma-direct.h>
26+#else
27 #include <linux/dma-mapping.h>
28+#endif
29 #include <linux/dma-buf.h>
30
31 _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd)
32--
332.7.4
34
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch
deleted file mode 100644
index a7c1d5cc..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch
+++ /dev/null
@@ -1,156 +0,0 @@
1From b6936450484b5aa9dd2438367a907af020341d1d Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Thu, 6 Dec 2018 13:30:44 -0800
4Subject: [PATCH 3/3] linux: mali_*timer: Get rid of init_timer
5
6kernel 4.19 got rid of ancient init_timer. Hence, replace it with
7timer_setup API. For more information refer kernel commit
87eeb6b893bd28c68b6d664de1d3120e49b855cdb
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
11Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
12Upstream Status: Pending
13---
14 driver/src/devicedrv/mali/common/mali_control_timer.c | 6 ++++++
15 driver/src/devicedrv/mali/common/mali_group.c | 6 ++++++
16 driver/src/devicedrv/mali/common/mali_osk.h | 15 ++++++++++++++-
17 driver/src/devicedrv/mali/linux/mali_osk_timers.c | 15 ++++++++++++++-
18 4 files changed, 40 insertions(+), 2 deletions(-)
19
20diff --git a/driver/src/devicedrv/mali/common/mali_control_timer.c b/driver/src/devicedrv/mali/common/mali_control_timer.c
21index 1296ffe..d24b934 100644
22--- common/mali_control_timer.c
23+++ b/common/mali_control_timer.c
24@@ -65,11 +65,17 @@ _mali_osk_errcode_t mali_control_timer_init(void)
25 }
26 }
27
28+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
29+ mali_control_timer = _mali_osk_timer_init(mali_control_timer_callback);
30+#else
31 mali_control_timer = _mali_osk_timer_init();
32+#endif
33 if (NULL == mali_control_timer) {
34 return _MALI_OSK_ERR_FAULT;
35 }
36+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
37 _mali_osk_timer_setcallback(mali_control_timer, mali_control_timer_callback, NULL);
38+#endif
39
40 return _MALI_OSK_ERR_OK;
41 }
42diff --git a/driver/src/devicedrv/mali/common/mali_group.c b/driver/src/devicedrv/mali/common/mali_group.c
43index 5c7b3f4..1702e9a 100644
44--- common/mali_group.c
45+++ b/common/mali_group.c
46@@ -65,9 +65,15 @@ struct mali_group *mali_group_create(struct mali_l2_cache_core *core,
47
48 group = _mali_osk_calloc(1, sizeof(struct mali_group));
49 if (NULL != group) {
50+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
51+ group->timeout_timer = _mali_osk_timer_init(mali_group_timeout);
52+#else
53 group->timeout_timer = _mali_osk_timer_init();
54+#endif
55 if (NULL != group->timeout_timer) {
56+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
57 _mali_osk_timer_setcallback(group->timeout_timer, mali_group_timeout, (void *)group);
58+#endif
59
60 group->l2_cache_core[0] = core;
61 _mali_osk_list_init(&group->group_list);
62diff --git a/driver/src/devicedrv/mali/common/mali_osk.h b/driver/src/devicedrv/mali/common/mali_osk.h
63index a501778..fe93d79 100644
64--- common/mali_osk.h
65+++ b/common/mali_osk.h
66@@ -947,7 +947,17 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_
67 * asked for.
68 *
69 * @{ */
70-
71+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
72+/** @brief Initialize a timer
73+ *
74+ * Allocates resources for a new timer, and initializes them. This does not
75+ * start the timer.
76+ *
77+ * @param callback Function to call when timer expires
78+ * @return a pointer to the allocated timer object, or NULL on failure.
79+ */
80+_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback);
81+#else
82 /** @brief Initialize a timer
83 *
84 * Allocates resources for a new timer, and initializes them. This does not
85@@ -956,6 +966,7 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_
86 * @return a pointer to the allocated timer object, or NULL on failure.
87 */
88 _mali_osk_timer_t *_mali_osk_timer_init(void);
89+#endif
90
91 /** @brief Start a timer
92 *
93@@ -1034,6 +1045,7 @@ void _mali_osk_timer_del_async(_mali_osk_timer_t *tim);
94 */
95 mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim);
96
97+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
98 /** @brief Set a timer's callback parameters.
99 *
100 * This must be called at least once before a timer is started/modified.
101@@ -1047,6 +1059,7 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim);
102 * @param data Function-specific data to supply to the function on expiry.
103 */
104 void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data);
105+#endif
106
107 /** @brief Terminate a timer, and deallocate resources.
108 *
109diff --git a/driver/src/devicedrv/mali/linux/mali_osk_timers.c b/driver/src/devicedrv/mali/linux/mali_osk_timers.c
110index e5d7238..f9b5a86 100644
111--- linux/mali_osk_timers.c
112+++ b/linux/mali_osk_timers.c
113@@ -21,13 +21,24 @@
114 struct _mali_osk_timer_t_struct {
115 struct timer_list timer;
116 };
117-
118+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
119+typedef void (*timer_timeout_function_t)(struct timer_list *);
120+#else
121 typedef void (*timer_timeout_function_t)(unsigned long);
122+#endif
123
124+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
125+_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback)
126+#else
127 _mali_osk_timer_t *_mali_osk_timer_init(void)
128+#endif
129 {
130 _mali_osk_timer_t *t = (_mali_osk_timer_t *)kmalloc(sizeof(_mali_osk_timer_t), GFP_KERNEL);
131+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
132+ if (NULL != t) timer_setup(&t->timer, (timer_timeout_function_t)callback, 0);
133+#else
134 if (NULL != t) init_timer(&t->timer);
135+#endif
136 return t;
137 }
138
139@@ -62,12 +73,14 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim)
140 return 1 == timer_pending(&(tim->timer));
141 }
142
143+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
144 void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data)
145 {
146 MALI_DEBUG_ASSERT_POINTER(tim);
147 tim->timer.data = (unsigned long)data;
148 tim->timer.function = (timer_timeout_function_t)callback;
149 }
150+#endif
151
152 void _mali_osk_timer_term(_mali_osk_timer_t *tim)
153 {
154--
1552.7.4
156
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch
deleted file mode 100644
index 5363c37e..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Index: mali/linux/mali_memory_os_alloc.c
2===================================================================
3--- mali.orig/linux/mali_memory_os_alloc.c
4+++ mali/linux/mali_memory_os_alloc.c
5@@ -239,8 +239,10 @@ int mali_mem_os_alloc_pages(mali_mem_os_
6 /* Ensure page is flushed from CPU caches. */
7 dma_addr = dma_map_page(&mali_platform_device->dev, new_page,
8 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
9- dma_unmap_page(&mali_platform_device->dev, dma_addr,
10- _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
11+ err = dma_mapping_error(&mali_platform_device->dev, dma_addr);
12+ if (likely(!err))
13+ dma_unmap_page(&mali_platform_device->dev, dma_addr,
14+ _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
15 dma_addr = dma_map_page(&mali_platform_device->dev, new_page,
16 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
17
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch
deleted file mode 100644
index dc8bbebf..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 8cf1dd43f3f25cb4afb84dfc3b0e7c02bc8f7f0c Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Mon, 24 Feb 2020 18:19:37 -0800
4Subject: [LINUX][rel-v2020.1][PATCH v1 1/3] mali_memory_secure: Kernel 5.0
5 onwards 'access_ok' API does not take 'type' as input parameter
6
7'access_ok' no longer needs 'type' as input paramter from kernel 5.0
8onwards.
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
11---
12 driver/src/devicedrv/mali/linux/mali_ukk_mem.c | 9 +++++++++
13 1 file changed, 9 insertions(+)
14
15diff --git a/driver/src/devicedrv/mali/linux/mali_ukk_mem.c b/driver/src/devicedrv/mali/linux/mali_ukk_mem.c
16index 4ec57dc..270bb6d 100644
17--- linux/mali_ukk_mem.c
18+++ b/linux/mali_ukk_mem.c
19@@ -207,8 +207,13 @@ int mem_write_safe_wrapper(struct mali_session_data *session_data, _mali_uk_mem_
20 kargs.ctx = (uintptr_t)session_data;
21
22 /* Check if we can access the buffers */
23+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
24+ if (!access_ok((const void __user *)kargs.dest, kargs.size)
25+ || !access_ok((const void __user *)kargs.src, kargs.size)) {
26+#else
27 if (!access_ok(VERIFY_WRITE, kargs.dest, kargs.size)
28 || !access_ok(VERIFY_READ, kargs.src, kargs.size)) {
29+#endif
30 return -EINVAL;
31 }
32
33@@ -266,7 +271,11 @@ int mem_dump_mmu_page_table_wrapper(struct mali_session_data *session_data, _mal
34 goto err_exit;
35
36 user_buffer = (void __user *)(uintptr_t)kargs.buffer;
37+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
38+ if (!access_ok(user_buffer, kargs.size))
39+#else
40 if (!access_ok(VERIFY_WRITE, user_buffer, kargs.size))
41+#endif
42 goto err_exit;
43
44 /* allocate temporary buffer (kernel side) to store mmu page table info */
45--
462.7.4
47
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch
deleted file mode 100644
index 9c4bbee9..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch
+++ /dev/null
@@ -1,146 +0,0 @@
1From 953cab73b8bc487da330aa454abd7f8c7466737e Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Mon, 24 Feb 2020 18:32:16 -0800
4Subject: [LINUX][rel-v2020.1][PATCH v1 2/3] Support for vm_insert_pfn
5 deprecated from kernel 4.20
6
7From kernel 4.20 onwards, support for vm_insert_pfn is deprecated.
8Hence, replace the same with vmf_insert_pfn.
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
11---
12 .../devicedrv/mali/linux/mali_memory_block_alloc.c | 6 +++++-
13 driver/src/devicedrv/mali/linux/mali_memory_cow.c | 14 ++++++++++++--
14 .../src/devicedrv/mali/linux/mali_memory_os_alloc.c | 20 +++++++++++++++++---
15 driver/src/devicedrv/mali/linux/mali_memory_secure.c | 7 ++++++-
16 4 files changed, 40 insertions(+), 7 deletions(-)
17
18diff --git a/driver/src/devicedrv/mali/linux/mali_memory_block_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_block_alloc.c
19index 0c5b6c3..e528699 100644
20--- linux/mali_memory_block_alloc.c
21+++ b/linux/mali_memory_block_alloc.c
22@@ -309,9 +309,13 @@ int mali_mem_block_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *v
23
24 list_for_each_entry(m_page, &block_mem->pfns, list) {
25 MALI_DEBUG_ASSERT(m_page->type == MALI_PAGE_NODE_BLOCK);
26+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
27+ ret = vmf_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page));
28+ if (unlikely(VM_FAULT_ERROR & ret)) {
29+#else
30 ret = vm_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page));
31-
32 if (unlikely(0 != ret)) {
33+#endif
34 return -EFAULT;
35 }
36 addr += _MALI_OSK_MALI_PAGE_SIZE;
37diff --git a/driver/src/devicedrv/mali/linux/mali_memory_cow.c b/driver/src/devicedrv/mali/linux/mali_memory_cow.c
38index f1d44fe..1dae1d6 100644
39--- linux/mali_memory_cow.c
40+++ b/linux/mali_memory_cow.c
41@@ -532,9 +532,14 @@ int mali_mem_cow_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma
42 * flush which makes it way slower than remap_pfn_range or vm_insert_pfn.
43 ret = vm_insert_page(vma, addr, page);
44 */
45+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
46+ ret = vmf_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page));
47+ if (unlikely(VM_FAULT_ERROR & ret)) {
48+#else
49 ret = vm_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page));
50-
51 if (unlikely(0 != ret)) {
52+#endif
53+
54 return ret;
55 }
56 addr += _MALI_OSK_MALI_PAGE_SIZE;
57@@ -569,9 +574,14 @@ _mali_osk_errcode_t mali_mem_cow_cpu_map_pages_locked(mali_mem_backend *mem_bken
58
59 list_for_each_entry(m_page, &cow->pages, list) {
60 if ((count >= offset) && (count < offset + num)) {
61+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
62+ ret = vmf_insert_pfn(vma, vaddr, _mali_page_node_get_pfn(m_page));
63+ if (unlikely(VM_FAULT_ERROR & ret)) {
64+#else
65 ret = vm_insert_pfn(vma, vaddr, _mali_page_node_get_pfn(m_page));
66-
67 if (unlikely(0 != ret)) {
68+#endif
69+
70 if (count == offset) {
71 return _MALI_OSK_ERR_FAULT;
72 } else {
73diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c
74index 3fb6f05..7de3920 100644
75--- linux/mali_memory_os_alloc.c
76+++ b/linux/mali_memory_os_alloc.c
77@@ -378,9 +378,14 @@ int mali_mem_os_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma)
78 ret = vm_insert_page(vma, addr, page);
79 */
80 page = m_page->page;
81+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
82+ ret = vmf_insert_pfn(vma, addr, page_to_pfn(page));
83+ if (unlikely(VM_FAULT_ERROR & ret)) {
84+#else
85 ret = vm_insert_pfn(vma, addr, page_to_pfn(page));
86-
87 if (unlikely(0 != ret)) {
88+#endif
89+
90 return -EFAULT;
91 }
92 addr += _MALI_OSK_MALI_PAGE_SIZE;
93@@ -416,9 +421,13 @@ _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bken
94
95 vm_end -= _MALI_OSK_MALI_PAGE_SIZE;
96 if (mapping_page_num > 0) {
97+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
98+ ret = vmf_insert_pfn(vma, vm_end, page_to_pfn(m_page->page));
99+ if (unlikely(VM_FAULT_ERROR & ret)) {
100+#else
101 ret = vm_insert_pfn(vma, vm_end, page_to_pfn(m_page->page));
102-
103 if (unlikely(0 != ret)) {
104+#endif
105 /*will return -EBUSY If the page has already been mapped into table, but it's OK*/
106 if (-EBUSY == ret) {
107 break;
108@@ -439,9 +448,14 @@ _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bken
109 list_for_each_entry(m_page, &os_mem->pages, list) {
110 if (count >= offset) {
111
112+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
113+ ret = vmf_insert_pfn(vma, vstart, page_to_pfn(m_page->page));
114+ if (unlikely(VM_FAULT_ERROR & ret)) {
115+#else
116 ret = vm_insert_pfn(vma, vstart, page_to_pfn(m_page->page));
117-
118 if (unlikely(0 != ret)) {
119+#endif
120+
121 /*will return -EBUSY If the page has already been mapped into table, but it's OK*/
122 if (-EBUSY == ret) {
123 break;
124diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c
125index 5546304..cebd1c8 100644
126--- linux/mali_memory_secure.c
127+++ b/linux/mali_memory_secure.c
128@@ -132,9 +132,14 @@ int mali_mem_secure_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *
129 MALI_DEBUG_ASSERT(0 == size % _MALI_OSK_MALI_PAGE_SIZE);
130
131 for (j = 0; j < size / _MALI_OSK_MALI_PAGE_SIZE; j++) {
132+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
133+ ret = vmf_insert_pfn(vma, addr, PFN_DOWN(phys));
134+ if (unlikely(VM_FAULT_ERROR & ret)) {
135+#else
136 ret = vm_insert_pfn(vma, addr, PFN_DOWN(phys));
137-
138 if (unlikely(0 != ret)) {
139+#endif
140+
141 return -EFAULT;
142 }
143 addr += _MALI_OSK_MALI_PAGE_SIZE;
144--
1452.7.4
146
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch
deleted file mode 100644
index 9797db62..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From ad5c569f0cc40698699fc2f2c1db3ceb9f8b8f35 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Tue, 25 Feb 2020 11:36:01 -0800
4Subject: [LINUX][rel-v2020.1][PATCH v1 3/3] Change return type to vm_fault_t
5 for fault handler
6
7From kernel 4.17 onwards the return type of fault handler for
8vm_operations is of type 'vm_fault_t'.
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
11---
12 driver/src/devicedrv/mali/linux/mali_memory.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15diff --git a/driver/src/devicedrv/mali/linux/mali_memory.c b/driver/src/devicedrv/mali/linux/mali_memory.c
16index c0f0982..2b2b209 100644
17--- linux/mali_memory.c
18+++ b/linux/mali_memory.c
19@@ -70,7 +70,9 @@ static void mali_mem_vma_close(struct vm_area_struct *vma)
20 }
21 }
22
23-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
24+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
25+static vm_fault_t mali_mem_vma_fault(struct vm_fault *vmf)
26+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
27 static int mali_mem_vma_fault(struct vm_fault *vmf)
28 #else
29 static int mali_mem_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
30--
312.7.4
32
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch
deleted file mode 100644
index 154bb673..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From c6a6b39cea3fdfd91cae7f2a4ef6f36d2c55fdd6 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Tue, 25 Feb 2020 15:17:17 -0800
4Subject: [LINUX][rel-v2020.1][PATCH v1] "get_monotonic_boottime(&ts)"
5 deprecated from kernel 4.20 onwards
6
7As "get_monotonic_boottime(&ts)" is deprecated, replace the same with
8"ktime_get_boottime_ts64(&ts)". Refer kernel commit ID
9976516404ff3fab2a8caa8bd6f5efc1437fed0b8
10
11Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
12---
13 driver/src/devicedrv/mali/linux/mali_osk_time.c | 6 ++++++
14 1 file changed, 6 insertions(+)
15
16diff --git a/driver/src/devicedrv/mali/linux/mali_osk_time.c b/driver/src/devicedrv/mali/linux/mali_osk_time.c
17index 03046a5..bfcbf7f 100644
18--- linux/mali_osk_time.c
19+++ b/linux/mali_osk_time.c
20@@ -53,7 +53,13 @@ u64 _mali_osk_time_get_ns(void)
21
22 u64 _mali_osk_boot_time_get_ns(void)
23 {
24+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
25+ struct timespec64 tsval;
26+ ktime_get_boottime_ts64(&tsval);
27+ return (u64)timespec64_to_ns(&tsval);
28+#else
29 struct timespec tsval;
30 get_monotonic_boottime(&tsval);
31 return (u64)timespec_to_ns(&tsval);
32+#endif
33 }
34--
352.7.4
36
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch
deleted file mode 100644
index ff86091f..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From cbc2351e8acf7ed38f6d965e5ea21620e45eda30 Mon Sep 17 00:00:00 2001
2From: Dylan Yip <dylan.yip@xilinx.com>
3Date: Tue, 9 Feb 2021 10:05:41 -0800
4Subject: [PATCH 20/23] Fix ioremap_nocache() deprecation in kernel 5.6
5
6As of commit 4bdc0d676a643140 ("remove ioremap_nocache and
7devm_ioremap_nocache") from kernel 5.6, ioremap_nocache has been
8removed because ioremap is already non-cached by default. So replace all
9calls with ioremap.
10
11Signed-off-by: Dylan Yip <dylan.yip@xilinx.com>
12---
13 linux/mali_memory_cow.c | 4 ++++
14 linux/mali_osk_low_level_mem.c | 4 ++++
15 platform/arm/arm.c | 12 ++++++++++++
16 3 files changed, 20 insertions(+)
17
18diff --git a/linux/mali_memory_cow.c b/linux/mali_memory_cow.c
19index 1dae1d6..6fadd42 100644
20--- a/linux/mali_memory_cow.c
21+++ b/linux/mali_memory_cow.c
22@@ -693,7 +693,11 @@ void _mali_mem_cow_copy_page(mali_page_node *src_node, mali_page_node *dst_node)
23 /*
24 * use ioremap to map src for BLOCK memory
25 */
26+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
27+ src = ioremap(_mali_page_node_get_dma_addr(src_node), _MALI_OSK_MALI_PAGE_SIZE);
28+#else
29 src = ioremap_nocache(_mali_page_node_get_dma_addr(src_node), _MALI_OSK_MALI_PAGE_SIZE);
30+#endif
31 memcpy(dst, src , _MALI_OSK_MALI_PAGE_SIZE);
32 iounmap(src);
33 }
34diff --git a/linux/mali_osk_low_level_mem.c b/linux/mali_osk_low_level_mem.c
35index 84f93d9..5a0a725 100644
36--- a/linux/mali_osk_low_level_mem.c
37+++ b/linux/mali_osk_low_level_mem.c
38@@ -33,7 +33,11 @@ void _mali_osk_write_mem_barrier(void)
39
40 mali_io_address _mali_osk_mem_mapioregion(uintptr_t phys, u32 size, const char *description)
41 {
42+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
43+ return (mali_io_address)ioremap(phys, size);
44+#else
45 return (mali_io_address)ioremap_nocache(phys, size);
46+#endif
47 }
48
49 void _mali_osk_mem_unmapioregion(uintptr_t phys, u32 size, mali_io_address virt)
50diff --git a/platform/arm/arm.c b/platform/arm/arm.c
51index b2fb746..e468263 100644
52--- a/platform/arm/arm.c
53+++ b/platform/arm/arm.c
54@@ -98,7 +98,11 @@ static int mali_secure_mode_init_juno(void)
55
56 MALI_DEBUG_ASSERT(NULL == secure_mode_mapped_addr);
57
58+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
59+ secure_mode_mapped_addr = ioremap(phys_addr_page, map_size);
60+#else
61 secure_mode_mapped_addr = ioremap_nocache(phys_addr_page, map_size);
62+#endif
63 if (NULL != secure_mode_mapped_addr) {
64 return mali_gpu_reset_and_secure_mode_disable_juno();
65 }
66@@ -588,7 +592,11 @@ static u32 mali_read_phys(u32 phys_addr)
67 u32 phys_offset = phys_addr & 0x00001FFF;
68 u32 map_size = phys_offset + sizeof(u32);
69 u32 ret = 0xDEADBEEF;
70+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
71+ void *mem_mapped = ioremap(phys_addr_page, map_size);
72+#else
73 void *mem_mapped = ioremap_nocache(phys_addr_page, map_size);
74+#endif
75 if (NULL != mem_mapped) {
76 ret = (u32)ioread32(((u8 *)mem_mapped) + phys_offset);
77 iounmap(mem_mapped);
78@@ -604,7 +612,11 @@ static void mali_write_phys(u32 phys_addr, u32 value)
79 u32 phys_addr_page = phys_addr & 0xFFFFE000;
80 u32 phys_offset = phys_addr & 0x00001FFF;
81 u32 map_size = phys_offset + sizeof(u32);
82+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
83+ void *mem_mapped = ioremap(phys_addr_page, map_size);
84+#else
85 void *mem_mapped = ioremap_nocache(phys_addr_page, map_size);
86+#endif
87 if (NULL != mem_mapped) {
88 iowrite32(value, ((u8 *)mem_mapped) + phys_offset);
89 iounmap(mem_mapped);
90--
912.17.1
92
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch
deleted file mode 100644
index adef8e18..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From bc0f85271681532c7e394229f0155366d1de8779 Mon Sep 17 00:00:00 2001
2From: Dylan Yip <dylan.yip@xilinx.com>
3Date: Mon, 8 Feb 2021 23:47:01 -0800
4Subject: [PATCH 21/23] Use updated timekeeping functions in kernel 5.6
5
6As of commit 412c53a680a9 ("y2038: remove unused time32 interfaces"), 32
7bit timekeeping functions like getnstimeofday() have been removed. So
8use the 64 bit replacements.
9
10Signed-off-by: Dylan Yip <dylan.yip@xilinx.com>
11---
12 linux/mali_osk_time.c | 6 ++++++
13 1 file changed, 6 insertions(+)
14
15diff --git a/linux/mali_osk_time.c b/linux/mali_osk_time.c
16index bfcbf7f..583d82b 100644
17--- a/linux/mali_osk_time.c
18+++ b/linux/mali_osk_time.c
19@@ -46,9 +46,15 @@ void _mali_osk_time_ubusydelay(u32 usecs)
20
21 u64 _mali_osk_time_get_ns(void)
22 {
23+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
24+ struct timespec64 tsval;
25+ ktime_get_real_ts64(&tsval);
26+ return (u64)timespec64_to_ns(&tsval);
27+#else
28 struct timespec tsval;
29 getnstimeofday(&tsval);
30 return (u64)timespec_to_ns(&tsval);
31+#endif
32 }
33
34 u64 _mali_osk_boot_time_get_ns(void)
35--
362.17.1
37
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch
deleted file mode 100644
index 181df7b7..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From d17933b6909cc29103befc2ef4e6cf413d9e8fb6 Mon Sep 17 00:00:00 2001
2From: Dylan Yip <dylan.yip@xilinx.com>
3Date: Tue, 9 Feb 2021 08:58:44 -0800
4Subject: [PATCH 22/23] Set HAVE_UNLOCKED_IOCTL default to true
5
6As of commit b19dd42faf41 ("bkl: Remove locked .ioctl file operation")
7of kernel 2.6, the ioctl operation has been replaced with
8unlocked_ioctl. Since this change has been around for almost 10 years,
9go ahead and set the default HAVE_UNLOCKED_IOCTL to be true.
10
11Signed-off-by: Dylan Yip <dylan.yip@xilinx.com>
12---
13 Kbuild | 2 ++
14 1 file changed, 2 insertions(+)
15
16diff --git a/Kbuild b/Kbuild
17index 02c3f3d..8c6e6e0 100644
18--- a/Kbuild
19+++ b/Kbuild
20@@ -21,6 +21,7 @@ MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 0
21 MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 0
22 MALI_UPPER_HALF_SCHEDULING ?= 1
23 MALI_ENABLE_CPU_CYCLES ?= 0
24+HAVE_UNLOCKED_IOCTL ?= 1
25
26 # For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases:
27 # The ARM proprietary product will only include the license/proprietary directory
28@@ -179,6 +180,7 @@ ccflags-y += -DMALI_STATE_TRACKING=1
29 ccflags-y += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)
30 ccflags-y += -DUSING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION)
31 ccflags-y += -DMALI_ENABLE_CPU_CYCLES=$(MALI_ENABLE_CPU_CYCLES)
32+ccflags-y += -DHAVE_UNLOCKED_IOCTL=$(HAVE_UNLOCKED_IOCTL)
33
34 ifeq ($(MALI_UPPER_HALF_SCHEDULING),1)
35 ccflags-y += -DMALI_UPPER_HALF_SCHEDULING
36--
372.17.1
38
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch
deleted file mode 100644
index bab2bd37..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From e2b52e358e0e030d3881ef80ef09de3662b41210 Mon Sep 17 00:00:00 2001
2From: Dylan Yip <dylan.yip@xilinx.com>
3Date: Tue, 9 Feb 2021 09:48:01 -0800
4Subject: [PATCH 23/23] Use PTR_ERR_OR_ZERO instead of PTR_RET
5
6As of commit fad7c9020948 ("err.h: remove deprecated PTR_RET for good")
7in kernel 5.7, PTR_RET has been removed and replaced with
8PTR_ERR_OR_ZERO. So use this API instead.
9
10Signed-off-by: Dylan Yip <dylan.yip@xilinx.com>
11---
12 linux/mali_memory_dma_buf.c | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c
16index 905cd8b..fcdcaac 100644
17--- a/linux/mali_memory_dma_buf.c
18+++ b/linux/mali_memory_dma_buf.c
19@@ -281,7 +281,11 @@ int mali_dma_buf_get_size(struct mali_session_data *session, _mali_uk_dma_buf_ge
20 buf = dma_buf_get(fd);
21 if (IS_ERR_OR_NULL(buf)) {
22 MALI_DEBUG_PRINT_ERROR(("Failed to get dma-buf from fd: %d\n", fd));
23+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
24+ return PTR_ERR_OR_ZERO(buf);
25+#else
26 return PTR_RET(buf);
27+#endif
28 }
29
30 if (0 != put_user(buf->size, &user_arg->size)) {
31--
322.17.1
33
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch
deleted file mode 100644
index 5b3eeedc..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch
+++ /dev/null
@@ -1,91 +0,0 @@
1Use the community device-tree names
2
3The community LIMA driver uses a series of names that are different then
4the legacy Xilinx names. Moves from the legacy names to the more standard
5names.
6
7This will allow us to have a single device tree that works with both the
8mali driver, as well as the lima driver.
9
10Interrupt-names:
11 IRQGP -> gp
12 IRQGPMMU -> gpmmu
13 IRQPP0 -> pp0
14 IRQPPMMU0 -> ppmmu0
15 IRQPP1 -> pp1
16 IRQPPMMU1 -> ppmmu1
17 ...
18
19Clock-names:
20 gpu_pp0 -> core
21 gpu_pp1 -> bus
22
23Signed-off-by: Mark Hatle <mark.hatle@amd.com>
24
25diff -ur a/linux/mali_kernel_linux.c b/linux/mali_kernel_linux.c
26--- a/linux/mali_kernel_linux.c 2018-09-17 04:04:48.000000000 -0700
27+++ b/linux/mali_kernel_linux.c 2022-10-24 14:01:54.614376177 -0700
28@@ -635,11 +635,11 @@
29 if (IS_ERR(clk_gpu))
30 return PTR_ERR(clk_gpu);
31
32- clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0");
33+ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "core");
34 if (IS_ERR(clk_gpu_pp0))
35 return PTR_ERR(clk_gpu_pp0);
36
37- clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1");
38+ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "bus");
39 if (IS_ERR(clk_gpu_pp1))
40 return PTR_ERR(clk_gpu_pp1);
41 #endif
42diff -ur a/linux/mali_osk_mali.c b/linux/mali_osk_mali.c
43--- a/linux/mali_osk_mali.c 2018-09-12 23:52:20.000000000 -0700
44+++ b/linux/mali_osk_mali.c 2022-10-24 14:00:28.470380512 -0700
45@@ -72,26 +72,26 @@
46 #define MALI_OSK_RESOURCE_DMA_LOCATION 26
47
48 static _mali_osk_resource_t mali_osk_resource_bank[MALI_OSK_MAX_RESOURCE_NUMBER] = {
49- {.description = "Mali_GP", .base = MALI_OFFSET_GP, .irq_name = "IRQGP",},
50- {.description = "Mali_GP_MMU", .base = MALI_OFFSET_GP_MMU, .irq_name = "IRQGPMMU",},
51- {.description = "Mali_PP0", .base = MALI_OFFSET_PP0, .irq_name = "IRQPP0",},
52- {.description = "Mali_PP0_MMU", .base = MALI_OFFSET_PP0_MMU, .irq_name = "IRQPPMMU0",},
53- {.description = "Mali_PP1", .base = MALI_OFFSET_PP1, .irq_name = "IRQPP1",},
54- {.description = "Mali_PP1_MMU", .base = MALI_OFFSET_PP1_MMU, .irq_name = "IRQPPMMU1",},
55- {.description = "Mali_PP2", .base = MALI_OFFSET_PP2, .irq_name = "IRQPP2",},
56- {.description = "Mali_PP2_MMU", .base = MALI_OFFSET_PP2_MMU, .irq_name = "IRQPPMMU2",},
57- {.description = "Mali_PP3", .base = MALI_OFFSET_PP3, .irq_name = "IRQPP3",},
58- {.description = "Mali_PP3_MMU", .base = MALI_OFFSET_PP3_MMU, .irq_name = "IRQPPMMU3",},
59- {.description = "Mali_PP4", .base = MALI_OFFSET_PP4, .irq_name = "IRQPP4",},
60- {.description = "Mali_PP4_MMU", .base = MALI_OFFSET_PP4_MMU, .irq_name = "IRQPPMMU4",},
61- {.description = "Mali_PP5", .base = MALI_OFFSET_PP5, .irq_name = "IRQPP5",},
62- {.description = "Mali_PP5_MMU", .base = MALI_OFFSET_PP5_MMU, .irq_name = "IRQPPMMU5",},
63- {.description = "Mali_PP6", .base = MALI_OFFSET_PP6, .irq_name = "IRQPP6",},
64- {.description = "Mali_PP6_MMU", .base = MALI_OFFSET_PP6_MMU, .irq_name = "IRQPPMMU6",},
65- {.description = "Mali_PP7", .base = MALI_OFFSET_PP7, .irq_name = "IRQPP7",},
66- {.description = "Mali_PP7_MMU", .base = MALI_OFFSET_PP7_MMU, .irq_name = "IRQPPMMU",},
67- {.description = "Mali_PP_Broadcast", .base = MALI_OFFSET_PP_BCAST, .irq_name = "IRQPP",},
68- {.description = "Mali_PMU", .base = MALI_OFFSET_PMU, .irq_name = "IRQPMU",},
69+ {.description = "Mali_GP", .base = MALI_OFFSET_GP, .irq_name = "gp",},
70+ {.description = "Mali_GP_MMU", .base = MALI_OFFSET_GP_MMU, .irq_name = "gpmmu",},
71+ {.description = "Mali_PP0", .base = MALI_OFFSET_PP0, .irq_name = "pp0",},
72+ {.description = "Mali_PP0_MMU", .base = MALI_OFFSET_PP0_MMU, .irq_name = "ppmmu0",},
73+ {.description = "Mali_PP1", .base = MALI_OFFSET_PP1, .irq_name = "pp1",},
74+ {.description = "Mali_PP1_MMU", .base = MALI_OFFSET_PP1_MMU, .irq_name = "ppmmu1",},
75+ {.description = "Mali_PP2", .base = MALI_OFFSET_PP2, .irq_name = "pp2",},
76+ {.description = "Mali_PP2_MMU", .base = MALI_OFFSET_PP2_MMU, .irq_name = "ppmmu2",},
77+ {.description = "Mali_PP3", .base = MALI_OFFSET_PP3, .irq_name = "pp3",},
78+ {.description = "Mali_PP3_MMU", .base = MALI_OFFSET_PP3_MMU, .irq_name = "ppmmu3",},
79+ {.description = "Mali_PP4", .base = MALI_OFFSET_PP4, .irq_name = "pp4",},
80+ {.description = "Mali_PP4_MMU", .base = MALI_OFFSET_PP4_MMU, .irq_name = "ppmmu4",},
81+ {.description = "Mali_PP5", .base = MALI_OFFSET_PP5, .irq_name = "pp5",},
82+ {.description = "Mali_PP5_MMU", .base = MALI_OFFSET_PP5_MMU, .irq_name = "ppmmu5",},
83+ {.description = "Mali_PP6", .base = MALI_OFFSET_PP6, .irq_name = "pp6",},
84+ {.description = "Mali_PP6_MMU", .base = MALI_OFFSET_PP6_MMU, .irq_name = "ppmmu6",},
85+ {.description = "Mali_PP7", .base = MALI_OFFSET_PP7, .irq_name = "pp7",},
86+ {.description = "Mali_PP7_MMU", .base = MALI_OFFSET_PP7_MMU, .irq_name = "ppmmu",},
87+ {.description = "Mali_PP_Broadcast", .base = MALI_OFFSET_PP_BCAST, .irq_name = "pp",},
88+ {.description = "Mali_PMU", .base = MALI_OFFSET_PMU, .irq_name = "pmu",},
89 {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE0,},
90 {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE1,},
91 {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE2,},
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
deleted file mode 100644
index eb5406f4..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From d4fcb32f8dc85d01c6e0dc8e5d85c7ed43f0866c Mon Sep 17 00:00:00 2001
2From: Yash Ladani <yash.ladani@amd.com>
3Date: Tue, 6 Dec 2022 00:52:53 -0800
4Subject: [PATCH] Import DMA_BUF module and update register_shrinker function
5 for kernel 5.16 or higher
6
7Added MODULE_IMPORT_NS(DMA_BUF) for kernel version 5.16 or higher.
8register_shrinker function call now requires two arguments
9for kernel 5.16 or higher updated this function call.
10
11Signed-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
18diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c
19index 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, 16, 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 */
33diff --git a/linux/mali_memory_os_alloc.c b/linux/mali_memory_os_alloc.c
34index 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, 16, 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
50diff --git a/linux/mali_memory_secure.c b/linux/mali_memory_secure.c
51index 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, 16, 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--
662.17.1
67
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch
deleted file mode 100644
index 247c92ff..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1From d7a56b7bdf1ea34194fe86639cc318d7a33b9abb Mon Sep 17 00:00:00 2001
2From: Parth Gajjar <parth.gajjar@xilinx.com>
3Date: Thu, 12 Jan 2023 06:00:20 -0800
4Subject: [PATCH] Fix gpu driver probe failure
5
6In patch a1a2b7125e1079cfcc13a116aa3af3df2f9e002b
7(Drop static setup of IRQ resource from DT core) platform_get_resource()
8stopped from returning the IRQ, as all drivers were supposed to have
9switched to platform_get_irq().
10Using platform_get_irq_optional() to avoid printing error messages
11for interrupts not found.
12
13Signed-off-by: Parth Gajjar <parth.gajjar@xilinx.com>
14---
15 linux/mali_osk_mali.c | 8 ++++----
16 1 file changed, 4 insertions(+), 4 deletions(-)
17
18diff --git a/linux/mali_osk_mali.c b/linux/mali_osk_mali.c
19index c22758d..3f66132 100644
20--- a/linux/mali_osk_mali.c
21+++ b/linux/mali_osk_mali.c
22@@ -113,7 +113,7 @@ static int _mali_osk_get_compatible_name(const char **out_string)
23 _mali_osk_errcode_t _mali_osk_resource_initialize(void)
24 {
25 mali_bool mali_is_450 = MALI_FALSE, mali_is_470 = MALI_FALSE;
26- int i, pp_core_num = 0, l2_core_num = 0;
27+ int i, pp_core_num = 0, l2_core_num = 0, irq = 0;
28 struct resource *res;
29 const char *compatible_name = NULL;
30
31@@ -128,9 +128,9 @@ _mali_osk_errcode_t _mali_osk_resource_initialize(void)
32 }
33
34 for (i = 0; i < MALI_OSK_RESOURCE_WITH_IRQ_NUMBER; i++) {
35- res = platform_get_resource_byname(mali_platform_device, IORESOURCE_IRQ, mali_osk_resource_bank[i].irq_name);
36- if (res) {
37- mali_osk_resource_bank[i].irq = res->start;
38+ irq = platform_get_irq_byname_optional(mali_platform_device, mali_osk_resource_bank[i].irq_name);
39+ if (irq > 0) {
40+ mali_osk_resource_bank[i].irq = irq;
41 } else {
42 mali_osk_resource_bank[i].base = MALI_OSK_INVALID_RESOURCE_ADDRESS;
43 }
44--
452.17.1
46
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch
deleted file mode 100644
index 18081dc3..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch
+++ /dev/null
@@ -1,95 +0,0 @@
1From a64707b7fea40d326c5b18636a41a5994f60048d Mon Sep 17 00:00:00 2001
2From: Parth Gajjar <parth.gajjar@amd.com>
3Date: Fri, 24 Feb 2023 05:11:38 -0800
4Subject: [PATCH] Updated clock name and structure to match LIMA driver
5
6Clock-names:
7 gpu -> bus
8 gpu_pp0,gpu_pp1 -> core
9
10This will allow us to have a single device tree that works with both the
11mali driver, as well as the lima driver.
12
13Signed-off-by: Parth Gajjar <parth.gajjar@amd.com>
14---
15 linux/mali_kernel_linux.c | 37 +++++++------------
16 1 file changed, 13 insertions(+), 24 deletions(-)
17
18diff --git a/linux/mali_kernel_linux.c b/linux/mali_kernel_linux.c
19index ad450b4..050af67 100644
20--- a/linux/mali_kernel_linux.c
21+++ b/linux/mali_kernel_linux.c
22@@ -48,9 +48,8 @@
23
24 #if defined(CONFIG_ARCH_ZYNQMP)
25 /* Initialize variables for clocks */
26-struct clk *clk_gpu;
27-struct clk *clk_gpu_pp0;
28-struct clk *clk_gpu_pp1;
29+struct clk *clk_bus;
30+struct clk *clk_core;
31 mali_bool clk_enabled;
32 #endif
33
34@@ -291,19 +290,14 @@ static int mali_enable_clk(void)
35 return 0;
36
37 clk_enabled = MALI_TRUE;
38- err = clk_prepare_enable(clk_gpu);
39+ err = clk_prepare_enable(clk_bus);
40 if (err) {
41 MALI_PRINT_ERROR(("Could not enable clock for GP\n\r"));
42 return err;
43 }
44- err = clk_prepare_enable(clk_gpu_pp0);
45+ err = clk_prepare_enable(clk_core);
46 if (err) {
47- MALI_PRINT_ERROR(("Could not enable clock for PP0\n\r"));
48- return err;
49- }
50- err = clk_prepare_enable(clk_gpu_pp1);
51- if (err) {
52- MALI_PRINT_ERROR(("Could not enable clock for PP1\n\r"));
53+ MALI_PRINT_ERROR(("Could not enable clock for PP\n\r"));
54 return err;
55 }
56 #endif
57@@ -315,9 +309,8 @@ static void mali_disable_clk(void)
58 #if defined(CONFIG_ARCH_ZYNQMP)
59 if (clk_enabled) {
60 clk_enabled = MALI_FALSE;
61- clk_disable_unprepare(clk_gpu);
62- clk_disable_unprepare(clk_gpu_pp0);
63- clk_disable_unprepare(clk_gpu_pp1);
64+ clk_disable_unprepare(clk_bus);
65+ clk_disable_unprepare(clk_core);
66 }
67 #endif
68 }
69@@ -631,17 +624,13 @@ static int mali_probe(struct platform_device *pdev)
70
71 #if defined(CONFIG_ARCH_ZYNQMP)
72 /* Initialize clocks for GPU and PP */
73- clk_gpu = devm_clk_get(&pdev->dev, "gpu");
74- if (IS_ERR(clk_gpu))
75- return PTR_ERR(clk_gpu);
76-
77- clk_gpu_pp0 = devm_clk_get(&pdev->dev, "core");
78- if (IS_ERR(clk_gpu_pp0))
79- return PTR_ERR(clk_gpu_pp0);
80+ clk_bus = devm_clk_get(&pdev->dev, "bus");
81+ if (IS_ERR(clk_bus))
82+ return PTR_ERR(clk_bus);
83
84- clk_gpu_pp1 = devm_clk_get(&pdev->dev, "bus");
85- if (IS_ERR(clk_gpu_pp1))
86- return PTR_ERR(clk_gpu_pp1);
87+ clk_core = devm_clk_get(&pdev->dev, "core");
88+ if (IS_ERR(clk_core))
89+ return PTR_ERR(clk_core);
90 #endif
91
92 err = mali_enable_clk();
93--
942.25.1
95
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch
deleted file mode 100644
index 72275a4c..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch
+++ /dev/null
@@ -1,81 +0,0 @@
1From e3e0f5e3fa0ddb396393d444bce6e575f7a16189 Mon Sep 17 00:00:00 2001
2From: Parth Gajjar <parth.gajjar@amd.com>
3Date: Thu, 21 Dec 2023 22:41:32 -0800
4Subject: [PATCH] Replace vma->vm_flags direct modifications with modifier
5 calls
6
7Replace direct modifications to vma->vm_flags with calls to modifier
8functions to be able to track flag changes and to keep vma locking
9correctness. (Kernel 6.3)
10
11Signed-off-by: Parth Gajjar <parth.gajjar@amd.com>
12---
13 linux/mali_memory.c | 10 ++++++++++
14 linux/mali_memory_cow.c | 13 ++++++++++---
15 2 files changed, 20 insertions(+), 3 deletions(-)
16
17diff --git a/linux/mali_memory.c b/linux/mali_memory.c
18index 2b2b209..c21d0b7 100644
19--- a/linux/mali_memory.c
20+++ b/linux/mali_memory.c
21@@ -266,11 +266,17 @@ int mali_mmap(struct file *filp, struct vm_area_struct *vma)
22 * that it's present and can never be paged out (see also previous
23 * entry)
24 */
25+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
26+ vm_flags_set(vma, VM_IO | VM_DONTCOPY | VM_PFNMAP);
27+#else
28 vma->vm_flags |= VM_IO;
29 vma->vm_flags |= VM_DONTCOPY;
30 vma->vm_flags |= VM_PFNMAP;
31+#endif
32 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)
33 vma->vm_flags |= VM_RESERVED;
34+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
35+ vm_flags_set(vma, VM_DONTDUMP | VM_DONTEXPAND);
36 #else
37 vma->vm_flags |= VM_DONTDUMP;
38 vma->vm_flags |= VM_DONTEXPAND;
39@@ -288,7 +294,11 @@ int mali_mmap(struct file *filp, struct vm_area_struct *vma)
40 if (!(vma->vm_flags & VM_WRITE)) {
41 MALI_DEBUG_PRINT(4, ("mmap allocation with read only !\n"));
42 /* add VM_WRITE for do_page_fault will check this when a write fault */
43+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
44+ vm_flags_set(vma, VM_WRITE | VM_READ);
45+#else
46 vma->vm_flags |= VM_WRITE | VM_READ;
47+#endif
48 vma->vm_page_prot = PAGE_READONLY;
49 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
50 mem_bkend->flags |= MALI_MEM_BACKEND_FLAG_COW_CPU_NO_WRITE;
51diff --git a/linux/mali_memory_cow.c b/linux/mali_memory_cow.c
52index 6fadd42..e631431 100644
53--- a/linux/mali_memory_cow.c
54+++ b/linux/mali_memory_cow.c
55@@ -391,13 +391,20 @@ _mali_osk_errcode_t mali_memory_cow_modify_range(mali_mem_backend *backend,
56 }
57 } else {
58 /* used to trigger page fault for swappable cowed memory. */
59- alloc->cpu_mapping.vma->vm_flags |= VM_PFNMAP;
60- alloc->cpu_mapping.vma->vm_flags |= VM_MIXEDMAP;
61-
62+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
63+ vm_flags_set(alloc->cpu_mapping.vma, VM_PFNMAP | VM_MIXEDMAP);
64+#else
65+ alloc->cpu_mapping.vma->vm_flags |= VM_PFNMAP;
66+ alloc->cpu_mapping.vma->vm_flags |= VM_MIXEDMAP;
67+#endif
68 zap_vma_ptes(alloc->cpu_mapping.vma, alloc->cpu_mapping.vma->vm_start + range_start, range_size);
69 /* delete this flag to let swappble is ummapped regard to stauct page not page frame. */
70+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
71+ vm_flags_clear(alloc->cpu_mapping.vma, VM_PFNMAP | VM_MIXEDMAP);
72+#else
73 alloc->cpu_mapping.vma->vm_flags &= ~VM_PFNMAP;
74 alloc->cpu_mapping.vma->vm_flags &= ~VM_MIXEDMAP;
75+#endif
76 }
77 }
78
79--
802.25.1
81
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch
deleted file mode 100644
index a3ddafed..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 7659ba2e251b72aa3c248d3b1f3a23971180ba41 Mon Sep 17 00:00:00 2001
2From: Parth Gajjar <parth.gajjar@amd.com>
3Date: Mon, 18 Mar 2024 13:43:30 +0000
4Subject: [PATCH] Fixed buildpath QA warning
5
6Removed KDIR from buildinfo
7WARNING: kernel-module-mali-r9p0-01rel0-r0 do_package_qa:
8QA Issue: File /lib/modules/6.6.10-xilinx-v2024.1-g2c37bbe14ced/updates/mali.ko
9 in package kernel-module-mali-6.6.10-xilinx-v2024.1-g2c37bbe14ced contains
10 reference to TMPDIR [buildpaths]" from the log file.
11
12Signed-off-by: Parth Gajjar <parth.gajjar@amd.com>
13
14diff --git a/Kbuild b/Kbuild
15index 8c6e6e0..2b8632b 100644
16--- a/Kbuild
17+++ b/Kbuild
18@@ -243,7 +243,7 @@ VERSION_STRINGS += BUILD=release
19 endif
20 VERSION_STRINGS += TARGET_PLATFORM=$(TARGET_PLATFORM)
21 VERSION_STRINGS += MALI_PLATFORM=$(MALI_PLATFORM)
22-VERSION_STRINGS += KDIR=$(KDIR)
23+#VERSION_STRINGS += KDIR=$(KDIR)
24 VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)
25 VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP)
26 VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING)
27--
282.37.6
29
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb
deleted file mode 100644
index 12b117d4..00000000
--- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb
+++ /dev/null
@@ -1,57 +0,0 @@
1SUMMARY = "A Mali 400 Linux Kernel module"
2SECTION = "kernel/modules"
3
4LICENSE = "GPL-2.0-only"
5LIC_FILES_CHKSUM = " \
6 file://linux/license/gpl/mali_kernel_license.h;md5=f5af2d61f4c1eb262cb6a557aaa1070a \
7 "
8
9SRC_URI = " \
10 https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-${PV}.tgz \
11 file://0001-Change-Makefile-to-be-compatible-with-Yocto.patch \
12 file://0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch \
13 file://0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch \
14 file://0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch \
15 file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \
16 file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch \
17 file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \
18 file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\
19 file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\
20 file://0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch\
21 file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\
22 file://0015-fix-driver-failed-to-check-map-error.patch \
23 file://0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch \
24 file://0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch \
25 file://0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch \
26 file://0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch \
27 file://0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch \
28 file://0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch \
29 file://0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch \
30 file://0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch \
31 file://0024-Use-community-device-tree-names.patch \
32 file://0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch \
33 file://0026-Fix-gpu-driver-probe-failure.patch \
34 file://0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch \
35 file://0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch \
36 file://0029-Fixed-buildpath-QA-warning.patch \
37 "
38SRC_URI[md5sum] = "85ea110dd6675c70b7d01af87ec9633c"
39SRC_URI[sha256sum] = "7a67127341d17640c1fff5dad80258fb2a37c8a2121b81525fe2327e4532ce2b"
40
41inherit features_check module
42
43PARALLEL_MAKE = "-j 1"
44
45S = "${UNPACKDIR}/DX910-SW-99002-${PV}/driver/src/devicedrv/mali"
46
47REQUIRED_MACHINE_FEATURES = "mali400"
48
49EXTRA_OEMAKE = 'KDIR="${STAGING_KERNEL_DIR}" \
50 ARCH="${ARCH}" \
51 BUILD=release \
52 MALI_PLATFORM="arm" \
53 USING_DT=1 \
54 MALI_SHARED_INTERRUPTS=1 \
55 CROSS_COMPILE="${TARGET_PREFIX}" \
56 MALI_QUIET=1 \
57 '
diff --git a/meta-xilinx-core/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch b/meta-xilinx-core/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch
deleted file mode 100644
index f77f1939..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1DRI: Add xlnx dri
2
3Add the Xilinx dri target
4
5Upstream-Status: Pending
6
7Signed-off-by: Mark Hatle <mark.hatle@amd.com>
8
9Index: mesa-24.0.1/src/gallium/targets/dri/meson.build
10===================================================================
11--- mesa-24.0.1.orig/src/gallium/targets/dri/meson.build
12+++ mesa-24.0.1/src/gallium/targets/dri/meson.build
13@@ -101,6 +101,7 @@ foreach d : [[with_gallium_kmsro, [
14 'stm_dri.so',
15 'sun4i-drm_dri.so',
16 'udl_dri.so',
17+ 'xlnx_dri.so',
18 ]],
19 [with_gallium_radeonsi, 'radeonsi_dri.so'],
20 [with_gallium_nouveau, 'nouveau_dri.so'],
21Index: mesa-24.0.1/src/gallium/targets/dri/target.c
22===================================================================
23--- mesa-24.0.1.orig/src/gallium/targets/dri/target.c
24+++ mesa-24.0.1/src/gallium/targets/dri/target.c
25@@ -129,6 +129,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(sti)
26 DEFINE_LOADER_DRM_ENTRYPOINT(stm)
27 DEFINE_LOADER_DRM_ENTRYPOINT(sun4i_drm)
28 DEFINE_LOADER_DRM_ENTRYPOINT(udl)
29+DEFINE_LOADER_DRM_ENTRYPOINT(xlnx)
30 #endif
31
32 #if defined(GALLIUM_LIMA)
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch
deleted file mode 100644
index fdb30564..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 9470d00850e8b622d963d4d9c61ad1e59972310a Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Tue, 28 Jan 2020 16:10:54 -0800
4Subject: [PATCH 1/2] src: egl: eglinfo: Align EXT_platform_device extension
5 macros with khronos
6
7Although the macro definitions are consistent, using the macros name
8defined under khronos makes it backward compatible with older eglext.h
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
11Upstream-Status: Inappropriate [Xilinx specific]
12Signed-off-by: Mark Hatle <mark.hatle@amd.com>
13---
14 src/egl/opengl/eglinfo.c | 6 +++---
15 1 file changed, 3 insertions(+), 3 deletions(-)
16
17diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
18index 72fe45a..e8a0225 100644
19--- a/src/egl/opengl/eglinfo.c
20+++ b/src/egl/opengl/eglinfo.c
21@@ -305,17 +305,17 @@ main(int argc, char *argv[])
22 NULL), "Android platform");
23 if (strstr(clientext, "EGL_MESA_platform_gbm") ||
24 strstr(clientext, "EGL_KHR_platform_gbm"))
25- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_MESA,
26+ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_KHR,
27 EGL_DEFAULT_DISPLAY,
28 NULL), "GBM platform");
29 if (strstr(clientext, "EGL_EXT_platform_wayland") ||
30 strstr(clientext, "EGL_KHR_platform_wayland"))
31- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT,
32+ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR,
33 EGL_DEFAULT_DISPLAY,
34 NULL), "Wayland platform");
35 if (strstr(clientext, "EGL_EXT_platform_x11") ||
36 strstr(clientext, "EGL_KHR_platform_x11"))
37- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_EXT,
38+ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR,
39 EGL_DEFAULT_DISPLAY,
40 NULL), "X11 platform");
41 if (strstr(clientext, "EGL_MESA_platform_surfaceless"))
42--
432.17.1
44
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch
deleted file mode 100644
index 7212ef27..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From 040b0b79a8e73a3348ab2e95f817636a7d479f18 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Tue, 28 Jan 2020 16:17:46 -0800
4Subject: [PATCH 2/2] src: egl: eglinfo: Use EGL_PLATFORM_DEVICE_EXT only if
5 the EGL provider supports it
6
7Compiling against the other EGL provider like mali fails, as they dont
8support this macro as one of thier supported platforms
9
10Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
11Upstream-Status: Inappropriate [Xilinx specific]
12Signed-off-by: Mark Hatle <mark.hatle@amd.com>
13---
14 src/egl/opengl/eglinfo.c | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c
18index e8a0225..bc0e869 100644
19--- a/src/egl/opengl/eglinfo.c
20+++ b/src/egl/opengl/eglinfo.c
21@@ -243,6 +243,7 @@ doOneDisplay(EGLDisplay d, const char *name)
22 static int
23 doOneDevice(EGLDeviceEXT d, int i)
24 {
25+#ifdef EGL_PLATFORM_DEVICE_EXT
26 PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay =
27 (PFNEGLGETPLATFORMDISPLAYEXTPROC)
28 eglGetProcAddress("eglGetPlatformDisplayEXT");
29@@ -253,6 +254,9 @@ doOneDevice(EGLDeviceEXT d, int i)
30
31 return doOneDisplay(getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, d, NULL),
32 "Platform Device");
33+#else
34+ return 0;
35+#endif
36 }
37
38
39--
402.17.1
41
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch
deleted file mode 100644
index 6cfecb38..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch
+++ /dev/null
@@ -1,69 +0,0 @@
1Upstream-Status: Inappropriate [libmali specific]
2
3Index: mesa-demos-8.5.0/src/egl/opengl/eglinfo.c
4===================================================================
5--- mesa-demos-8.5.0.orig/src/egl/opengl/eglinfo.c
6+++ mesa-demos-8.5.0/src/egl/opengl/eglinfo.c
7@@ -195,6 +195,7 @@ PrintDisplayExtensions(EGLDisplay d)
8 }
9
10
11+#ifdef EGL_EXT_device_base
12 static const char *
13 PrintDeviceExtensions(EGLDeviceEXT d)
14 {
15@@ -211,7 +212,7 @@ PrintDeviceExtensions(EGLDeviceEXT d)
16
17 return PrintExtensions(extensions);
18 }
19-
20+#endif
21
22 static int
23 doOneDisplay(EGLDisplay d, const char *name)
24@@ -240,6 +241,7 @@ doOneDisplay(EGLDisplay d, const char *n
25 }
26
27
28+#ifdef EGL_EXT_device_base
29 static int
30 doOneDevice(EGLDeviceEXT d, int i)
31 {
32@@ -258,8 +260,9 @@ doOneDevice(EGLDeviceEXT d, int i)
33 return 0;
34 #endif
35 }
36+#endif
37
38-
39+#ifdef EGL_EXT_device_base
40 static int
41 doDevices(const char *name)
42 {
43@@ -288,7 +291,7 @@ doDevices(const char *name)
44
45 return ret;
46 }
47-
48+#endif
49
50 int
51 main(int argc, char *argv[])
52@@ -322,13 +325,17 @@ main(int argc, char *argv[])
53 ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR,
54 EGL_DEFAULT_DISPLAY,
55 NULL), "X11 platform");
56+#ifdef EGL_PLATFORM_SURFACELESS_MESA
57 if (strstr(clientext, "EGL_MESA_platform_surfaceless"))
58 ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA,
59 EGL_DEFAULT_DISPLAY,
60 NULL), "Surfaceless platform");
61+#endif
62+#ifdef EGL_EXT_device_base
63 if (strstr(clientext, "EGL_EXT_device_enumeration") &&
64 strstr(clientext, "EGL_EXT_platform_device"))
65 ret += doDevices("Device platform");
66+#endif
67 }
68 else {
69 ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default display");
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend b/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend
deleted file mode 100644
index 5c84f56e..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend
+++ /dev/null
@@ -1,16 +0,0 @@
1FILESEXTRAPATHS:prepend := "${THISDIR}/mesa-demos:"
2
3SRC_URI += " \
4 file://0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch \
5 file://0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch \
6 file://libmali-egl-workaround.patch \
7"
8
9DEPENDS += "wayland-protocols"
10
11# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
12DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
13MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
14MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
15PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
16PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa-gl_%.bbappend b/meta-xilinx-core/recipes-graphics/mesa/mesa-gl_%.bbappend
deleted file mode 100644
index a8e18a57..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/mesa-gl_%.bbappend
+++ /dev/null
@@ -1,18 +0,0 @@
1PACKAGECONFIG:append = " dri3 gallium"
2
3# If we're using libmali-xlnx, then we need to bring it in for the KHR/khrplatform.h file
4DEPENDS .= "${@' libmali-xlnx' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else ''}"
5RDEPENDS:libgl-mesa-dev .= "${@' libmali-xlnx-dev' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else ''}"
6
7do_install:append () {
8 if ${@'true' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else 'false'} ; then
9 rm -rf ${D}${includedir}/KHR/*
10 fi
11}
12
13# If we require libmali-xlnx, this becomes MACHINE_ARCH specific
14DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
15MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
16MALI_PACKAGE_ARCH = "${MACHINE_ARCH}"
17PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
18PACKAGE_ARCH = "${@'${MALI_PACKAGE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
diff --git a/meta-xilinx-core/recipes-graphics/mesa/mesa_%.bbappend b/meta-xilinx-core/recipes-graphics/mesa/mesa_%.bbappend
deleted file mode 100644
index 86183f54..00000000
--- a/meta-xilinx-core/recipes-graphics/mesa/mesa_%.bbappend
+++ /dev/null
@@ -1,15 +0,0 @@
1FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
2SRC_URI:append:class-target = " file://0001-DRI_Add_xlnx_dri.patch"
3
4# This is not compatible with the mali400 driver, use mesa-gl instead
5CONFLICT_DISTRO_FEATURES:class-target = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', bb.utils.contains('DISTRO_FEATURES', 'libmali', 'libmali', '', d), '', d)}"
6
7# Enable lima if not using libmali
8PACKAGECONFIG_MALI = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '', 'lima', d)}"
9PACKAGECONFIG:append:class-target = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${PACKAGECONFIG_MALI}', '', d)}"
10
11PACKAGE_ARCH_DEFAULT := "${PACKAGE_ARCH}"
12MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
13MALI_PACKAGE_ARCH = "${MACHINE_ARCH}"
14PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
15PACKAGE_ARCH = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${MALI_PACKAGE_ARCH}', '${PACKAGE_ARCH_DEFAULT}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/virglrenderer/virglrenderer_%.bbappend b/meta-xilinx-core/recipes-graphics/virglrenderer/virglrenderer_%.bbappend
deleted file mode 100644
index 03823f6e..00000000
--- a/meta-xilinx-core/recipes-graphics/virglrenderer/virglrenderer_%.bbappend
+++ /dev/null
@@ -1,6 +0,0 @@
1# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
2DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
3MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
4MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
5PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
6PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch b/meta-xilinx-core/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch
deleted file mode 100644
index de1f3719..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 3fbb596e53524e78703b76c4fdc33cd6ac62f777 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Fri, 11 Dec 2020 16:21:38 -0800
4Subject: [PATCH] libweston: Remove substitute format for ARGB8888
5
6Xilinx DP gfx layer does not support XRGB8888. Hence, remove the same
7as opaque substitute.
8
9Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
10Upstream-Status: Inappropriate [Xilinx specific]
11
12Reworked the patch for the newer weston
13
14Signed-off-by: Mark Hatle <mark.hatle@amd.com>
15---
16 libweston/pixel-formats.c | 1 -
17 1 file changed, 1 deletion(-)
18
19Index: weston-13.0.0/libweston/pixel-formats.c
20===================================================================
21--- weston-13.0.0.orig/libweston/pixel-formats.c
22+++ weston-13.0.0/libweston/pixel-formats.c
23@@ -251,7 +251,6 @@ static const struct pixel_format_info pi
24 {
25 DRM_FORMAT(ARGB8888),
26 BITS_RGBA_FIXED(8, 8, 8, 8),
27- .opaque_substitute = DRM_FORMAT_XRGB8888,
28 .addfb_legacy_depth = 32,
29 .bpp = 32,
30 GL_INTERNALFORMAT(GL_RGBA8),
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch b/meta-xilinx-core/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch
deleted file mode 100644
index 6b5f53b0..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 3fbb596e53524e78703b76c4fdc33cd6ac62f777 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Fri, 11 Dec 2020 16:21:38 -0800
4Subject: [PATCH] libweston: Remove substitute format for ARGB8888
5
6Xilinx DP gfx layer does not support XRGB8888. Hence, remove the same
7as opaque substitute.
8
9Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
10Upstream-Status: Inappropriate [Xilinx specific]
11---
12 libweston/pixel-formats.c | 1 -
13 1 file changed, 1 deletion(-)
14
15diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c
16index 79dc709..ec2d3b7 100644
17--- a/libweston/pixel-formats.c
18+++ b/libweston/pixel-formats.c
19@@ -193,7 +193,6 @@ static const struct pixel_format_info pixel_format_table[] = {
20 {
21 DRM_FORMAT(ARGB8888),
22 BITS_RGBA_FIXED(8, 8, 8, 8),
23- .opaque_substitute = DRM_FORMAT_XRGB8888,
24 .depth = 32,
25 .bpp = 32,
26 GL_FORMAT(GL_BGRA_EXT),
27--
282.17.1
29
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/init b/meta-xilinx-core/recipes-graphics/wayland/files/init
deleted file mode 100644
index f74ac8b1..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/files/init
+++ /dev/null
@@ -1,54 +0,0 @@
1#!/bin/sh
2#
3### BEGIN INIT INFO
4# Provides: weston
5# Required-Start: $local_fs $remote_fs
6# Required-Stop: $local_fs $remote_fs
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9### END INIT INFO
10
11if test -e /etc/default/weston ; then
12 . /etc/default/weston
13fi
14
15killproc() {
16 pid=`/bin/pidof $1`
17 [ "$pid" != "" ] && kill $pid
18}
19
20read CMDLINE < /proc/cmdline
21for x in $CMDLINE; do
22 case $x in
23 weston=false)
24 echo "Weston disabled"
25 exit 0;
26 ;;
27 esac
28done
29
30case "$1" in
31 start)
32 . /etc/profile
33 export HOME=ROOTHOME
34
35 weston-start -- --continue-without-input $OPTARGS
36 ;;
37
38 stop)
39 echo "Stopping Weston"
40 killproc weston
41 ;;
42
43 restart)
44 $0 stop
45 sleep 1
46 $0 start
47 ;;
48
49 *)
50 echo "usage: $0 { start | stop | restart }"
51 ;;
52esac
53
54exit 0
diff --git a/meta-xilinx-core/recipes-graphics/wayland/files/weston.service b/meta-xilinx-core/recipes-graphics/wayland/files/weston.service
deleted file mode 100644
index c7583e92..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/files/weston.service
+++ /dev/null
@@ -1,71 +0,0 @@
1# This is a system unit for launching Weston with auto-login as the
2# user configured here.
3#
4# Weston must be built with systemd support, and your weston.ini must load
5# the plugin systemd-notify.so.
6[Unit]
7Description=Weston, a Wayland compositor, as a system service
8Documentation=man:weston(1) man:weston.ini(5)
9Documentation=http://wayland.freedesktop.org/
10
11# Make sure we are started after logins are permitted.
12Requires=systemd-user-sessions.service
13After=systemd-user-sessions.service
14
15# If Plymouth is used, we want to start when it is on its way out.
16After=plymouth-quit-wait.service
17
18# D-Bus is necessary for contacting logind. Logind is required.
19Wants=dbus.socket
20After=dbus.socket
21
22# Ensure the socket is present
23Requires=weston.socket
24
25# Since we are part of the graphical session, make sure we are started before
26# it is complete.
27Before=graphical.target
28
29# Prevent starting on systems without virtual consoles, Weston requires one
30# for now.
31ConditionPathExists=/dev/tty0
32
33[Service]
34# Requires systemd-notify.so Weston plugin.
35Type=notify
36EnvironmentFile=/etc/default/weston
37ExecStart=/usr/bin/weston --continue-without-input --modules=systemd-notify.so
38
39# Optional watchdog setup
40TimeoutStartSec=60
41WatchdogSec=20
42
43# The user to run Weston as.
44User=weston
45Group=weston
46
47# Make sure the working directory is the users home directory
48WorkingDirectory=/home/weston
49
50# Set up a full user session for the user, required by Weston.
51PAMName=weston-autologin
52
53# A virtual terminal is needed.
54TTYPath=/dev/tty7
55TTYReset=yes
56TTYVHangup=yes
57TTYVTDisallocate=yes
58
59# Fail to start if not controlling the tty.
60StandardInput=tty-fail
61StandardOutput=journal
62StandardError=journal
63
64# Log this user with utmp, letting it show up with commands 'w' and 'who'.
65UtmpIdentifier=tty7
66UtmpMode=user
67
68[Install]
69# Note: If you only want weston to start on-demand, remove this line with a
70# service drop file
71WantedBy=graphical.target
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston-init.bbappend b/meta-xilinx-core/recipes-graphics/wayland/weston-init.bbappend
deleted file mode 100644
index f0d64e27..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston-init.bbappend
+++ /dev/null
@@ -1,5 +0,0 @@
1PACKAGECONFIG += "no-idle-timeout"
2
3do_install:append:zynqmp() {
4 sed -i -e "/^\[core\]/a gbm-format=rgb565" ${D}${sysconfdir}/xdg/weston/weston.ini
5}
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston.inc b/meta-xilinx-core/recipes-graphics/wayland/weston.inc
deleted file mode 100644
index fadc9486..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston.inc
+++ /dev/null
@@ -1,15 +0,0 @@
1SRC_URI:append:zynqmp = " file://0001-libweston-Remove-substitute-format-for-ARGB8888.patch"
2
3# Due to the SRC_URI zynqmp specific change, this needs to be SOC_FAMILY_ARCH specific
4SOC_FAMILY_ARCH ??= "${TUNE_PKGARCH}"
5DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
6DEFAULT_PACKAGE_ARCH:zynqmp = "${SOC_FAMILY_ARCH}"
7PACKAGE_ARCH = "${DEFAULT_PACKAGE_ARCH}"
8
9
10# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
11DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
12MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
13MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
14PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
15PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch b/meta-xilinx-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch
deleted file mode 100644
index f8f75894..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1From c8bfa1f8d576cdc6d515dbbac36c48c6166be0d5 Mon Sep 17 00:00:00 2001
2From: Marius Vlad <marius.vlad@collabora.com>
3Date: Thu, 1 Apr 2021 00:12:00 +0300
4Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at DRM-backend tear down
5
6Tearing down the drm-backend when there are no input devices, would call
7for the gbm device destruction before compositor shutdown. The latter
8would call into the renderer detroy function and assume that the
9EGLDisplay, which was created using the before-mentioned gbm device, is
10still available. This patch re-orders the gbm destruction after the
11compositor shutdown when no one would make use of it.
12
13Fixes: #314
14
15Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
16Suggested-by: Daniel Stone <daniel.stone@collabora.com>
17
18Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb]
19---
20 libweston/backend-drm/drm.c | 8 ++++----
21 1 file changed, 4 insertions(+), 4 deletions(-)
22
23diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
24index 2780f3b..fbcfeca 100644
25--- a/libweston/backend-drm/drm.c
26+++ b/libweston/backend-drm/drm.c
27@@ -3025,10 +3025,6 @@ err_drm_source:
28 err_udev_input:
29 udev_input_destroy(&b->input);
30 err_sprite:
31-#ifdef BUILD_DRM_GBM
32- if (b->gbm)
33- gbm_device_destroy(b->gbm);
34-#endif
35 destroy_sprites(b);
36 err_udev_dev:
37 udev_device_unref(drm_device);
38@@ -3038,6 +3034,10 @@ err_launcher:
39 weston_launcher_destroy(compositor->launcher);
40 err_compositor:
41 weston_compositor_shutdown(compositor);
42+#ifdef BUILD_DRM_GBM
43+ if (b->gbm)
44+ gbm_device_destroy(b->gbm);
45+#endif
46 free(b);
47 return NULL;
48 }
49--
502.33.0
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch b/meta-xilinx-core/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch
deleted file mode 100644
index 06e0f7ba..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 20 Apr 2021 20:42:18 -0700
4Subject: [PATCH] meson.build: fix incorrect header
5
6The wayland.c actually include 'xdg-shell-client-protocol.h' instead of
7the server one, so fix it. Otherwise, it's possible to get build failure
8due to race condition.
9
10Upstream-Status: Pending
11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 libweston/backend-wayland/meson.build | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build
18index 7e82513..29270b5 100644
19--- a/libweston/backend-wayland/meson.build
20+++ b/libweston/backend-wayland/meson.build
21@@ -10,7 +10,7 @@ srcs_wlwl = [
22 fullscreen_shell_unstable_v1_protocol_c,
23 presentation_time_protocol_c,
24 presentation_time_server_protocol_h,
25- xdg_shell_server_protocol_h,
26+ xdg_shell_client_protocol_h,
27 xdg_shell_protocol_c,
28 ]
29
30--
312.30.2
32
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch b/meta-xilinx-core/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch
deleted file mode 100644
index 6fe86ff3..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 58760e09eed662a72da939ff4802d605489cff8e Mon Sep 17 00:00:00 2001
2From: Denys Dmytriyenko <denys@ti.com>
3Date: Tue, 8 Sep 2020 19:37:42 -0400
4Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and
5 O_CREAT
6
7musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(),
8O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors:
9
10| ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock':
11| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:7: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
12| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
13| | ^~~~
14| | popen
15| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function)
16| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
17| | ^~~~~~
18| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: note: each undeclared identifier is reported only once for each function it appears in
19| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function)
20| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
21| | ^~~~~~~~~
22| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function)
23| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
24| | ^~~~~~~
25
26Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c]
27
28Signed-off-by: Denys Dmytriyenko <denys@ti.com>
29---
30 tests/weston-test-fixture-compositor.c | 1 +
31 1 file changed, 1 insertion(+)
32
33diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c
34index 0c9855f..e0e32c9 100644
35--- a/tests/weston-test-fixture-compositor.c
36+++ b/tests/weston-test-fixture-compositor.c
37@@ -31,6 +31,7 @@
38 #include <unistd.h>
39 #include <sys/file.h>
40 #include <errno.h>
41+#include <fcntl.h>
42
43 #include "shared/helpers.h"
44 #include "weston-test-fixture-compositor.h"
45--
462.7.4
47
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta-xilinx-core/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
deleted file mode 100644
index f6ebfd8f..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
+++ /dev/null
@@ -1,199 +0,0 @@
1From a1548c742bf2dedbb47282d8a00407b60bbab669 Mon Sep 17 00:00:00 2001
2From: Tom Hochstein <tom.hochstein@nxp.com>
3Date: Wed, 22 Feb 2017 15:53:30 +0200
4Subject: [PATCH] weston-launch: Provide a default version that doesn't require
5
6 PAM
7
8weston-launch requires PAM for starting weston as a non-root user.
9
10Since starting weston as root is a valid use case by itself, if
11PAM is not available, provide a default version of weston-launch
12without non-root-user support.
13
14Upstream-Status: Denied [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725]
15
16Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
17Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
18Signed-off-by: Denys Dmytriyenko <denys@ti.com>
19Signed-off-by: Ming Liu <ming.liu@toradex.com>
20
21---
22 libweston/meson.build | 16 ++++++++++++----
23 libweston/weston-launch.c | 21 +++++++++++++++++++++
24 meson_options.txt | 7 +++++++
25 3 files changed, 40 insertions(+), 4 deletions(-)
26
27diff --git a/libweston/meson.build b/libweston/meson.build
28index 08d23ec..cb9fd3f 100644
29--- a/libweston/meson.build
30+++ b/libweston/meson.build
31@@ -216,16 +216,24 @@ dep_vertex_clipping = declare_dependency(
32 )
33
34 if get_option('weston-launch')
35- dep_pam = cc.find_library('pam')
36+ deps_weston_launch = [systemd_dep, dep_libdrm]
37
38- if not cc.has_function('pam_open_session', dependencies: dep_pam)
39- error('pam_open_session not found for weston-launch')
40+ if get_option('pam')
41+ dep_pam = cc.find_library('pam')
42+ if not cc.has_function('pam_open_session', dependencies: dep_pam)
43+ error('pam_open_session not found for weston-launch')
44+ endif
45+
46+ if dep_pam.found()
47+ deps_weston_launch += dep_pam
48+ config_h.set('HAVE_PAM', '1')
49+ endif
50 endif
51
52 executable(
53 'weston-launch',
54 'weston-launch.c',
55- dependencies: [dep_pam, systemd_dep, dep_libdrm],
56+ dependencies: deps_weston_launch,
57 include_directories: common_inc,
58 install: true
59 )
60diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
61index 521cb2c..2d42d33 100644
62--- a/libweston/weston-launch.c
63+++ b/libweston/weston-launch.c
64@@ -51,7 +51,9 @@
65
66 #include <pwd.h>
67 #include <grp.h>
68+#ifdef HAVE_PAM
69 #include <security/pam_appl.h>
70+#endif
71
72 #ifdef HAVE_SYSTEMD_LOGIN
73 #include <systemd/sd-login.h>
74@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd)
75 #endif
76
77 struct weston_launch {
78+#ifdef HAVE_PAM
79 struct pam_conv pc;
80 pam_handle_t *ph;
81+#endif
82 int tty;
83 int ttynr;
84 int sock[2];
85@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl)
86 return false;
87 }
88
89+#ifdef HAVE_PAM
90 static int
91 pam_conversation_fn(int msg_count,
92 const struct pam_message **messages,
93@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl)
94
95 return 0;
96 }
97+#endif
98
99 static int
100 setup_launcher_socket(struct weston_launch *wl)
101@@ -466,6 +472,7 @@ quit(struct weston_launch *wl, int status)
102 close(wl->signalfd);
103 close(wl->sock[0]);
104
105+#ifdef HAVE_PAM
106 if (wl->new_user) {
107 err = pam_close_session(wl->ph, 0);
108 if (err)
109@@ -473,6 +480,7 @@ quit(struct weston_launch *wl, int status)
110 err, pam_strerror(wl->ph, err));
111 pam_end(wl->ph, err);
112 }
113+#endif
114
115 /*
116 * Get a fresh handle to the tty as the previous one is in
117@@ -710,6 +718,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
118 setenv("HOME", wl->pw->pw_dir, 1);
119 setenv("SHELL", wl->pw->pw_shell, 1);
120
121+#ifdef HAVE_PAM
122 env = pam_getenvlist(wl->ph);
123 if (env) {
124 for (i = 0; env[i]; ++i) {
125@@ -718,6 +727,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
126 }
127 free(env);
128 }
129+#endif
130
131 /*
132 * We open a new session, so it makes sense
133@@ -789,8 +799,10 @@ static void
134 help(const char *name)
135 {
136 fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
137+#ifdef HAVE_PAM
138 fprintf(stderr, " -u, --user Start session as specified username,\n"
139 " e.g. -u joe, requires root.\n");
140+#endif
141 fprintf(stderr, " -t, --tty Start session on alternative tty,\n"
142 " e.g. -t /dev/tty4, requires -u option.\n");
143 fprintf(stderr, " -v, --verbose Be verbose\n");
144@@ -804,7 +816,9 @@ main(int argc, char *argv[])
145 int i, c;
146 char *tty = NULL;
147 struct option opts[] = {
148+#ifdef HAVE_PAM
149 { "user", required_argument, NULL, 'u' },
150+#endif
151 { "tty", required_argument, NULL, 't' },
152 { "verbose", no_argument, NULL, 'v' },
153 { "help", no_argument, NULL, 'h' },
154@@ -816,11 +830,16 @@ main(int argc, char *argv[])
155 while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) {
156 switch (c) {
157 case 'u':
158+#ifdef HAVE_PAM
159 wl.new_user = optarg;
160 if (getuid() != 0) {
161 fprintf(stderr, "weston: Permission denied. -u allowed for root only\n");
162 exit(EXIT_FAILURE);
163 }
164+#else
165+ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n");
166+ exit(EXIT_FAILURE);
167+#endif
168 break;
169 case 't':
170 tty = optarg;
171@@ -872,8 +891,10 @@ main(int argc, char *argv[])
172 if (setup_tty(&wl, tty) < 0)
173 exit(EXIT_FAILURE);
174
175+#ifdef HAVE_PAM
176 if (wl.new_user && setup_pam(&wl) < 0)
177 exit(EXIT_FAILURE);
178+#endif
179
180 if (setup_launcher_socket(&wl) < 0)
181 exit(EXIT_FAILURE);
182diff --git a/meson_options.txt b/meson_options.txt
183index 239bd2d..99e4ec3 100644
184--- a/meson_options.txt
185+++ b/meson_options.txt
186@@ -73,6 +73,13 @@ option(
187 )
188
189 option(
190+ 'pam',
191+ type: 'boolean',
192+ value: true,
193+ description: 'Define if PAM is available'
194+)
195+
196+option(
197 'xwayland',
198 type: 'boolean',
199 value: true,
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch b/meta-xilinx-core/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch
deleted file mode 100644
index a4444e5d..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1Fix atomic modesetting with musl
2
3atomic modesetting seems to fail with drm weston backend and this patch fixes
4it, below errors are seen before weston exits
5
6atomic: couldn't commit new state: Invalid argument
7
8Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11--- a/libweston/backend-drm/kms.c
12+++ b/libweston/backend-drm/kms.c
13@@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr
14 wl_list_for_each(plane, &b->plane_list, link) {
15 drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n",
16 (unsigned long) plane->plane_id);
17- plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0);
18- plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0);
19+ //plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0);
20+ //plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0);
21 }
22
23 flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/systemd-notify.weston-start b/meta-xilinx-core/recipes-graphics/wayland/weston/systemd-notify.weston-start
deleted file mode 100644
index a97e7b38..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/systemd-notify.weston-start
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/sh
2
3# SPDX-FileCopyrightText: Huawei Inc.
4# SPDX-License-Identifier: Apache-2.0
5
6
7if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then
8 add_weston_module "systemd-notify.so"
9fi
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/weston.desktop b/meta-xilinx-core/recipes-graphics/wayland/weston/weston.desktop
deleted file mode 100644
index 1086ae8b..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/weston.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
1[Desktop Entry]
2Encoding=UTF-8
3Type=Application
4Name=Weston
5Comment=Wayland Compostitor
6Exec=weston
7Icon=weston
8Terminal=false
9Categories=Utility;
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/weston.png b/meta-xilinx-core/recipes-graphics/wayland/weston/weston.png
deleted file mode 100644
index ea8b7e0e..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/weston.png
+++ /dev/null
Binary files differ
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston/xwayland.weston-start b/meta-xilinx-core/recipes-graphics/wayland/weston/xwayland.weston-start
deleted file mode 100644
index db384b1a..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston/xwayland.weston-start
+++ /dev/null
@@ -1,5 +0,0 @@
1#!/bin/sh
2
3if type Xwayland >/dev/null 2>/dev/null; then
4 mkdir -p /tmp/.X11-unix
5fi
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston_13.%.bbappend b/meta-xilinx-core/recipes-graphics/wayland/weston_13.%.bbappend
deleted file mode 100644
index 3ee9cafa..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston_13.%.bbappend
+++ /dev/null
@@ -1,12 +0,0 @@
1FILESEXTRAPATHS:prepend:zynqmp := "${THISDIR}/files:"
2
3require weston.inc
4
5ZYNQMP_WARN_DEFAULT = "0"
6ZYNQMP_WARN_DEFAULT:zynqmp = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '0', d)}"
7ZYNQMP_WARN = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${ZYNQMP_WARN_DEFAULT}', '0', d)}"
8
9python() {
10 if d.getVar('ZYNQMP_WARN') == "1":
11 raise bb.parse.SkipRecipe("Weston %s requires GLES 3 interfaces which are not available when libmali enabled. Use Weston 9.0.0.0 instead." % (d.getVar('PV')))
12}
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bb b/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bb
deleted file mode 100644
index af329e30..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bb
+++ /dev/null
@@ -1,148 +0,0 @@
1SUMMARY = "Weston, a Wayland compositor"
2DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
3HOMEPAGE = "http://wayland.freedesktop.org"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
6 file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a"
7
8# We want this version to be "newer" then 10, only if libmali and mali400 are both enabled
9ORIG_PE := "${PE}"
10MALI_PE = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '${ORIG_PE}', d)}"
11PE = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${MALI_PE}', '${ORIG_PE}', d)}"
12
13SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
14 file://weston.png \
15 file://weston.desktop \
16 file://xwayland.weston-start \
17 file://systemd-notify.weston-start \
18 file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
19 file://0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch \
20 file://0001-meson.build-fix-incorrect-header.patch \
21 file://0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch \
22"
23
24SRC_URI:append:libc-musl = " file://dont-use-plane-add-prop.patch "
25
26SRC_URI[sha256sum] = "5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe"
27
28UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
29
30inherit meson pkgconfig useradd features_check
31# depends on virtual/egl
32# weston-init requires pam enabled if started via systemd
33REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
34
35DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0"
36DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
37
38LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}"
39
40WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
41
42EXTRA_OEMESON += "-Dbackend-default=auto -Dpipewire=false"
43
44PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl clients', '', d)} \
45 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
46 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
47 ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \
48 launch \
49 image-jpeg \
50 screenshare \
51 shell-desktop \
52 shell-fullscreen \
53 shell-ivi"
54
55#
56# Compositor choices
57#
58# Weston on KMS
59PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev"
60# Weston on Wayland (nested Weston)
61PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2"
62# Weston on X11
63PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo"
64# Headless Weston
65PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false"
66# Weston on framebuffer
67PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev"
68# Weston on RDP
69PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp"
70# weston-launch
71PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm"
72# VA-API desktop recorder
73PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva"
74# Weston with EGL support
75PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl"
76# Weston with lcms support
77PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms"
78# Weston with webp support
79PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp"
80# Weston with systemd-login support
81PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus"
82# Weston with Xwayland support (requires X11 and Wayland)
83PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false"
84# colord CMS support
85PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord"
86# Clients support
87PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
88# Virtual remote output with GStreamer on DRM backend
89PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base"
90# Weston with PAM support
91PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam"
92# Weston with screen-share support
93PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false"
94# Traditional desktop shell
95PACKAGECONFIG[shell-desktop] = "-Dshell-desktop=true,-Dshell-desktop=false"
96# Fullscreen shell
97PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=false"
98# In-Vehicle Infotainment (IVI) shell
99PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false"
100# JPEG image loading support
101PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg"
102
103do_install:append() {
104 # Weston doesn't need the .la files to load modules, so wipe them
105 rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la
106
107 # If X11, ship a desktop file to launch it
108 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
109 install -d ${D}${datadir}/applications
110 install ${UNPACKDIR}/weston.desktop ${D}${datadir}/applications
111
112 install -d ${D}${datadir}/icons/hicolor/48x48/apps
113 install ${UNPACKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
114 fi
115
116 if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
117 install -Dm 644 ${UNPACKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
118 fi
119
120 if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then
121 install -Dm 644 ${UNPACKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify
122 fi
123
124 if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then
125 chmod u+s ${D}${bindir}/weston-launch
126 fi
127}
128
129PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
130 libweston-${WESTON_MAJOR_VERSION} ${PN}-examples"
131
132FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so"
133FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}"
134
135FILES:libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so"
136SUMMARY:libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'."
137
138FILES:${PN}-examples = "${bindir}/*"
139
140FILES:${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
141RDEPENDS:${PN}-xwayland += "xwayland"
142
143RDEPENDS:${PN} += "xkeyboard-config"
144RRECOMMENDS:${PN} = "weston-init liberation-fonts"
145RRECOMMENDS:${PN}-dev += "wayland-protocols"
146
147USERADD_PACKAGES = "${PN}"
148GROUPADD_PARAM:${PN} = "--system weston-launch"
diff --git a/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bbappend b/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bbappend
deleted file mode 100644
index 80512ac3..00000000
--- a/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bbappend
+++ /dev/null
@@ -1,3 +0,0 @@
1FILESEXTRAPATHS:prepend:zynqmp := "${THISDIR}/files/9.0.0:${THISDIR}/files:"
2
3require weston.inc
diff --git a/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
index 3306f1c4..fe24534f 100644
--- a/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
+++ b/meta-xilinx-core/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
@@ -1,10 +1,3 @@
1# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
2DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
3MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
4MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
5PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
6PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
7
8FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 1FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
9 2
10SRC_URI += " \ 3SRC_URI += " \
diff --git a/meta-xilinx-core/recipes-graphics/xwayland/xwayland_%.bbappend b/meta-xilinx-core/recipes-graphics/xwayland/xwayland_%.bbappend
deleted file mode 100644
index c1005f11..00000000
--- a/meta-xilinx-core/recipes-graphics/xwayland/xwayland_%.bbappend
+++ /dev/null
@@ -1,7 +0,0 @@
1# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
2DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}"
3MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH"
4MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}"
5PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
6PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
7
diff --git a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb
index a09ae9ed..a2fc6765 100644
--- a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb
+++ b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb
@@ -5,7 +5,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
5 5
6SRC_URI = "\ 6SRC_URI = "\
7 file://99-aie-device.rules \ 7 file://99-aie-device.rules \
8 file://99-mali-device.rules \
9" 8"
10 9
11S = "${UNPACKDIR}" 10S = "${UNPACKDIR}"
diff --git a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules
deleted file mode 100644
index 89ec5f78..00000000
--- a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules
+++ /dev/null
@@ -1,2 +0,0 @@
1# Device rules for GPU MALI-400 drivers.
2ACTION=="add", SUBSYSTEM=="misc", KERNEL=="mali", MODE="0660", GROUP="video", TAG+="uaccess"
diff --git a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc
index 63052933..27d79964 100644
--- a/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc
+++ b/meta-xilinx-core/recipes-kernel/linux/linux-xlnx.inc
@@ -61,7 +61,3 @@ KERNEL_FEATURES:append:zynqmp = "${@' features/xilinx/overlay_of/overlay_of.scc'
61KERNEL_FEATURES:append:versal = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' features/xen/xen.scc', '', d)} features/xilinx/hdmi-module/hdmi-module.scc" 61KERNEL_FEATURES:append:versal = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' features/xen/xen.scc', '', d)} features/xilinx/hdmi-module/hdmi-module.scc"
62 62
63KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', ' features/ocicontainer/ocicontainer.scc', '', d)}" 63KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', ' features/ocicontainer/ocicontainer.scc', '', d)}"
64
65# Enable DRM_LIMA support if DISTRO_FEATURES != 'libmali' and MACHINE_FEATURES mali400 is enabled
66MALI_FEATURE = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '', 'features/drm-lima/drm-lima.scc', d)}"
67KERNEL_FEATURES:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' ${MALI_FEATURE}', '', d)}"