From b2932fda0375cd904cbb9f2f797fca627ba8423b Mon Sep 17 00:00:00 2001 From: John Toomey Date: Wed, 15 May 2024 14:16:28 +0100 Subject: meta-xilinx-mali400: Create new Mali400 layer Create a new layer containing all code related to the Mali400 graphics stack and software. This includes the Mali kernel module / patches, libglu/libgles code, mesa, wayland, kernel recipe and udev rules. This layer also includes a dynamic layer for the qt5 bbappends and patches. Signed-off-by: Mark Hatle --- .../machine/include/machine-xilinx-default.inc | 18 -- .../recipes-benchmark/glmark2/glmark2_%.bbappend | 8 - .../recipes-devtools/qemu/qemu-xilinx_8.1.0.bb | 8 - .../recipes-devtools/qemu/qemu_%.bbappend | 7 - .../recipes-gnome/gtk+/gtk+3_%.bbappend | 6 - .../recipes-graphics/libepoxy/libepoxy_%.bbappend | 6 - .../recipes-graphics/libgles/files/egl.pc | 12 -- .../recipes-graphics/libgles/files/gbm.pc | 12 -- .../recipes-graphics/libgles/files/glesv1.pc | 12 -- .../recipes-graphics/libgles/files/glesv1_cm.pc | 12 -- .../recipes-graphics/libgles/files/glesv2.pc | 12 -- .../libgles/libmali-xlnx_r9p0-01rel0.bb | 199 --------------------- .../recipes-graphics/libglu/libglu_%.bbappend | 11 -- .../recipes-graphics/libsdl2/libsdl2_%.bbappend | 6 - ...ange-Makefile-to-be-compatible-with-Yocto.patch | 47 ----- ...i-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch | 52 ------ ...li-r8p0-01rel0-Remove-unused-trace-macros.patch | 35 ---- ...i-r8p0-01rel0-Don-t-include-mali_read_phy.patch | 47 ----- ...kernel_linux.c-Handle-clock-when-probed-a.patch | 90 ---------- ...l-variable-dma_ops-is-removed-from-the-ke.patch | 35 ---- ..._pm.c-Add-PM-runtime-barrier-after-removi.patch | 31 ---- ...kernel_linux.c-Enable-disable-clock-for-r.patch | 153 ---------------- ...ux-mali_memory_os_alloc-Remove-__GFP_COLD.patch | 33 ---- ...memory_secure-Add-header-file-dma-direct..patch | 34 ---- ...4-linux-mali_-timer-Get-rid-of-init_timer.patch | 156 ---------------- ...0015-fix-driver-failed-to-check-map-error.patch | 17 -- ..._secure-Kernel-5.0-onwards-access_ok-API-.patch | 47 ----- ...-vm_insert_pfn-deprecated-from-kernel-4.2.patch | 146 --------------- ...turn-type-to-vm_fault_t-for-fault-handler.patch | 32 ---- ...ic_boottime-ts-deprecated-from-kernel-4.2.patch | 36 ---- ...ioremap_nocache-deprecation-in-kernel-5.6.patch | 92 ---------- ...dated-timekeeping-functions-in-kernel-5.6.patch | 37 ---- ...2-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch | 38 ---- ...23-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch | 33 ---- .../0024-Use-community-device-tree-names.patch | 91 ---------- ...BUF-module-and-update-register_shrinker-f.patch | 67 ------- .../0026-Fix-gpu-driver-probe-failure.patch | 46 ----- ...ck-name-and-structure-to-match-LIMA-drive.patch | 95 ---------- ...-vm_flags-direct-modifications-with-modif.patch | 81 --------- .../0029-Fixed-buildpath-QA-warning.patch | 29 --- .../mali/kernel-module-mali_r9p0-01rel0.bb | 57 ------ .../mesa/files/0001-DRI_Add_xlnx_dri.patch | 32 ---- ...info-Align-EXT_platform_device-extension-.patch | 44 ----- ...info-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch | 41 ----- .../mesa/mesa-demos/libmali-egl-workaround.patch | 69 ------- .../recipes-graphics/mesa/mesa-demos_%.bbappend | 16 -- .../recipes-graphics/mesa/mesa-gl_%.bbappend | 18 -- .../recipes-graphics/mesa/mesa_%.bbappend | 15 -- .../virglrenderer/virglrenderer_%.bbappend | 6 - ...ton-Remove-substitute-format-for-ARGB8888.patch | 30 ---- ...ton-Remove-substitute-format-for-ARGB8888.patch | 29 --- .../recipes-graphics/wayland/files/init | 54 ------ .../recipes-graphics/wayland/files/weston.service | 71 -------- .../recipes-graphics/wayland/weston-init.bbappend | 5 - .../recipes-graphics/wayland/weston.inc | 15 -- ...ackend-drm-Re-order-gbm-destruction-at-DR.patch | 50 ------ .../0001-meson.build-fix-incorrect-header.patch | 32 ---- ...de-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch | 47 ----- ...ch-Provide-a-default-version-that-doesn-t.patch | 199 --------------------- .../wayland/weston/dont-use-plane-add-prop.patch | 23 --- .../wayland/weston/systemd-notify.weston-start | 9 - .../recipes-graphics/wayland/weston/weston.desktop | 9 - .../recipes-graphics/wayland/weston/weston.png | Bin 2383 -> 0 bytes .../wayland/weston/xwayland.weston-start | 5 - .../recipes-graphics/wayland/weston_13.%.bbappend | 12 -- .../recipes-graphics/wayland/weston_9.0.0.bb | 148 --------------- .../recipes-graphics/wayland/weston_9.0.0.bbappend | 3 - .../xorg-xserver/xserver-xorg_%.bbappend | 7 - .../recipes-graphics/xwayland/xwayland_%.bbappend | 7 - .../linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb | 1 - .../linux-xlnx-udev-rules/99-mali-device.rules | 2 - .../recipes-kernel/linux/linux-xlnx.inc | 4 - .../classes/meta-xilinx-mali400-cfg.bbclass | 6 + .../classes/sanity-meta-xilinx-mali400.bbclass | 10 ++ .../meta-xilinx-mali400-default-versions.inc | 22 +++ meta-xilinx-mali400/conf/layer.conf | 34 ++++ .../recipes-benchmark/glmark2/glmark2_%.bbappend | 6 + ...Modify-the-default-color-format-to-RGB565.patch | 110 ++++++++++++ ...cpp-Disable-hw-cursor-as-a-default-option.patch | 31 ++++ .../qt5-layer/recipes-qt/qt5/qtbase_%.bbappend | 41 +++++ .../recipes-qt/qt5/qtmultimedia_%.bbappend | 7 + ...ion-in-QWaylandGlContext-makeCurrent-for-.patch | 34 ++++ ...dow.cpp-Do-not-destroy-shell-suface-befor.patch | 31 ++++ ...imize-minimize-fullscreen-in-xdg_shell_v6.patch | 20 +++ ...window.cpp-Bind-the-context-before-callin.patch | 32 ++++ .../qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend | 21 +++ .../recipes-qt/qt5/qtwebengine_%.bbappend | 1 + .../qt5-layer/recipes-qt/qt5/qtwebkit_%.bbappend | 8 + .../gstreamer/gstreamer1.0-plugins-base_%.bbappend | 6 + .../0001-Make-RGB565-as-default-EGLconfig.patch | 31 ++++ ...e-egl-Use-native_display-to-load-EGL-func.patch | 33 ++++ ....cpp-Add-options-to-configure-bpp-and-dep.patch | 104 +++++++++++ .../recipes-benchmarks/glmark2_%.bbappend | 14 ++ .../qemu/qemu-xilinx_8.1.0.bbappend | 6 + .../recipes-devtools/qemu/qemu_%.bbappend | 6 + .../recipes-gnome/gtk+/gtk+3_%.bbappend | 6 + .../recipes-graphics/libepoxy/libepoxy_%.bbappend | 6 + .../recipes-graphics/libgles/files/egl.pc | 12 ++ .../recipes-graphics/libgles/files/gbm.pc | 12 ++ .../recipes-graphics/libgles/files/glesv1.pc | 12 ++ .../recipes-graphics/libgles/files/glesv1_cm.pc | 12 ++ .../recipes-graphics/libgles/files/glesv2.pc | 12 ++ .../libgles/libmali-xlnx_r9p0-01rel0.bb | 199 +++++++++++++++++++++ .../recipes-graphics/libglu/libglu_%.bbappend | 11 ++ .../recipes-graphics/libsdl2/libsdl2_%.bbappend | 6 + ...ange-Makefile-to-be-compatible-with-Yocto.patch | 47 +++++ ...i-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch | 52 ++++++ ...li-r8p0-01rel0-Remove-unused-trace-macros.patch | 35 ++++ ...i-r8p0-01rel0-Don-t-include-mali_read_phy.patch | 47 +++++ ...kernel_linux.c-Handle-clock-when-probed-a.patch | 90 ++++++++++ ...l-variable-dma_ops-is-removed-from-the-ke.patch | 35 ++++ ..._pm.c-Add-PM-runtime-barrier-after-removi.patch | 31 ++++ ...kernel_linux.c-Enable-disable-clock-for-r.patch | 153 ++++++++++++++++ ...ux-mali_memory_os_alloc-Remove-__GFP_COLD.patch | 33 ++++ ...memory_secure-Add-header-file-dma-direct..patch | 34 ++++ ...4-linux-mali_-timer-Get-rid-of-init_timer.patch | 156 ++++++++++++++++ ...0015-fix-driver-failed-to-check-map-error.patch | 17 ++ ..._secure-Kernel-5.0-onwards-access_ok-API-.patch | 47 +++++ ...-vm_insert_pfn-deprecated-from-kernel-4.2.patch | 146 +++++++++++++++ ...turn-type-to-vm_fault_t-for-fault-handler.patch | 32 ++++ ...ic_boottime-ts-deprecated-from-kernel-4.2.patch | 36 ++++ ...ioremap_nocache-deprecation-in-kernel-5.6.patch | 92 ++++++++++ ...dated-timekeeping-functions-in-kernel-5.6.patch | 37 ++++ ...2-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch | 38 ++++ ...23-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch | 33 ++++ .../0024-Use-community-device-tree-names.patch | 91 ++++++++++ ...BUF-module-and-update-register_shrinker-f.patch | 67 +++++++ .../0026-Fix-gpu-driver-probe-failure.patch | 46 +++++ ...ck-name-and-structure-to-match-LIMA-drive.patch | 95 ++++++++++ ...-vm_flags-direct-modifications-with-modif.patch | 81 +++++++++ .../0029-Fixed-buildpath-QA-warning.patch | 29 +++ .../mali/kernel-module-mali_r9p0-01rel0.bb | 57 ++++++ .../mesa/files/0001-DRI_Add_xlnx_dri.patch | 32 ++++ ...info-Align-EXT_platform_device-extension-.patch | 44 +++++ ...info-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch | 41 +++++ .../mesa/mesa-demos/libmali-egl-workaround.patch | 69 +++++++ .../recipes-graphics/mesa/mesa-demos_%.bbappend | 16 ++ .../recipes-graphics/mesa/mesa-gl_%.bbappend | 18 ++ .../recipes-graphics/mesa/mesa_%.bbappend | 15 ++ .../virglrenderer/virglrenderer_%.bbappend | 6 + ...ton-Remove-substitute-format-for-ARGB8888.patch | 30 ++++ ...ton-Remove-substitute-format-for-ARGB8888.patch | 29 +++ .../recipes-graphics/wayland/files/init | 54 ++++++ .../recipes-graphics/wayland/files/weston.service | 71 ++++++++ .../recipes-graphics/wayland/weston-init.bbappend | 5 + .../recipes-graphics/wayland/weston.inc | 15 ++ ...ackend-drm-Re-order-gbm-destruction-at-DR.patch | 50 ++++++ .../0001-meson.build-fix-incorrect-header.patch | 32 ++++ ...de-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch | 47 +++++ ...ch-Provide-a-default-version-that-doesn-t.patch | 199 +++++++++++++++++++++ .../wayland/weston/dont-use-plane-add-prop.patch | 23 +++ .../wayland/weston/systemd-notify.weston-start | 9 + .../recipes-graphics/wayland/weston/weston.desktop | 9 + .../recipes-graphics/wayland/weston/weston.png | Bin 0 -> 2383 bytes .../wayland/weston/xwayland.weston-start | 5 + .../recipes-graphics/wayland/weston_13.%.bbappend | 12 ++ .../recipes-graphics/wayland/weston_9.0.0.bb | 148 +++++++++++++++ .../recipes-graphics/wayland/weston_9.0.0.bbappend | 3 + .../xorg-xserver/xserver-xorg_%.bbappend | 6 + .../recipes-graphics/xwayland/xwayland_%.bbappend | 7 + .../linux-xlnx-udev-rules.bbappend | 3 + .../linux-xlnx-udev-rules/99-mali-device.rules | 2 + .../recipes-kernel/linux/linux-xlnx-mali400.inc | 3 + .../recipes-kernel/linux/linux-xlnx_%.bbappend | 1 + .../FIXME/gstreamer1.0-plugins-base_%.bbappend | 6 - 165 files changed, 3563 insertions(+), 2995 deletions(-) delete mode 100644 meta-xilinx-core/recipes-gnome/gtk+/gtk+3_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/libepoxy/libepoxy_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/libgles/files/egl.pc delete mode 100644 meta-xilinx-core/recipes-graphics/libgles/files/gbm.pc delete mode 100644 meta-xilinx-core/recipes-graphics/libgles/files/glesv1.pc delete mode 100644 meta-xilinx-core/recipes-graphics/libgles/files/glesv1_cm.pc delete mode 100644 meta-xilinx-core/recipes-graphics/libgles/files/glesv2.pc delete mode 100644 meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb delete mode 100644 meta-xilinx-core/recipes-graphics/libglu/libglu_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/libsdl2/libsdl2_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/mesa-demos_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/mesa-gl_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/mesa/mesa_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/virglrenderer/virglrenderer_%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/files/init delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/files/weston.service delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston-init.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston.inc delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/systemd-notify.weston-start delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/weston.desktop delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/weston.png delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston/xwayland.weston-start delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston_13.%.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bb delete mode 100644 meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bbappend delete mode 100644 meta-xilinx-core/recipes-graphics/xwayland/xwayland_%.bbappend delete mode 100644 meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules create mode 100644 meta-xilinx-mali400/classes/meta-xilinx-mali400-cfg.bbclass create mode 100644 meta-xilinx-mali400/classes/sanity-meta-xilinx-mali400.bbclass create mode 100644 meta-xilinx-mali400/conf/distro/include/meta-xilinx-mali400-default-versions.inc create mode 100644 meta-xilinx-mali400/conf/layer.conf create mode 100644 meta-xilinx-mali400/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0002-egl_kms-Modify-the-default-color-format-to-RGB565.patch create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0003-qkmsdevice.cpp-Disable-hw-cursor-as-a-default-option.patch create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtmultimedia_%.bbappend create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-Fix-regression-in-QWaylandGlContext-makeCurrent-for-.patch create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-qwaylandwindow.cpp-Do-not-destroy-shell-suface-befor.patch create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0002-Handle-maximize-minimize-fullscreen-in-xdg_shell_v6.patch create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0003-qwaylandeglwindow.cpp-Bind-the-context-before-callin.patch create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebengine_%.bbappend create mode 100644 meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebkit_%.bbappend create mode 100644 meta-xilinx-mali400/dynamic-layers/xilinx-multimedia/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-benchmarks/files/0001-Make-RGB565-as-default-EGLconfig.patch create mode 100644 meta-xilinx-mali400/recipes-benchmarks/files/0001-src-gl-state-egl-Use-native_display-to-load-EGL-func.patch create mode 100644 meta-xilinx-mali400/recipes-benchmarks/files/0001-src-options.cpp-Add-options-to-configure-bpp-and-dep.patch create mode 100644 meta-xilinx-mali400/recipes-benchmarks/glmark2_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-devtools/qemu/qemu-xilinx_8.1.0.bbappend create mode 100644 meta-xilinx-mali400/recipes-devtools/qemu/qemu_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-gnome/gtk+/gtk+3_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/libepoxy/libepoxy_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/libgles/files/egl.pc create mode 100644 meta-xilinx-mali400/recipes-graphics/libgles/files/gbm.pc create mode 100644 meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1.pc create mode 100644 meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1_cm.pc create mode 100644 meta-xilinx-mali400/recipes-graphics/libgles/files/glesv2.pc create mode 100644 meta-xilinx-mali400/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb create mode 100644 meta-xilinx-mali400/recipes-graphics/libglu/libglu_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/libsdl2/libsdl2_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/mesa-gl_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/mesa/mesa_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/virglrenderer/virglrenderer_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/files/init create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/files/weston.service create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston-init.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston.inc create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/systemd-notify.weston-start create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.desktop create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.png create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston/xwayland.weston-start create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston_13.%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bb create mode 100644 meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-graphics/xwayland/xwayland_%.bbappend create mode 100644 meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bbappend create mode 100644 meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules create mode 100644 meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx-mali400.inc create mode 100644 meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx_%.bbappend delete mode 100644 meta-xilinx-multimedia/recipes-multimedia/gstreamer/FIXME/gstreamer1.0-plugins-base_%.bbappend 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" UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" UBOOT_ELF ?= "u-boot.elf" -# libmali is selected by DISTRO_FEATURE of libmali & MACHINE_FEATURES of mali400 -# lima is selected by DISTRO_FEATURE != libmali & MACHINE_FEATURES of mali400 -# default mesa because otherwise -def xlnx_is_libmali_enabled(d): - if bb.utils.contains('MACHINE_FEATURES', 'mali400', '1', '', d) == '1': - if bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '', d) == '1': - return True - return False - -# libmali requires certain preferred providers to be selected -PREFERRED_PROVIDER_virtual/egl ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" -PREFERRED_PROVIDER_virtual/libgl ?= "${@'mesa-gl' if xlnx_is_libmali_enabled(d) else 'mesa'}" -PREFERRED_PROVIDER_virtual/libgles1 ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" -PREFERRED_PROVIDER_virtual/libgles2 ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" -PREFERRED_PROVIDER_virtual/libgles3 ?= "${@'NOT_SUPPORTED' if xlnx_is_libmali_enabled(d) else 'mesa'}" -PREFERRED_PROVIDER_virtual/libgbm ?= "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" -PREFERRED_PROVIDER_virtual/mesa ?= "${@'mesa-gl' if xlnx_is_libmali_enabled(d) else 'mesa'}" - XSERVER ?= " \ xserver-xorg \ 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 = " \ PACKAGECONFIG[fbdev-glesv2] = ",,virtual/libgles2 virtual/egl" EXTRA_OECONF:append = "${@bb.utils.contains('DISTRO_FEATURES', 'fbdev', ' --with-flavors=fbdev-glesv2', '', d)}" - -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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-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 require qemu-xilinx-8.1.inc require qemu-alt.inc -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" - - DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native" DEPENDS: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 @@ require qemu-alt.inc - -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=/usr/lib -includedir=/usr/include - -Name: egl -Description: MALI EGL library -Requires.private: -Version: 17.3 -Libs: -L${libdir} -lEGL -Libs.private: -lm -lpthread -ldl -Cflags: -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 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=/usr/lib -includedir=/usr/include - -Name: gbm -Description: MALI gbm library -Requires.private: -Version: 17.3 -Libs: -L${libdir} -lgbm -Libs.private: -lm -lpthread -ldl -Cflags: -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 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=/usr/lib -includedir=/usr/include - -Name: glesv1 -Description: MALI OpenGL ES 1.1 library -Requires.private: -Version: 17.3 -Libs: -L${libdir} -lGLESv1_CM -Libs.private: -lm -lpthread -ldl -Cflags: -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 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=/usr/lib -includedir=/usr/include - -Name: gles_cm -Description: Mali OpenGL ES 1.1 CM library -Requires.private: -Version: 17.3 -Libs: -L${libdir} -lGLESv1_CM -Libs.private: -lm -lpthread -ldl -Cflags: -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 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=/usr/lib -includedir=/usr/include - -Name: glesv2 -Description: MALI OpenGL ES 2.0 library -Requires.private: -Version: 17.3 -Libs: -L${libdir} -lGLESv2 -Libs.private: -lm -lpthread -ldl -Cflags: -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 7f5fba0b..00000000 --- a/meta-xilinx-core/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb +++ /dev/null @@ -1,199 +0,0 @@ -DESCRIPTION = "libGLES for ZynqMP with Mali 400" - -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://EULA;md5=82e466d0ed92c5a15f568dbe6b31089c" - -inherit features_check update-alternatives - -ANY_OF_DISTRO_FEATURES = "x11 fbdev wayland" -REQUIRED_MACHINE_FEATURES = "mali400" - -PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm" - -FILESEXTRAPATHS:prepend := "${THISDIR}/files:" - -REPO ?= "git://github.com/Xilinx/mali-userspace-binaries.git;protocol=https" -BRANCH ?= "xlnx_rel_v2024.1" -SRCREV ?= "b3a772aad859cdadc8513b11c3e995546c20e75e" -BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" - -SRC_URI = " \ - ${REPO};${BRANCHARG} \ - file://egl.pc \ - file://glesv1_cm.pc \ - file://glesv1.pc \ - file://glesv2.pc \ - file://gbm.pc \ - " - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -S = "${WORKDIR}/git" - -# If were switching at runtime, we would need all RDEPENDS needed for all backends available -X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes" -X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes" - -# Don't install runtime dependencies for other backends unless the DISTRO supports it -RDEPENDS:${PN} = " \ - kernel-module-mali \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \ -" - -# We dont build anything but we want to avoid QA warning build-deps -DEPENDS = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland libdrm', '', d)} \ -" - - -# x11 is default, set to "fbdev" , "wayland", or "headless" if required -MALI_BACKEND_DEFAULT ?= "x11" - -USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}" -USE_FB = "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "yes", "no", d)}" -USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}" - -MONOLITHIC_LIBMALI = "libMali.so.9.0" - -do_install() { - #Identify the ARCH type - ${TARGET_PREFIX}gcc --version > ARCH_PLATFORM - if grep -q aarch64 "ARCH_PLATFORM"; then - ARCH_PLATFORM_DIR=aarch64-linux-gnu - else - ARCH_PLATFORM_DIR=arm-linux-gnueabihf - fi - - # install headers - install -d -m 0655 ${D}${includedir}/EGL - install -m 0644 ${S}/${PV}/glesHeaders/EGL/*.h ${D}${includedir}/EGL/ - install -d -m 0655 ${D}${includedir}/GLES - install -m 0644 ${S}/${PV}/glesHeaders/GLES/*.h ${D}${includedir}/GLES/ - install -d -m 0655 ${D}${includedir}/GLES2 - install -m 0644 ${S}/${PV}/glesHeaders/GLES2/*.h ${D}${includedir}/GLES2/ - install -d -m 0655 ${D}${includedir}/KHR - install -m 0644 ${S}/${PV}/glesHeaders/KHR/*.h ${D}${includedir}/KHR/ - - install -d ${D}${libdir}/pkgconfig - install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc - install -m 0644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc - install -m 0644 ${WORKDIR}/glesv1.pc ${D}${libdir}/pkgconfig/glesv1.pc - install -m 0644 ${WORKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc - - install -d ${D}${libdir} - install -d ${D}${includedir} - - cp -a --no-preserve=ownership ${S}/${PV}/${ARCH_PLATFORM_DIR}/common/*.so* ${D}${libdir} - - install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/headless/${MONOLITHIC_LIBMALI} ${D}${libdir}/headless/${MONOLITHIC_LIBMALI} - ln -snf headless/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} - - if [ "${USE_FB}" = "yes" ]; then - install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/fbdev/${MONOLITHIC_LIBMALI} ${D}${libdir}/fbdev/${MONOLITHIC_LIBMALI} - if [ "${MALI_BACKEND_DEFAULT}" = "fbdev" ]; then - ln -snf fbdev/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} - fi - fi - if [ "${USE_X11}" = "yes" ]; then - install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/x11/${MONOLITHIC_LIBMALI} ${D}${libdir}/x11/${MONOLITHIC_LIBMALI} - if [ "${MALI_BACKEND_DEFAULT}" = "x11" ]; then - ln -snf x11/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} - fi - else - # We cant rely on the fact that all apps will use pkgconfig correctly - sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if (1)/' ${D}${includedir}/EGL/eglplatform.h - fi - if [ "${USE_WL}" = "yes" ]; then - install -m 0644 ${S}/${PV}/glesHeaders/GBM/gbm.h ${D}${includedir}/ - install -m 0644 ${WORKDIR}/gbm.pc ${D}${libdir}/pkgconfig/gbm.pc - install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/wayland/${MONOLITHIC_LIBMALI} ${D}${libdir}/wayland/${MONOLITHIC_LIBMALI} - if [ "${MALI_BACKEND_DEFAULT}" = "wayland" ]; then - ln -snf wayland/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} - fi - fi -} - - -# We need separate packages to provide multiple alternatives, at this point we install -# everything on the default one but that can be split if necessary -PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "x11", "${PN}-x11", "", d)}" -PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "${PN}-fbdev", "", d)}" -PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "${PN}-wayland", "", d)}" -PACKAGES += "${PN}-headless" - -# This is default/common for all alternatives -ALTERNATIVE_LINK_NAME[libmali-xlnx] = "${libdir}/${MONOLITHIC_LIBMALI}" - - -# Declare alternatives and corresponding library location -ALTERNATIVE:${PN}-x11 = "libmali-xlnx" -ALTERNATIVE_TARGET_libmali-xlnx-x11[libmali-xlnx] = "${libdir}/x11/${MONOLITHIC_LIBMALI}" - -ALTERNATIVE:${PN}-fbdev = "libmali-xlnx" -ALTERNATIVE_TARGET_libmali-xlnx-fbdev[libmali-xlnx] = "${libdir}/fbdev/${MONOLITHIC_LIBMALI}" - -ALTERNATIVE:${PN}-wayland = "libmali-xlnx" -ALTERNATIVE_TARGET_libmali-xlnx-wayland[libmali-xlnx] = "${libdir}/wayland/${MONOLITHIC_LIBMALI}" - -ALTERNATIVE:${PN}-headless = "libmali-xlnx" -ALTERNATIVE_TARGET_libmali-xlnx-headless[libmali-xlnx] = "${libdir}/headless/${MONOLITHIC_LIBMALI}" - -# Set priorities according to what we prveiously defined -ALTERNATIVE_PRIORITY_libmali-xlnx-x11[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "x11", "20", "10", d)}" -ALTERNATIVE_PRIORITY_libmali-xlnx-fbdev[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "fbdev", "20", "10", d)}" -ALTERNATIVE_PRIORITY_libmali-xlnx-wayland[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "wayland", "20", "10", d)}" - -# If misconfigured, fallback to headless -ALTERNATIVE_PRIORITY_libmali-xlnx-headless[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "headless", "20", "15", d)}" - - -# Package gets renamed on the debian class, but we want to keep -xlnx -DEBIAN_NOAUTONAME:libmali-xlnx = "1" - -# Update alternatives will actually have separate postinst scripts (one for each package) -# This wont work for us, so we create a common postinst script and we pass that as the general -# libmali-xlnx postinst script, but we defer execution to run on first boot (pkg_postinst_ontarget). -# This will avoid ldconfig removing the symbolic links when creating the root filesystem. -python populate_packages_updatealternatives:append () { - # We need to remove the 'fake' libmali-xlnx before creating any links - libdir = d.getVar('libdir') - common_postinst = "#!/bin/sh\nrm " + libdir + "/${MONOLITHIC_LIBMALI}\n" - for pkg in (d.getVar('PACKAGES') or "").split(): - # Not all packages provide an alternative (e.g. ${PN}-lic) - postinst = d.getVar('pkg_postinst:%s' % pkg) - if postinst: - old_postinst = postinst - new_postinst = postinst.replace('#!/bin/sh','') - common_postinst += new_postinst - d.setVar('pkg_postinst_ontarget:%s' % 'libmali-xlnx', common_postinst) -} - - -# Inhibit warnings about files being stripped -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_SYSROOT_STRIP = "1" - -RREPLACES:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" -RPROVIDES:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" -RCONFLICTS:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" - -# These libraries shouldn't get installed in world builds unless something -# explicitly depends upon them. -EXCLUDE_FROM_WORLD = "1" -FILES:${PN} += "${libdir}/*" - -do_package:append() { - - shlibswork_dir = d.getVar('SHLIBSWORKDIR') - pkg_filename = d.getVar('PN') + ".list" - shlibs_file = os.path.join(shlibswork_dir, pkg_filename) - lines = "" - with open(shlibs_file, "r") as f: - lines = f.readlines() - with open(shlibs_file, "w") as f: - for line in lines: - if d.getVar('MALI_BACKEND_DEFAULT') in line.strip("\n"): - f.write(line) -} 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 @@ -# OpenGL comes from libmali, adjust parameters -MALI_DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', ' virtual/libgles2', '', d)}" -DEPENDS:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' ${MALI_DEPENDS}', '', d)}" - -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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/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 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -From 6d283b9aa3f7fb761da4cb076b47a62275fc4caa Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Tue, 21 Nov 2017 03:57:25 -0800 -Subject: [PATCH 1/9] Change Makefile to be compatible with Yocto - -Signed-off-by: Manjukumar Matha -Signed-off-by: Hyun Kwon -Signed-off-by: Madhurkiran Harikrishnan -Upstream Status: Inappropriate [Xilinx specific] ---- - driver/src/devicedrv/mali/Makefile | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/driver/src/devicedrv/mali/Makefile b/driver/src/devicedrv/mali/Makefile -index 5a259fe..a6dd94c 100644 ---- Makefile -+++ b/Makefile -@@ -89,7 +89,11 @@ endif - # Define host system directory - KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build - --include $(KDIR)/.config -+ifeq ($(O),) -+ -include $(KDIR)/.config -+else -+ -include $(O)/.config -+endif - - ifeq ($(ARCH), arm) - # when compiling for ARM we're cross compiling -@@ -204,9 +208,12 @@ EXTRA_DEFINES += -DMALI_MEM_SWAP_TRACKING=1 - endif - - all: $(UMP_SYMVERS_FILE) -- $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules -+ $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) O=$(O) modules - @rm $(FILES_PREFIX)__malidrv_build_info.c $(FILES_PREFIX)__malidrv_build_info.o - -+modules_install: -+ $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules_install -+ - clean: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean - --- -2.7.4 - 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 @@ -From f27aab2b0e4d5dea9b5a0e4648c142257940c428 Mon Sep 17 00:00:00 2001 -From: Hyun Kwon -Date: Thu, 25 Jun 2015 17:14:42 -0700 -Subject: [PATCH 2/9] staging: mali: r8p0-01rel0: Add the ZYNQ/ZYNQMP platform - -Add the number of PP cores that is required for Zynq/ZynqMP configuration. - -Signed-off-by: Hyun Kwon -Signed-off-by: Michal Simek -Upstream Status: Inappropriate [Xilinx specific] ---- - driver/src/devicedrv/mali/platform/arm/arm.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c -index 4e09aca..fac99bc 100644 ---- platform/arm/arm.c -+++ b/platform/arm/arm.c -@@ -261,6 +261,10 @@ static struct mali_gpu_device_data mali_gpu_data = { - .dedicated_mem_start = 0x80000000, /* Physical start address (use 0xD0000000 for old indirect setup) */ - .dedicated_mem_size = 0x10000000, /* 256MB */ - #endif -+#if defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP) -+ .fb_start = 0x00000000, -+ .fb_size = 0xfffff000, -+#else - #if defined(CONFIG_ARM64) - /* Some framebuffer drivers get the framebuffer dynamically, such as through GEM, - * in which the memory resource can't be predicted in advance. -@@ -271,6 +275,7 @@ static struct mali_gpu_device_data mali_gpu_data = { - .fb_start = 0xe0000000, - .fb_size = 0x01000000, - #endif -+#endif /* !defined(CONFIG_ARCH_ZYNQ) && !defined(CONFIG_ARCH_ZYNQMP) */ - .control_interval = 1000, /* 1000ms */ - .utilization_callback = mali_gpu_utilization_callback, - .get_clock_info = NULL, -@@ -505,6 +510,11 @@ int mali_platform_device_init(struct platform_device *device) - mali_write_phys(0xC0010020, 0xA); /* Enable direct memory mapping for FPGA */ - } - } -+#elif defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP) -+ -+ MALI_DEBUG_PRINT(4, ("Registering Zynq/ZynqMP Mali-400 device\n")); -+ num_pp_cores = 2; -+ - #endif - - /* After kernel 3.15 device tree will default set dev --- -2.7.4 - 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 @@ -From d6e44bbf8d1377f78481f611dec237e8d24baf74 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Tue, 21 Nov 2017 04:00:27 -0800 -Subject: [PATCH 3/9] staging: mali: r8p0-01rel0: Remove unused trace macros - -TRACE_SYSTEM_STRING is not need in each trace file anymore. - -Signed-off-by: Hyun Kwon -Signed-off-by: Madhurkiran Harikrishnan -Upstream Status: Pending ---- - driver/src/devicedrv/mali/linux/mali_linux_trace.h | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/driver/src/devicedrv/mali/linux/mali_linux_trace.h b/driver/src/devicedrv/mali/linux/mali_linux_trace.h -index 7f0b19d..33cb1ca 100644 ---- linux/mali_linux_trace.h -+++ b/linux/mali_linux_trace.h -@@ -13,13 +13,11 @@ - - #include - --#include - #include - - #undef TRACE_SYSTEM - #define TRACE_SYSTEM mali - #ifndef TRACEPOINTS_ENABLED --#define TRACE_SYSTEM_STRING __stringfy(TRACE_SYSTEM) - #endif - #define TRACE_INCLUDE_PATH . - #define TRACE_INCLUDE_FILE mali_linux_trace --- -2.7.4 - 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 @@ -From 2f5e8944357f43fbde4cb642c6ee4a699c88efb5 Mon Sep 17 00:00:00 2001 -From: Hyun Kwon -Date: Wed, 29 Jun 2016 09:14:37 -0700 -Subject: [PATCH 4/9] staging: mali: r8p0-01rel0: Don't include - mali_read_phys() for zynq/zynqmp - -mali_read_phys() is not used with CONFIG_ARCH_ZYNQ and CONFIG_ARCH_ZYNQMP. - -Signed-off-by: Hyun Kwon -Upstream Status: Inappropriate [Xilinx specific] ---- - driver/src/devicedrv/mali/platform/arm/arm.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c -index fac99bc..62f9be6 100644 ---- platform/arm/arm.c -+++ b/platform/arm/arm.c -@@ -38,7 +38,9 @@ - static int mali_core_scaling_enable = 0; - - void mali_gpu_utilization_callback(struct mali_gpu_utilization_data *data); -+#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)) - static u32 mali_read_phys(u32 phys_addr); -+#endif - #if defined(CONFIG_ARCH_REALVIEW) - static void mali_write_phys(u32 phys_addr, u32 value); - #endif -@@ -578,6 +580,7 @@ int mali_platform_device_deinit(struct platform_device *device) - - #endif /* CONFIG_MALI_DT */ - -+#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)) - static u32 mali_read_phys(u32 phys_addr) - { - u32 phys_addr_page = phys_addr & 0xFFFFE000; -@@ -592,6 +595,7 @@ static u32 mali_read_phys(u32 phys_addr) - - return ret; - } -+#endif - - #if defined(CONFIG_ARCH_REALVIEW) - static void mali_write_phys(u32 phys_addr, u32 value) --- -2.7.4 - 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 @@ -From e67e20ec6ff0c9720d87844270421453c738066a Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Thu, 16 Feb 2017 12:15:58 -0800 -Subject: [PATCH 5/9] linux/mali_kernel_linux.c: Handle clock when probed and - removed - -This patch will handle the clock through clock -specifier for GPU PP0 and PP1. - -Signed-off-by: Madhurkiran Harikrishnan -Upstream Status: Inappropriate [Xilinx specific] ---- - .../src/devicedrv/mali/linux/mali_kernel_linux.c | 40 +++++++++++++++++++++- - 1 file changed, 39 insertions(+), 1 deletion(-) - -diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c -index d7893a3..f15fb56 100644 ---- linux/mali_kernel_linux.c -+++ b/linux/mali_kernel_linux.c -@@ -45,6 +45,14 @@ - #if defined(CONFIG_MALI400_INTERNAL_PROFILING) - #include "mali_profiling_internal.h" - #endif -+ -+#if defined(CONFIG_ARCH_ZYNQMP) -+/* Initialize variables for clocks */ -+struct clk *clk_gpu; -+struct clk *clk_gpu_pp0; -+struct clk *clk_gpu_pp1; -+#endif -+ - #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS) - #include "mali_osk_profiling.h" - #include "mali_dvfs_policy.h" -@@ -580,7 +588,23 @@ static int mali_probe(struct platform_device *pdev) - } - #endif - -- -+#if defined(CONFIG_ARCH_ZYNQMP) -+ /* Initialize clocks for GPU and PP */ -+ clk_gpu = devm_clk_get(&pdev->dev, "gpu"); -+ if (IS_ERR(clk_gpu)) -+ return PTR_ERR(clk_gpu); -+ clk_prepare_enable(clk_gpu); -+ -+ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); -+ if (IS_ERR(clk_gpu_pp0)) -+ return PTR_ERR(clk_gpu_pp0); -+ clk_prepare_enable(clk_gpu_pp0); -+ -+ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); -+ if (IS_ERR(clk_gpu_pp1)) -+ return PTR_ERR(clk_gpu_pp1); -+ clk_prepare_enable(clk_gpu_pp1); -+#endif - if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) { - /* Initialize the Mali GPU HW specified by pdev */ - if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) { -@@ -608,6 +632,12 @@ static int mali_probe(struct platform_device *pdev) - _mali_osk_wq_term(); - } - -+#if defined(CONFIG_ARCH_ZYNQMP) -+ clk_disable_unprepare(clk_gpu); -+ clk_disable_unprepare(clk_gpu_pp0); -+ clk_disable_unprepare(clk_gpu_pp1); -+#endif -+ - #ifdef CONFIG_MALI_DEVFREQ - mali_devfreq_term(mdev); - devfreq_init_failed: -@@ -673,6 +703,14 @@ static int mali_remove(struct platform_device *pdev) - mali_platform_device_deinit(mali_platform_device); - #endif - mali_platform_device = NULL; -+ -+#if defined(CONFIG_ARCH_ZYNQMP) -+ /* Remove clock */ -+ clk_disable_unprepare(clk_gpu); -+ clk_disable_unprepare(clk_gpu_pp0); -+ clk_disable_unprepare(clk_gpu_pp1); -+#endif -+ - return 0; - } - --- -2.7.4 - 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 @@ -From ed7242238151c12029c566d1974058c579d8ae3d Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Wed, 25 Jan 2017 10:00:33 -0800 -Subject: [PATCH 6/9] arm.c: global variable dma_ops is removed from the kernel - 4.7 - -Refer kernel commit 1dccb598df549d892b6450c261da54cdd7af44b4, the global -dma_ops variable and the special-casing for ACPI is removed , and just -returns the dma ops that got set for the device, or the dummy_dma_ops -if none were present. - -Signed-off-by: Madhurkiran Harikrishnan -Upstream Status: Pending ---- - driver/src/devicedrv/mali/platform/arm/arm.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c -index 62f9be6..57ca989 100644 ---- platform/arm/arm.c -+++ b/platform/arm/arm.c -@@ -529,8 +529,9 @@ int mali_platform_device_init(struct platform_device *device) - */ - if (!device->dev.dma_mask) - device->dev.dma_mask = &device->dev.coherent_dma_mask; -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) - device->dev.archdata.dma_ops = dma_ops; -- -+#endif - err = platform_device_add_data(device, &mali_gpu_data, sizeof(mali_gpu_data)); - - if (0 == err) { --- -2.7.4 - 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 @@ -From 58e2c55176f1a146781430b2a570c8ce5f80d426 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Mon, 28 Aug 2017 09:40:37 -0700 -Subject: [PATCH] common/mali_pm.c: Add PM runtime barrier after removing - suspend - -Runtime PM suspend "put" results in addition of PM suspend -API in work queue. This barrier API will remove it from -the work queue. - -Signed-off-by: Madhurkiran Harikrishnan -Upstream-Status: Pending ---- - driver/src/devicedrv/mali/common/mali_pm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/driver/src/devicedrv/mali/common/mali_pm.c b/driver/src/devicedrv/mali/common/mali_pm.c -index 858c689..62a1e5f 100644 ---- common/mali_pm.c -+++ b/common/mali_pm.c -@@ -301,6 +301,7 @@ void mali_pm_init_end(void) - } - - _mali_osk_pm_dev_ref_put(); -+ _mali_osk_pm_dev_barrier(); - } - - void mali_pm_update_sync(void) --- -2.7.4 - 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 @@ -From aeff13ad9e9ef73172a9325f669aefd3c0403dbb Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Wed, 21 Feb 2018 16:52:15 -0800 -Subject: [PATCH] linux/mali_kernel_linux.c: Enable/disable clock for runtime - resume/suspend - -Enable/Disable the clock for GP,PP0 and PP1 during runtime -resume/suspend. - -Signed-off-by: Madhurkiran Harikrishnan -Reviewed-by: Hyun Kwon -Upstream Status: Inappropriate [Xilinx specific] ---- - .../src/devicedrv/mali/linux/mali_kernel_linux.c | 65 ++++++++++++++++++---- - 1 file changed, 54 insertions(+), 11 deletions(-) - -diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c -index f15fb56..e61f33b 100644 ---- linux/mali_kernel_linux.c -+++ b/linux/mali_kernel_linux.c -@@ -51,6 +51,7 @@ - struct clk *clk_gpu; - struct clk *clk_gpu_pp0; - struct clk *clk_gpu_pp1; -+mali_bool clk_enabled; - #endif - - #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS) -@@ -281,6 +282,46 @@ struct file_operations mali_fops = { - .mmap = mali_mmap - }; - -+static int mali_enable_clk(void) -+{ -+#if defined(CONFIG_ARCH_ZYNQMP) -+ int err = 0; -+ -+ if (clk_enabled) -+ return 0; -+ -+ clk_enabled = MALI_TRUE; -+ err = clk_prepare_enable(clk_gpu); -+ if (err) { -+ MALI_PRINT_ERROR(("Could not enable clock for GP\n\r")); -+ return err; -+ } -+ err = clk_prepare_enable(clk_gpu_pp0); -+ if (err) { -+ MALI_PRINT_ERROR(("Could not enable clock for PP0\n\r")); -+ return err; -+ } -+ err = clk_prepare_enable(clk_gpu_pp1); -+ if (err) { -+ MALI_PRINT_ERROR(("Could not enable clock for PP1\n\r")); -+ return err; -+ } -+#endif -+ return 0; -+} -+ -+static void mali_disable_clk(void) -+{ -+#if defined(CONFIG_ARCH_ZYNQMP) -+ if (clk_enabled) { -+ clk_enabled = MALI_FALSE; -+ clk_disable_unprepare(clk_gpu); -+ clk_disable_unprepare(clk_gpu_pp0); -+ clk_disable_unprepare(clk_gpu_pp1); -+ } -+#endif -+} -+ - #if MALI_ENABLE_CPU_CYCLES - void mali_init_cpu_time_counters(int reset, int enable_divide_by_64) - { -@@ -593,18 +634,19 @@ static int mali_probe(struct platform_device *pdev) - clk_gpu = devm_clk_get(&pdev->dev, "gpu"); - if (IS_ERR(clk_gpu)) - return PTR_ERR(clk_gpu); -- clk_prepare_enable(clk_gpu); - - clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); - if (IS_ERR(clk_gpu_pp0)) - return PTR_ERR(clk_gpu_pp0); -- clk_prepare_enable(clk_gpu_pp0); - - clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); - if (IS_ERR(clk_gpu_pp1)) - return PTR_ERR(clk_gpu_pp1); -- clk_prepare_enable(clk_gpu_pp1); - #endif -+ -+ err = mali_enable_clk(); -+ if (err) -+ return err; - if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) { - /* Initialize the Mali GPU HW specified by pdev */ - if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) { -@@ -632,11 +674,6 @@ static int mali_probe(struct platform_device *pdev) - _mali_osk_wq_term(); - } - --#if defined(CONFIG_ARCH_ZYNQMP) -- clk_disable_unprepare(clk_gpu); -- clk_disable_unprepare(clk_gpu_pp0); -- clk_disable_unprepare(clk_gpu_pp1); --#endif - - #ifdef CONFIG_MALI_DEVFREQ - mali_devfreq_term(mdev); -@@ -644,6 +681,7 @@ devfreq_init_failed: - mali_pm_metrics_term(mdev); - pm_metrics_init_failed: - clk_disable_unprepare(mdev->clock); -+ mali_disable_clk(); - clock_prepare_failed: - clk_put(mdev->clock); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && defined(CONFIG_OF) \ -@@ -706,9 +744,7 @@ static int mali_remove(struct platform_device *pdev) - - #if defined(CONFIG_ARCH_ZYNQMP) - /* Remove clock */ -- clk_disable_unprepare(clk_gpu); -- clk_disable_unprepare(clk_gpu_pp0); -- clk_disable_unprepare(clk_gpu_pp1); -+ mali_disable_clk(); - #endif - - return 0; -@@ -816,6 +852,8 @@ static int mali_driver_runtime_suspend(struct device *dev) - devfreq_suspend_device(mdev->devfreq); - #endif - -+ mali_disable_clk(); -+ - return 0; - } else { - return -EBUSY; -@@ -824,6 +862,11 @@ static int mali_driver_runtime_suspend(struct device *dev) - - static int mali_driver_runtime_resume(struct device *dev) - { -+ int err ; -+ -+ err = mali_enable_clk(); -+ if (err) -+ return err; - #ifdef CONFIG_MALI_DEVFREQ - struct mali_device *mdev = dev_get_drvdata(dev); - if (!mdev) --- -2.7.4 - 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 @@ -From 779b1883d56804ecd08fe7f57d6c01e3db4e893b Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Wed, 5 Dec 2018 18:07:29 -0800 -Subject: [PATCH 1/3] linux: mali_memory_os_alloc: Remove __GFP_COLD - -The support for Cache hot and cold pages are removed from the kernel. -For more information refer kernel commit 453f85d43fa9ee243f0fc3ac4e1be45615301e3f - -Signed-off-by: Madhurkiran Harikrishnan -Reviewed-by: Hyun Kwon -Upstream Status: Pending ---- - driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c -index 1602371..830e8c6 100644 ---- linux/mali_memory_os_alloc.c -+++ b/linux/mali_memory_os_alloc.c -@@ -202,7 +202,9 @@ int mali_mem_os_alloc_pages(mali_mem_os_mem *os_mem, u32 size) - /* Allocate new pages, if needed. */ - for (i = 0; i < remaining; i++) { - dma_addr_t dma_addr; --#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) -+ gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN; -+#elif LINUX_VERSION_CODE == KERNEL_VERSION(4, 14, 0) - gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | __GFP_COLD; - #else - gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD; --- -2.7.4 - 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 @@ -From d20b6eb3e48e56558488dbdda98875b1aed0c29f Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Wed, 5 Dec 2018 18:13:28 -0800 -Subject: [PATCH 2/3] linux: mali_memory_secure: Add header file dma-direct.h - -Add dma-direct.h header, as API dma_to_phys is defined here. -refer kernel commit ea8c64ace86647260ec4255f483e5844d62af2df - -Signed-off-by: Madhurkiran Harikrishnan -Reviewed-by: Hyun Kwon -Upstream Status: Pending ---- - driver/src/devicedrv/mali/linux/mali_memory_secure.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c -index 2836b1b..4f55fa5 100644 ---- linux/mali_memory_secure.c -+++ b/linux/mali_memory_secure.c -@@ -13,7 +13,11 @@ - #include "mali_memory_secure.h" - #include "mali_osk.h" - #include -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0) -+#include -+#else - #include -+#endif - #include - - _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd) --- -2.7.4 - 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 @@ -From b6936450484b5aa9dd2438367a907af020341d1d Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Thu, 6 Dec 2018 13:30:44 -0800 -Subject: [PATCH 3/3] linux: mali_*timer: Get rid of init_timer - -kernel 4.19 got rid of ancient init_timer. Hence, replace it with -timer_setup API. For more information refer kernel commit -7eeb6b893bd28c68b6d664de1d3120e49b855cdb - -Signed-off-by: Madhurkiran Harikrishnan -Reviewed-by: Hyun Kwon -Upstream Status: Pending ---- - driver/src/devicedrv/mali/common/mali_control_timer.c | 6 ++++++ - driver/src/devicedrv/mali/common/mali_group.c | 6 ++++++ - driver/src/devicedrv/mali/common/mali_osk.h | 15 ++++++++++++++- - driver/src/devicedrv/mali/linux/mali_osk_timers.c | 15 ++++++++++++++- - 4 files changed, 40 insertions(+), 2 deletions(-) - -diff --git a/driver/src/devicedrv/mali/common/mali_control_timer.c b/driver/src/devicedrv/mali/common/mali_control_timer.c -index 1296ffe..d24b934 100644 ---- common/mali_control_timer.c -+++ b/common/mali_control_timer.c -@@ -65,11 +65,17 @@ _mali_osk_errcode_t mali_control_timer_init(void) - } - } - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+ mali_control_timer = _mali_osk_timer_init(mali_control_timer_callback); -+#else - mali_control_timer = _mali_osk_timer_init(); -+#endif - if (NULL == mali_control_timer) { - return _MALI_OSK_ERR_FAULT; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) - _mali_osk_timer_setcallback(mali_control_timer, mali_control_timer_callback, NULL); -+#endif - - return _MALI_OSK_ERR_OK; - } -diff --git a/driver/src/devicedrv/mali/common/mali_group.c b/driver/src/devicedrv/mali/common/mali_group.c -index 5c7b3f4..1702e9a 100644 ---- common/mali_group.c -+++ b/common/mali_group.c -@@ -65,9 +65,15 @@ struct mali_group *mali_group_create(struct mali_l2_cache_core *core, - - group = _mali_osk_calloc(1, sizeof(struct mali_group)); - if (NULL != group) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+ group->timeout_timer = _mali_osk_timer_init(mali_group_timeout); -+#else - group->timeout_timer = _mali_osk_timer_init(); -+#endif - if (NULL != group->timeout_timer) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) - _mali_osk_timer_setcallback(group->timeout_timer, mali_group_timeout, (void *)group); -+#endif - - group->l2_cache_core[0] = core; - _mali_osk_list_init(&group->group_list); -diff --git a/driver/src/devicedrv/mali/common/mali_osk.h b/driver/src/devicedrv/mali/common/mali_osk.h -index a501778..fe93d79 100644 ---- common/mali_osk.h -+++ b/common/mali_osk.h -@@ -947,7 +947,17 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_ - * asked for. - * - * @{ */ -- -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+/** @brief Initialize a timer -+ * -+ * Allocates resources for a new timer, and initializes them. This does not -+ * start the timer. -+ * -+ * @param callback Function to call when timer expires -+ * @return a pointer to the allocated timer object, or NULL on failure. -+ */ -+_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback); -+#else - /** @brief Initialize a timer - * - * Allocates resources for a new timer, and initializes them. This does not -@@ -956,6 +966,7 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_ - * @return a pointer to the allocated timer object, or NULL on failure. - */ - _mali_osk_timer_t *_mali_osk_timer_init(void); -+#endif - - /** @brief Start a timer - * -@@ -1034,6 +1045,7 @@ void _mali_osk_timer_del_async(_mali_osk_timer_t *tim); - */ - mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim); - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) - /** @brief Set a timer's callback parameters. - * - * This must be called at least once before a timer is started/modified. -@@ -1047,6 +1059,7 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim); - * @param data Function-specific data to supply to the function on expiry. - */ - void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data); -+#endif - - /** @brief Terminate a timer, and deallocate resources. - * -diff --git a/driver/src/devicedrv/mali/linux/mali_osk_timers.c b/driver/src/devicedrv/mali/linux/mali_osk_timers.c -index e5d7238..f9b5a86 100644 ---- linux/mali_osk_timers.c -+++ b/linux/mali_osk_timers.c -@@ -21,13 +21,24 @@ - struct _mali_osk_timer_t_struct { - struct timer_list timer; - }; -- -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+typedef void (*timer_timeout_function_t)(struct timer_list *); -+#else - typedef void (*timer_timeout_function_t)(unsigned long); -+#endif - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback) -+#else - _mali_osk_timer_t *_mali_osk_timer_init(void) -+#endif - { - _mali_osk_timer_t *t = (_mali_osk_timer_t *)kmalloc(sizeof(_mali_osk_timer_t), GFP_KERNEL); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) -+ if (NULL != t) timer_setup(&t->timer, (timer_timeout_function_t)callback, 0); -+#else - if (NULL != t) init_timer(&t->timer); -+#endif - return t; - } - -@@ -62,12 +73,14 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim) - return 1 == timer_pending(&(tim->timer)); - } - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) - void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data) - { - MALI_DEBUG_ASSERT_POINTER(tim); - tim->timer.data = (unsigned long)data; - tim->timer.function = (timer_timeout_function_t)callback; - } -+#endif - - void _mali_osk_timer_term(_mali_osk_timer_t *tim) - { --- -2.7.4 - 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 @@ -Index: mali/linux/mali_memory_os_alloc.c -=================================================================== ---- mali.orig/linux/mali_memory_os_alloc.c -+++ mali/linux/mali_memory_os_alloc.c -@@ -239,8 +239,10 @@ int mali_mem_os_alloc_pages(mali_mem_os_ - /* Ensure page is flushed from CPU caches. */ - dma_addr = dma_map_page(&mali_platform_device->dev, new_page, - 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); -- dma_unmap_page(&mali_platform_device->dev, dma_addr, -- _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); -+ err = dma_mapping_error(&mali_platform_device->dev, dma_addr); -+ if (likely(!err)) -+ dma_unmap_page(&mali_platform_device->dev, dma_addr, -+ _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); - dma_addr = dma_map_page(&mali_platform_device->dev, new_page, - 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); - 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 @@ -From 8cf1dd43f3f25cb4afb84dfc3b0e7c02bc8f7f0c Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Mon, 24 Feb 2020 18:19:37 -0800 -Subject: [LINUX][rel-v2020.1][PATCH v1 1/3] mali_memory_secure: Kernel 5.0 - onwards 'access_ok' API does not take 'type' as input parameter - -'access_ok' no longer needs 'type' as input paramter from kernel 5.0 -onwards. - -Signed-off-by: Madhurkiran Harikrishnan ---- - driver/src/devicedrv/mali/linux/mali_ukk_mem.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/driver/src/devicedrv/mali/linux/mali_ukk_mem.c b/driver/src/devicedrv/mali/linux/mali_ukk_mem.c -index 4ec57dc..270bb6d 100644 ---- linux/mali_ukk_mem.c -+++ b/linux/mali_ukk_mem.c -@@ -207,8 +207,13 @@ int mem_write_safe_wrapper(struct mali_session_data *session_data, _mali_uk_mem_ - kargs.ctx = (uintptr_t)session_data; - - /* Check if we can access the buffers */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) -+ if (!access_ok((const void __user *)kargs.dest, kargs.size) -+ || !access_ok((const void __user *)kargs.src, kargs.size)) { -+#else - if (!access_ok(VERIFY_WRITE, kargs.dest, kargs.size) - || !access_ok(VERIFY_READ, kargs.src, kargs.size)) { -+#endif - return -EINVAL; - } - -@@ -266,7 +271,11 @@ int mem_dump_mmu_page_table_wrapper(struct mali_session_data *session_data, _mal - goto err_exit; - - user_buffer = (void __user *)(uintptr_t)kargs.buffer; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) -+ if (!access_ok(user_buffer, kargs.size)) -+#else - if (!access_ok(VERIFY_WRITE, user_buffer, kargs.size)) -+#endif - goto err_exit; - - /* allocate temporary buffer (kernel side) to store mmu page table info */ --- -2.7.4 - 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 @@ -From 953cab73b8bc487da330aa454abd7f8c7466737e Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Mon, 24 Feb 2020 18:32:16 -0800 -Subject: [LINUX][rel-v2020.1][PATCH v1 2/3] Support for vm_insert_pfn - deprecated from kernel 4.20 - -From kernel 4.20 onwards, support for vm_insert_pfn is deprecated. -Hence, replace the same with vmf_insert_pfn. - -Signed-off-by: Madhurkiran Harikrishnan ---- - .../devicedrv/mali/linux/mali_memory_block_alloc.c | 6 +++++- - driver/src/devicedrv/mali/linux/mali_memory_cow.c | 14 ++++++++++++-- - .../src/devicedrv/mali/linux/mali_memory_os_alloc.c | 20 +++++++++++++++++--- - driver/src/devicedrv/mali/linux/mali_memory_secure.c | 7 ++++++- - 4 files changed, 40 insertions(+), 7 deletions(-) - -diff --git a/driver/src/devicedrv/mali/linux/mali_memory_block_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_block_alloc.c -index 0c5b6c3..e528699 100644 ---- linux/mali_memory_block_alloc.c -+++ b/linux/mali_memory_block_alloc.c -@@ -309,9 +309,13 @@ int mali_mem_block_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *v - - list_for_each_entry(m_page, &block_mem->pfns, list) { - MALI_DEBUG_ASSERT(m_page->type == MALI_PAGE_NODE_BLOCK); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); -- - if (unlikely(0 != ret)) { -+#endif - return -EFAULT; - } - addr += _MALI_OSK_MALI_PAGE_SIZE; -diff --git a/driver/src/devicedrv/mali/linux/mali_memory_cow.c b/driver/src/devicedrv/mali/linux/mali_memory_cow.c -index f1d44fe..1dae1d6 100644 ---- linux/mali_memory_cow.c -+++ b/linux/mali_memory_cow.c -@@ -532,9 +532,14 @@ int mali_mem_cow_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma - * flush which makes it way slower than remap_pfn_range or vm_insert_pfn. - ret = vm_insert_page(vma, addr, page); - */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); -- - if (unlikely(0 != ret)) { -+#endif -+ - return ret; - } - addr += _MALI_OSK_MALI_PAGE_SIZE; -@@ -569,9 +574,14 @@ _mali_osk_errcode_t mali_mem_cow_cpu_map_pages_locked(mali_mem_backend *mem_bken - - list_for_each_entry(m_page, &cow->pages, list) { - if ((count >= offset) && (count < offset + num)) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, vaddr, _mali_page_node_get_pfn(m_page)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, vaddr, _mali_page_node_get_pfn(m_page)); -- - if (unlikely(0 != ret)) { -+#endif -+ - if (count == offset) { - return _MALI_OSK_ERR_FAULT; - } else { -diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c -index 3fb6f05..7de3920 100644 ---- linux/mali_memory_os_alloc.c -+++ b/linux/mali_memory_os_alloc.c -@@ -378,9 +378,14 @@ int mali_mem_os_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma) - ret = vm_insert_page(vma, addr, page); - */ - page = m_page->page; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, addr, page_to_pfn(page)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, addr, page_to_pfn(page)); -- - if (unlikely(0 != ret)) { -+#endif -+ - return -EFAULT; - } - addr += _MALI_OSK_MALI_PAGE_SIZE; -@@ -416,9 +421,13 @@ _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bken - - vm_end -= _MALI_OSK_MALI_PAGE_SIZE; - if (mapping_page_num > 0) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, vm_end, page_to_pfn(m_page->page)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, vm_end, page_to_pfn(m_page->page)); -- - if (unlikely(0 != ret)) { -+#endif - /*will return -EBUSY If the page has already been mapped into table, but it's OK*/ - if (-EBUSY == ret) { - break; -@@ -439,9 +448,14 @@ _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bken - list_for_each_entry(m_page, &os_mem->pages, list) { - if (count >= offset) { - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, vstart, page_to_pfn(m_page->page)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, vstart, page_to_pfn(m_page->page)); -- - if (unlikely(0 != ret)) { -+#endif -+ - /*will return -EBUSY If the page has already been mapped into table, but it's OK*/ - if (-EBUSY == ret) { - break; -diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c -index 5546304..cebd1c8 100644 ---- linux/mali_memory_secure.c -+++ b/linux/mali_memory_secure.c -@@ -132,9 +132,14 @@ int mali_mem_secure_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct * - MALI_DEBUG_ASSERT(0 == size % _MALI_OSK_MALI_PAGE_SIZE); - - for (j = 0; j < size / _MALI_OSK_MALI_PAGE_SIZE; j++) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ ret = vmf_insert_pfn(vma, addr, PFN_DOWN(phys)); -+ if (unlikely(VM_FAULT_ERROR & ret)) { -+#else - ret = vm_insert_pfn(vma, addr, PFN_DOWN(phys)); -- - if (unlikely(0 != ret)) { -+#endif -+ - return -EFAULT; - } - addr += _MALI_OSK_MALI_PAGE_SIZE; --- -2.7.4 - 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 @@ -From ad5c569f0cc40698699fc2f2c1db3ceb9f8b8f35 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Tue, 25 Feb 2020 11:36:01 -0800 -Subject: [LINUX][rel-v2020.1][PATCH v1 3/3] Change return type to vm_fault_t - for fault handler - -From kernel 4.17 onwards the return type of fault handler for -vm_operations is of type 'vm_fault_t'. - -Signed-off-by: Madhurkiran Harikrishnan ---- - driver/src/devicedrv/mali/linux/mali_memory.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/driver/src/devicedrv/mali/linux/mali_memory.c b/driver/src/devicedrv/mali/linux/mali_memory.c -index c0f0982..2b2b209 100644 ---- linux/mali_memory.c -+++ b/linux/mali_memory.c -@@ -70,7 +70,9 @@ static void mali_mem_vma_close(struct vm_area_struct *vma) - } - } - --#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) -+static vm_fault_t mali_mem_vma_fault(struct vm_fault *vmf) -+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) - static int mali_mem_vma_fault(struct vm_fault *vmf) - #else - static int mali_mem_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) --- -2.7.4 - 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 @@ -From c6a6b39cea3fdfd91cae7f2a4ef6f36d2c55fdd6 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Tue, 25 Feb 2020 15:17:17 -0800 -Subject: [LINUX][rel-v2020.1][PATCH v1] "get_monotonic_boottime(&ts)" - deprecated from kernel 4.20 onwards - -As "get_monotonic_boottime(&ts)" is deprecated, replace the same with -"ktime_get_boottime_ts64(&ts)". Refer kernel commit ID -976516404ff3fab2a8caa8bd6f5efc1437fed0b8 - -Signed-off-by: Madhurkiran Harikrishnan ---- - driver/src/devicedrv/mali/linux/mali_osk_time.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/driver/src/devicedrv/mali/linux/mali_osk_time.c b/driver/src/devicedrv/mali/linux/mali_osk_time.c -index 03046a5..bfcbf7f 100644 ---- linux/mali_osk_time.c -+++ b/linux/mali_osk_time.c -@@ -53,7 +53,13 @@ u64 _mali_osk_time_get_ns(void) - - u64 _mali_osk_boot_time_get_ns(void) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) -+ struct timespec64 tsval; -+ ktime_get_boottime_ts64(&tsval); -+ return (u64)timespec64_to_ns(&tsval); -+#else - struct timespec tsval; - get_monotonic_boottime(&tsval); - return (u64)timespec_to_ns(&tsval); -+#endif - } --- -2.7.4 - 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 @@ -From cbc2351e8acf7ed38f6d965e5ea21620e45eda30 Mon Sep 17 00:00:00 2001 -From: Dylan Yip -Date: Tue, 9 Feb 2021 10:05:41 -0800 -Subject: [PATCH 20/23] Fix ioremap_nocache() deprecation in kernel 5.6 - -As of commit 4bdc0d676a643140 ("remove ioremap_nocache and -devm_ioremap_nocache") from kernel 5.6, ioremap_nocache has been -removed because ioremap is already non-cached by default. So replace all -calls with ioremap. - -Signed-off-by: Dylan Yip ---- - linux/mali_memory_cow.c | 4 ++++ - linux/mali_osk_low_level_mem.c | 4 ++++ - platform/arm/arm.c | 12 ++++++++++++ - 3 files changed, 20 insertions(+) - -diff --git a/linux/mali_memory_cow.c b/linux/mali_memory_cow.c -index 1dae1d6..6fadd42 100644 ---- a/linux/mali_memory_cow.c -+++ b/linux/mali_memory_cow.c -@@ -693,7 +693,11 @@ void _mali_mem_cow_copy_page(mali_page_node *src_node, mali_page_node *dst_node) - /* - * use ioremap to map src for BLOCK memory - */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ src = ioremap(_mali_page_node_get_dma_addr(src_node), _MALI_OSK_MALI_PAGE_SIZE); -+#else - src = ioremap_nocache(_mali_page_node_get_dma_addr(src_node), _MALI_OSK_MALI_PAGE_SIZE); -+#endif - memcpy(dst, src , _MALI_OSK_MALI_PAGE_SIZE); - iounmap(src); - } -diff --git a/linux/mali_osk_low_level_mem.c b/linux/mali_osk_low_level_mem.c -index 84f93d9..5a0a725 100644 ---- a/linux/mali_osk_low_level_mem.c -+++ b/linux/mali_osk_low_level_mem.c -@@ -33,7 +33,11 @@ void _mali_osk_write_mem_barrier(void) - - mali_io_address _mali_osk_mem_mapioregion(uintptr_t phys, u32 size, const char *description) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ return (mali_io_address)ioremap(phys, size); -+#else - return (mali_io_address)ioremap_nocache(phys, size); -+#endif - } - - void _mali_osk_mem_unmapioregion(uintptr_t phys, u32 size, mali_io_address virt) -diff --git a/platform/arm/arm.c b/platform/arm/arm.c -index b2fb746..e468263 100644 ---- a/platform/arm/arm.c -+++ b/platform/arm/arm.c -@@ -98,7 +98,11 @@ static int mali_secure_mode_init_juno(void) - - MALI_DEBUG_ASSERT(NULL == secure_mode_mapped_addr); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ secure_mode_mapped_addr = ioremap(phys_addr_page, map_size); -+#else - secure_mode_mapped_addr = ioremap_nocache(phys_addr_page, map_size); -+#endif - if (NULL != secure_mode_mapped_addr) { - return mali_gpu_reset_and_secure_mode_disable_juno(); - } -@@ -588,7 +592,11 @@ static u32 mali_read_phys(u32 phys_addr) - u32 phys_offset = phys_addr & 0x00001FFF; - u32 map_size = phys_offset + sizeof(u32); - u32 ret = 0xDEADBEEF; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ void *mem_mapped = ioremap(phys_addr_page, map_size); -+#else - void *mem_mapped = ioremap_nocache(phys_addr_page, map_size); -+#endif - if (NULL != mem_mapped) { - ret = (u32)ioread32(((u8 *)mem_mapped) + phys_offset); - iounmap(mem_mapped); -@@ -604,7 +612,11 @@ static void mali_write_phys(u32 phys_addr, u32 value) - u32 phys_addr_page = phys_addr & 0xFFFFE000; - u32 phys_offset = phys_addr & 0x00001FFF; - u32 map_size = phys_offset + sizeof(u32); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ void *mem_mapped = ioremap(phys_addr_page, map_size); -+#else - void *mem_mapped = ioremap_nocache(phys_addr_page, map_size); -+#endif - if (NULL != mem_mapped) { - iowrite32(value, ((u8 *)mem_mapped) + phys_offset); - iounmap(mem_mapped); --- -2.17.1 - 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 @@ -From bc0f85271681532c7e394229f0155366d1de8779 Mon Sep 17 00:00:00 2001 -From: Dylan Yip -Date: Mon, 8 Feb 2021 23:47:01 -0800 -Subject: [PATCH 21/23] Use updated timekeeping functions in kernel 5.6 - -As of commit 412c53a680a9 ("y2038: remove unused time32 interfaces"), 32 -bit timekeeping functions like getnstimeofday() have been removed. So -use the 64 bit replacements. - -Signed-off-by: Dylan Yip ---- - linux/mali_osk_time.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/linux/mali_osk_time.c b/linux/mali_osk_time.c -index bfcbf7f..583d82b 100644 ---- a/linux/mali_osk_time.c -+++ b/linux/mali_osk_time.c -@@ -46,9 +46,15 @@ void _mali_osk_time_ubusydelay(u32 usecs) - - u64 _mali_osk_time_get_ns(void) - { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+ struct timespec64 tsval; -+ ktime_get_real_ts64(&tsval); -+ return (u64)timespec64_to_ns(&tsval); -+#else - struct timespec tsval; - getnstimeofday(&tsval); - return (u64)timespec_to_ns(&tsval); -+#endif - } - - u64 _mali_osk_boot_time_get_ns(void) --- -2.17.1 - 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 @@ -From d17933b6909cc29103befc2ef4e6cf413d9e8fb6 Mon Sep 17 00:00:00 2001 -From: Dylan Yip -Date: Tue, 9 Feb 2021 08:58:44 -0800 -Subject: [PATCH 22/23] Set HAVE_UNLOCKED_IOCTL default to true - -As of commit b19dd42faf41 ("bkl: Remove locked .ioctl file operation") -of kernel 2.6, the ioctl operation has been replaced with -unlocked_ioctl. Since this change has been around for almost 10 years, -go ahead and set the default HAVE_UNLOCKED_IOCTL to be true. - -Signed-off-by: Dylan Yip ---- - Kbuild | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Kbuild b/Kbuild -index 02c3f3d..8c6e6e0 100644 ---- a/Kbuild -+++ b/Kbuild -@@ -21,6 +21,7 @@ MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 0 - MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 0 - MALI_UPPER_HALF_SCHEDULING ?= 1 - MALI_ENABLE_CPU_CYCLES ?= 0 -+HAVE_UNLOCKED_IOCTL ?= 1 - - # For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases: - # The ARM proprietary product will only include the license/proprietary directory -@@ -179,6 +180,7 @@ ccflags-y += -DMALI_STATE_TRACKING=1 - ccflags-y += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB) - ccflags-y += -DUSING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION) - ccflags-y += -DMALI_ENABLE_CPU_CYCLES=$(MALI_ENABLE_CPU_CYCLES) -+ccflags-y += -DHAVE_UNLOCKED_IOCTL=$(HAVE_UNLOCKED_IOCTL) - - ifeq ($(MALI_UPPER_HALF_SCHEDULING),1) - ccflags-y += -DMALI_UPPER_HALF_SCHEDULING --- -2.17.1 - 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 @@ -From e2b52e358e0e030d3881ef80ef09de3662b41210 Mon Sep 17 00:00:00 2001 -From: Dylan Yip -Date: Tue, 9 Feb 2021 09:48:01 -0800 -Subject: [PATCH 23/23] Use PTR_ERR_OR_ZERO instead of PTR_RET - -As of commit fad7c9020948 ("err.h: remove deprecated PTR_RET for good") -in kernel 5.7, PTR_RET has been removed and replaced with -PTR_ERR_OR_ZERO. So use this API instead. - -Signed-off-by: Dylan Yip ---- - linux/mali_memory_dma_buf.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c -index 905cd8b..fcdcaac 100644 ---- a/linux/mali_memory_dma_buf.c -+++ b/linux/mali_memory_dma_buf.c -@@ -281,7 +281,11 @@ int mali_dma_buf_get_size(struct mali_session_data *session, _mali_uk_dma_buf_ge - buf = dma_buf_get(fd); - if (IS_ERR_OR_NULL(buf)) { - MALI_DEBUG_PRINT_ERROR(("Failed to get dma-buf from fd: %d\n", fd)); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) -+ return PTR_ERR_OR_ZERO(buf); -+#else - return PTR_RET(buf); -+#endif - } - - if (0 != put_user(buf->size, &user_arg->size)) { --- -2.17.1 - 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 @@ -Use the community device-tree names - -The community LIMA driver uses a series of names that are different then -the legacy Xilinx names. Moves from the legacy names to the more standard -names. - -This will allow us to have a single device tree that works with both the -mali driver, as well as the lima driver. - -Interrupt-names: - IRQGP -> gp - IRQGPMMU -> gpmmu - IRQPP0 -> pp0 - IRQPPMMU0 -> ppmmu0 - IRQPP1 -> pp1 - IRQPPMMU1 -> ppmmu1 - ... - -Clock-names: - gpu_pp0 -> core - gpu_pp1 -> bus - -Signed-off-by: Mark Hatle - -diff -ur a/linux/mali_kernel_linux.c b/linux/mali_kernel_linux.c ---- a/linux/mali_kernel_linux.c 2018-09-17 04:04:48.000000000 -0700 -+++ b/linux/mali_kernel_linux.c 2022-10-24 14:01:54.614376177 -0700 -@@ -635,11 +635,11 @@ - if (IS_ERR(clk_gpu)) - return PTR_ERR(clk_gpu); - -- clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); -+ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "core"); - if (IS_ERR(clk_gpu_pp0)) - return PTR_ERR(clk_gpu_pp0); - -- clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); -+ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "bus"); - if (IS_ERR(clk_gpu_pp1)) - return PTR_ERR(clk_gpu_pp1); - #endif -diff -ur a/linux/mali_osk_mali.c b/linux/mali_osk_mali.c ---- a/linux/mali_osk_mali.c 2018-09-12 23:52:20.000000000 -0700 -+++ b/linux/mali_osk_mali.c 2022-10-24 14:00:28.470380512 -0700 -@@ -72,26 +72,26 @@ - #define MALI_OSK_RESOURCE_DMA_LOCATION 26 - - static _mali_osk_resource_t mali_osk_resource_bank[MALI_OSK_MAX_RESOURCE_NUMBER] = { -- {.description = "Mali_GP", .base = MALI_OFFSET_GP, .irq_name = "IRQGP",}, -- {.description = "Mali_GP_MMU", .base = MALI_OFFSET_GP_MMU, .irq_name = "IRQGPMMU",}, -- {.description = "Mali_PP0", .base = MALI_OFFSET_PP0, .irq_name = "IRQPP0",}, -- {.description = "Mali_PP0_MMU", .base = MALI_OFFSET_PP0_MMU, .irq_name = "IRQPPMMU0",}, -- {.description = "Mali_PP1", .base = MALI_OFFSET_PP1, .irq_name = "IRQPP1",}, -- {.description = "Mali_PP1_MMU", .base = MALI_OFFSET_PP1_MMU, .irq_name = "IRQPPMMU1",}, -- {.description = "Mali_PP2", .base = MALI_OFFSET_PP2, .irq_name = "IRQPP2",}, -- {.description = "Mali_PP2_MMU", .base = MALI_OFFSET_PP2_MMU, .irq_name = "IRQPPMMU2",}, -- {.description = "Mali_PP3", .base = MALI_OFFSET_PP3, .irq_name = "IRQPP3",}, -- {.description = "Mali_PP3_MMU", .base = MALI_OFFSET_PP3_MMU, .irq_name = "IRQPPMMU3",}, -- {.description = "Mali_PP4", .base = MALI_OFFSET_PP4, .irq_name = "IRQPP4",}, -- {.description = "Mali_PP4_MMU", .base = MALI_OFFSET_PP4_MMU, .irq_name = "IRQPPMMU4",}, -- {.description = "Mali_PP5", .base = MALI_OFFSET_PP5, .irq_name = "IRQPP5",}, -- {.description = "Mali_PP5_MMU", .base = MALI_OFFSET_PP5_MMU, .irq_name = "IRQPPMMU5",}, -- {.description = "Mali_PP6", .base = MALI_OFFSET_PP6, .irq_name = "IRQPP6",}, -- {.description = "Mali_PP6_MMU", .base = MALI_OFFSET_PP6_MMU, .irq_name = "IRQPPMMU6",}, -- {.description = "Mali_PP7", .base = MALI_OFFSET_PP7, .irq_name = "IRQPP7",}, -- {.description = "Mali_PP7_MMU", .base = MALI_OFFSET_PP7_MMU, .irq_name = "IRQPPMMU",}, -- {.description = "Mali_PP_Broadcast", .base = MALI_OFFSET_PP_BCAST, .irq_name = "IRQPP",}, -- {.description = "Mali_PMU", .base = MALI_OFFSET_PMU, .irq_name = "IRQPMU",}, -+ {.description = "Mali_GP", .base = MALI_OFFSET_GP, .irq_name = "gp",}, -+ {.description = "Mali_GP_MMU", .base = MALI_OFFSET_GP_MMU, .irq_name = "gpmmu",}, -+ {.description = "Mali_PP0", .base = MALI_OFFSET_PP0, .irq_name = "pp0",}, -+ {.description = "Mali_PP0_MMU", .base = MALI_OFFSET_PP0_MMU, .irq_name = "ppmmu0",}, -+ {.description = "Mali_PP1", .base = MALI_OFFSET_PP1, .irq_name = "pp1",}, -+ {.description = "Mali_PP1_MMU", .base = MALI_OFFSET_PP1_MMU, .irq_name = "ppmmu1",}, -+ {.description = "Mali_PP2", .base = MALI_OFFSET_PP2, .irq_name = "pp2",}, -+ {.description = "Mali_PP2_MMU", .base = MALI_OFFSET_PP2_MMU, .irq_name = "ppmmu2",}, -+ {.description = "Mali_PP3", .base = MALI_OFFSET_PP3, .irq_name = "pp3",}, -+ {.description = "Mali_PP3_MMU", .base = MALI_OFFSET_PP3_MMU, .irq_name = "ppmmu3",}, -+ {.description = "Mali_PP4", .base = MALI_OFFSET_PP4, .irq_name = "pp4",}, -+ {.description = "Mali_PP4_MMU", .base = MALI_OFFSET_PP4_MMU, .irq_name = "ppmmu4",}, -+ {.description = "Mali_PP5", .base = MALI_OFFSET_PP5, .irq_name = "pp5",}, -+ {.description = "Mali_PP5_MMU", .base = MALI_OFFSET_PP5_MMU, .irq_name = "ppmmu5",}, -+ {.description = "Mali_PP6", .base = MALI_OFFSET_PP6, .irq_name = "pp6",}, -+ {.description = "Mali_PP6_MMU", .base = MALI_OFFSET_PP6_MMU, .irq_name = "ppmmu6",}, -+ {.description = "Mali_PP7", .base = MALI_OFFSET_PP7, .irq_name = "pp7",}, -+ {.description = "Mali_PP7_MMU", .base = MALI_OFFSET_PP7_MMU, .irq_name = "ppmmu",}, -+ {.description = "Mali_PP_Broadcast", .base = MALI_OFFSET_PP_BCAST, .irq_name = "pp",}, -+ {.description = "Mali_PMU", .base = MALI_OFFSET_PMU, .irq_name = "pmu",}, - {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE0,}, - {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE1,}, - {.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 @@ -From d4fcb32f8dc85d01c6e0dc8e5d85c7ed43f0866c Mon Sep 17 00:00:00 2001 -From: Yash Ladani -Date: Tue, 6 Dec 2022 00:52:53 -0800 -Subject: [PATCH] Import DMA_BUF module and update register_shrinker function - for kernel 5.16 or higher - -Added MODULE_IMPORT_NS(DMA_BUF) for kernel version 5.16 or higher. -register_shrinker function call now requires two arguments -for kernel 5.16 or higher updated this function call. - -Signed-off-by: Yash Ladani ---- - linux/mali_memory_dma_buf.c | 4 ++++ - linux/mali_memory_os_alloc.c | 5 ++++- - linux/mali_memory_secure.c | 4 ++++ - 3 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c -index fcdcaac..72e28a8 100644 ---- a/linux/mali_memory_dma_buf.c -+++ b/linux/mali_memory_dma_buf.c -@@ -34,6 +34,10 @@ - #include "mali_memory_virtual.h" - #include "mali_pp_job.h" - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) -+MODULE_IMPORT_NS(DMA_BUF); -+#endif -+ - /* - * Map DMA buf attachment \a mem into \a session at virtual address \a virt. - */ -diff --git a/linux/mali_memory_os_alloc.c b/linux/mali_memory_os_alloc.c -index 7de3920..5bf08f8 100644 ---- a/linux/mali_memory_os_alloc.c -+++ b/linux/mali_memory_os_alloc.c -@@ -801,8 +801,11 @@ _mali_osk_errcode_t mali_mem_os_init(void) - dma_set_attr(DMA_ATTR_WRITE_COMBINE, &dma_attrs_wc); - #endif - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) -+ register_shrinker(&mali_mem_os_allocator.shrinker, "mali"); -+#else - register_shrinker(&mali_mem_os_allocator.shrinker); -- -+#endif - return _MALI_OSK_ERR_OK; - } - -diff --git a/linux/mali_memory_secure.c b/linux/mali_memory_secure.c -index cebd1c8..a9d932f 100644 ---- a/linux/mali_memory_secure.c -+++ b/linux/mali_memory_secure.c -@@ -20,6 +20,10 @@ - #endif - #include - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) -+MODULE_IMPORT_NS(DMA_BUF); -+#endif -+ - _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd) - { - struct dma_buf *buf; --- -2.17.1 - 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 @@ -From d7a56b7bdf1ea34194fe86639cc318d7a33b9abb Mon Sep 17 00:00:00 2001 -From: Parth Gajjar -Date: Thu, 12 Jan 2023 06:00:20 -0800 -Subject: [PATCH] Fix gpu driver probe failure - -In patch a1a2b7125e1079cfcc13a116aa3af3df2f9e002b -(Drop static setup of IRQ resource from DT core) platform_get_resource() -stopped from returning the IRQ, as all drivers were supposed to have -switched to platform_get_irq(). -Using platform_get_irq_optional() to avoid printing error messages -for interrupts not found. - -Signed-off-by: Parth Gajjar ---- - linux/mali_osk_mali.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/linux/mali_osk_mali.c b/linux/mali_osk_mali.c -index c22758d..3f66132 100644 ---- a/linux/mali_osk_mali.c -+++ b/linux/mali_osk_mali.c -@@ -113,7 +113,7 @@ static int _mali_osk_get_compatible_name(const char **out_string) - _mali_osk_errcode_t _mali_osk_resource_initialize(void) - { - mali_bool mali_is_450 = MALI_FALSE, mali_is_470 = MALI_FALSE; -- int i, pp_core_num = 0, l2_core_num = 0; -+ int i, pp_core_num = 0, l2_core_num = 0, irq = 0; - struct resource *res; - const char *compatible_name = NULL; - -@@ -128,9 +128,9 @@ _mali_osk_errcode_t _mali_osk_resource_initialize(void) - } - - for (i = 0; i < MALI_OSK_RESOURCE_WITH_IRQ_NUMBER; i++) { -- res = platform_get_resource_byname(mali_platform_device, IORESOURCE_IRQ, mali_osk_resource_bank[i].irq_name); -- if (res) { -- mali_osk_resource_bank[i].irq = res->start; -+ irq = platform_get_irq_byname_optional(mali_platform_device, mali_osk_resource_bank[i].irq_name); -+ if (irq > 0) { -+ mali_osk_resource_bank[i].irq = irq; - } else { - mali_osk_resource_bank[i].base = MALI_OSK_INVALID_RESOURCE_ADDRESS; - } --- -2.17.1 - 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 @@ -From a64707b7fea40d326c5b18636a41a5994f60048d Mon Sep 17 00:00:00 2001 -From: Parth Gajjar -Date: Fri, 24 Feb 2023 05:11:38 -0800 -Subject: [PATCH] Updated clock name and structure to match LIMA driver - -Clock-names: - gpu -> bus - gpu_pp0,gpu_pp1 -> core - -This will allow us to have a single device tree that works with both the -mali driver, as well as the lima driver. - -Signed-off-by: Parth Gajjar ---- - linux/mali_kernel_linux.c | 37 +++++++------------ - 1 file changed, 13 insertions(+), 24 deletions(-) - -diff --git a/linux/mali_kernel_linux.c b/linux/mali_kernel_linux.c -index ad450b4..050af67 100644 ---- a/linux/mali_kernel_linux.c -+++ b/linux/mali_kernel_linux.c -@@ -48,9 +48,8 @@ - - #if defined(CONFIG_ARCH_ZYNQMP) - /* Initialize variables for clocks */ --struct clk *clk_gpu; --struct clk *clk_gpu_pp0; --struct clk *clk_gpu_pp1; -+struct clk *clk_bus; -+struct clk *clk_core; - mali_bool clk_enabled; - #endif - -@@ -291,19 +290,14 @@ static int mali_enable_clk(void) - return 0; - - clk_enabled = MALI_TRUE; -- err = clk_prepare_enable(clk_gpu); -+ err = clk_prepare_enable(clk_bus); - if (err) { - MALI_PRINT_ERROR(("Could not enable clock for GP\n\r")); - return err; - } -- err = clk_prepare_enable(clk_gpu_pp0); -+ err = clk_prepare_enable(clk_core); - if (err) { -- MALI_PRINT_ERROR(("Could not enable clock for PP0\n\r")); -- return err; -- } -- err = clk_prepare_enable(clk_gpu_pp1); -- if (err) { -- MALI_PRINT_ERROR(("Could not enable clock for PP1\n\r")); -+ MALI_PRINT_ERROR(("Could not enable clock for PP\n\r")); - return err; - } - #endif -@@ -315,9 +309,8 @@ static void mali_disable_clk(void) - #if defined(CONFIG_ARCH_ZYNQMP) - if (clk_enabled) { - clk_enabled = MALI_FALSE; -- clk_disable_unprepare(clk_gpu); -- clk_disable_unprepare(clk_gpu_pp0); -- clk_disable_unprepare(clk_gpu_pp1); -+ clk_disable_unprepare(clk_bus); -+ clk_disable_unprepare(clk_core); - } - #endif - } -@@ -631,17 +624,13 @@ static int mali_probe(struct platform_device *pdev) - - #if defined(CONFIG_ARCH_ZYNQMP) - /* Initialize clocks for GPU and PP */ -- clk_gpu = devm_clk_get(&pdev->dev, "gpu"); -- if (IS_ERR(clk_gpu)) -- return PTR_ERR(clk_gpu); -- -- clk_gpu_pp0 = devm_clk_get(&pdev->dev, "core"); -- if (IS_ERR(clk_gpu_pp0)) -- return PTR_ERR(clk_gpu_pp0); -+ clk_bus = devm_clk_get(&pdev->dev, "bus"); -+ if (IS_ERR(clk_bus)) -+ return PTR_ERR(clk_bus); - -- clk_gpu_pp1 = devm_clk_get(&pdev->dev, "bus"); -- if (IS_ERR(clk_gpu_pp1)) -- return PTR_ERR(clk_gpu_pp1); -+ clk_core = devm_clk_get(&pdev->dev, "core"); -+ if (IS_ERR(clk_core)) -+ return PTR_ERR(clk_core); - #endif - - err = mali_enable_clk(); --- -2.25.1 - 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 @@ -From e3e0f5e3fa0ddb396393d444bce6e575f7a16189 Mon Sep 17 00:00:00 2001 -From: Parth Gajjar -Date: Thu, 21 Dec 2023 22:41:32 -0800 -Subject: [PATCH] Replace vma->vm_flags direct modifications with modifier - calls - -Replace direct modifications to vma->vm_flags with calls to modifier -functions to be able to track flag changes and to keep vma locking -correctness. (Kernel 6.3) - -Signed-off-by: Parth Gajjar ---- - linux/mali_memory.c | 10 ++++++++++ - linux/mali_memory_cow.c | 13 ++++++++++--- - 2 files changed, 20 insertions(+), 3 deletions(-) - -diff --git a/linux/mali_memory.c b/linux/mali_memory.c -index 2b2b209..c21d0b7 100644 ---- a/linux/mali_memory.c -+++ b/linux/mali_memory.c -@@ -266,11 +266,17 @@ int mali_mmap(struct file *filp, struct vm_area_struct *vma) - * that it's present and can never be paged out (see also previous - * entry) - */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+ vm_flags_set(vma, VM_IO | VM_DONTCOPY | VM_PFNMAP); -+#else - vma->vm_flags |= VM_IO; - vma->vm_flags |= VM_DONTCOPY; - vma->vm_flags |= VM_PFNMAP; -+#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) - vma->vm_flags |= VM_RESERVED; -+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+ vm_flags_set(vma, VM_DONTDUMP | VM_DONTEXPAND); - #else - vma->vm_flags |= VM_DONTDUMP; - vma->vm_flags |= VM_DONTEXPAND; -@@ -288,7 +294,11 @@ int mali_mmap(struct file *filp, struct vm_area_struct *vma) - if (!(vma->vm_flags & VM_WRITE)) { - MALI_DEBUG_PRINT(4, ("mmap allocation with read only !\n")); - /* add VM_WRITE for do_page_fault will check this when a write fault */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+ vm_flags_set(vma, VM_WRITE | VM_READ); -+#else - vma->vm_flags |= VM_WRITE | VM_READ; -+#endif - vma->vm_page_prot = PAGE_READONLY; - vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); - mem_bkend->flags |= MALI_MEM_BACKEND_FLAG_COW_CPU_NO_WRITE; -diff --git a/linux/mali_memory_cow.c b/linux/mali_memory_cow.c -index 6fadd42..e631431 100644 ---- a/linux/mali_memory_cow.c -+++ b/linux/mali_memory_cow.c -@@ -391,13 +391,20 @@ _mali_osk_errcode_t mali_memory_cow_modify_range(mali_mem_backend *backend, - } - } else { - /* used to trigger page fault for swappable cowed memory. */ -- alloc->cpu_mapping.vma->vm_flags |= VM_PFNMAP; -- alloc->cpu_mapping.vma->vm_flags |= VM_MIXEDMAP; -- -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+ vm_flags_set(alloc->cpu_mapping.vma, VM_PFNMAP | VM_MIXEDMAP); -+#else -+ alloc->cpu_mapping.vma->vm_flags |= VM_PFNMAP; -+ alloc->cpu_mapping.vma->vm_flags |= VM_MIXEDMAP; -+#endif - zap_vma_ptes(alloc->cpu_mapping.vma, alloc->cpu_mapping.vma->vm_start + range_start, range_size); - /* delete this flag to let swappble is ummapped regard to stauct page not page frame. */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+ vm_flags_clear(alloc->cpu_mapping.vma, VM_PFNMAP | VM_MIXEDMAP); -+#else - alloc->cpu_mapping.vma->vm_flags &= ~VM_PFNMAP; - alloc->cpu_mapping.vma->vm_flags &= ~VM_MIXEDMAP; -+#endif - } - } - --- -2.25.1 - 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 @@ -From 7659ba2e251b72aa3c248d3b1f3a23971180ba41 Mon Sep 17 00:00:00 2001 -From: Parth Gajjar -Date: Mon, 18 Mar 2024 13:43:30 +0000 -Subject: [PATCH] Fixed buildpath QA warning - -Removed KDIR from buildinfo -WARNING: kernel-module-mali-r9p0-01rel0-r0 do_package_qa: -QA Issue: File /lib/modules/6.6.10-xilinx-v2024.1-g2c37bbe14ced/updates/mali.ko - in package kernel-module-mali-6.6.10-xilinx-v2024.1-g2c37bbe14ced contains - reference to TMPDIR [buildpaths]" from the log file. - -Signed-off-by: Parth Gajjar - -diff --git a/Kbuild b/Kbuild -index 8c6e6e0..2b8632b 100644 ---- a/Kbuild -+++ b/Kbuild -@@ -243,7 +243,7 @@ VERSION_STRINGS += BUILD=release - endif - VERSION_STRINGS += TARGET_PLATFORM=$(TARGET_PLATFORM) - VERSION_STRINGS += MALI_PLATFORM=$(MALI_PLATFORM) --VERSION_STRINGS += KDIR=$(KDIR) -+#VERSION_STRINGS += KDIR=$(KDIR) - VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB) - VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP) - VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING) --- -2.37.6 - 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 c25970e7..00000000 --- a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb +++ /dev/null @@ -1,57 +0,0 @@ -SUMMARY = "A Mali 400 Linux Kernel module" -SECTION = "kernel/modules" - -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = " \ - file://linux/license/gpl/mali_kernel_license.h;md5=f5af2d61f4c1eb262cb6a557aaa1070a \ - " - -SRC_URI = " \ - https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-${PV}.tgz \ - file://0001-Change-Makefile-to-be-compatible-with-Yocto.patch \ - file://0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch \ - file://0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch \ - file://0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch \ - file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \ - file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch \ - file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \ - file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\ - file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\ - file://0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch\ - file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\ - file://0015-fix-driver-failed-to-check-map-error.patch \ - file://0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch \ - file://0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch \ - file://0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch \ - file://0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch \ - file://0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch \ - file://0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch \ - file://0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch \ - file://0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch \ - file://0024-Use-community-device-tree-names.patch \ - file://0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch \ - file://0026-Fix-gpu-driver-probe-failure.patch \ - file://0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch \ - file://0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch \ - file://0029-Fixed-buildpath-QA-warning.patch \ - " -SRC_URI[md5sum] = "85ea110dd6675c70b7d01af87ec9633c" -SRC_URI[sha256sum] = "7a67127341d17640c1fff5dad80258fb2a37c8a2121b81525fe2327e4532ce2b" - -inherit features_check module - -PARALLEL_MAKE = "-j 1" - -S = "${WORKDIR}/DX910-SW-99002-${PV}/driver/src/devicedrv/mali" - -REQUIRED_MACHINE_FEATURES = "mali400" - -EXTRA_OEMAKE = 'KDIR="${STAGING_KERNEL_DIR}" \ - ARCH="${ARCH}" \ - BUILD=release \ - MALI_PLATFORM="arm" \ - USING_DT=1 \ - MALI_SHARED_INTERRUPTS=1 \ - CROSS_COMPILE="${TARGET_PREFIX}" \ - MALI_QUIET=1 \ - ' 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 @@ -DRI: Add xlnx dri - -Add the Xilinx dri target - -Upstream-Status: Pending - -Signed-off-by: Mark Hatle - -Index: mesa-24.0.1/src/gallium/targets/dri/meson.build -=================================================================== ---- mesa-24.0.1.orig/src/gallium/targets/dri/meson.build -+++ mesa-24.0.1/src/gallium/targets/dri/meson.build -@@ -101,6 +101,7 @@ foreach d : [[with_gallium_kmsro, [ - 'stm_dri.so', - 'sun4i-drm_dri.so', - 'udl_dri.so', -+ 'xlnx_dri.so', - ]], - [with_gallium_radeonsi, 'radeonsi_dri.so'], - [with_gallium_nouveau, 'nouveau_dri.so'], -Index: mesa-24.0.1/src/gallium/targets/dri/target.c -=================================================================== ---- mesa-24.0.1.orig/src/gallium/targets/dri/target.c -+++ mesa-24.0.1/src/gallium/targets/dri/target.c -@@ -129,6 +129,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(sti) - DEFINE_LOADER_DRM_ENTRYPOINT(stm) - DEFINE_LOADER_DRM_ENTRYPOINT(sun4i_drm) - DEFINE_LOADER_DRM_ENTRYPOINT(udl) -+DEFINE_LOADER_DRM_ENTRYPOINT(xlnx) - #endif - - #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 @@ -From 9470d00850e8b622d963d4d9c61ad1e59972310a Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Tue, 28 Jan 2020 16:10:54 -0800 -Subject: [PATCH 1/2] src: egl: eglinfo: Align EXT_platform_device extension - macros with khronos - -Although the macro definitions are consistent, using the macros name -defined under khronos makes it backward compatible with older eglext.h - -Signed-off-by: Madhurkiran Harikrishnan -Upstream-Status: Inappropriate [Xilinx specific] -Signed-off-by: Mark Hatle ---- - src/egl/opengl/eglinfo.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c -index 72fe45a..e8a0225 100644 ---- a/src/egl/opengl/eglinfo.c -+++ b/src/egl/opengl/eglinfo.c -@@ -305,17 +305,17 @@ main(int argc, char *argv[]) - NULL), "Android platform"); - if (strstr(clientext, "EGL_MESA_platform_gbm") || - strstr(clientext, "EGL_KHR_platform_gbm")) -- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_MESA, -+ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_KHR, - EGL_DEFAULT_DISPLAY, - NULL), "GBM platform"); - if (strstr(clientext, "EGL_EXT_platform_wayland") || - strstr(clientext, "EGL_KHR_platform_wayland")) -- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, -+ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, - EGL_DEFAULT_DISPLAY, - NULL), "Wayland platform"); - if (strstr(clientext, "EGL_EXT_platform_x11") || - strstr(clientext, "EGL_KHR_platform_x11")) -- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_EXT, -+ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR, - EGL_DEFAULT_DISPLAY, - NULL), "X11 platform"); - if (strstr(clientext, "EGL_MESA_platform_surfaceless")) --- -2.17.1 - 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 @@ -From 040b0b79a8e73a3348ab2e95f817636a7d479f18 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Tue, 28 Jan 2020 16:17:46 -0800 -Subject: [PATCH 2/2] src: egl: eglinfo: Use EGL_PLATFORM_DEVICE_EXT only if - the EGL provider supports it - -Compiling against the other EGL provider like mali fails, as they dont -support this macro as one of thier supported platforms - -Signed-off-by: Madhurkiran Harikrishnan -Upstream-Status: Inappropriate [Xilinx specific] -Signed-off-by: Mark Hatle ---- - src/egl/opengl/eglinfo.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c -index e8a0225..bc0e869 100644 ---- a/src/egl/opengl/eglinfo.c -+++ b/src/egl/opengl/eglinfo.c -@@ -243,6 +243,7 @@ doOneDisplay(EGLDisplay d, const char *name) - static int - doOneDevice(EGLDeviceEXT d, int i) - { -+#ifdef EGL_PLATFORM_DEVICE_EXT - PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = - (PFNEGLGETPLATFORMDISPLAYEXTPROC) - eglGetProcAddress("eglGetPlatformDisplayEXT"); -@@ -253,6 +254,9 @@ doOneDevice(EGLDeviceEXT d, int i) - - return doOneDisplay(getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, d, NULL), - "Platform Device"); -+#else -+ return 0; -+#endif - } - - --- -2.17.1 - 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 @@ -Upstream-Status: Inappropriate [libmali specific] - -Index: mesa-demos-8.5.0/src/egl/opengl/eglinfo.c -=================================================================== ---- mesa-demos-8.5.0.orig/src/egl/opengl/eglinfo.c -+++ mesa-demos-8.5.0/src/egl/opengl/eglinfo.c -@@ -195,6 +195,7 @@ PrintDisplayExtensions(EGLDisplay d) - } - - -+#ifdef EGL_EXT_device_base - static const char * - PrintDeviceExtensions(EGLDeviceEXT d) - { -@@ -211,7 +212,7 @@ PrintDeviceExtensions(EGLDeviceEXT d) - - return PrintExtensions(extensions); - } -- -+#endif - - static int - doOneDisplay(EGLDisplay d, const char *name) -@@ -240,6 +241,7 @@ doOneDisplay(EGLDisplay d, const char *n - } - - -+#ifdef EGL_EXT_device_base - static int - doOneDevice(EGLDeviceEXT d, int i) - { -@@ -258,8 +260,9 @@ doOneDevice(EGLDeviceEXT d, int i) - return 0; - #endif - } -+#endif - -- -+#ifdef EGL_EXT_device_base - static int - doDevices(const char *name) - { -@@ -288,7 +291,7 @@ doDevices(const char *name) - - return ret; - } -- -+#endif - - int - main(int argc, char *argv[]) -@@ -322,13 +325,17 @@ main(int argc, char *argv[]) - ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR, - EGL_DEFAULT_DISPLAY, - NULL), "X11 platform"); -+#ifdef EGL_PLATFORM_SURFACELESS_MESA - if (strstr(clientext, "EGL_MESA_platform_surfaceless")) - ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, - EGL_DEFAULT_DISPLAY, - NULL), "Surfaceless platform"); -+#endif -+#ifdef EGL_EXT_device_base - if (strstr(clientext, "EGL_EXT_device_enumeration") && - strstr(clientext, "EGL_EXT_platform_device")) - ret += doDevices("Device platform"); -+#endif - } - else { - 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 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/mesa-demos:" - -SRC_URI += " \ - file://0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch \ - file://0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch \ - file://libmali-egl-workaround.patch \ -" - -DEPENDS += "wayland-protocols" - -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -PACKAGECONFIG:append = " dri3 gallium" - -# If we're using libmali-xlnx, then we need to bring it in for the KHR/khrplatform.h file -DEPENDS .= "${@' libmali-xlnx' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else ''}" -RDEPENDS:libgl-mesa-dev .= "${@' libmali-xlnx-dev' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else ''}" - -do_install:append () { - if ${@'true' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else 'false'} ; then - rm -rf ${D}${includedir}/KHR/* - fi -} - -# If we require libmali-xlnx, this becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${MACHINE_ARCH}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -SRC_URI:append:class-target = " file://0001-DRI_Add_xlnx_dri.patch" - -# This is not compatible with the mali400 driver, use mesa-gl instead -CONFLICT_DISTRO_FEATURES:class-target = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', bb.utils.contains('DISTRO_FEATURES', 'libmali', 'libmali', '', d), '', d)}" - -# Enable lima if not using libmali -PACKAGECONFIG_MALI = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '', 'lima', d)}" -PACKAGECONFIG:append:class-target = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${PACKAGECONFIG_MALI}', '', d)}" - -PACKAGE_ARCH_DEFAULT := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${MACHINE_ARCH}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -From 3fbb596e53524e78703b76c4fdc33cd6ac62f777 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Fri, 11 Dec 2020 16:21:38 -0800 -Subject: [PATCH] libweston: Remove substitute format for ARGB8888 - -Xilinx DP gfx layer does not support XRGB8888. Hence, remove the same -as opaque substitute. - -Signed-off-by: Madhurkiran Harikrishnan -Upstream-Status: Inappropriate [Xilinx specific] - -Reworked the patch for the newer weston - -Signed-off-by: Mark Hatle ---- - libweston/pixel-formats.c | 1 - - 1 file changed, 1 deletion(-) - -Index: weston-13.0.0/libweston/pixel-formats.c -=================================================================== ---- weston-13.0.0.orig/libweston/pixel-formats.c -+++ weston-13.0.0/libweston/pixel-formats.c -@@ -251,7 +251,6 @@ static const struct pixel_format_info pi - { - DRM_FORMAT(ARGB8888), - BITS_RGBA_FIXED(8, 8, 8, 8), -- .opaque_substitute = DRM_FORMAT_XRGB8888, - .addfb_legacy_depth = 32, - .bpp = 32, - 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 @@ -From 3fbb596e53524e78703b76c4fdc33cd6ac62f777 Mon Sep 17 00:00:00 2001 -From: Madhurkiran Harikrishnan -Date: Fri, 11 Dec 2020 16:21:38 -0800 -Subject: [PATCH] libweston: Remove substitute format for ARGB8888 - -Xilinx DP gfx layer does not support XRGB8888. Hence, remove the same -as opaque substitute. - -Signed-off-by: Madhurkiran Harikrishnan -Upstream-Status: Inappropriate [Xilinx specific] ---- - libweston/pixel-formats.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c -index 79dc709..ec2d3b7 100644 ---- a/libweston/pixel-formats.c -+++ b/libweston/pixel-formats.c -@@ -193,7 +193,6 @@ static const struct pixel_format_info pixel_format_table[] = { - { - DRM_FORMAT(ARGB8888), - BITS_RGBA_FIXED(8, 8, 8, 8), -- .opaque_substitute = DRM_FORMAT_XRGB8888, - .depth = 32, - .bpp = 32, - GL_FORMAT(GL_BGRA_EXT), --- -2.17.1 - 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 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: weston -# Required-Start: $local_fs $remote_fs -# Required-Stop: $local_fs $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -### END INIT INFO - -if test -e /etc/default/weston ; then - . /etc/default/weston -fi - -killproc() { - pid=`/bin/pidof $1` - [ "$pid" != "" ] && kill $pid -} - -read CMDLINE < /proc/cmdline -for x in $CMDLINE; do - case $x in - weston=false) - echo "Weston disabled" - exit 0; - ;; - esac -done - -case "$1" in - start) - . /etc/profile - export HOME=ROOTHOME - - weston-start -- --continue-without-input $OPTARGS - ;; - - stop) - echo "Stopping Weston" - killproc weston - ;; - - restart) - $0 stop - sleep 1 - $0 start - ;; - - *) - echo "usage: $0 { start | stop | restart }" - ;; -esac - -exit 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 @@ -# This is a system unit for launching Weston with auto-login as the -# user configured here. -# -# Weston must be built with systemd support, and your weston.ini must load -# the plugin systemd-notify.so. -[Unit] -Description=Weston, a Wayland compositor, as a system service -Documentation=man:weston(1) man:weston.ini(5) -Documentation=http://wayland.freedesktop.org/ - -# Make sure we are started after logins are permitted. -Requires=systemd-user-sessions.service -After=systemd-user-sessions.service - -# If Plymouth is used, we want to start when it is on its way out. -After=plymouth-quit-wait.service - -# D-Bus is necessary for contacting logind. Logind is required. -Wants=dbus.socket -After=dbus.socket - -# Ensure the socket is present -Requires=weston.socket - -# Since we are part of the graphical session, make sure we are started before -# it is complete. -Before=graphical.target - -# Prevent starting on systems without virtual consoles, Weston requires one -# for now. -ConditionPathExists=/dev/tty0 - -[Service] -# Requires systemd-notify.so Weston plugin. -Type=notify -EnvironmentFile=/etc/default/weston -ExecStart=/usr/bin/weston --continue-without-input --modules=systemd-notify.so - -# Optional watchdog setup -TimeoutStartSec=60 -WatchdogSec=20 - -# The user to run Weston as. -User=weston -Group=weston - -# Make sure the working directory is the users home directory -WorkingDirectory=/home/weston - -# Set up a full user session for the user, required by Weston. -PAMName=weston-autologin - -# A virtual terminal is needed. -TTYPath=/dev/tty7 -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes - -# Fail to start if not controlling the tty. -StandardInput=tty-fail -StandardOutput=journal -StandardError=journal - -# Log this user with utmp, letting it show up with commands 'w' and 'who'. -UtmpIdentifier=tty7 -UtmpMode=user - -[Install] -# Note: If you only want weston to start on-demand, remove this line with a -# service drop file -WantedBy=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 @@ -PACKAGECONFIG += "no-idle-timeout" - -do_install:append:zynqmp() { - sed -i -e "/^\[core\]/a gbm-format=rgb565" ${D}${sysconfdir}/xdg/weston/weston.ini -} 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 @@ -SRC_URI:append:zynqmp = " file://0001-libweston-Remove-substitute-format-for-ARGB8888.patch" - -# Due to the SRC_URI zynqmp specific change, this needs to be SOC_FAMILY_ARCH specific -SOC_FAMILY_ARCH ??= "${TUNE_PKGARCH}" -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -DEFAULT_PACKAGE_ARCH:zynqmp = "${SOC_FAMILY_ARCH}" -PACKAGE_ARCH = "${DEFAULT_PACKAGE_ARCH}" - - -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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 @@ -From c8bfa1f8d576cdc6d515dbbac36c48c6166be0d5 Mon Sep 17 00:00:00 2001 -From: Marius Vlad -Date: Thu, 1 Apr 2021 00:12:00 +0300 -Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at DRM-backend tear down - -Tearing down the drm-backend when there are no input devices, would call -for the gbm device destruction before compositor shutdown. The latter -would call into the renderer detroy function and assume that the -EGLDisplay, which was created using the before-mentioned gbm device, is -still available. This patch re-orders the gbm destruction after the -compositor shutdown when no one would make use of it. - -Fixes: #314 - -Signed-off-by: Marius Vlad -Suggested-by: Daniel Stone - -Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb] ---- - libweston/backend-drm/drm.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c -index 2780f3b..fbcfeca 100644 ---- a/libweston/backend-drm/drm.c -+++ b/libweston/backend-drm/drm.c -@@ -3025,10 +3025,6 @@ err_drm_source: - err_udev_input: - udev_input_destroy(&b->input); - err_sprite: --#ifdef BUILD_DRM_GBM -- if (b->gbm) -- gbm_device_destroy(b->gbm); --#endif - destroy_sprites(b); - err_udev_dev: - udev_device_unref(drm_device); -@@ -3038,6 +3034,10 @@ err_launcher: - weston_launcher_destroy(compositor->launcher); - err_compositor: - weston_compositor_shutdown(compositor); -+#ifdef BUILD_DRM_GBM -+ if (b->gbm) -+ gbm_device_destroy(b->gbm); -+#endif - free(b); - return NULL; - } --- -2.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 @@ -From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001 -From: Chen Qi -Date: Tue, 20 Apr 2021 20:42:18 -0700 -Subject: [PATCH] meson.build: fix incorrect header - -The wayland.c actually include 'xdg-shell-client-protocol.h' instead of -the server one, so fix it. Otherwise, it's possible to get build failure -due to race condition. - -Upstream-Status: Pending - -Signed-off-by: Chen Qi ---- - libweston/backend-wayland/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build -index 7e82513..29270b5 100644 ---- a/libweston/backend-wayland/meson.build -+++ b/libweston/backend-wayland/meson.build -@@ -10,7 +10,7 @@ srcs_wlwl = [ - fullscreen_shell_unstable_v1_protocol_c, - presentation_time_protocol_c, - presentation_time_server_protocol_h, -- xdg_shell_server_protocol_h, -+ xdg_shell_client_protocol_h, - xdg_shell_protocol_c, - ] - --- -2.30.2 - 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 @@ -From 58760e09eed662a72da939ff4802d605489cff8e Mon Sep 17 00:00:00 2001 -From: Denys Dmytriyenko -Date: Tue, 8 Sep 2020 19:37:42 -0400 -Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and - O_CREAT - -musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(), -O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors: - -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock': -| ../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] -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~ -| | popen -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function) -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~~~ -| ../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 -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function) -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~~~~~~ -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function) -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~~~~ - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c] - -Signed-off-by: Denys Dmytriyenko ---- - tests/weston-test-fixture-compositor.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c -index 0c9855f..e0e32c9 100644 ---- a/tests/weston-test-fixture-compositor.c -+++ b/tests/weston-test-fixture-compositor.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - #include "shared/helpers.h" - #include "weston-test-fixture-compositor.h" --- -2.7.4 - 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 @@ -From a1548c742bf2dedbb47282d8a00407b60bbab669 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein -Date: Wed, 22 Feb 2017 15:53:30 +0200 -Subject: [PATCH] weston-launch: Provide a default version that doesn't require - - PAM - -weston-launch requires PAM for starting weston as a non-root user. - -Since starting weston as root is a valid use case by itself, if -PAM is not available, provide a default version of weston-launch -without non-root-user support. - -Upstream-Status: Denied [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725] - -Signed-off-by: Tom Hochstein -Signed-off-by: Jussi Kukkonen -Signed-off-by: Denys Dmytriyenko -Signed-off-by: Ming Liu - ---- - libweston/meson.build | 16 ++++++++++++---- - libweston/weston-launch.c | 21 +++++++++++++++++++++ - meson_options.txt | 7 +++++++ - 3 files changed, 40 insertions(+), 4 deletions(-) - -diff --git a/libweston/meson.build b/libweston/meson.build -index 08d23ec..cb9fd3f 100644 ---- a/libweston/meson.build -+++ b/libweston/meson.build -@@ -216,16 +216,24 @@ dep_vertex_clipping = declare_dependency( - ) - - if get_option('weston-launch') -- dep_pam = cc.find_library('pam') -+ deps_weston_launch = [systemd_dep, dep_libdrm] - -- if not cc.has_function('pam_open_session', dependencies: dep_pam) -- error('pam_open_session not found for weston-launch') -+ if get_option('pam') -+ dep_pam = cc.find_library('pam') -+ if not cc.has_function('pam_open_session', dependencies: dep_pam) -+ error('pam_open_session not found for weston-launch') -+ endif -+ -+ if dep_pam.found() -+ deps_weston_launch += dep_pam -+ config_h.set('HAVE_PAM', '1') -+ endif - endif - - executable( - 'weston-launch', - 'weston-launch.c', -- dependencies: [dep_pam, systemd_dep, dep_libdrm], -+ dependencies: deps_weston_launch, - include_directories: common_inc, - install: true - ) -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index 521cb2c..2d42d33 100644 ---- a/libweston/weston-launch.c -+++ b/libweston/weston-launch.c -@@ -51,7 +51,9 @@ - - #include - #include -+#ifdef HAVE_PAM - #include -+#endif - - #ifdef HAVE_SYSTEMD_LOGIN - #include -@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd) - #endif - - struct weston_launch { -+#ifdef HAVE_PAM - struct pam_conv pc; - pam_handle_t *ph; -+#endif - int tty; - int ttynr; - int sock[2]; -@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl) - return false; - } - -+#ifdef HAVE_PAM - static int - pam_conversation_fn(int msg_count, - const struct pam_message **messages, -@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl) - - return 0; - } -+#endif - - static int - setup_launcher_socket(struct weston_launch *wl) -@@ -466,6 +472,7 @@ quit(struct weston_launch *wl, int status) - close(wl->signalfd); - close(wl->sock[0]); - -+#ifdef HAVE_PAM - if (wl->new_user) { - err = pam_close_session(wl->ph, 0); - if (err) -@@ -473,6 +480,7 @@ quit(struct weston_launch *wl, int status) - err, pam_strerror(wl->ph, err)); - pam_end(wl->ph, err); - } -+#endif - - /* - * Get a fresh handle to the tty as the previous one is in -@@ -710,6 +718,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - setenv("HOME", wl->pw->pw_dir, 1); - setenv("SHELL", wl->pw->pw_shell, 1); - -+#ifdef HAVE_PAM - env = pam_getenvlist(wl->ph); - if (env) { - for (i = 0; env[i]; ++i) { -@@ -718,6 +727,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - } - free(env); - } -+#endif - - /* - * We open a new session, so it makes sense -@@ -789,8 +799,10 @@ static void - help(const char *name) - { - fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); -+#ifdef HAVE_PAM - fprintf(stderr, " -u, --user Start session as specified username,\n" - " e.g. -u joe, requires root.\n"); -+#endif - fprintf(stderr, " -t, --tty Start session on alternative tty,\n" - " e.g. -t /dev/tty4, requires -u option.\n"); - fprintf(stderr, " -v, --verbose Be verbose\n"); -@@ -804,7 +816,9 @@ main(int argc, char *argv[]) - int i, c; - char *tty = NULL; - struct option opts[] = { -+#ifdef HAVE_PAM - { "user", required_argument, NULL, 'u' }, -+#endif - { "tty", required_argument, NULL, 't' }, - { "verbose", no_argument, NULL, 'v' }, - { "help", no_argument, NULL, 'h' }, -@@ -816,11 +830,16 @@ main(int argc, char *argv[]) - while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { - switch (c) { - case 'u': -+#ifdef HAVE_PAM - wl.new_user = optarg; - if (getuid() != 0) { - fprintf(stderr, "weston: Permission denied. -u allowed for root only\n"); - exit(EXIT_FAILURE); - } -+#else -+ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n"); -+ exit(EXIT_FAILURE); -+#endif - break; - case 't': - tty = optarg; -@@ -872,8 +891,10 @@ main(int argc, char *argv[]) - if (setup_tty(&wl, tty) < 0) - exit(EXIT_FAILURE); - -+#ifdef HAVE_PAM - if (wl.new_user && setup_pam(&wl) < 0) - exit(EXIT_FAILURE); -+#endif - - if (setup_launcher_socket(&wl) < 0) - exit(EXIT_FAILURE); -diff --git a/meson_options.txt b/meson_options.txt -index 239bd2d..99e4ec3 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -73,6 +73,13 @@ option( - ) - - option( -+ 'pam', -+ type: 'boolean', -+ value: true, -+ description: 'Define if PAM is available' -+) -+ -+option( - 'xwayland', - type: 'boolean', - 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 @@ -Fix atomic modesetting with musl - -atomic modesetting seems to fail with drm weston backend and this patch fixes -it, below errors are seen before weston exits - -atomic: couldn't commit new state: Invalid argument - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158] -Signed-off-by: Khem Raj - ---- a/libweston/backend-drm/kms.c -+++ b/libweston/backend-drm/kms.c -@@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr - wl_list_for_each(plane, &b->plane_list, link) { - drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n", - (unsigned long) plane->plane_id); -- plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0); -- plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0); -+ //plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0); -+ //plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0); - } - - 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 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: Huawei Inc. -# SPDX-License-Identifier: Apache-2.0 - - -if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then - add_weston_module "systemd-notify.so" -fi 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 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Application -Name=Weston -Comment=Wayland Compostitor -Exec=weston -Icon=weston -Terminal=false -Categories=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 Binary files a/meta-xilinx-core/recipes-graphics/wayland/weston/weston.png and /dev/null 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 @@ -#!/bin/sh - -if type Xwayland >/dev/null 2>/dev/null; then - mkdir -p /tmp/.X11-unix -fi 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 @@ -FILESEXTRAPATHS:prepend:zynqmp := "${THISDIR}/files:" - -require weston.inc - -ZYNQMP_WARN_DEFAULT = "0" -ZYNQMP_WARN_DEFAULT:zynqmp = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '0', d)}" -ZYNQMP_WARN = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${ZYNQMP_WARN_DEFAULT}', '0', d)}" - -python() { - if d.getVar('ZYNQMP_WARN') == "1": - 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'))) -} 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 a534b1b7..00000000 --- a/meta-xilinx-core/recipes-graphics/wayland/weston_9.0.0.bb +++ /dev/null @@ -1,148 +0,0 @@ -SUMMARY = "Weston, a Wayland compositor" -DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" -HOMEPAGE = "http://wayland.freedesktop.org" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ - file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" - -# We want this version to be "newer" then 10, only if libmali and mali400 are both enabled -ORIG_PE := "${PE}" -MALI_PE = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '${ORIG_PE}', d)}" -PE = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${MALI_PE}', '${ORIG_PE}', d)}" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://weston.png \ - file://weston.desktop \ - file://xwayland.weston-start \ - file://systemd-notify.weston-start \ - file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ - file://0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch \ - file://0001-meson.build-fix-incorrect-header.patch \ - file://0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch \ -" - -SRC_URI:append:libc-musl = " file://dont-use-plane-add-prop.patch " - -SRC_URI[sha256sum] = "5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -inherit meson pkgconfig useradd features_check -# depends on virtual/egl -# weston-init requires pam enabled if started via systemd -REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" - -DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0" -DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" - -LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}" - -WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" - -EXTRA_OEMESON += "-Dbackend-default=auto -Dpipewire=false" - -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl clients', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ - ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ - launch \ - image-jpeg \ - screenshare \ - shell-desktop \ - shell-fullscreen \ - shell-ivi" - -# -# Compositor choices -# -# Weston on KMS -PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev" -# Weston on Wayland (nested Weston) -PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2" -# Weston on X11 -PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo" -# Headless Weston -PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false" -# Weston on framebuffer -PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev" -# Weston on RDP -PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp" -# weston-launch -PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm" -# VA-API desktop recorder -PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva" -# Weston with EGL support -PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl" -# Weston with lcms support -PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms" -# Weston with webp support -PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp" -# Weston with systemd-login support -PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus" -# Weston with Xwayland support (requires X11 and Wayland) -PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false" -# colord CMS support -PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord" -# Clients support -PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" -# Virtual remote output with GStreamer on DRM backend -PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base" -# Weston with PAM support -PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam" -# Weston with screen-share support -PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false" -# Traditional desktop shell -PACKAGECONFIG[shell-desktop] = "-Dshell-desktop=true,-Dshell-desktop=false" -# Fullscreen shell -PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=false" -# In-Vehicle Infotainment (IVI) shell -PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false" -# JPEG image loading support -PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" - -do_install:append() { - # Weston doesn't need the .la files to load modules, so wipe them - rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la - - # If X11, ship a desktop file to launch it - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then - install -d ${D}${datadir}/applications - install ${WORKDIR}/weston.desktop ${D}${datadir}/applications - - install -d ${D}${datadir}/icons/hicolor/48x48/apps - install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps - fi - - if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then - install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland - fi - - if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then - install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify - fi - - if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then - chmod u+s ${D}${bindir}/weston-launch - fi -} - -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ - libweston-${WESTON_MAJOR_VERSION} ${PN}-examples" - -FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so" -FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}" - -FILES:libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so" -SUMMARY:libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'." - -FILES:${PN}-examples = "${bindir}/*" - -FILES:${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so" -RDEPENDS:${PN}-xwayland += "xwayland" - -RDEPENDS:${PN} += "xkeyboard-config" -RRECOMMENDS:${PN} = "weston-init liberation-fonts" -RRECOMMENDS:${PN}-dev += "wayland-protocols" - -USERADD_PACKAGES = "${PN}" -GROUPADD_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 @@ -FILESEXTRAPATHS:prepend:zynqmp := "${THISDIR}/files/9.0.0:${THISDIR}/files:" - -require 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 460ff581..dc6a75c6 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 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" - FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_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 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_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-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 611e2e91..7ff3ef79 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 SRC_URI = "\ file://99-aie-device.rules \ - file://99-mali-device.rules \ " S = "${WORKDIR}" 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 @@ -# Device rules for GPU MALI-400 drivers. -ACTION=="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 897fbb1c..fff62eb6 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' KERNEL_FEATURES:append:versal = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', ' features/xen/xen.scc', '', d)} features/xilinx/hdmi-module/hdmi-module.scc" KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', ' features/ocicontainer/ocicontainer.scc', '', d)}" - -# Enable DRM_LIMA support if DISTRO_FEATURES != 'libmali' and MACHINE_FEATURES mali400 is enabled -MALI_FEATURE = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '', 'features/drm-lima/drm-lima.scc', d)}" -KERNEL_FEATURES:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' ${MALI_FEATURE}', '', d)}" diff --git a/meta-xilinx-mali400/classes/meta-xilinx-mali400-cfg.bbclass b/meta-xilinx-mali400/classes/meta-xilinx-mali400-cfg.bbclass new file mode 100644 index 00000000..26d54f59 --- /dev/null +++ b/meta-xilinx-mali400/classes/meta-xilinx-mali400-cfg.bbclass @@ -0,0 +1,6 @@ +# We need to load the meta-xilinx-mali400 config components, only if "libmali" +# is in the distro features. Since we don't know the distro flags during +# layer.conf load time, we delay using a special bbclass that simply includes +# the META_XILINX_MALI400_CONFIG_PATH file. + +include ${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '${META_XILINX_MALI400_CONFIG_PATH}', '', d)} diff --git a/meta-xilinx-mali400/classes/sanity-meta-xilinx-mali400.bbclass b/meta-xilinx-mali400/classes/sanity-meta-xilinx-mali400.bbclass new file mode 100644 index 00000000..25353fd6 --- /dev/null +++ b/meta-xilinx-mali400/classes/sanity-meta-xilinx-mali400.bbclass @@ -0,0 +1,10 @@ +addhandler mali400_bbappend_distrocheck +mali400_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck" +python mali400_bbappend_distrocheck() { + skip_check = e.data.getVar('SKIP_META_XILINX_MALI400_SANITY_CHECK') == "1" + if 'libmali' not in e.data.getVar('DISTRO_FEATURES').split() and not skip_check: + bb.warn("You have included the meta-xilinx-mali400 layer, but \ +'libmali' has not been enabled in your DISTRO_FEATURES. Some bbappend files \ +may not take effect. See the meta-xilinx-mali400 README for details on enabling \ +libmali - mali400 support.") +} diff --git a/meta-xilinx-mali400/conf/distro/include/meta-xilinx-mali400-default-versions.inc b/meta-xilinx-mali400/conf/distro/include/meta-xilinx-mali400-default-versions.inc new file mode 100644 index 00000000..9975eff4 --- /dev/null +++ b/meta-xilinx-mali400/conf/distro/include/meta-xilinx-mali400-default-versions.inc @@ -0,0 +1,22 @@ +SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ + *->qtbase \ + *->qtmultimedia \ +" + +# libmali is selected by DISTRO_FEATURE of libmali & MACHINE_FEATURES of mali400 +# lima is selected by DISTRO_FEATURE != libmali & MACHINE_FEATURES of mali400 +# default mesa because otherwise +def xlnx_is_libmali_enabled(d): + if bb.utils.contains('MACHINE_FEATURES', 'mali400', '1', '', d) == '1': + if bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '', d) == '1': + return True + return False + +# libmali requires certain preferred providers to be selected +PREFERRED_PROVIDER_virtual/egl = "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" +PREFERRED_PROVIDER_virtual/libgl = "${@'mesa-gl' if xlnx_is_libmali_enabled(d) else 'mesa'}" +PREFERRED_PROVIDER_virtual/libgles1 = "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" +PREFERRED_PROVIDER_virtual/libgles2 = "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" +PREFERRED_PROVIDER_virtual/libgles3 = "${@'NOT_SUPPORTED' if xlnx_is_libmali_enabled(d) else 'mesa'}" +PREFERRED_PROVIDER_virtual/libgbm = "${@'libmali-xlnx' if xlnx_is_libmali_enabled(d) else 'mesa'}" +PREFERRED_PROVIDER_virtual/mesa = "${@'mesa-gl' if xlnx_is_libmali_enabled(d) else 'mesa'}" diff --git a/meta-xilinx-mali400/conf/layer.conf b/meta-xilinx-mali400/conf/layer.conf new file mode 100644 index 00000000..7bc75aa8 --- /dev/null +++ b/meta-xilinx-mali400/conf/layer.conf @@ -0,0 +1,34 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a packages directory, add to BBFILES +BBFILES += " \ + ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend \ + " + +BBFILES_DYNAMIC += " \ + openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bb \ + openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes-*/*/*.bbappend \ + qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/recipes-*/*/*.bb \ + qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/recipes-*/*/*.bbappend \ + xilinx-multimedia:${LAYERDIR}/dynamic-layers/xilinx-multimedia/recipes-*/*/*.bb \ + xilinx-multimedia:${LAYERDIR}/dynamic-layers/xilinx-multimedia/recipes-*/*/*.bbappend \ +" + +BBFILE_COLLECTIONS += "xilinx-mali400" +BBFILE_PATTERN_xilinx-mali400 = "^${LAYERDIR}/" +BBFILE_PRIORITY_xilinx-mali400 = "5" + +LAYERDEPENDS_xilinx-mali400 = " \ + core \ + xilinx \ + " + +LAYERSERIES_COMPAT_xilinx-mali400 = "scarthgap" + +INHERIT += "sanity-meta-xilinx-mali400" + +META_XILINX_MALI400_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-xilinx-mali400-default-versions.inc" + +USER_CLASSES:append = " meta-xilinx-mali400-cfg" diff --git a/meta-xilinx-mali400/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend b/meta-xilinx-mali400/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0002-egl_kms-Modify-the-default-color-format-to-RGB565.patch b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0002-egl_kms-Modify-the-default-color-format-to-RGB565.patch new file mode 100644 index 00000000..363edd4d --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0002-egl_kms-Modify-the-default-color-format-to-RGB565.patch @@ -0,0 +1,110 @@ +From f791102afb7c65601042b697a9d85c4f4fce5dab Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 19 Nov 2019 13:45:58 -0800 +Subject: [PATCH] egl_kms: Modify the default color format to RGB565 + +DP supports RGB565 hence modify the default color format to RGB565. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] + +--- + .../kmsconvenience/qkmsdevice.cpp | 4 ++-- + .../eglfs_kms/qeglfskmsgbmcursor.cpp | 6 +++--- + .../eglfs_kms/qeglfskmsgbmintegration.cpp | 2 +- + .../eglfs_kms_support/qeglfskmsintegration.cpp | 16 +++++++++++++--- + 4 files changed, 19 insertions(+), 9 deletions(-) + +diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp +index 8cd7f9b368..657b3d553e 100644 +--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp ++++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp +@@ -369,7 +369,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, + uint32_t drmFormat; + bool drmFormatExplicit = true; + if (formatStr.isEmpty()) { +- drmFormat = DRM_FORMAT_XRGB8888; ++ drmFormat = DRM_FORMAT_RGB565; + drmFormatExplicit = false; + } else if (formatStr == "xrgb8888") { + drmFormat = DRM_FORMAT_XRGB8888; +@@ -393,7 +393,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, + drmFormat = DRM_FORMAT_ABGR2101010; + } else { + qWarning("Invalid pixel format \"%s\" for output %s", formatStr.constData(), connectorName.constData()); +- drmFormat = DRM_FORMAT_XRGB8888; ++ drmFormat = DRM_FORMAT_RGB565; + drmFormatExplicit = false; + } + qCDebug(qLcKmsDebug) << "Format is" << Qt::hex << drmFormat << Qt::dec << "requested_by_user =" << drmFormatExplicit +diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp +index 612eec4ce0..39073a42c2 100644 +--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp ++++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp +@@ -87,7 +87,7 @@ QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen) + } + + m_bo = gbm_bo_create(static_cast(m_screen->device())->gbmDevice(), m_cursorSize.width(), m_cursorSize.height(), +- GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE); ++ DRM_FORMAT_RGB565, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE); + if (!m_bo) { + qWarning("Could not create buffer for cursor!"); + } else { +@@ -197,7 +197,7 @@ void QEglFSKmsGbmCursor::changeCursor(QCursor *windowCursor, QWindow *window) + if (m_cursorImage.image()->width() > m_cursorSize.width() || m_cursorImage.image()->height() > m_cursorSize.height()) + qWarning("Cursor larger than %dx%d, cursor will be clipped.", m_cursorSize.width(), m_cursorSize.height()); + +- QImage cursorImage(m_cursorSize, QImage::Format_ARGB32); ++ QImage cursorImage(m_cursorSize, QImage::Format_RGB16); + cursorImage.fill(Qt::transparent); + + QPainter painter; +@@ -302,7 +302,7 @@ void QEglFSKmsGbmCursor::initCursorAtlas() + m_cursorAtlas.hotSpots << hotSpot; + } + +- QImage image = QImage(atlas).convertToFormat(QImage::Format_ARGB32); ++ QImage image = QImage(atlas).convertToFormat(QImage::Format_RGB16); + m_cursorAtlas.cursorWidth = image.width() / m_cursorAtlas.cursorsPerRow; + m_cursorAtlas.cursorHeight = image.height() / ((Qt::LastCursor + cursorsPerRow) / cursorsPerRow); + m_cursorAtlas.width = image.width(); +diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp +index caa1187b40..b8f129212c 100644 +--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp ++++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp +@@ -96,7 +96,7 @@ EGLNativeWindowType QEglFSKmsGbmIntegration::createNativeOffscreenWindow(const Q + + gbm_surface *surface = gbm_surface_create(static_cast(device())->gbmDevice(), + 1, 1, +- GBM_FORMAT_XRGB8888, ++ DRM_FORMAT_RGB565, + GBM_BO_USE_RENDERING); + + return reinterpret_cast(surface); +diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp +index 28b6b7df63..91dd092311 100644 +--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp ++++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp +@@ -102,9 +102,19 @@ QSurfaceFormat QEglFSKmsIntegration::surfaceFormatFor(const QSurfaceFormat &inpu + QSurfaceFormat format(inputFormat); + format.setRenderableType(QSurfaceFormat::OpenGLES); + format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); +- format.setRedBufferSize(8); +- format.setGreenBufferSize(8); +- format.setBlueBufferSize(8); ++ ++ static const bool force888 = qEnvironmentVariableIntValue("QT_QPA_EGLFS_FORCE888"); ++ if (force888){ ++ format.setRedBufferSize(8); ++ format.setGreenBufferSize(8); ++ format.setBlueBufferSize(8); ++ } ++ else{ ++ format.setRedBufferSize(5); ++ format.setGreenBufferSize(6); ++ format.setBlueBufferSize(5); ++ } ++ + return format; + } + diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0003-qkmsdevice.cpp-Disable-hw-cursor-as-a-default-option.patch b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0003-qkmsdevice.cpp-Disable-hw-cursor-as-a-default-option.patch new file mode 100644 index 00000000..8a357d3d --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase/0003-qkmsdevice.cpp-Disable-hw-cursor-as-a-default-option.patch @@ -0,0 +1,31 @@ +From b8bdd78fc2836f7ecb8777c3bd99fc2d48dfeda4 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Fri, 8 Mar 2019 16:23:29 -0800 +Subject: [PATCH] qkmsdevice.cpp: Disable hw cursor as a default option. + +Zynqmp does not support hardware cursor, hence disable it as a default +choice and enable pbuffer. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] + +--- + src/platformsupport/kmsconvenience/qkmsdevice.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp +index 657b3d553e..64aafb2247 100644 +--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp ++++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp +@@ -1028,9 +1028,9 @@ QKmsScreenConfig *QKmsDevice::screenConfig() const + + QKmsScreenConfig::QKmsScreenConfig() + : m_headless(false) +- , m_hwCursor(true) ++ , m_hwCursor(false) + , m_separateScreens(false) +- , m_pbuffers(false) ++ , m_pbuffers(true) + , m_virtualDesktopLayout(VirtualDesktopLayoutHorizontal) + { + loadConfig(); diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend new file mode 100644 index 00000000..2e80a4c8 --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend @@ -0,0 +1,41 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/qtbase:" + +SRC_URI:append = " \ + file://0002-egl_kms-Modify-the-default-color-format-to-RGB565.patch \ + file://0003-qkmsdevice.cpp-Disable-hw-cursor-as-a-default-option.patch \ +" + +PACKAGECONFIG:append = " \ + examples accessibility tools libinput fontconfig \ + ${@bb.utils.contains('DISTRO_FEATURES', 'fbdev', 'linuxfb gles2 eglfs', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gles2 eglfs', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'gles2 eglfs kms gbm', '', d)} \ + " + +PACKAGECONFIG:remove = "tests" + +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" + +# There is some sort of parallel make install failure +# Makefile:144: recipe for target 'sub-dbus-install_subtargets' failed +# make[1]: *** [sub-dbus-install_subtargets] Error 2 +PARALLEL_MAKEINST = "-j 1" + +EXTRA_OEMAKE:task-install = " \ + MAKEFLAGS='${PARALLEL_MAKEINST}' \ + OE_QMAKE_CC='${OE_QMAKE_CC}' \ + OE_QMAKE_CXX='${OE_QMAKE_CXX}' \ + OE_QMAKE_CFLAGS='${OE_QMAKE_CFLAGS}' \ + OE_QMAKE_CXXFLAGS='${OE_QMAKE_CXXFLAGS}' \ + OE_QMAKE_LINK='${OE_QMAKE_LINK}' \ + OE_QMAKE_LDFLAGS='${OE_QMAKE_LDFLAGS}' \ + OE_QMAKE_AR='${OE_QMAKE_AR}' \ + OE_QMAKE_OBJCOPY='${OE_QMAKE_OBJCOPY}' \ + OE_QMAKE_STRIP='${OE_QMAKE_STRIP}' \ + OE_QMAKE_INCDIR_QT='${STAGING_DIR_TARGET}/${OE_QMAKE_PATH_HEADERS}' \ +" diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtmultimedia_%.bbappend b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtmultimedia_%.bbappend new file mode 100644 index 00000000..1e329fbd --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtmultimedia_%.bbappend @@ -0,0 +1,7 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'gstreamer1.0-plugins-base', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" +# Note: gstreamer1.0-plugins-base has a dependency on opengl, which infects directly linking to it diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-Fix-regression-in-QWaylandGlContext-makeCurrent-for-.patch b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-Fix-regression-in-QWaylandGlContext-makeCurrent-for-.patch new file mode 100644 index 00000000..09ad1b5b --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-Fix-regression-in-QWaylandGlContext-makeCurrent-for-.patch @@ -0,0 +1,34 @@ +From eb44571eab0036a9a1bcd7c423f0187abcbf7a37 Mon Sep 17 00:00:00 2001 +From: Johan Klokkhammer Helsing +Date: Thu, 30 Aug 2018 09:31:33 +0200 +Subject: [PATCH] Fix regression in QWaylandGlContext::makeCurrent for + offscreen surfaces + +[ChangeLog][QPA plugin] Fixed a bug where offscreen surfaces would get +surfaceless EGL contexts. + +Fixes a regression in in bf09c7a1. + +The call, window->updateSurface(window->isExposed()), is problematic because +offscreen textures are never exposed, and consequently, eglSurface will be +EGL_NO_SURFACE, which will then create a surfaceless context in the call: + + eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context) + +This reverts to the old behavior of always trying to create an EGL surface, +unless the window doesn't have a valid wl_surface, in which case it doesn't +make sense (which is what bf09c7a1 fixed, QTBUG-65553). + +Task-number: QTBUG-70242 +Task-number: QTBUG-68605 +Task-number: QTBUG-67601 +Change-Id: I44b07bb8bf4b33c73c6379a1de8e9e5cfd220b51 + +Signed-off-by: Johan Helsing +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Backport +--- + src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp | 9 ++++++--- + src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 2 +- + 2 files changed, 7 insertions(+), 4 deletions(-) + diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-qwaylandwindow.cpp-Do-not-destroy-shell-suface-befor.patch b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-qwaylandwindow.cpp-Do-not-destroy-shell-suface-befor.patch new file mode 100644 index 00000000..8f81ffcf --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0001-qwaylandwindow.cpp-Do-not-destroy-shell-suface-befor.patch @@ -0,0 +1,31 @@ +From 30f5d53244ef4173544413124f319af272235cfd Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 16 May 2018 17:16:53 -0700 +Subject: [PATCH 1/3] qwaylandwindow.cpp: Do not destroy shell suface before + eglDestroySurface + +The call to reset results in a race condition resulting in destruction +of shell surface before the eglSurface thereby crashing libwayland-client. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Pending +--- + src/client/qwaylandwindow.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index 6d7c088..94c89a3 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -385,8 +385,6 @@ void QWaylandWindow::setVisible(bool visible) + QWindowSystemInterface::flushWindowSystemEvents(); + if (!deleteGuard.isNull() && window()->type() == Qt::Popup) + closePopups(this); +- if (!deleteGuard.isNull()) +- reset(); + } + } + +-- +2.7.4 + diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0002-Handle-maximize-minimize-fullscreen-in-xdg_shell_v6.patch b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0002-Handle-maximize-minimize-fullscreen-in-xdg_shell_v6.patch new file mode 100644 index 00000000..52db5ac2 --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0002-Handle-maximize-minimize-fullscreen-in-xdg_shell_v6.patch @@ -0,0 +1,20 @@ +From 75ac221b9d78d97c121b984ffc633c8cdbe3a92d Mon Sep 17 00:00:00 2001 +From: Giulio Camuffo +Date: Mon, 7 May 2018 17:40:57 -0700 +Subject: [PATCH 2/3] Handle maximize/minimize/fullscreen in xdg_shell_v6 + +[ChangeLog][QPA plugin] Implement support for maximization, minimization +and fullscreen with xdg-shell unstable v6. + +Task-number: QTBUG-63417 +Task-number: QTBUG-63748 +Change-Id: I385eb3279d91f1c38d2f5d46bc63b324f0456ca4 + +signed-off-by: Giulio Camuffo +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Backport +--- + src/client/qwaylandxdgshellv6.cpp | 22 ++++++++++++++++++++++ + src/client/qwaylandxdgshellv6_p.h | 4 ++++ + 2 files changed, 26 insertions(+) + diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0003-qwaylandeglwindow.cpp-Bind-the-context-before-callin.patch b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0003-qwaylandeglwindow.cpp-Bind-the-context-before-callin.patch new file mode 100644 index 00000000..c29edab4 --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland/0003-qwaylandeglwindow.cpp-Bind-the-context-before-callin.patch @@ -0,0 +1,32 @@ +From 7067fce80a6e863532a86a5aeb9d6f53e538b387 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 5 Sep 2018 14:08:16 -0700 +Subject: [PATCH 3/3] qwaylandeglwindow.cpp: Bind the context before calling + eglDestroySurface + +Call eglMakeCurrent to bind the context to the current rendering thread +before calling eglDestroySurface to avoid a crash caused by the post +processing activity of GPU driver. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Pending +--- + src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +index 6b5c532..77cc433 100644 +--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp ++++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +@@ -171,6 +171,8 @@ void QWaylandEglWindow::doInvalidateSurface() + void QWaylandEglWindow::invalidateSurface() + { + if (m_eglSurface) { ++ eglMakeCurrent(m_clientBufferIntegration->eglDisplay(), EGL_NO_SURFACE, ++ EGL_NO_SURFACE, EGL_NO_CONTEXT); + eglDestroySurface(m_clientBufferIntegration->eglDisplay(), m_eglSurface); + m_eglSurface = 0; + } +-- +2.7.4 + diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend new file mode 100644 index 00000000..b51451a0 --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend @@ -0,0 +1,21 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/qtwayland:" +# file://0001-qwaylandwindow.cpp-Do-not-destroy-shell-suface-befor.patch +# file://0002-Handle-maximize-minimize-fullscreen-in-xdg_shell_v6.patch +SRC_URI:append = " \ + file://0003-qwaylandeglwindow.cpp-Bind-the-context-before-callin.patch \ +" +# file://0001-Fix-regression-in-QWaylandGlContext-makeCurrent-for-.patch + +PACKAGECONFIG = " \ + wayland-client \ + wayland-server \ + wayland-egl \ + wayland-drm-egl-server-buffer \ +" + +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebengine_%.bbappend b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebengine_%.bbappend new file mode 100644 index 00000000..973608d3 --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebengine_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:append = " ffmpeg opus" diff --git a/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebkit_%.bbappend b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebkit_%.bbappend new file mode 100644 index 00000000..0997181a --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwebkit_%.bbappend @@ -0,0 +1,8 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'qtmultimedia', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" +# Note: qtmultimedia has a dependency on gstreamer1.0-plugins-base, which has a dependency on opengl, which infects directly linking to it + diff --git a/meta-xilinx-mali400/dynamic-layers/xilinx-multimedia/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/meta-xilinx-mali400/dynamic-layers/xilinx-multimedia/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/dynamic-layers/xilinx-multimedia/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-benchmarks/files/0001-Make-RGB565-as-default-EGLconfig.patch b/meta-xilinx-mali400/recipes-benchmarks/files/0001-Make-RGB565-as-default-EGLconfig.patch new file mode 100644 index 00000000..aeedfd58 --- /dev/null +++ b/meta-xilinx-mali400/recipes-benchmarks/files/0001-Make-RGB565-as-default-EGLconfig.patch @@ -0,0 +1,31 @@ +From 43cdcd9dbb032d32e66bab9c25d5e7000797efb8 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 26 Sep 2018 14:44:11 -0700 +Subject: [PATCH 1/3] Make RGB565 as default EGLconfig + +Make RGB565 as default EGL config as that way user need not pass +explicit parameters for RGB565 EGLconfig. In the orignial scenario, if +user does not pass the gl-visual-config to RGB565 there will be color +conversion resulting in lower performance. + +Signed-off-by: Madhurkiran Harikrishnan +Reviewed-by: Hyun Kwon +Upstream-Status: Inappropriate [Xilinx specific] +Signed-off-by: Mark Hatle +--- + src/gl-visual-config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: git/src/gl-visual-config.h +=================================================================== +--- git.orig/src/gl-visual-config.h ++++ git/src/gl-visual-config.h +@@ -31,7 +31,7 @@ class GLVisualConfig + { + public: + GLVisualConfig(): +- id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(-1), buffer(1), samples(0) {} ++ id(0), red(5), green(6), blue(5), alpha(0), depth(16), stencil(0), buffer(16), samples(0) {} + GLVisualConfig(const std::string &s); + + /** diff --git a/meta-xilinx-mali400/recipes-benchmarks/files/0001-src-gl-state-egl-Use-native_display-to-load-EGL-func.patch b/meta-xilinx-mali400/recipes-benchmarks/files/0001-src-gl-state-egl-Use-native_display-to-load-EGL-func.patch new file mode 100644 index 00000000..61a7cbf9 --- /dev/null +++ b/meta-xilinx-mali400/recipes-benchmarks/files/0001-src-gl-state-egl-Use-native_display-to-load-EGL-func.patch @@ -0,0 +1,33 @@ +From 534a0f99b38f7a32fc07562bec3e992dfad448c0 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Mon, 3 Feb 2020 13:00:36 -0800 +Subject: [PATCH] src: gl-state-egl: Use native_display to load EGL funcs + through glad + +EGL_DEFAULT_DISPLAY may not be suiitable for all the backends like GBM. +Instead, use the already initialized display and only fallback to +EGL_DEFAULT_DISPLAY if the display is unintialized (which is already +been taken care). + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-status: Pending +--- + src/gl-state-egl.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gl-state-egl.cpp b/src/gl-state-egl.cpp +index 8d7d66e..316b856 100644 +--- a/src/gl-state-egl.cpp ++++ b/src/gl-state-egl.cpp +@@ -317,7 +317,7 @@ GLStateEGL::init_display(void* native_display, GLVisualConfig& visual_config) + return false; + } + +- if (gladLoadEGLUserPtr(EGL_NO_DISPLAY, load_egl_func, &egl_lib_) == 0) { ++ if (gladLoadEGLUserPtr(native_display, load_egl_func, &egl_lib_) == 0) { + Log::error("Loading EGL entry points failed\n"); + return false; + } +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-benchmarks/files/0001-src-options.cpp-Add-options-to-configure-bpp-and-dep.patch b/meta-xilinx-mali400/recipes-benchmarks/files/0001-src-options.cpp-Add-options-to-configure-bpp-and-dep.patch new file mode 100644 index 00000000..015f2f49 --- /dev/null +++ b/meta-xilinx-mali400/recipes-benchmarks/files/0001-src-options.cpp-Add-options-to-configure-bpp-and-dep.patch @@ -0,0 +1,104 @@ +From c5de6efc463c1f8f47d37c2423da983c016b3ce8 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Thu, 27 Jun 2019 16:16:05 -0700 +Subject: [PATCH] src/options.cpp: Add options to configure bpp and depth + +Instead of hardcoding the depth and bpp for drm backend, application +should have a knob to configure the same. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] +--- + src/native-state-drm.cpp | 5 +++-- + src/options.cpp | 10 ++++++++++ + src/options.h | 2 ++ + 3 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/src/native-state-drm.cpp b/src/native-state-drm.cpp +index 62566ee..9743575 100644 +--- a/src/native-state-drm.cpp ++++ b/src/native-state-drm.cpp +@@ -24,6 +24,7 @@ + */ + #include "native-state-drm.h" + #include "log.h" ++#include "options.h" + + #include + #include +@@ -403,7 +404,7 @@ NativeStateDRM::fb_get_from_bo(gbm_bo* bo) + unsigned int stride = gbm_bo_get_stride(bo); + unsigned int handle = gbm_bo_get_handle(bo).u32; + unsigned int fb_id(0); +- int status = drmModeAddFB(fd_, width, height, 24, 32, stride, handle, &fb_id); ++ int status = drmModeAddFB(fd_, width, height, Options::depth, Options::bpp, stride, handle, &fb_id); + if (status < 0) { + Log::error("Failed to create FB: %d\n", status); + return 0; +@@ -428,7 +429,7 @@ NativeStateDRM::init_gbm() + } + + surface_ = gbm_surface_create(dev_, mode_->hdisplay, mode_->vdisplay, +- GBM_FORMAT_XRGB8888, ++ (Options::bpp == 32) ? GBM_FORMAT_XRGB8888 : GBM_FORMAT_RGB565, + GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); + if (!surface_) { + Log::error("Failed to create GBM surface\n"); +diff --git a/src/options.cpp b/src/options.cpp +index 05cd617..7de1ddc 100644 +--- a/src/options.cpp ++++ b/src/options.cpp +@@ -41,6 +41,8 @@ bool Options::reuse_context = false; + bool Options::run_forever = false; + bool Options::annotate = false; + bool Options::offscreen = false; ++int Options::depth = 16; ++int Options::bpp = 16; + GLVisualConfig Options::visual_config; + + static struct option long_options[] = { +@@ -59,6 +61,8 @@ static struct option long_options[] = { + {"show-all-options", 0, 0, 0}, + {"debug", 0, 0, 0}, + {"help", 0, 0, 0}, ++ {"depth", 1, 0, 0}, ++ {"bpp", 1, 0, 0}, + {0, 0, 0, 0} + }; + +@@ -142,6 +146,8 @@ Options::print_help() + " --annotate Annotate the benchmarks with on-screen information\n" + " (same as -b :show-fps=true:title=#info#)\n" + " -d, --debug Display debug messages\n" ++ " --depth Depth for drm backend\n" ++ " --bpp Bpp for drm backend\n" + " -h, --help Display help\n"); + } + +@@ -193,6 +199,10 @@ Options::parse_args(int argc, char **argv) + Options::show_debug = true; + else if (c == 'h' || !strcmp(optname, "help")) + Options::show_help = true; ++ else if (!strcmp(optname, "depth")) ++ Options::depth = Util::fromString(optarg); ++ else if (!strcmp(optname, "bpp")) ++ Options::bpp = Util::fromString(optarg); + } + + return true; +diff --git a/src/options.h b/src/options.h +index f62e02a..04bef5f 100644 +--- a/src/options.h ++++ b/src/options.h +@@ -53,6 +53,8 @@ struct Options { + static bool run_forever; + static bool annotate; + static bool offscreen; ++ static int depth; ++ static int bpp; + static GLVisualConfig visual_config; + }; + +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-benchmarks/glmark2_%.bbappend b/meta-xilinx-mali400/recipes-benchmarks/glmark2_%.bbappend new file mode 100644 index 00000000..9f9ab267 --- /dev/null +++ b/meta-xilinx-mali400/recipes-benchmarks/glmark2_%.bbappend @@ -0,0 +1,14 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +# TODO: Two patches are disabled as they do not apply to the current version of glmark2 +# This will need review by someone familiar with that code +SRC_URI:append = " file://0001-Make-RGB565-as-default-EGLconfig.patch \ + file://0001-src-options.cpp-Add-options-to-configure-bpp-and-dep.patch;apply=0 \ + file://0001-src-gl-state-egl-Use-native_display-to-load-EGL-func.patch;apply=0 \ + " + +PACKAGECONFIG = " \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gl x11-gles2', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'drm-gles2 wayland-gles2', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'fbdev', 'fbdev-glesv2', '', d)} \ +" diff --git a/meta-xilinx-mali400/recipes-devtools/qemu/qemu-xilinx_8.1.0.bbappend b/meta-xilinx-mali400/recipes-devtools/qemu/qemu-xilinx_8.1.0.bbappend new file mode 100644 index 00000000..514cacaa --- /dev/null +++ b/meta-xilinx-mali400/recipes-devtools/qemu/qemu-xilinx_8.1.0.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" diff --git a/meta-xilinx-mali400/recipes-devtools/qemu/qemu_%.bbappend b/meta-xilinx-mali400/recipes-devtools/qemu/qemu_%.bbappend new file mode 100644 index 00000000..514cacaa --- /dev/null +++ b/meta-xilinx-mali400/recipes-devtools/qemu/qemu_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" diff --git a/meta-xilinx-mali400/recipes-gnome/gtk+/gtk+3_%.bbappend b/meta-xilinx-mali400/recipes-gnome/gtk+/gtk+3_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/recipes-gnome/gtk+/gtk+3_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/libepoxy/libepoxy_%.bbappend b/meta-xilinx-mali400/recipes-graphics/libepoxy/libepoxy_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libepoxy/libepoxy_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/libgles/files/egl.pc b/meta-xilinx-mali400/recipes-graphics/libgles/files/egl.pc new file mode 100644 index 00000000..65c4c1f3 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libgles/files/egl.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib +includedir=/usr/include + +Name: egl +Description: MALI EGL library +Requires.private: +Version: 17.3 +Libs: -L${libdir} -lEGL +Libs.private: -lm -lpthread -ldl +Cflags: -I${includedir} diff --git a/meta-xilinx-mali400/recipes-graphics/libgles/files/gbm.pc b/meta-xilinx-mali400/recipes-graphics/libgles/files/gbm.pc new file mode 100644 index 00000000..c40b5f4f --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libgles/files/gbm.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib +includedir=/usr/include + +Name: gbm +Description: MALI gbm library +Requires.private: +Version: 17.3 +Libs: -L${libdir} -lgbm +Libs.private: -lm -lpthread -ldl +Cflags: -I${includedir} diff --git a/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1.pc b/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1.pc new file mode 100644 index 00000000..39467f33 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib +includedir=/usr/include + +Name: glesv1 +Description: MALI OpenGL ES 1.1 library +Requires.private: +Version: 17.3 +Libs: -L${libdir} -lGLESv1_CM +Libs.private: -lm -lpthread -ldl +Cflags: -I${includedir} diff --git a/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1_cm.pc b/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1_cm.pc new file mode 100644 index 00000000..1547b4c8 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv1_cm.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib +includedir=/usr/include + +Name: gles_cm +Description: Mali OpenGL ES 1.1 CM library +Requires.private: +Version: 17.3 +Libs: -L${libdir} -lGLESv1_CM +Libs.private: -lm -lpthread -ldl +Cflags: -I${includedir} diff --git a/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv2.pc b/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv2.pc new file mode 100644 index 00000000..a0a84f23 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libgles/files/glesv2.pc @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib +includedir=/usr/include + +Name: glesv2 +Description: MALI OpenGL ES 2.0 library +Requires.private: +Version: 17.3 +Libs: -L${libdir} -lGLESv2 +Libs.private: -lm -lpthread -ldl +Cflags: -I${includedir} diff --git a/meta-xilinx-mali400/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb b/meta-xilinx-mali400/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb new file mode 100644 index 00000000..7f5fba0b --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libgles/libmali-xlnx_r9p0-01rel0.bb @@ -0,0 +1,199 @@ +DESCRIPTION = "libGLES for ZynqMP with Mali 400" + +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://EULA;md5=82e466d0ed92c5a15f568dbe6b31089c" + +inherit features_check update-alternatives + +ANY_OF_DISTRO_FEATURES = "x11 fbdev wayland" +REQUIRED_MACHINE_FEATURES = "mali400" + +PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +REPO ?= "git://github.com/Xilinx/mali-userspace-binaries.git;protocol=https" +BRANCH ?= "xlnx_rel_v2024.1" +SRCREV ?= "b3a772aad859cdadc8513b11c3e995546c20e75e" +BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" + +SRC_URI = " \ + ${REPO};${BRANCHARG} \ + file://egl.pc \ + file://glesv1_cm.pc \ + file://glesv1.pc \ + file://glesv2.pc \ + file://gbm.pc \ + " + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +S = "${WORKDIR}/git" + +# If were switching at runtime, we would need all RDEPENDS needed for all backends available +X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes" +X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes" + +# Don't install runtime dependencies for other backends unless the DISTRO supports it +RDEPENDS:${PN} = " \ + kernel-module-mali \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \ +" + +# We dont build anything but we want to avoid QA warning build-deps +DEPENDS = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland libdrm', '', d)} \ +" + + +# x11 is default, set to "fbdev" , "wayland", or "headless" if required +MALI_BACKEND_DEFAULT ?= "x11" + +USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}" +USE_FB = "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "yes", "no", d)}" +USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}" + +MONOLITHIC_LIBMALI = "libMali.so.9.0" + +do_install() { + #Identify the ARCH type + ${TARGET_PREFIX}gcc --version > ARCH_PLATFORM + if grep -q aarch64 "ARCH_PLATFORM"; then + ARCH_PLATFORM_DIR=aarch64-linux-gnu + else + ARCH_PLATFORM_DIR=arm-linux-gnueabihf + fi + + # install headers + install -d -m 0655 ${D}${includedir}/EGL + install -m 0644 ${S}/${PV}/glesHeaders/EGL/*.h ${D}${includedir}/EGL/ + install -d -m 0655 ${D}${includedir}/GLES + install -m 0644 ${S}/${PV}/glesHeaders/GLES/*.h ${D}${includedir}/GLES/ + install -d -m 0655 ${D}${includedir}/GLES2 + install -m 0644 ${S}/${PV}/glesHeaders/GLES2/*.h ${D}${includedir}/GLES2/ + install -d -m 0655 ${D}${includedir}/KHR + install -m 0644 ${S}/${PV}/glesHeaders/KHR/*.h ${D}${includedir}/KHR/ + + install -d ${D}${libdir}/pkgconfig + install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc + install -m 0644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc + install -m 0644 ${WORKDIR}/glesv1.pc ${D}${libdir}/pkgconfig/glesv1.pc + install -m 0644 ${WORKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc + + install -d ${D}${libdir} + install -d ${D}${includedir} + + cp -a --no-preserve=ownership ${S}/${PV}/${ARCH_PLATFORM_DIR}/common/*.so* ${D}${libdir} + + install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/headless/${MONOLITHIC_LIBMALI} ${D}${libdir}/headless/${MONOLITHIC_LIBMALI} + ln -snf headless/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} + + if [ "${USE_FB}" = "yes" ]; then + install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/fbdev/${MONOLITHIC_LIBMALI} ${D}${libdir}/fbdev/${MONOLITHIC_LIBMALI} + if [ "${MALI_BACKEND_DEFAULT}" = "fbdev" ]; then + ln -snf fbdev/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} + fi + fi + if [ "${USE_X11}" = "yes" ]; then + install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/x11/${MONOLITHIC_LIBMALI} ${D}${libdir}/x11/${MONOLITHIC_LIBMALI} + if [ "${MALI_BACKEND_DEFAULT}" = "x11" ]; then + ln -snf x11/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} + fi + else + # We cant rely on the fact that all apps will use pkgconfig correctly + sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if (1)/' ${D}${includedir}/EGL/eglplatform.h + fi + if [ "${USE_WL}" = "yes" ]; then + install -m 0644 ${S}/${PV}/glesHeaders/GBM/gbm.h ${D}${includedir}/ + install -m 0644 ${WORKDIR}/gbm.pc ${D}${libdir}/pkgconfig/gbm.pc + install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/wayland/${MONOLITHIC_LIBMALI} ${D}${libdir}/wayland/${MONOLITHIC_LIBMALI} + if [ "${MALI_BACKEND_DEFAULT}" = "wayland" ]; then + ln -snf wayland/${MONOLITHIC_LIBMALI} ${D}${libdir}/${MONOLITHIC_LIBMALI} + fi + fi +} + + +# We need separate packages to provide multiple alternatives, at this point we install +# everything on the default one but that can be split if necessary +PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "x11", "${PN}-x11", "", d)}" +PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "${PN}-fbdev", "", d)}" +PACKAGES += "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "${PN}-wayland", "", d)}" +PACKAGES += "${PN}-headless" + +# This is default/common for all alternatives +ALTERNATIVE_LINK_NAME[libmali-xlnx] = "${libdir}/${MONOLITHIC_LIBMALI}" + + +# Declare alternatives and corresponding library location +ALTERNATIVE:${PN}-x11 = "libmali-xlnx" +ALTERNATIVE_TARGET_libmali-xlnx-x11[libmali-xlnx] = "${libdir}/x11/${MONOLITHIC_LIBMALI}" + +ALTERNATIVE:${PN}-fbdev = "libmali-xlnx" +ALTERNATIVE_TARGET_libmali-xlnx-fbdev[libmali-xlnx] = "${libdir}/fbdev/${MONOLITHIC_LIBMALI}" + +ALTERNATIVE:${PN}-wayland = "libmali-xlnx" +ALTERNATIVE_TARGET_libmali-xlnx-wayland[libmali-xlnx] = "${libdir}/wayland/${MONOLITHIC_LIBMALI}" + +ALTERNATIVE:${PN}-headless = "libmali-xlnx" +ALTERNATIVE_TARGET_libmali-xlnx-headless[libmali-xlnx] = "${libdir}/headless/${MONOLITHIC_LIBMALI}" + +# Set priorities according to what we prveiously defined +ALTERNATIVE_PRIORITY_libmali-xlnx-x11[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "x11", "20", "10", d)}" +ALTERNATIVE_PRIORITY_libmali-xlnx-fbdev[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "fbdev", "20", "10", d)}" +ALTERNATIVE_PRIORITY_libmali-xlnx-wayland[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "wayland", "20", "10", d)}" + +# If misconfigured, fallback to headless +ALTERNATIVE_PRIORITY_libmali-xlnx-headless[libmali-xlnx] = "${@bb.utils.contains("MALI_BACKEND_DEFAULT", "headless", "20", "15", d)}" + + +# Package gets renamed on the debian class, but we want to keep -xlnx +DEBIAN_NOAUTONAME:libmali-xlnx = "1" + +# Update alternatives will actually have separate postinst scripts (one for each package) +# This wont work for us, so we create a common postinst script and we pass that as the general +# libmali-xlnx postinst script, but we defer execution to run on first boot (pkg_postinst_ontarget). +# This will avoid ldconfig removing the symbolic links when creating the root filesystem. +python populate_packages_updatealternatives:append () { + # We need to remove the 'fake' libmali-xlnx before creating any links + libdir = d.getVar('libdir') + common_postinst = "#!/bin/sh\nrm " + libdir + "/${MONOLITHIC_LIBMALI}\n" + for pkg in (d.getVar('PACKAGES') or "").split(): + # Not all packages provide an alternative (e.g. ${PN}-lic) + postinst = d.getVar('pkg_postinst:%s' % pkg) + if postinst: + old_postinst = postinst + new_postinst = postinst.replace('#!/bin/sh','') + common_postinst += new_postinst + d.setVar('pkg_postinst_ontarget:%s' % 'libmali-xlnx', common_postinst) +} + + +# Inhibit warnings about files being stripped +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" + +RREPLACES:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" +RPROVIDES:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" +RCONFLICTS:${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" + +# These libraries shouldn't get installed in world builds unless something +# explicitly depends upon them. +EXCLUDE_FROM_WORLD = "1" +FILES:${PN} += "${libdir}/*" + +do_package:append() { + + shlibswork_dir = d.getVar('SHLIBSWORKDIR') + pkg_filename = d.getVar('PN') + ".list" + shlibs_file = os.path.join(shlibswork_dir, pkg_filename) + lines = "" + with open(shlibs_file, "r") as f: + lines = f.readlines() + with open(shlibs_file, "w") as f: + for line in lines: + if d.getVar('MALI_BACKEND_DEFAULT') in line.strip("\n"): + f.write(line) +} diff --git a/meta-xilinx-mali400/recipes-graphics/libglu/libglu_%.bbappend b/meta-xilinx-mali400/recipes-graphics/libglu/libglu_%.bbappend new file mode 100644 index 00000000..e824a179 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libglu/libglu_%.bbappend @@ -0,0 +1,11 @@ +# OpenGL comes from libmali, adjust parameters +MALI_DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', ' virtual/libgles2', '', d)}" +DEPENDS:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' ${MALI_DEPENDS}', '', d)}" + +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/libsdl2/libsdl2_%.bbappend b/meta-xilinx-mali400/recipes-graphics/libsdl2/libsdl2_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/libsdl2/libsdl2_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch new file mode 100644 index 00000000..3c82f602 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0001-Change-Makefile-to-be-compatible-with-Yocto.patch @@ -0,0 +1,47 @@ +From 6d283b9aa3f7fb761da4cb076b47a62275fc4caa Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 21 Nov 2017 03:57:25 -0800 +Subject: [PATCH 1/9] Change Makefile to be compatible with Yocto + +Signed-off-by: Manjukumar Matha +Signed-off-by: Hyun Kwon +Signed-off-by: Madhurkiran Harikrishnan +Upstream Status: Inappropriate [Xilinx specific] +--- + driver/src/devicedrv/mali/Makefile | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/driver/src/devicedrv/mali/Makefile b/driver/src/devicedrv/mali/Makefile +index 5a259fe..a6dd94c 100644 +--- Makefile ++++ b/Makefile +@@ -89,7 +89,11 @@ endif + # Define host system directory + KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build + +-include $(KDIR)/.config ++ifeq ($(O),) ++ -include $(KDIR)/.config ++else ++ -include $(O)/.config ++endif + + ifeq ($(ARCH), arm) + # when compiling for ARM we're cross compiling +@@ -204,9 +208,12 @@ EXTRA_DEFINES += -DMALI_MEM_SWAP_TRACKING=1 + endif + + all: $(UMP_SYMVERS_FILE) +- $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules ++ $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) O=$(O) modules + @rm $(FILES_PREFIX)__malidrv_build_info.c $(FILES_PREFIX)__malidrv_build_info.o + ++modules_install: ++ $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules_install ++ + clean: + $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean + +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch new file mode 100644 index 00000000..0a7b6736 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch @@ -0,0 +1,52 @@ +From f27aab2b0e4d5dea9b5a0e4648c142257940c428 Mon Sep 17 00:00:00 2001 +From: Hyun Kwon +Date: Thu, 25 Jun 2015 17:14:42 -0700 +Subject: [PATCH 2/9] staging: mali: r8p0-01rel0: Add the ZYNQ/ZYNQMP platform + +Add the number of PP cores that is required for Zynq/ZynqMP configuration. + +Signed-off-by: Hyun Kwon +Signed-off-by: Michal Simek +Upstream Status: Inappropriate [Xilinx specific] +--- + driver/src/devicedrv/mali/platform/arm/arm.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c +index 4e09aca..fac99bc 100644 +--- platform/arm/arm.c ++++ b/platform/arm/arm.c +@@ -261,6 +261,10 @@ static struct mali_gpu_device_data mali_gpu_data = { + .dedicated_mem_start = 0x80000000, /* Physical start address (use 0xD0000000 for old indirect setup) */ + .dedicated_mem_size = 0x10000000, /* 256MB */ + #endif ++#if defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP) ++ .fb_start = 0x00000000, ++ .fb_size = 0xfffff000, ++#else + #if defined(CONFIG_ARM64) + /* Some framebuffer drivers get the framebuffer dynamically, such as through GEM, + * in which the memory resource can't be predicted in advance. +@@ -271,6 +275,7 @@ static struct mali_gpu_device_data mali_gpu_data = { + .fb_start = 0xe0000000, + .fb_size = 0x01000000, + #endif ++#endif /* !defined(CONFIG_ARCH_ZYNQ) && !defined(CONFIG_ARCH_ZYNQMP) */ + .control_interval = 1000, /* 1000ms */ + .utilization_callback = mali_gpu_utilization_callback, + .get_clock_info = NULL, +@@ -505,6 +510,11 @@ int mali_platform_device_init(struct platform_device *device) + mali_write_phys(0xC0010020, 0xA); /* Enable direct memory mapping for FPGA */ + } + } ++#elif defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP) ++ ++ MALI_DEBUG_PRINT(4, ("Registering Zynq/ZynqMP Mali-400 device\n")); ++ num_pp_cores = 2; ++ + #endif + + /* After kernel 3.15 device tree will default set dev +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch new file mode 100644 index 00000000..98aa6ac9 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch @@ -0,0 +1,35 @@ +From d6e44bbf8d1377f78481f611dec237e8d24baf74 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 21 Nov 2017 04:00:27 -0800 +Subject: [PATCH 3/9] staging: mali: r8p0-01rel0: Remove unused trace macros + +TRACE_SYSTEM_STRING is not need in each trace file anymore. + +Signed-off-by: Hyun Kwon +Signed-off-by: Madhurkiran Harikrishnan +Upstream Status: Pending +--- + driver/src/devicedrv/mali/linux/mali_linux_trace.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/driver/src/devicedrv/mali/linux/mali_linux_trace.h b/driver/src/devicedrv/mali/linux/mali_linux_trace.h +index 7f0b19d..33cb1ca 100644 +--- linux/mali_linux_trace.h ++++ b/linux/mali_linux_trace.h +@@ -13,13 +13,11 @@ + + #include + +-#include + #include + + #undef TRACE_SYSTEM + #define TRACE_SYSTEM mali + #ifndef TRACEPOINTS_ENABLED +-#define TRACE_SYSTEM_STRING __stringfy(TRACE_SYSTEM) + #endif + #define TRACE_INCLUDE_PATH . + #define TRACE_INCLUDE_FILE mali_linux_trace +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch new file mode 100644 index 00000000..c5c49679 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch @@ -0,0 +1,47 @@ +From 2f5e8944357f43fbde4cb642c6ee4a699c88efb5 Mon Sep 17 00:00:00 2001 +From: Hyun Kwon +Date: Wed, 29 Jun 2016 09:14:37 -0700 +Subject: [PATCH 4/9] staging: mali: r8p0-01rel0: Don't include + mali_read_phys() for zynq/zynqmp + +mali_read_phys() is not used with CONFIG_ARCH_ZYNQ and CONFIG_ARCH_ZYNQMP. + +Signed-off-by: Hyun Kwon +Upstream Status: Inappropriate [Xilinx specific] +--- + driver/src/devicedrv/mali/platform/arm/arm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c +index fac99bc..62f9be6 100644 +--- platform/arm/arm.c ++++ b/platform/arm/arm.c +@@ -38,7 +38,9 @@ + static int mali_core_scaling_enable = 0; + + void mali_gpu_utilization_callback(struct mali_gpu_utilization_data *data); ++#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)) + static u32 mali_read_phys(u32 phys_addr); ++#endif + #if defined(CONFIG_ARCH_REALVIEW) + static void mali_write_phys(u32 phys_addr, u32 value); + #endif +@@ -578,6 +580,7 @@ int mali_platform_device_deinit(struct platform_device *device) + + #endif /* CONFIG_MALI_DT */ + ++#if !(defined(CONFIG_ARCH_ZYNQ) || defined(CONFIG_ARCH_ZYNQMP)) + static u32 mali_read_phys(u32 phys_addr) + { + u32 phys_addr_page = phys_addr & 0xFFFFE000; +@@ -592,6 +595,7 @@ static u32 mali_read_phys(u32 phys_addr) + + return ret; + } ++#endif + + #if defined(CONFIG_ARCH_REALVIEW) + static void mali_write_phys(u32 phys_addr, u32 value) +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch new file mode 100644 index 00000000..3d784604 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch @@ -0,0 +1,90 @@ +From e67e20ec6ff0c9720d87844270421453c738066a Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Thu, 16 Feb 2017 12:15:58 -0800 +Subject: [PATCH 5/9] linux/mali_kernel_linux.c: Handle clock when probed and + removed + +This patch will handle the clock through clock +specifier for GPU PP0 and PP1. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream Status: Inappropriate [Xilinx specific] +--- + .../src/devicedrv/mali/linux/mali_kernel_linux.c | 40 +++++++++++++++++++++- + 1 file changed, 39 insertions(+), 1 deletion(-) + +diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c +index d7893a3..f15fb56 100644 +--- linux/mali_kernel_linux.c ++++ b/linux/mali_kernel_linux.c +@@ -45,6 +45,14 @@ + #if defined(CONFIG_MALI400_INTERNAL_PROFILING) + #include "mali_profiling_internal.h" + #endif ++ ++#if defined(CONFIG_ARCH_ZYNQMP) ++/* Initialize variables for clocks */ ++struct clk *clk_gpu; ++struct clk *clk_gpu_pp0; ++struct clk *clk_gpu_pp1; ++#endif ++ + #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS) + #include "mali_osk_profiling.h" + #include "mali_dvfs_policy.h" +@@ -580,7 +588,23 @@ static int mali_probe(struct platform_device *pdev) + } + #endif + +- ++#if defined(CONFIG_ARCH_ZYNQMP) ++ /* Initialize clocks for GPU and PP */ ++ clk_gpu = devm_clk_get(&pdev->dev, "gpu"); ++ if (IS_ERR(clk_gpu)) ++ return PTR_ERR(clk_gpu); ++ clk_prepare_enable(clk_gpu); ++ ++ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); ++ if (IS_ERR(clk_gpu_pp0)) ++ return PTR_ERR(clk_gpu_pp0); ++ clk_prepare_enable(clk_gpu_pp0); ++ ++ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); ++ if (IS_ERR(clk_gpu_pp1)) ++ return PTR_ERR(clk_gpu_pp1); ++ clk_prepare_enable(clk_gpu_pp1); ++#endif + if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) { + /* Initialize the Mali GPU HW specified by pdev */ + if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) { +@@ -608,6 +632,12 @@ static int mali_probe(struct platform_device *pdev) + _mali_osk_wq_term(); + } + ++#if defined(CONFIG_ARCH_ZYNQMP) ++ clk_disable_unprepare(clk_gpu); ++ clk_disable_unprepare(clk_gpu_pp0); ++ clk_disable_unprepare(clk_gpu_pp1); ++#endif ++ + #ifdef CONFIG_MALI_DEVFREQ + mali_devfreq_term(mdev); + devfreq_init_failed: +@@ -673,6 +703,14 @@ static int mali_remove(struct platform_device *pdev) + mali_platform_device_deinit(mali_platform_device); + #endif + mali_platform_device = NULL; ++ ++#if defined(CONFIG_ARCH_ZYNQMP) ++ /* Remove clock */ ++ clk_disable_unprepare(clk_gpu); ++ clk_disable_unprepare(clk_gpu_pp0); ++ clk_disable_unprepare(clk_gpu_pp1); ++#endif ++ + return 0; + } + +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch new file mode 100644 index 00000000..3e1745fd --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch @@ -0,0 +1,35 @@ +From ed7242238151c12029c566d1974058c579d8ae3d Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 25 Jan 2017 10:00:33 -0800 +Subject: [PATCH 6/9] arm.c: global variable dma_ops is removed from the kernel + 4.7 + +Refer kernel commit 1dccb598df549d892b6450c261da54cdd7af44b4, the global +dma_ops variable and the special-casing for ACPI is removed , and just +returns the dma ops that got set for the device, or the dummy_dma_ops +if none were present. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream Status: Pending +--- + driver/src/devicedrv/mali/platform/arm/arm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/driver/src/devicedrv/mali/platform/arm/arm.c b/driver/src/devicedrv/mali/platform/arm/arm.c +index 62f9be6..57ca989 100644 +--- platform/arm/arm.c ++++ b/platform/arm/arm.c +@@ -529,8 +529,9 @@ int mali_platform_device_init(struct platform_device *device) + */ + if (!device->dev.dma_mask) + device->dev.dma_mask = &device->dev.coherent_dma_mask; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)) + device->dev.archdata.dma_ops = dma_ops; +- ++#endif + err = platform_device_add_data(device, &mali_gpu_data, sizeof(mali_gpu_data)); + + if (0 == err) { +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch new file mode 100644 index 00000000..98a86c88 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch @@ -0,0 +1,31 @@ +From 58e2c55176f1a146781430b2a570c8ce5f80d426 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Mon, 28 Aug 2017 09:40:37 -0700 +Subject: [PATCH] common/mali_pm.c: Add PM runtime barrier after removing + suspend + +Runtime PM suspend "put" results in addition of PM suspend +API in work queue. This barrier API will remove it from +the work queue. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Pending +--- + driver/src/devicedrv/mali/common/mali_pm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/driver/src/devicedrv/mali/common/mali_pm.c b/driver/src/devicedrv/mali/common/mali_pm.c +index 858c689..62a1e5f 100644 +--- common/mali_pm.c ++++ b/common/mali_pm.c +@@ -301,6 +301,7 @@ void mali_pm_init_end(void) + } + + _mali_osk_pm_dev_ref_put(); ++ _mali_osk_pm_dev_barrier(); + } + + void mali_pm_update_sync(void) +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch new file mode 100644 index 00000000..38ab4042 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch @@ -0,0 +1,153 @@ +From aeff13ad9e9ef73172a9325f669aefd3c0403dbb Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 21 Feb 2018 16:52:15 -0800 +Subject: [PATCH] linux/mali_kernel_linux.c: Enable/disable clock for runtime + resume/suspend + +Enable/Disable the clock for GP,PP0 and PP1 during runtime +resume/suspend. + +Signed-off-by: Madhurkiran Harikrishnan +Reviewed-by: Hyun Kwon +Upstream Status: Inappropriate [Xilinx specific] +--- + .../src/devicedrv/mali/linux/mali_kernel_linux.c | 65 ++++++++++++++++++---- + 1 file changed, 54 insertions(+), 11 deletions(-) + +diff --git a/driver/src/devicedrv/mali/linux/mali_kernel_linux.c b/driver/src/devicedrv/mali/linux/mali_kernel_linux.c +index f15fb56..e61f33b 100644 +--- linux/mali_kernel_linux.c ++++ b/linux/mali_kernel_linux.c +@@ -51,6 +51,7 @@ + struct clk *clk_gpu; + struct clk *clk_gpu_pp0; + struct clk *clk_gpu_pp1; ++mali_bool clk_enabled; + #endif + + #if defined(CONFIG_MALI400_PROFILING) && defined(CONFIG_MALI_DVFS) +@@ -281,6 +282,46 @@ struct file_operations mali_fops = { + .mmap = mali_mmap + }; + ++static int mali_enable_clk(void) ++{ ++#if defined(CONFIG_ARCH_ZYNQMP) ++ int err = 0; ++ ++ if (clk_enabled) ++ return 0; ++ ++ clk_enabled = MALI_TRUE; ++ err = clk_prepare_enable(clk_gpu); ++ if (err) { ++ MALI_PRINT_ERROR(("Could not enable clock for GP\n\r")); ++ return err; ++ } ++ err = clk_prepare_enable(clk_gpu_pp0); ++ if (err) { ++ MALI_PRINT_ERROR(("Could not enable clock for PP0\n\r")); ++ return err; ++ } ++ err = clk_prepare_enable(clk_gpu_pp1); ++ if (err) { ++ MALI_PRINT_ERROR(("Could not enable clock for PP1\n\r")); ++ return err; ++ } ++#endif ++ return 0; ++} ++ ++static void mali_disable_clk(void) ++{ ++#if defined(CONFIG_ARCH_ZYNQMP) ++ if (clk_enabled) { ++ clk_enabled = MALI_FALSE; ++ clk_disable_unprepare(clk_gpu); ++ clk_disable_unprepare(clk_gpu_pp0); ++ clk_disable_unprepare(clk_gpu_pp1); ++ } ++#endif ++} ++ + #if MALI_ENABLE_CPU_CYCLES + void mali_init_cpu_time_counters(int reset, int enable_divide_by_64) + { +@@ -593,18 +634,19 @@ static int mali_probe(struct platform_device *pdev) + clk_gpu = devm_clk_get(&pdev->dev, "gpu"); + if (IS_ERR(clk_gpu)) + return PTR_ERR(clk_gpu); +- clk_prepare_enable(clk_gpu); + + clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); + if (IS_ERR(clk_gpu_pp0)) + return PTR_ERR(clk_gpu_pp0); +- clk_prepare_enable(clk_gpu_pp0); + + clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); + if (IS_ERR(clk_gpu_pp1)) + return PTR_ERR(clk_gpu_pp1); +- clk_prepare_enable(clk_gpu_pp1); + #endif ++ ++ err = mali_enable_clk(); ++ if (err) ++ return err; + if (_MALI_OSK_ERR_OK == _mali_osk_wq_init()) { + /* Initialize the Mali GPU HW specified by pdev */ + if (_MALI_OSK_ERR_OK == mali_initialize_subsystems()) { +@@ -632,11 +674,6 @@ static int mali_probe(struct platform_device *pdev) + _mali_osk_wq_term(); + } + +-#if defined(CONFIG_ARCH_ZYNQMP) +- clk_disable_unprepare(clk_gpu); +- clk_disable_unprepare(clk_gpu_pp0); +- clk_disable_unprepare(clk_gpu_pp1); +-#endif + + #ifdef CONFIG_MALI_DEVFREQ + mali_devfreq_term(mdev); +@@ -644,6 +681,7 @@ devfreq_init_failed: + mali_pm_metrics_term(mdev); + pm_metrics_init_failed: + clk_disable_unprepare(mdev->clock); ++ mali_disable_clk(); + clock_prepare_failed: + clk_put(mdev->clock); + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && defined(CONFIG_OF) \ +@@ -706,9 +744,7 @@ static int mali_remove(struct platform_device *pdev) + + #if defined(CONFIG_ARCH_ZYNQMP) + /* Remove clock */ +- clk_disable_unprepare(clk_gpu); +- clk_disable_unprepare(clk_gpu_pp0); +- clk_disable_unprepare(clk_gpu_pp1); ++ mali_disable_clk(); + #endif + + return 0; +@@ -816,6 +852,8 @@ static int mali_driver_runtime_suspend(struct device *dev) + devfreq_suspend_device(mdev->devfreq); + #endif + ++ mali_disable_clk(); ++ + return 0; + } else { + return -EBUSY; +@@ -824,6 +862,11 @@ static int mali_driver_runtime_suspend(struct device *dev) + + static int mali_driver_runtime_resume(struct device *dev) + { ++ int err ; ++ ++ err = mali_enable_clk(); ++ if (err) ++ return err; + #ifdef CONFIG_MALI_DEVFREQ + struct mali_device *mdev = dev_get_drvdata(dev); + if (!mdev) +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch new file mode 100644 index 00000000..24f0a22c --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch @@ -0,0 +1,33 @@ +From 779b1883d56804ecd08fe7f57d6c01e3db4e893b Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 5 Dec 2018 18:07:29 -0800 +Subject: [PATCH 1/3] linux: mali_memory_os_alloc: Remove __GFP_COLD + +The support for Cache hot and cold pages are removed from the kernel. +For more information refer kernel commit 453f85d43fa9ee243f0fc3ac4e1be45615301e3f + +Signed-off-by: Madhurkiran Harikrishnan +Reviewed-by: Hyun Kwon +Upstream Status: Pending +--- + driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c +index 1602371..830e8c6 100644 +--- linux/mali_memory_os_alloc.c ++++ b/linux/mali_memory_os_alloc.c +@@ -202,7 +202,9 @@ int mali_mem_os_alloc_pages(mali_mem_os_mem *os_mem, u32 size) + /* Allocate new pages, if needed. */ + for (i = 0; i < remaining; i++) { + dma_addr_t dma_addr; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN; ++#elif LINUX_VERSION_CODE == KERNEL_VERSION(4, 14, 0) + gfp_t flags = __GFP_ZERO | __GFP_RETRY_MAYFAIL | __GFP_NOWARN | __GFP_COLD; + #else + gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD; +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch new file mode 100644 index 00000000..c28a83f4 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch @@ -0,0 +1,34 @@ +From d20b6eb3e48e56558488dbdda98875b1aed0c29f Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Wed, 5 Dec 2018 18:13:28 -0800 +Subject: [PATCH 2/3] linux: mali_memory_secure: Add header file dma-direct.h + +Add dma-direct.h header, as API dma_to_phys is defined here. +refer kernel commit ea8c64ace86647260ec4255f483e5844d62af2df + +Signed-off-by: Madhurkiran Harikrishnan +Reviewed-by: Hyun Kwon +Upstream Status: Pending +--- + driver/src/devicedrv/mali/linux/mali_memory_secure.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c +index 2836b1b..4f55fa5 100644 +--- linux/mali_memory_secure.c ++++ b/linux/mali_memory_secure.c +@@ -13,7 +13,11 @@ + #include "mali_memory_secure.h" + #include "mali_osk.h" + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0) ++#include ++#else + #include ++#endif + #include + + _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd) +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch new file mode 100644 index 00000000..a7c1d5cc --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0014-linux-mali_-timer-Get-rid-of-init_timer.patch @@ -0,0 +1,156 @@ +From b6936450484b5aa9dd2438367a907af020341d1d Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Thu, 6 Dec 2018 13:30:44 -0800 +Subject: [PATCH 3/3] linux: mali_*timer: Get rid of init_timer + +kernel 4.19 got rid of ancient init_timer. Hence, replace it with +timer_setup API. For more information refer kernel commit +7eeb6b893bd28c68b6d664de1d3120e49b855cdb + +Signed-off-by: Madhurkiran Harikrishnan +Reviewed-by: Hyun Kwon +Upstream Status: Pending +--- + driver/src/devicedrv/mali/common/mali_control_timer.c | 6 ++++++ + driver/src/devicedrv/mali/common/mali_group.c | 6 ++++++ + driver/src/devicedrv/mali/common/mali_osk.h | 15 ++++++++++++++- + driver/src/devicedrv/mali/linux/mali_osk_timers.c | 15 ++++++++++++++- + 4 files changed, 40 insertions(+), 2 deletions(-) + +diff --git a/driver/src/devicedrv/mali/common/mali_control_timer.c b/driver/src/devicedrv/mali/common/mali_control_timer.c +index 1296ffe..d24b934 100644 +--- common/mali_control_timer.c ++++ b/common/mali_control_timer.c +@@ -65,11 +65,17 @@ _mali_osk_errcode_t mali_control_timer_init(void) + } + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ mali_control_timer = _mali_osk_timer_init(mali_control_timer_callback); ++#else + mali_control_timer = _mali_osk_timer_init(); ++#endif + if (NULL == mali_control_timer) { + return _MALI_OSK_ERR_FAULT; + } ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) + _mali_osk_timer_setcallback(mali_control_timer, mali_control_timer_callback, NULL); ++#endif + + return _MALI_OSK_ERR_OK; + } +diff --git a/driver/src/devicedrv/mali/common/mali_group.c b/driver/src/devicedrv/mali/common/mali_group.c +index 5c7b3f4..1702e9a 100644 +--- common/mali_group.c ++++ b/common/mali_group.c +@@ -65,9 +65,15 @@ struct mali_group *mali_group_create(struct mali_l2_cache_core *core, + + group = _mali_osk_calloc(1, sizeof(struct mali_group)); + if (NULL != group) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ group->timeout_timer = _mali_osk_timer_init(mali_group_timeout); ++#else + group->timeout_timer = _mali_osk_timer_init(); ++#endif + if (NULL != group->timeout_timer) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) + _mali_osk_timer_setcallback(group->timeout_timer, mali_group_timeout, (void *)group); ++#endif + + group->l2_cache_core[0] = core; + _mali_osk_list_init(&group->group_list); +diff --git a/driver/src/devicedrv/mali/common/mali_osk.h b/driver/src/devicedrv/mali/common/mali_osk.h +index a501778..fe93d79 100644 +--- common/mali_osk.h ++++ b/common/mali_osk.h +@@ -947,7 +947,17 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_ + * asked for. + * + * @{ */ +- ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++/** @brief Initialize a timer ++ * ++ * Allocates resources for a new timer, and initializes them. This does not ++ * start the timer. ++ * ++ * @param callback Function to call when timer expires ++ * @return a pointer to the allocated timer object, or NULL on failure. ++ */ ++_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback); ++#else + /** @brief Initialize a timer + * + * Allocates resources for a new timer, and initializes them. This does not +@@ -956,6 +966,7 @@ _mali_osk_errcode_t _mali_osk_notification_queue_dequeue(_mali_osk_notification_ + * @return a pointer to the allocated timer object, or NULL on failure. + */ + _mali_osk_timer_t *_mali_osk_timer_init(void); ++#endif + + /** @brief Start a timer + * +@@ -1034,6 +1045,7 @@ void _mali_osk_timer_del_async(_mali_osk_timer_t *tim); + */ + mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) + /** @brief Set a timer's callback parameters. + * + * This must be called at least once before a timer is started/modified. +@@ -1047,6 +1059,7 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim); + * @param data Function-specific data to supply to the function on expiry. + */ + void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data); ++#endif + + /** @brief Terminate a timer, and deallocate resources. + * +diff --git a/driver/src/devicedrv/mali/linux/mali_osk_timers.c b/driver/src/devicedrv/mali/linux/mali_osk_timers.c +index e5d7238..f9b5a86 100644 +--- linux/mali_osk_timers.c ++++ b/linux/mali_osk_timers.c +@@ -21,13 +21,24 @@ + struct _mali_osk_timer_t_struct { + struct timer_list timer; + }; +- ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++typedef void (*timer_timeout_function_t)(struct timer_list *); ++#else + typedef void (*timer_timeout_function_t)(unsigned long); ++#endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback) ++#else + _mali_osk_timer_t *_mali_osk_timer_init(void) ++#endif + { + _mali_osk_timer_t *t = (_mali_osk_timer_t *)kmalloc(sizeof(_mali_osk_timer_t), GFP_KERNEL); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ if (NULL != t) timer_setup(&t->timer, (timer_timeout_function_t)callback, 0); ++#else + if (NULL != t) init_timer(&t->timer); ++#endif + return t; + } + +@@ -62,12 +73,14 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim) + return 1 == timer_pending(&(tim->timer)); + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) + void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data) + { + MALI_DEBUG_ASSERT_POINTER(tim); + tim->timer.data = (unsigned long)data; + tim->timer.function = (timer_timeout_function_t)callback; + } ++#endif + + void _mali_osk_timer_term(_mali_osk_timer_t *tim) + { +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch new file mode 100644 index 00000000..5363c37e --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch @@ -0,0 +1,17 @@ +Index: mali/linux/mali_memory_os_alloc.c +=================================================================== +--- mali.orig/linux/mali_memory_os_alloc.c ++++ mali/linux/mali_memory_os_alloc.c +@@ -239,8 +239,10 @@ int mali_mem_os_alloc_pages(mali_mem_os_ + /* Ensure page is flushed from CPU caches. */ + dma_addr = dma_map_page(&mali_platform_device->dev, new_page, + 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); +- dma_unmap_page(&mali_platform_device->dev, dma_addr, +- _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); ++ err = dma_mapping_error(&mali_platform_device->dev, dma_addr); ++ if (likely(!err)) ++ dma_unmap_page(&mali_platform_device->dev, dma_addr, ++ _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); + dma_addr = dma_map_page(&mali_platform_device->dev, new_page, + 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL); + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch new file mode 100644 index 00000000..dc8bbebf --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch @@ -0,0 +1,47 @@ +From 8cf1dd43f3f25cb4afb84dfc3b0e7c02bc8f7f0c Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Mon, 24 Feb 2020 18:19:37 -0800 +Subject: [LINUX][rel-v2020.1][PATCH v1 1/3] mali_memory_secure: Kernel 5.0 + onwards 'access_ok' API does not take 'type' as input parameter + +'access_ok' no longer needs 'type' as input paramter from kernel 5.0 +onwards. + +Signed-off-by: Madhurkiran Harikrishnan +--- + driver/src/devicedrv/mali/linux/mali_ukk_mem.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/driver/src/devicedrv/mali/linux/mali_ukk_mem.c b/driver/src/devicedrv/mali/linux/mali_ukk_mem.c +index 4ec57dc..270bb6d 100644 +--- linux/mali_ukk_mem.c ++++ b/linux/mali_ukk_mem.c +@@ -207,8 +207,13 @@ int mem_write_safe_wrapper(struct mali_session_data *session_data, _mali_uk_mem_ + kargs.ctx = (uintptr_t)session_data; + + /* Check if we can access the buffers */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++ if (!access_ok((const void __user *)kargs.dest, kargs.size) ++ || !access_ok((const void __user *)kargs.src, kargs.size)) { ++#else + if (!access_ok(VERIFY_WRITE, kargs.dest, kargs.size) + || !access_ok(VERIFY_READ, kargs.src, kargs.size)) { ++#endif + return -EINVAL; + } + +@@ -266,7 +271,11 @@ int mem_dump_mmu_page_table_wrapper(struct mali_session_data *session_data, _mal + goto err_exit; + + user_buffer = (void __user *)(uintptr_t)kargs.buffer; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++ if (!access_ok(user_buffer, kargs.size)) ++#else + if (!access_ok(VERIFY_WRITE, user_buffer, kargs.size)) ++#endif + goto err_exit; + + /* allocate temporary buffer (kernel side) to store mmu page table info */ +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch new file mode 100644 index 00000000..9c4bbee9 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch @@ -0,0 +1,146 @@ +From 953cab73b8bc487da330aa454abd7f8c7466737e Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Mon, 24 Feb 2020 18:32:16 -0800 +Subject: [LINUX][rel-v2020.1][PATCH v1 2/3] Support for vm_insert_pfn + deprecated from kernel 4.20 + +From kernel 4.20 onwards, support for vm_insert_pfn is deprecated. +Hence, replace the same with vmf_insert_pfn. + +Signed-off-by: Madhurkiran Harikrishnan +--- + .../devicedrv/mali/linux/mali_memory_block_alloc.c | 6 +++++- + driver/src/devicedrv/mali/linux/mali_memory_cow.c | 14 ++++++++++++-- + .../src/devicedrv/mali/linux/mali_memory_os_alloc.c | 20 +++++++++++++++++--- + driver/src/devicedrv/mali/linux/mali_memory_secure.c | 7 ++++++- + 4 files changed, 40 insertions(+), 7 deletions(-) + +diff --git a/driver/src/devicedrv/mali/linux/mali_memory_block_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_block_alloc.c +index 0c5b6c3..e528699 100644 +--- linux/mali_memory_block_alloc.c ++++ b/linux/mali_memory_block_alloc.c +@@ -309,9 +309,13 @@ int mali_mem_block_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *v + + list_for_each_entry(m_page, &block_mem->pfns, list) { + MALI_DEBUG_ASSERT(m_page->type == MALI_PAGE_NODE_BLOCK); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); +- + if (unlikely(0 != ret)) { ++#endif + return -EFAULT; + } + addr += _MALI_OSK_MALI_PAGE_SIZE; +diff --git a/driver/src/devicedrv/mali/linux/mali_memory_cow.c b/driver/src/devicedrv/mali/linux/mali_memory_cow.c +index f1d44fe..1dae1d6 100644 +--- linux/mali_memory_cow.c ++++ b/linux/mali_memory_cow.c +@@ -532,9 +532,14 @@ int mali_mem_cow_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma + * flush which makes it way slower than remap_pfn_range or vm_insert_pfn. + ret = vm_insert_page(vma, addr, page); + */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, addr, _mali_page_node_get_pfn(m_page)); +- + if (unlikely(0 != ret)) { ++#endif ++ + return ret; + } + addr += _MALI_OSK_MALI_PAGE_SIZE; +@@ -569,9 +574,14 @@ _mali_osk_errcode_t mali_mem_cow_cpu_map_pages_locked(mali_mem_backend *mem_bken + + list_for_each_entry(m_page, &cow->pages, list) { + if ((count >= offset) && (count < offset + num)) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, vaddr, _mali_page_node_get_pfn(m_page)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, vaddr, _mali_page_node_get_pfn(m_page)); +- + if (unlikely(0 != ret)) { ++#endif ++ + if (count == offset) { + return _MALI_OSK_ERR_FAULT; + } else { +diff --git a/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c b/driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c +index 3fb6f05..7de3920 100644 +--- linux/mali_memory_os_alloc.c ++++ b/linux/mali_memory_os_alloc.c +@@ -378,9 +378,14 @@ int mali_mem_os_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma) + ret = vm_insert_page(vma, addr, page); + */ + page = m_page->page; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, addr, page_to_pfn(page)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, addr, page_to_pfn(page)); +- + if (unlikely(0 != ret)) { ++#endif ++ + return -EFAULT; + } + addr += _MALI_OSK_MALI_PAGE_SIZE; +@@ -416,9 +421,13 @@ _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bken + + vm_end -= _MALI_OSK_MALI_PAGE_SIZE; + if (mapping_page_num > 0) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, vm_end, page_to_pfn(m_page->page)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, vm_end, page_to_pfn(m_page->page)); +- + if (unlikely(0 != ret)) { ++#endif + /*will return -EBUSY If the page has already been mapped into table, but it's OK*/ + if (-EBUSY == ret) { + break; +@@ -439,9 +448,14 @@ _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bken + list_for_each_entry(m_page, &os_mem->pages, list) { + if (count >= offset) { + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, vstart, page_to_pfn(m_page->page)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, vstart, page_to_pfn(m_page->page)); +- + if (unlikely(0 != ret)) { ++#endif ++ + /*will return -EBUSY If the page has already been mapped into table, but it's OK*/ + if (-EBUSY == ret) { + break; +diff --git a/driver/src/devicedrv/mali/linux/mali_memory_secure.c b/driver/src/devicedrv/mali/linux/mali_memory_secure.c +index 5546304..cebd1c8 100644 +--- linux/mali_memory_secure.c ++++ b/linux/mali_memory_secure.c +@@ -132,9 +132,14 @@ int mali_mem_secure_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct * + MALI_DEBUG_ASSERT(0 == size % _MALI_OSK_MALI_PAGE_SIZE); + + for (j = 0; j < size / _MALI_OSK_MALI_PAGE_SIZE; j++) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ ret = vmf_insert_pfn(vma, addr, PFN_DOWN(phys)); ++ if (unlikely(VM_FAULT_ERROR & ret)) { ++#else + ret = vm_insert_pfn(vma, addr, PFN_DOWN(phys)); +- + if (unlikely(0 != ret)) { ++#endif ++ + return -EFAULT; + } + addr += _MALI_OSK_MALI_PAGE_SIZE; +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch new file mode 100644 index 00000000..9797db62 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch @@ -0,0 +1,32 @@ +From ad5c569f0cc40698699fc2f2c1db3ceb9f8b8f35 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 25 Feb 2020 11:36:01 -0800 +Subject: [LINUX][rel-v2020.1][PATCH v1 3/3] Change return type to vm_fault_t + for fault handler + +From kernel 4.17 onwards the return type of fault handler for +vm_operations is of type 'vm_fault_t'. + +Signed-off-by: Madhurkiran Harikrishnan +--- + driver/src/devicedrv/mali/linux/mali_memory.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/driver/src/devicedrv/mali/linux/mali_memory.c b/driver/src/devicedrv/mali/linux/mali_memory.c +index c0f0982..2b2b209 100644 +--- linux/mali_memory.c ++++ b/linux/mali_memory.c +@@ -70,7 +70,9 @@ static void mali_mem_vma_close(struct vm_area_struct *vma) + } + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) ++static vm_fault_t mali_mem_vma_fault(struct vm_fault *vmf) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + static int mali_mem_vma_fault(struct vm_fault *vmf) + #else + static int mali_mem_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch new file mode 100644 index 00000000..154bb673 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch @@ -0,0 +1,36 @@ +From c6a6b39cea3fdfd91cae7f2a4ef6f36d2c55fdd6 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 25 Feb 2020 15:17:17 -0800 +Subject: [LINUX][rel-v2020.1][PATCH v1] "get_monotonic_boottime(&ts)" + deprecated from kernel 4.20 onwards + +As "get_monotonic_boottime(&ts)" is deprecated, replace the same with +"ktime_get_boottime_ts64(&ts)". Refer kernel commit ID +976516404ff3fab2a8caa8bd6f5efc1437fed0b8 + +Signed-off-by: Madhurkiran Harikrishnan +--- + driver/src/devicedrv/mali/linux/mali_osk_time.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/driver/src/devicedrv/mali/linux/mali_osk_time.c b/driver/src/devicedrv/mali/linux/mali_osk_time.c +index 03046a5..bfcbf7f 100644 +--- linux/mali_osk_time.c ++++ b/linux/mali_osk_time.c +@@ -53,7 +53,13 @@ u64 _mali_osk_time_get_ns(void) + + u64 _mali_osk_boot_time_get_ns(void) + { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) ++ struct timespec64 tsval; ++ ktime_get_boottime_ts64(&tsval); ++ return (u64)timespec64_to_ns(&tsval); ++#else + struct timespec tsval; + get_monotonic_boottime(&tsval); + return (u64)timespec_to_ns(&tsval); ++#endif + } +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch new file mode 100644 index 00000000..ff86091f --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch @@ -0,0 +1,92 @@ +From cbc2351e8acf7ed38f6d965e5ea21620e45eda30 Mon Sep 17 00:00:00 2001 +From: Dylan Yip +Date: Tue, 9 Feb 2021 10:05:41 -0800 +Subject: [PATCH 20/23] Fix ioremap_nocache() deprecation in kernel 5.6 + +As of commit 4bdc0d676a643140 ("remove ioremap_nocache and +devm_ioremap_nocache") from kernel 5.6, ioremap_nocache has been +removed because ioremap is already non-cached by default. So replace all +calls with ioremap. + +Signed-off-by: Dylan Yip +--- + linux/mali_memory_cow.c | 4 ++++ + linux/mali_osk_low_level_mem.c | 4 ++++ + platform/arm/arm.c | 12 ++++++++++++ + 3 files changed, 20 insertions(+) + +diff --git a/linux/mali_memory_cow.c b/linux/mali_memory_cow.c +index 1dae1d6..6fadd42 100644 +--- a/linux/mali_memory_cow.c ++++ b/linux/mali_memory_cow.c +@@ -693,7 +693,11 @@ void _mali_mem_cow_copy_page(mali_page_node *src_node, mali_page_node *dst_node) + /* + * use ioremap to map src for BLOCK memory + */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ src = ioremap(_mali_page_node_get_dma_addr(src_node), _MALI_OSK_MALI_PAGE_SIZE); ++#else + src = ioremap_nocache(_mali_page_node_get_dma_addr(src_node), _MALI_OSK_MALI_PAGE_SIZE); ++#endif + memcpy(dst, src , _MALI_OSK_MALI_PAGE_SIZE); + iounmap(src); + } +diff --git a/linux/mali_osk_low_level_mem.c b/linux/mali_osk_low_level_mem.c +index 84f93d9..5a0a725 100644 +--- a/linux/mali_osk_low_level_mem.c ++++ b/linux/mali_osk_low_level_mem.c +@@ -33,7 +33,11 @@ void _mali_osk_write_mem_barrier(void) + + mali_io_address _mali_osk_mem_mapioregion(uintptr_t phys, u32 size, const char *description) + { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ return (mali_io_address)ioremap(phys, size); ++#else + return (mali_io_address)ioremap_nocache(phys, size); ++#endif + } + + void _mali_osk_mem_unmapioregion(uintptr_t phys, u32 size, mali_io_address virt) +diff --git a/platform/arm/arm.c b/platform/arm/arm.c +index b2fb746..e468263 100644 +--- a/platform/arm/arm.c ++++ b/platform/arm/arm.c +@@ -98,7 +98,11 @@ static int mali_secure_mode_init_juno(void) + + MALI_DEBUG_ASSERT(NULL == secure_mode_mapped_addr); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ secure_mode_mapped_addr = ioremap(phys_addr_page, map_size); ++#else + secure_mode_mapped_addr = ioremap_nocache(phys_addr_page, map_size); ++#endif + if (NULL != secure_mode_mapped_addr) { + return mali_gpu_reset_and_secure_mode_disable_juno(); + } +@@ -588,7 +592,11 @@ static u32 mali_read_phys(u32 phys_addr) + u32 phys_offset = phys_addr & 0x00001FFF; + u32 map_size = phys_offset + sizeof(u32); + u32 ret = 0xDEADBEEF; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ void *mem_mapped = ioremap(phys_addr_page, map_size); ++#else + void *mem_mapped = ioremap_nocache(phys_addr_page, map_size); ++#endif + if (NULL != mem_mapped) { + ret = (u32)ioread32(((u8 *)mem_mapped) + phys_offset); + iounmap(mem_mapped); +@@ -604,7 +612,11 @@ static void mali_write_phys(u32 phys_addr, u32 value) + u32 phys_addr_page = phys_addr & 0xFFFFE000; + u32 phys_offset = phys_addr & 0x00001FFF; + u32 map_size = phys_offset + sizeof(u32); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ void *mem_mapped = ioremap(phys_addr_page, map_size); ++#else + void *mem_mapped = ioremap_nocache(phys_addr_page, map_size); ++#endif + if (NULL != mem_mapped) { + iowrite32(value, ((u8 *)mem_mapped) + phys_offset); + iounmap(mem_mapped); +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch new file mode 100644 index 00000000..adef8e18 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch @@ -0,0 +1,37 @@ +From bc0f85271681532c7e394229f0155366d1de8779 Mon Sep 17 00:00:00 2001 +From: Dylan Yip +Date: Mon, 8 Feb 2021 23:47:01 -0800 +Subject: [PATCH 21/23] Use updated timekeeping functions in kernel 5.6 + +As of commit 412c53a680a9 ("y2038: remove unused time32 interfaces"), 32 +bit timekeeping functions like getnstimeofday() have been removed. So +use the 64 bit replacements. + +Signed-off-by: Dylan Yip +--- + linux/mali_osk_time.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/linux/mali_osk_time.c b/linux/mali_osk_time.c +index bfcbf7f..583d82b 100644 +--- a/linux/mali_osk_time.c ++++ b/linux/mali_osk_time.c +@@ -46,9 +46,15 @@ void _mali_osk_time_ubusydelay(u32 usecs) + + u64 _mali_osk_time_get_ns(void) + { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ struct timespec64 tsval; ++ ktime_get_real_ts64(&tsval); ++ return (u64)timespec64_to_ns(&tsval); ++#else + struct timespec tsval; + getnstimeofday(&tsval); + return (u64)timespec_to_ns(&tsval); ++#endif + } + + u64 _mali_osk_boot_time_get_ns(void) +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch new file mode 100644 index 00000000..181df7b7 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch @@ -0,0 +1,38 @@ +From d17933b6909cc29103befc2ef4e6cf413d9e8fb6 Mon Sep 17 00:00:00 2001 +From: Dylan Yip +Date: Tue, 9 Feb 2021 08:58:44 -0800 +Subject: [PATCH 22/23] Set HAVE_UNLOCKED_IOCTL default to true + +As of commit b19dd42faf41 ("bkl: Remove locked .ioctl file operation") +of kernel 2.6, the ioctl operation has been replaced with +unlocked_ioctl. Since this change has been around for almost 10 years, +go ahead and set the default HAVE_UNLOCKED_IOCTL to be true. + +Signed-off-by: Dylan Yip +--- + Kbuild | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Kbuild b/Kbuild +index 02c3f3d..8c6e6e0 100644 +--- a/Kbuild ++++ b/Kbuild +@@ -21,6 +21,7 @@ MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 0 + MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 0 + MALI_UPPER_HALF_SCHEDULING ?= 1 + MALI_ENABLE_CPU_CYCLES ?= 0 ++HAVE_UNLOCKED_IOCTL ?= 1 + + # For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases: + # The ARM proprietary product will only include the license/proprietary directory +@@ -179,6 +180,7 @@ ccflags-y += -DMALI_STATE_TRACKING=1 + ccflags-y += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB) + ccflags-y += -DUSING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION) + ccflags-y += -DMALI_ENABLE_CPU_CYCLES=$(MALI_ENABLE_CPU_CYCLES) ++ccflags-y += -DHAVE_UNLOCKED_IOCTL=$(HAVE_UNLOCKED_IOCTL) + + ifeq ($(MALI_UPPER_HALF_SCHEDULING),1) + ccflags-y += -DMALI_UPPER_HALF_SCHEDULING +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch new file mode 100644 index 00000000..bab2bd37 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch @@ -0,0 +1,33 @@ +From e2b52e358e0e030d3881ef80ef09de3662b41210 Mon Sep 17 00:00:00 2001 +From: Dylan Yip +Date: Tue, 9 Feb 2021 09:48:01 -0800 +Subject: [PATCH 23/23] Use PTR_ERR_OR_ZERO instead of PTR_RET + +As of commit fad7c9020948 ("err.h: remove deprecated PTR_RET for good") +in kernel 5.7, PTR_RET has been removed and replaced with +PTR_ERR_OR_ZERO. So use this API instead. + +Signed-off-by: Dylan Yip +--- + linux/mali_memory_dma_buf.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c +index 905cd8b..fcdcaac 100644 +--- a/linux/mali_memory_dma_buf.c ++++ b/linux/mali_memory_dma_buf.c +@@ -281,7 +281,11 @@ int mali_dma_buf_get_size(struct mali_session_data *session, _mali_uk_dma_buf_ge + buf = dma_buf_get(fd); + if (IS_ERR_OR_NULL(buf)) { + MALI_DEBUG_PRINT_ERROR(("Failed to get dma-buf from fd: %d\n", fd)); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) ++ return PTR_ERR_OR_ZERO(buf); ++#else + return PTR_RET(buf); ++#endif + } + + if (0 != put_user(buf->size, &user_arg->size)) { +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch new file mode 100644 index 00000000..5b3eeedc --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0024-Use-community-device-tree-names.patch @@ -0,0 +1,91 @@ +Use the community device-tree names + +The community LIMA driver uses a series of names that are different then +the legacy Xilinx names. Moves from the legacy names to the more standard +names. + +This will allow us to have a single device tree that works with both the +mali driver, as well as the lima driver. + +Interrupt-names: + IRQGP -> gp + IRQGPMMU -> gpmmu + IRQPP0 -> pp0 + IRQPPMMU0 -> ppmmu0 + IRQPP1 -> pp1 + IRQPPMMU1 -> ppmmu1 + ... + +Clock-names: + gpu_pp0 -> core + gpu_pp1 -> bus + +Signed-off-by: Mark Hatle + +diff -ur a/linux/mali_kernel_linux.c b/linux/mali_kernel_linux.c +--- a/linux/mali_kernel_linux.c 2018-09-17 04:04:48.000000000 -0700 ++++ b/linux/mali_kernel_linux.c 2022-10-24 14:01:54.614376177 -0700 +@@ -635,11 +635,11 @@ + if (IS_ERR(clk_gpu)) + return PTR_ERR(clk_gpu); + +- clk_gpu_pp0 = devm_clk_get(&pdev->dev, "gpu_pp0"); ++ clk_gpu_pp0 = devm_clk_get(&pdev->dev, "core"); + if (IS_ERR(clk_gpu_pp0)) + return PTR_ERR(clk_gpu_pp0); + +- clk_gpu_pp1 = devm_clk_get(&pdev->dev, "gpu_pp1"); ++ clk_gpu_pp1 = devm_clk_get(&pdev->dev, "bus"); + if (IS_ERR(clk_gpu_pp1)) + return PTR_ERR(clk_gpu_pp1); + #endif +diff -ur a/linux/mali_osk_mali.c b/linux/mali_osk_mali.c +--- a/linux/mali_osk_mali.c 2018-09-12 23:52:20.000000000 -0700 ++++ b/linux/mali_osk_mali.c 2022-10-24 14:00:28.470380512 -0700 +@@ -72,26 +72,26 @@ + #define MALI_OSK_RESOURCE_DMA_LOCATION 26 + + static _mali_osk_resource_t mali_osk_resource_bank[MALI_OSK_MAX_RESOURCE_NUMBER] = { +- {.description = "Mali_GP", .base = MALI_OFFSET_GP, .irq_name = "IRQGP",}, +- {.description = "Mali_GP_MMU", .base = MALI_OFFSET_GP_MMU, .irq_name = "IRQGPMMU",}, +- {.description = "Mali_PP0", .base = MALI_OFFSET_PP0, .irq_name = "IRQPP0",}, +- {.description = "Mali_PP0_MMU", .base = MALI_OFFSET_PP0_MMU, .irq_name = "IRQPPMMU0",}, +- {.description = "Mali_PP1", .base = MALI_OFFSET_PP1, .irq_name = "IRQPP1",}, +- {.description = "Mali_PP1_MMU", .base = MALI_OFFSET_PP1_MMU, .irq_name = "IRQPPMMU1",}, +- {.description = "Mali_PP2", .base = MALI_OFFSET_PP2, .irq_name = "IRQPP2",}, +- {.description = "Mali_PP2_MMU", .base = MALI_OFFSET_PP2_MMU, .irq_name = "IRQPPMMU2",}, +- {.description = "Mali_PP3", .base = MALI_OFFSET_PP3, .irq_name = "IRQPP3",}, +- {.description = "Mali_PP3_MMU", .base = MALI_OFFSET_PP3_MMU, .irq_name = "IRQPPMMU3",}, +- {.description = "Mali_PP4", .base = MALI_OFFSET_PP4, .irq_name = "IRQPP4",}, +- {.description = "Mali_PP4_MMU", .base = MALI_OFFSET_PP4_MMU, .irq_name = "IRQPPMMU4",}, +- {.description = "Mali_PP5", .base = MALI_OFFSET_PP5, .irq_name = "IRQPP5",}, +- {.description = "Mali_PP5_MMU", .base = MALI_OFFSET_PP5_MMU, .irq_name = "IRQPPMMU5",}, +- {.description = "Mali_PP6", .base = MALI_OFFSET_PP6, .irq_name = "IRQPP6",}, +- {.description = "Mali_PP6_MMU", .base = MALI_OFFSET_PP6_MMU, .irq_name = "IRQPPMMU6",}, +- {.description = "Mali_PP7", .base = MALI_OFFSET_PP7, .irq_name = "IRQPP7",}, +- {.description = "Mali_PP7_MMU", .base = MALI_OFFSET_PP7_MMU, .irq_name = "IRQPPMMU",}, +- {.description = "Mali_PP_Broadcast", .base = MALI_OFFSET_PP_BCAST, .irq_name = "IRQPP",}, +- {.description = "Mali_PMU", .base = MALI_OFFSET_PMU, .irq_name = "IRQPMU",}, ++ {.description = "Mali_GP", .base = MALI_OFFSET_GP, .irq_name = "gp",}, ++ {.description = "Mali_GP_MMU", .base = MALI_OFFSET_GP_MMU, .irq_name = "gpmmu",}, ++ {.description = "Mali_PP0", .base = MALI_OFFSET_PP0, .irq_name = "pp0",}, ++ {.description = "Mali_PP0_MMU", .base = MALI_OFFSET_PP0_MMU, .irq_name = "ppmmu0",}, ++ {.description = "Mali_PP1", .base = MALI_OFFSET_PP1, .irq_name = "pp1",}, ++ {.description = "Mali_PP1_MMU", .base = MALI_OFFSET_PP1_MMU, .irq_name = "ppmmu1",}, ++ {.description = "Mali_PP2", .base = MALI_OFFSET_PP2, .irq_name = "pp2",}, ++ {.description = "Mali_PP2_MMU", .base = MALI_OFFSET_PP2_MMU, .irq_name = "ppmmu2",}, ++ {.description = "Mali_PP3", .base = MALI_OFFSET_PP3, .irq_name = "pp3",}, ++ {.description = "Mali_PP3_MMU", .base = MALI_OFFSET_PP3_MMU, .irq_name = "ppmmu3",}, ++ {.description = "Mali_PP4", .base = MALI_OFFSET_PP4, .irq_name = "pp4",}, ++ {.description = "Mali_PP4_MMU", .base = MALI_OFFSET_PP4_MMU, .irq_name = "ppmmu4",}, ++ {.description = "Mali_PP5", .base = MALI_OFFSET_PP5, .irq_name = "pp5",}, ++ {.description = "Mali_PP5_MMU", .base = MALI_OFFSET_PP5_MMU, .irq_name = "ppmmu5",}, ++ {.description = "Mali_PP6", .base = MALI_OFFSET_PP6, .irq_name = "pp6",}, ++ {.description = "Mali_PP6_MMU", .base = MALI_OFFSET_PP6_MMU, .irq_name = "ppmmu6",}, ++ {.description = "Mali_PP7", .base = MALI_OFFSET_PP7, .irq_name = "pp7",}, ++ {.description = "Mali_PP7_MMU", .base = MALI_OFFSET_PP7_MMU, .irq_name = "ppmmu",}, ++ {.description = "Mali_PP_Broadcast", .base = MALI_OFFSET_PP_BCAST, .irq_name = "pp",}, ++ {.description = "Mali_PMU", .base = MALI_OFFSET_PMU, .irq_name = "pmu",}, + {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE0,}, + {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE1,}, + {.description = "Mali_L2", .base = MALI_OFFSET_L2_RESOURCE2,}, diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch new file mode 100644 index 00000000..eb5406f4 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch @@ -0,0 +1,67 @@ +From d4fcb32f8dc85d01c6e0dc8e5d85c7ed43f0866c Mon Sep 17 00:00:00 2001 +From: Yash Ladani +Date: Tue, 6 Dec 2022 00:52:53 -0800 +Subject: [PATCH] Import DMA_BUF module and update register_shrinker function + for kernel 5.16 or higher + +Added MODULE_IMPORT_NS(DMA_BUF) for kernel version 5.16 or higher. +register_shrinker function call now requires two arguments +for kernel 5.16 or higher updated this function call. + +Signed-off-by: Yash Ladani +--- + linux/mali_memory_dma_buf.c | 4 ++++ + linux/mali_memory_os_alloc.c | 5 ++++- + linux/mali_memory_secure.c | 4 ++++ + 3 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/linux/mali_memory_dma_buf.c b/linux/mali_memory_dma_buf.c +index fcdcaac..72e28a8 100644 +--- a/linux/mali_memory_dma_buf.c ++++ b/linux/mali_memory_dma_buf.c +@@ -34,6 +34,10 @@ + #include "mali_memory_virtual.h" + #include "mali_pp_job.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) ++MODULE_IMPORT_NS(DMA_BUF); ++#endif ++ + /* + * Map DMA buf attachment \a mem into \a session at virtual address \a virt. + */ +diff --git a/linux/mali_memory_os_alloc.c b/linux/mali_memory_os_alloc.c +index 7de3920..5bf08f8 100644 +--- a/linux/mali_memory_os_alloc.c ++++ b/linux/mali_memory_os_alloc.c +@@ -801,8 +801,11 @@ _mali_osk_errcode_t mali_mem_os_init(void) + dma_set_attr(DMA_ATTR_WRITE_COMBINE, &dma_attrs_wc); + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) ++ register_shrinker(&mali_mem_os_allocator.shrinker, "mali"); ++#else + register_shrinker(&mali_mem_os_allocator.shrinker); +- ++#endif + return _MALI_OSK_ERR_OK; + } + +diff --git a/linux/mali_memory_secure.c b/linux/mali_memory_secure.c +index cebd1c8..a9d932f 100644 +--- a/linux/mali_memory_secure.c ++++ b/linux/mali_memory_secure.c +@@ -20,6 +20,10 @@ + #endif + #include + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) ++MODULE_IMPORT_NS(DMA_BUF); ++#endif ++ + _mali_osk_errcode_t mali_mem_secure_attach_dma_buf(mali_mem_secure *secure_mem, u32 size, int mem_fd) + { + struct dma_buf *buf; +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch new file mode 100644 index 00000000..247c92ff --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0026-Fix-gpu-driver-probe-failure.patch @@ -0,0 +1,46 @@ +From d7a56b7bdf1ea34194fe86639cc318d7a33b9abb Mon Sep 17 00:00:00 2001 +From: Parth Gajjar +Date: Thu, 12 Jan 2023 06:00:20 -0800 +Subject: [PATCH] Fix gpu driver probe failure + +In patch a1a2b7125e1079cfcc13a116aa3af3df2f9e002b +(Drop static setup of IRQ resource from DT core) platform_get_resource() +stopped from returning the IRQ, as all drivers were supposed to have +switched to platform_get_irq(). +Using platform_get_irq_optional() to avoid printing error messages +for interrupts not found. + +Signed-off-by: Parth Gajjar +--- + linux/mali_osk_mali.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/linux/mali_osk_mali.c b/linux/mali_osk_mali.c +index c22758d..3f66132 100644 +--- a/linux/mali_osk_mali.c ++++ b/linux/mali_osk_mali.c +@@ -113,7 +113,7 @@ static int _mali_osk_get_compatible_name(const char **out_string) + _mali_osk_errcode_t _mali_osk_resource_initialize(void) + { + mali_bool mali_is_450 = MALI_FALSE, mali_is_470 = MALI_FALSE; +- int i, pp_core_num = 0, l2_core_num = 0; ++ int i, pp_core_num = 0, l2_core_num = 0, irq = 0; + struct resource *res; + const char *compatible_name = NULL; + +@@ -128,9 +128,9 @@ _mali_osk_errcode_t _mali_osk_resource_initialize(void) + } + + for (i = 0; i < MALI_OSK_RESOURCE_WITH_IRQ_NUMBER; i++) { +- res = platform_get_resource_byname(mali_platform_device, IORESOURCE_IRQ, mali_osk_resource_bank[i].irq_name); +- if (res) { +- mali_osk_resource_bank[i].irq = res->start; ++ irq = platform_get_irq_byname_optional(mali_platform_device, mali_osk_resource_bank[i].irq_name); ++ if (irq > 0) { ++ mali_osk_resource_bank[i].irq = irq; + } else { + mali_osk_resource_bank[i].base = MALI_OSK_INVALID_RESOURCE_ADDRESS; + } +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch new file mode 100644 index 00000000..18081dc3 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch @@ -0,0 +1,95 @@ +From a64707b7fea40d326c5b18636a41a5994f60048d Mon Sep 17 00:00:00 2001 +From: Parth Gajjar +Date: Fri, 24 Feb 2023 05:11:38 -0800 +Subject: [PATCH] Updated clock name and structure to match LIMA driver + +Clock-names: + gpu -> bus + gpu_pp0,gpu_pp1 -> core + +This will allow us to have a single device tree that works with both the +mali driver, as well as the lima driver. + +Signed-off-by: Parth Gajjar +--- + linux/mali_kernel_linux.c | 37 +++++++------------ + 1 file changed, 13 insertions(+), 24 deletions(-) + +diff --git a/linux/mali_kernel_linux.c b/linux/mali_kernel_linux.c +index ad450b4..050af67 100644 +--- a/linux/mali_kernel_linux.c ++++ b/linux/mali_kernel_linux.c +@@ -48,9 +48,8 @@ + + #if defined(CONFIG_ARCH_ZYNQMP) + /* Initialize variables for clocks */ +-struct clk *clk_gpu; +-struct clk *clk_gpu_pp0; +-struct clk *clk_gpu_pp1; ++struct clk *clk_bus; ++struct clk *clk_core; + mali_bool clk_enabled; + #endif + +@@ -291,19 +290,14 @@ static int mali_enable_clk(void) + return 0; + + clk_enabled = MALI_TRUE; +- err = clk_prepare_enable(clk_gpu); ++ err = clk_prepare_enable(clk_bus); + if (err) { + MALI_PRINT_ERROR(("Could not enable clock for GP\n\r")); + return err; + } +- err = clk_prepare_enable(clk_gpu_pp0); ++ err = clk_prepare_enable(clk_core); + if (err) { +- MALI_PRINT_ERROR(("Could not enable clock for PP0\n\r")); +- return err; +- } +- err = clk_prepare_enable(clk_gpu_pp1); +- if (err) { +- MALI_PRINT_ERROR(("Could not enable clock for PP1\n\r")); ++ MALI_PRINT_ERROR(("Could not enable clock for PP\n\r")); + return err; + } + #endif +@@ -315,9 +309,8 @@ static void mali_disable_clk(void) + #if defined(CONFIG_ARCH_ZYNQMP) + if (clk_enabled) { + clk_enabled = MALI_FALSE; +- clk_disable_unprepare(clk_gpu); +- clk_disable_unprepare(clk_gpu_pp0); +- clk_disable_unprepare(clk_gpu_pp1); ++ clk_disable_unprepare(clk_bus); ++ clk_disable_unprepare(clk_core); + } + #endif + } +@@ -631,17 +624,13 @@ static int mali_probe(struct platform_device *pdev) + + #if defined(CONFIG_ARCH_ZYNQMP) + /* Initialize clocks for GPU and PP */ +- clk_gpu = devm_clk_get(&pdev->dev, "gpu"); +- if (IS_ERR(clk_gpu)) +- return PTR_ERR(clk_gpu); +- +- clk_gpu_pp0 = devm_clk_get(&pdev->dev, "core"); +- if (IS_ERR(clk_gpu_pp0)) +- return PTR_ERR(clk_gpu_pp0); ++ clk_bus = devm_clk_get(&pdev->dev, "bus"); ++ if (IS_ERR(clk_bus)) ++ return PTR_ERR(clk_bus); + +- clk_gpu_pp1 = devm_clk_get(&pdev->dev, "bus"); +- if (IS_ERR(clk_gpu_pp1)) +- return PTR_ERR(clk_gpu_pp1); ++ clk_core = devm_clk_get(&pdev->dev, "core"); ++ if (IS_ERR(clk_core)) ++ return PTR_ERR(clk_core); + #endif + + err = mali_enable_clk(); +-- +2.25.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch new file mode 100644 index 00000000..72275a4c --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch @@ -0,0 +1,81 @@ +From e3e0f5e3fa0ddb396393d444bce6e575f7a16189 Mon Sep 17 00:00:00 2001 +From: Parth Gajjar +Date: Thu, 21 Dec 2023 22:41:32 -0800 +Subject: [PATCH] Replace vma->vm_flags direct modifications with modifier + calls + +Replace direct modifications to vma->vm_flags with calls to modifier +functions to be able to track flag changes and to keep vma locking +correctness. (Kernel 6.3) + +Signed-off-by: Parth Gajjar +--- + linux/mali_memory.c | 10 ++++++++++ + linux/mali_memory_cow.c | 13 ++++++++++--- + 2 files changed, 20 insertions(+), 3 deletions(-) + +diff --git a/linux/mali_memory.c b/linux/mali_memory.c +index 2b2b209..c21d0b7 100644 +--- a/linux/mali_memory.c ++++ b/linux/mali_memory.c +@@ -266,11 +266,17 @@ int mali_mmap(struct file *filp, struct vm_area_struct *vma) + * that it's present and can never be paged out (see also previous + * entry) + */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++ vm_flags_set(vma, VM_IO | VM_DONTCOPY | VM_PFNMAP); ++#else + vma->vm_flags |= VM_IO; + vma->vm_flags |= VM_DONTCOPY; + vma->vm_flags |= VM_PFNMAP; ++#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) + vma->vm_flags |= VM_RESERVED; ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++ vm_flags_set(vma, VM_DONTDUMP | VM_DONTEXPAND); + #else + vma->vm_flags |= VM_DONTDUMP; + vma->vm_flags |= VM_DONTEXPAND; +@@ -288,7 +294,11 @@ int mali_mmap(struct file *filp, struct vm_area_struct *vma) + if (!(vma->vm_flags & VM_WRITE)) { + MALI_DEBUG_PRINT(4, ("mmap allocation with read only !\n")); + /* add VM_WRITE for do_page_fault will check this when a write fault */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++ vm_flags_set(vma, VM_WRITE | VM_READ); ++#else + vma->vm_flags |= VM_WRITE | VM_READ; ++#endif + vma->vm_page_prot = PAGE_READONLY; + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); + mem_bkend->flags |= MALI_MEM_BACKEND_FLAG_COW_CPU_NO_WRITE; +diff --git a/linux/mali_memory_cow.c b/linux/mali_memory_cow.c +index 6fadd42..e631431 100644 +--- a/linux/mali_memory_cow.c ++++ b/linux/mali_memory_cow.c +@@ -391,13 +391,20 @@ _mali_osk_errcode_t mali_memory_cow_modify_range(mali_mem_backend *backend, + } + } else { + /* used to trigger page fault for swappable cowed memory. */ +- alloc->cpu_mapping.vma->vm_flags |= VM_PFNMAP; +- alloc->cpu_mapping.vma->vm_flags |= VM_MIXEDMAP; +- ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++ vm_flags_set(alloc->cpu_mapping.vma, VM_PFNMAP | VM_MIXEDMAP); ++#else ++ alloc->cpu_mapping.vma->vm_flags |= VM_PFNMAP; ++ alloc->cpu_mapping.vma->vm_flags |= VM_MIXEDMAP; ++#endif + zap_vma_ptes(alloc->cpu_mapping.vma, alloc->cpu_mapping.vma->vm_start + range_start, range_size); + /* delete this flag to let swappble is ummapped regard to stauct page not page frame. */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++ vm_flags_clear(alloc->cpu_mapping.vma, VM_PFNMAP | VM_MIXEDMAP); ++#else + alloc->cpu_mapping.vma->vm_flags &= ~VM_PFNMAP; + alloc->cpu_mapping.vma->vm_flags &= ~VM_MIXEDMAP; ++#endif + } + } + +-- +2.25.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch new file mode 100644 index 00000000..a3ddafed --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali/0029-Fixed-buildpath-QA-warning.patch @@ -0,0 +1,29 @@ +From 7659ba2e251b72aa3c248d3b1f3a23971180ba41 Mon Sep 17 00:00:00 2001 +From: Parth Gajjar +Date: Mon, 18 Mar 2024 13:43:30 +0000 +Subject: [PATCH] Fixed buildpath QA warning + +Removed KDIR from buildinfo +WARNING: kernel-module-mali-r9p0-01rel0-r0 do_package_qa: +QA Issue: File /lib/modules/6.6.10-xilinx-v2024.1-g2c37bbe14ced/updates/mali.ko + in package kernel-module-mali-6.6.10-xilinx-v2024.1-g2c37bbe14ced contains + reference to TMPDIR [buildpaths]" from the log file. + +Signed-off-by: Parth Gajjar + +diff --git a/Kbuild b/Kbuild +index 8c6e6e0..2b8632b 100644 +--- a/Kbuild ++++ b/Kbuild +@@ -243,7 +243,7 @@ VERSION_STRINGS += BUILD=release + endif + VERSION_STRINGS += TARGET_PLATFORM=$(TARGET_PLATFORM) + VERSION_STRINGS += MALI_PLATFORM=$(MALI_PLATFORM) +-VERSION_STRINGS += KDIR=$(KDIR) ++#VERSION_STRINGS += KDIR=$(KDIR) + VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB) + VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP) + VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING) +-- +2.37.6 + diff --git a/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb new file mode 100644 index 00000000..c25970e7 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mali/kernel-module-mali_r9p0-01rel0.bb @@ -0,0 +1,57 @@ +SUMMARY = "A Mali 400 Linux Kernel module" +SECTION = "kernel/modules" + +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = " \ + file://linux/license/gpl/mali_kernel_license.h;md5=f5af2d61f4c1eb262cb6a557aaa1070a \ + " + +SRC_URI = " \ + https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-${PV}.tgz \ + file://0001-Change-Makefile-to-be-compatible-with-Yocto.patch \ + file://0002-staging-mali-r8p0-01rel0-Add-the-ZYNQ-ZYNQMP-platfor.patch \ + file://0003-staging-mali-r8p0-01rel0-Remove-unused-trace-macros.patch \ + file://0004-staging-mali-r8p0-01rel0-Don-t-include-mali_read_phy.patch \ + file://0005-linux-mali_kernel_linux.c-Handle-clock-when-probed-a.patch \ + file://0006-arm.c-global-variable-dma_ops-is-removed-from-the-ke.patch \ + file://0010-common-mali_pm.c-Add-PM-runtime-barrier-after-removi.patch \ + file://0011-linux-mali_kernel_linux.c-Enable-disable-clock-for-r.patch\ + file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\ + file://0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch\ + file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\ + file://0015-fix-driver-failed-to-check-map-error.patch \ + file://0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch \ + file://0017-Support-for-vm_insert_pfn-deprecated-from-kernel-4.2.patch \ + file://0018-Change-return-type-to-vm_fault_t-for-fault-handler.patch \ + file://0019-get_monotonic_boottime-ts-deprecated-from-kernel-4.2.patch \ + file://0020-Fix-ioremap_nocache-deprecation-in-kernel-5.6.patch \ + file://0021-Use-updated-timekeeping-functions-in-kernel-5.6.patch \ + file://0022-Set-HAVE_UNLOCKED_IOCTL-default-to-true.patch \ + file://0023-Use-PTR_ERR_OR_ZERO-instead-of-PTR_RET.patch \ + file://0024-Use-community-device-tree-names.patch \ + file://0025-Import-DMA_BUF-module-and-update-register_shrinker-f.patch \ + file://0026-Fix-gpu-driver-probe-failure.patch \ + file://0027-Updated-clock-name-and-structure-to-match-LIMA-drive.patch \ + file://0028-Replace-vma-vm_flags-direct-modifications-with-modif.patch \ + file://0029-Fixed-buildpath-QA-warning.patch \ + " +SRC_URI[md5sum] = "85ea110dd6675c70b7d01af87ec9633c" +SRC_URI[sha256sum] = "7a67127341d17640c1fff5dad80258fb2a37c8a2121b81525fe2327e4532ce2b" + +inherit features_check module + +PARALLEL_MAKE = "-j 1" + +S = "${WORKDIR}/DX910-SW-99002-${PV}/driver/src/devicedrv/mali" + +REQUIRED_MACHINE_FEATURES = "mali400" + +EXTRA_OEMAKE = 'KDIR="${STAGING_KERNEL_DIR}" \ + ARCH="${ARCH}" \ + BUILD=release \ + MALI_PLATFORM="arm" \ + USING_DT=1 \ + MALI_SHARED_INTERRUPTS=1 \ + CROSS_COMPILE="${TARGET_PREFIX}" \ + MALI_QUIET=1 \ + ' diff --git a/meta-xilinx-mali400/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch b/meta-xilinx-mali400/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch new file mode 100644 index 00000000..f77f1939 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/files/0001-DRI_Add_xlnx_dri.patch @@ -0,0 +1,32 @@ +DRI: Add xlnx dri + +Add the Xilinx dri target + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: mesa-24.0.1/src/gallium/targets/dri/meson.build +=================================================================== +--- mesa-24.0.1.orig/src/gallium/targets/dri/meson.build ++++ mesa-24.0.1/src/gallium/targets/dri/meson.build +@@ -101,6 +101,7 @@ foreach d : [[with_gallium_kmsro, [ + 'stm_dri.so', + 'sun4i-drm_dri.so', + 'udl_dri.so', ++ 'xlnx_dri.so', + ]], + [with_gallium_radeonsi, 'radeonsi_dri.so'], + [with_gallium_nouveau, 'nouveau_dri.so'], +Index: mesa-24.0.1/src/gallium/targets/dri/target.c +=================================================================== +--- mesa-24.0.1.orig/src/gallium/targets/dri/target.c ++++ mesa-24.0.1/src/gallium/targets/dri/target.c +@@ -129,6 +129,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(sti) + DEFINE_LOADER_DRM_ENTRYPOINT(stm) + DEFINE_LOADER_DRM_ENTRYPOINT(sun4i_drm) + DEFINE_LOADER_DRM_ENTRYPOINT(udl) ++DEFINE_LOADER_DRM_ENTRYPOINT(xlnx) + #endif + + #if defined(GALLIUM_LIMA) diff --git a/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch new file mode 100644 index 00000000..fdb30564 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch @@ -0,0 +1,44 @@ +From 9470d00850e8b622d963d4d9c61ad1e59972310a Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 28 Jan 2020 16:10:54 -0800 +Subject: [PATCH 1/2] src: egl: eglinfo: Align EXT_platform_device extension + macros with khronos + +Although the macro definitions are consistent, using the macros name +defined under khronos makes it backward compatible with older eglext.h + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] +Signed-off-by: Mark Hatle +--- + src/egl/opengl/eglinfo.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c +index 72fe45a..e8a0225 100644 +--- a/src/egl/opengl/eglinfo.c ++++ b/src/egl/opengl/eglinfo.c +@@ -305,17 +305,17 @@ main(int argc, char *argv[]) + NULL), "Android platform"); + if (strstr(clientext, "EGL_MESA_platform_gbm") || + strstr(clientext, "EGL_KHR_platform_gbm")) +- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_MESA, ++ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_GBM_KHR, + EGL_DEFAULT_DISPLAY, + NULL), "GBM platform"); + if (strstr(clientext, "EGL_EXT_platform_wayland") || + strstr(clientext, "EGL_KHR_platform_wayland")) +- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, ++ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, + EGL_DEFAULT_DISPLAY, + NULL), "Wayland platform"); + if (strstr(clientext, "EGL_EXT_platform_x11") || + strstr(clientext, "EGL_KHR_platform_x11")) +- ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_EXT, ++ ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR, + EGL_DEFAULT_DISPLAY, + NULL), "X11 platform"); + if (strstr(clientext, "EGL_MESA_platform_surfaceless")) +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch new file mode 100644 index 00000000..7212ef27 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch @@ -0,0 +1,41 @@ +From 040b0b79a8e73a3348ab2e95f817636a7d479f18 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Tue, 28 Jan 2020 16:17:46 -0800 +Subject: [PATCH 2/2] src: egl: eglinfo: Use EGL_PLATFORM_DEVICE_EXT only if + the EGL provider supports it + +Compiling against the other EGL provider like mali fails, as they dont +support this macro as one of thier supported platforms + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] +Signed-off-by: Mark Hatle +--- + src/egl/opengl/eglinfo.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/egl/opengl/eglinfo.c b/src/egl/opengl/eglinfo.c +index e8a0225..bc0e869 100644 +--- a/src/egl/opengl/eglinfo.c ++++ b/src/egl/opengl/eglinfo.c +@@ -243,6 +243,7 @@ doOneDisplay(EGLDisplay d, const char *name) + static int + doOneDevice(EGLDeviceEXT d, int i) + { ++#ifdef EGL_PLATFORM_DEVICE_EXT + PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = + (PFNEGLGETPLATFORMDISPLAYEXTPROC) + eglGetProcAddress("eglGetPlatformDisplayEXT"); +@@ -253,6 +254,9 @@ doOneDevice(EGLDeviceEXT d, int i) + + return doOneDisplay(getPlatformDisplay(EGL_PLATFORM_DEVICE_EXT, d, NULL), + "Platform Device"); ++#else ++ return 0; ++#endif + } + + +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch new file mode 100644 index 00000000..6cfecb38 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos/libmali-egl-workaround.patch @@ -0,0 +1,69 @@ +Upstream-Status: Inappropriate [libmali specific] + +Index: mesa-demos-8.5.0/src/egl/opengl/eglinfo.c +=================================================================== +--- mesa-demos-8.5.0.orig/src/egl/opengl/eglinfo.c ++++ mesa-demos-8.5.0/src/egl/opengl/eglinfo.c +@@ -195,6 +195,7 @@ PrintDisplayExtensions(EGLDisplay d) + } + + ++#ifdef EGL_EXT_device_base + static const char * + PrintDeviceExtensions(EGLDeviceEXT d) + { +@@ -211,7 +212,7 @@ PrintDeviceExtensions(EGLDeviceEXT d) + + return PrintExtensions(extensions); + } +- ++#endif + + static int + doOneDisplay(EGLDisplay d, const char *name) +@@ -240,6 +241,7 @@ doOneDisplay(EGLDisplay d, const char *n + } + + ++#ifdef EGL_EXT_device_base + static int + doOneDevice(EGLDeviceEXT d, int i) + { +@@ -258,8 +260,9 @@ doOneDevice(EGLDeviceEXT d, int i) + return 0; + #endif + } ++#endif + +- ++#ifdef EGL_EXT_device_base + static int + doDevices(const char *name) + { +@@ -288,7 +291,7 @@ doDevices(const char *name) + + return ret; + } +- ++#endif + + int + main(int argc, char *argv[]) +@@ -322,13 +325,17 @@ main(int argc, char *argv[]) + ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_X11_KHR, + EGL_DEFAULT_DISPLAY, + NULL), "X11 platform"); ++#ifdef EGL_PLATFORM_SURFACELESS_MESA + if (strstr(clientext, "EGL_MESA_platform_surfaceless")) + ret += doOneDisplay(getPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, + EGL_DEFAULT_DISPLAY, + NULL), "Surfaceless platform"); ++#endif ++#ifdef EGL_EXT_device_base + if (strstr(clientext, "EGL_EXT_device_enumeration") && + strstr(clientext, "EGL_EXT_platform_device")) + ret += doDevices("Device platform"); ++#endif + } + else { + ret = doOneDisplay(eglGetDisplay(EGL_DEFAULT_DISPLAY), "Default display"); diff --git a/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos_%.bbappend b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos_%.bbappend new file mode 100644 index 00000000..5c84f56e --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-demos_%.bbappend @@ -0,0 +1,16 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/mesa-demos:" + +SRC_URI += " \ + file://0001-src-egl-eglinfo-Align-EXT_platform_device-extension-.patch \ + file://0002-src-egl-eglinfo-Use-EGL_PLATFORM_DEVICE_EXT-only-if-.patch \ + file://libmali-egl-workaround.patch \ +" + +DEPENDS += "wayland-protocols" + +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/mesa/mesa-gl_%.bbappend b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-gl_%.bbappend new file mode 100644 index 00000000..a8e18a57 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/mesa-gl_%.bbappend @@ -0,0 +1,18 @@ +PACKAGECONFIG:append = " dri3 gallium" + +# If we're using libmali-xlnx, then we need to bring it in for the KHR/khrplatform.h file +DEPENDS .= "${@' libmali-xlnx' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else ''}" +RDEPENDS:libgl-mesa-dev .= "${@' libmali-xlnx-dev' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else ''}" + +do_install:append () { + if ${@'true' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else 'false'} ; then + rm -rf ${D}${includedir}/KHR/* + fi +} + +# If we require libmali-xlnx, this becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${MACHINE_ARCH}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH = "${@'${MALI_PACKAGE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" diff --git a/meta-xilinx-mali400/recipes-graphics/mesa/mesa_%.bbappend b/meta-xilinx-mali400/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 00000000..86183f54 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +SRC_URI:append:class-target = " file://0001-DRI_Add_xlnx_dri.patch" + +# This is not compatible with the mali400 driver, use mesa-gl instead +CONFLICT_DISTRO_FEATURES:class-target = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', bb.utils.contains('DISTRO_FEATURES', 'libmali', 'libmali', '', d), '', d)}" + +# Enable lima if not using libmali +PACKAGECONFIG_MALI = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '', 'lima', d)}" +PACKAGECONFIG:append:class-target = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${PACKAGECONFIG_MALI}', '', d)}" + +PACKAGE_ARCH_DEFAULT := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${MACHINE_ARCH}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_ARCH = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${MALI_PACKAGE_ARCH}', '${PACKAGE_ARCH_DEFAULT}', d)}" diff --git a/meta-xilinx-mali400/recipes-graphics/virglrenderer/virglrenderer_%.bbappend b/meta-xilinx-mali400/recipes-graphics/virglrenderer/virglrenderer_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/virglrenderer/virglrenderer_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch b/meta-xilinx-mali400/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch new file mode 100644 index 00000000..de1f3719 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/files/0001-libweston-Remove-substitute-format-for-ARGB8888.patch @@ -0,0 +1,30 @@ +From 3fbb596e53524e78703b76c4fdc33cd6ac62f777 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Fri, 11 Dec 2020 16:21:38 -0800 +Subject: [PATCH] libweston: Remove substitute format for ARGB8888 + +Xilinx DP gfx layer does not support XRGB8888. Hence, remove the same +as opaque substitute. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] + +Reworked the patch for the newer weston + +Signed-off-by: Mark Hatle +--- + libweston/pixel-formats.c | 1 - + 1 file changed, 1 deletion(-) + +Index: weston-13.0.0/libweston/pixel-formats.c +=================================================================== +--- weston-13.0.0.orig/libweston/pixel-formats.c ++++ weston-13.0.0/libweston/pixel-formats.c +@@ -251,7 +251,6 @@ static const struct pixel_format_info pi + { + DRM_FORMAT(ARGB8888), + BITS_RGBA_FIXED(8, 8, 8, 8), +- .opaque_substitute = DRM_FORMAT_XRGB8888, + .addfb_legacy_depth = 32, + .bpp = 32, + GL_INTERNALFORMAT(GL_RGBA8), diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch b/meta-xilinx-mali400/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch new file mode 100644 index 00000000..6b5f53b0 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/files/9.0.0/0001-libweston-Remove-substitute-format-for-ARGB8888.patch @@ -0,0 +1,29 @@ +From 3fbb596e53524e78703b76c4fdc33cd6ac62f777 Mon Sep 17 00:00:00 2001 +From: Madhurkiran Harikrishnan +Date: Fri, 11 Dec 2020 16:21:38 -0800 +Subject: [PATCH] libweston: Remove substitute format for ARGB8888 + +Xilinx DP gfx layer does not support XRGB8888. Hence, remove the same +as opaque substitute. + +Signed-off-by: Madhurkiran Harikrishnan +Upstream-Status: Inappropriate [Xilinx specific] +--- + libweston/pixel-formats.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c +index 79dc709..ec2d3b7 100644 +--- a/libweston/pixel-formats.c ++++ b/libweston/pixel-formats.c +@@ -193,7 +193,6 @@ static const struct pixel_format_info pixel_format_table[] = { + { + DRM_FORMAT(ARGB8888), + BITS_RGBA_FIXED(8, 8, 8, 8), +- .opaque_substitute = DRM_FORMAT_XRGB8888, + .depth = 32, + .bpp = 32, + GL_FORMAT(GL_BGRA_EXT), +-- +2.17.1 + diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/files/init b/meta-xilinx-mali400/recipes-graphics/wayland/files/init new file mode 100644 index 00000000..f74ac8b1 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/files/init @@ -0,0 +1,54 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: weston +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO + +if test -e /etc/default/weston ; then + . /etc/default/weston +fi + +killproc() { + pid=`/bin/pidof $1` + [ "$pid" != "" ] && kill $pid +} + +read CMDLINE < /proc/cmdline +for x in $CMDLINE; do + case $x in + weston=false) + echo "Weston disabled" + exit 0; + ;; + esac +done + +case "$1" in + start) + . /etc/profile + export HOME=ROOTHOME + + weston-start -- --continue-without-input $OPTARGS + ;; + + stop) + echo "Stopping Weston" + killproc weston + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "usage: $0 { start | stop | restart }" + ;; +esac + +exit 0 diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/files/weston.service b/meta-xilinx-mali400/recipes-graphics/wayland/files/weston.service new file mode 100644 index 00000000..c7583e92 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/files/weston.service @@ -0,0 +1,71 @@ +# This is a system unit for launching Weston with auto-login as the +# user configured here. +# +# Weston must be built with systemd support, and your weston.ini must load +# the plugin systemd-notify.so. +[Unit] +Description=Weston, a Wayland compositor, as a system service +Documentation=man:weston(1) man:weston.ini(5) +Documentation=http://wayland.freedesktop.org/ + +# Make sure we are started after logins are permitted. +Requires=systemd-user-sessions.service +After=systemd-user-sessions.service + +# If Plymouth is used, we want to start when it is on its way out. +After=plymouth-quit-wait.service + +# D-Bus is necessary for contacting logind. Logind is required. +Wants=dbus.socket +After=dbus.socket + +# Ensure the socket is present +Requires=weston.socket + +# Since we are part of the graphical session, make sure we are started before +# it is complete. +Before=graphical.target + +# Prevent starting on systems without virtual consoles, Weston requires one +# for now. +ConditionPathExists=/dev/tty0 + +[Service] +# Requires systemd-notify.so Weston plugin. +Type=notify +EnvironmentFile=/etc/default/weston +ExecStart=/usr/bin/weston --continue-without-input --modules=systemd-notify.so + +# Optional watchdog setup +TimeoutStartSec=60 +WatchdogSec=20 + +# The user to run Weston as. +User=weston +Group=weston + +# Make sure the working directory is the users home directory +WorkingDirectory=/home/weston + +# Set up a full user session for the user, required by Weston. +PAMName=weston-autologin + +# A virtual terminal is needed. +TTYPath=/dev/tty7 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes + +# Fail to start if not controlling the tty. +StandardInput=tty-fail +StandardOutput=journal +StandardError=journal + +# Log this user with utmp, letting it show up with commands 'w' and 'who'. +UtmpIdentifier=tty7 +UtmpMode=user + +[Install] +# Note: If you only want weston to start on-demand, remove this line with a +# service drop file +WantedBy=graphical.target diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston-init.bbappend b/meta-xilinx-mali400/recipes-graphics/wayland/weston-init.bbappend new file mode 100644 index 00000000..f0d64e27 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston-init.bbappend @@ -0,0 +1,5 @@ +PACKAGECONFIG += "no-idle-timeout" + +do_install:append:zynqmp() { + sed -i -e "/^\[core\]/a gbm-format=rgb565" ${D}${sysconfdir}/xdg/weston/weston.ini +} diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston.inc b/meta-xilinx-mali400/recipes-graphics/wayland/weston.inc new file mode 100644 index 00000000..fadc9486 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston.inc @@ -0,0 +1,15 @@ +SRC_URI:append:zynqmp = " file://0001-libweston-Remove-substitute-format-for-ARGB8888.patch" + +# Due to the SRC_URI zynqmp specific change, this needs to be SOC_FAMILY_ARCH specific +SOC_FAMILY_ARCH ??= "${TUNE_PKGARCH}" +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +DEFAULT_PACKAGE_ARCH:zynqmp = "${SOC_FAMILY_ARCH}" +PACKAGE_ARCH = "${DEFAULT_PACKAGE_ARCH}" + + +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch new file mode 100644 index 00000000..f8f75894 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch @@ -0,0 +1,50 @@ +From c8bfa1f8d576cdc6d515dbbac36c48c6166be0d5 Mon Sep 17 00:00:00 2001 +From: Marius Vlad +Date: Thu, 1 Apr 2021 00:12:00 +0300 +Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at DRM-backend tear down + +Tearing down the drm-backend when there are no input devices, would call +for the gbm device destruction before compositor shutdown. The latter +would call into the renderer detroy function and assume that the +EGLDisplay, which was created using the before-mentioned gbm device, is +still available. This patch re-orders the gbm destruction after the +compositor shutdown when no one would make use of it. + +Fixes: #314 + +Signed-off-by: Marius Vlad +Suggested-by: Daniel Stone + +Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb] +--- + libweston/backend-drm/drm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c +index 2780f3b..fbcfeca 100644 +--- a/libweston/backend-drm/drm.c ++++ b/libweston/backend-drm/drm.c +@@ -3025,10 +3025,6 @@ err_drm_source: + err_udev_input: + udev_input_destroy(&b->input); + err_sprite: +-#ifdef BUILD_DRM_GBM +- if (b->gbm) +- gbm_device_destroy(b->gbm); +-#endif + destroy_sprites(b); + err_udev_dev: + udev_device_unref(drm_device); +@@ -3038,6 +3034,10 @@ err_launcher: + weston_launcher_destroy(compositor->launcher); + err_compositor: + weston_compositor_shutdown(compositor); ++#ifdef BUILD_DRM_GBM ++ if (b->gbm) ++ gbm_device_destroy(b->gbm); ++#endif + free(b); + return NULL; + } +-- +2.33.0 diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch new file mode 100644 index 00000000..06e0f7ba --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch @@ -0,0 +1,32 @@ +From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 20 Apr 2021 20:42:18 -0700 +Subject: [PATCH] meson.build: fix incorrect header + +The wayland.c actually include 'xdg-shell-client-protocol.h' instead of +the server one, so fix it. Otherwise, it's possible to get build failure +due to race condition. + +Upstream-Status: Pending + +Signed-off-by: Chen Qi +--- + libweston/backend-wayland/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build +index 7e82513..29270b5 100644 +--- a/libweston/backend-wayland/meson.build ++++ b/libweston/backend-wayland/meson.build +@@ -10,7 +10,7 @@ srcs_wlwl = [ + fullscreen_shell_unstable_v1_protocol_c, + presentation_time_protocol_c, + presentation_time_server_protocol_h, +- xdg_shell_server_protocol_h, ++ xdg_shell_client_protocol_h, + xdg_shell_protocol_c, + ] + +-- +2.30.2 + diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch new file mode 100644 index 00000000..6fe86ff3 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch @@ -0,0 +1,47 @@ +From 58760e09eed662a72da939ff4802d605489cff8e Mon Sep 17 00:00:00 2001 +From: Denys Dmytriyenko +Date: Tue, 8 Sep 2020 19:37:42 -0400 +Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and + O_CREAT + +musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(), +O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors: + +| ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock': +| ../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] +| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); +| | ^~~~ +| | popen +| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function) +| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); +| | ^~~~~~ +| ../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 +| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function) +| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); +| | ^~~~~~~~~ +| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function) +| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); +| | ^~~~~~~ + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c] + +Signed-off-by: Denys Dmytriyenko +--- + tests/weston-test-fixture-compositor.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c +index 0c9855f..e0e32c9 100644 +--- a/tests/weston-test-fixture-compositor.c ++++ b/tests/weston-test-fixture-compositor.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #include "shared/helpers.h" + #include "weston-test-fixture-compositor.h" +-- +2.7.4 + diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch new file mode 100644 index 00000000..f6ebfd8f --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch @@ -0,0 +1,199 @@ +From a1548c742bf2dedbb47282d8a00407b60bbab669 Mon Sep 17 00:00:00 2001 +From: Tom Hochstein +Date: Wed, 22 Feb 2017 15:53:30 +0200 +Subject: [PATCH] weston-launch: Provide a default version that doesn't require + + PAM + +weston-launch requires PAM for starting weston as a non-root user. + +Since starting weston as root is a valid use case by itself, if +PAM is not available, provide a default version of weston-launch +without non-root-user support. + +Upstream-Status: Denied [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725] + +Signed-off-by: Tom Hochstein +Signed-off-by: Jussi Kukkonen +Signed-off-by: Denys Dmytriyenko +Signed-off-by: Ming Liu + +--- + libweston/meson.build | 16 ++++++++++++---- + libweston/weston-launch.c | 21 +++++++++++++++++++++ + meson_options.txt | 7 +++++++ + 3 files changed, 40 insertions(+), 4 deletions(-) + +diff --git a/libweston/meson.build b/libweston/meson.build +index 08d23ec..cb9fd3f 100644 +--- a/libweston/meson.build ++++ b/libweston/meson.build +@@ -216,16 +216,24 @@ dep_vertex_clipping = declare_dependency( + ) + + if get_option('weston-launch') +- dep_pam = cc.find_library('pam') ++ deps_weston_launch = [systemd_dep, dep_libdrm] + +- if not cc.has_function('pam_open_session', dependencies: dep_pam) +- error('pam_open_session not found for weston-launch') ++ if get_option('pam') ++ dep_pam = cc.find_library('pam') ++ if not cc.has_function('pam_open_session', dependencies: dep_pam) ++ error('pam_open_session not found for weston-launch') ++ endif ++ ++ if dep_pam.found() ++ deps_weston_launch += dep_pam ++ config_h.set('HAVE_PAM', '1') ++ endif + endif + + executable( + 'weston-launch', + 'weston-launch.c', +- dependencies: [dep_pam, systemd_dep, dep_libdrm], ++ dependencies: deps_weston_launch, + include_directories: common_inc, + install: true + ) +diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c +index 521cb2c..2d42d33 100644 +--- a/libweston/weston-launch.c ++++ b/libweston/weston-launch.c +@@ -51,7 +51,9 @@ + + #include + #include ++#ifdef HAVE_PAM + #include ++#endif + + #ifdef HAVE_SYSTEMD_LOGIN + #include +@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd) + #endif + + struct weston_launch { ++#ifdef HAVE_PAM + struct pam_conv pc; + pam_handle_t *ph; ++#endif + int tty; + int ttynr; + int sock[2]; +@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl) + return false; + } + ++#ifdef HAVE_PAM + static int + pam_conversation_fn(int msg_count, + const struct pam_message **messages, +@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl) + + return 0; + } ++#endif + + static int + setup_launcher_socket(struct weston_launch *wl) +@@ -466,6 +472,7 @@ quit(struct weston_launch *wl, int status) + close(wl->signalfd); + close(wl->sock[0]); + ++#ifdef HAVE_PAM + if (wl->new_user) { + err = pam_close_session(wl->ph, 0); + if (err) +@@ -473,6 +480,7 @@ quit(struct weston_launch *wl, int status) + err, pam_strerror(wl->ph, err)); + pam_end(wl->ph, err); + } ++#endif + + /* + * Get a fresh handle to the tty as the previous one is in +@@ -710,6 +718,7 @@ setup_session(struct weston_launch *wl, char **child_argv) + setenv("HOME", wl->pw->pw_dir, 1); + setenv("SHELL", wl->pw->pw_shell, 1); + ++#ifdef HAVE_PAM + env = pam_getenvlist(wl->ph); + if (env) { + for (i = 0; env[i]; ++i) { +@@ -718,6 +727,7 @@ setup_session(struct weston_launch *wl, char **child_argv) + } + free(env); + } ++#endif + + /* + * We open a new session, so it makes sense +@@ -789,8 +799,10 @@ static void + help(const char *name) + { + fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); ++#ifdef HAVE_PAM + fprintf(stderr, " -u, --user Start session as specified username,\n" + " e.g. -u joe, requires root.\n"); ++#endif + fprintf(stderr, " -t, --tty Start session on alternative tty,\n" + " e.g. -t /dev/tty4, requires -u option.\n"); + fprintf(stderr, " -v, --verbose Be verbose\n"); +@@ -804,7 +816,9 @@ main(int argc, char *argv[]) + int i, c; + char *tty = NULL; + struct option opts[] = { ++#ifdef HAVE_PAM + { "user", required_argument, NULL, 'u' }, ++#endif + { "tty", required_argument, NULL, 't' }, + { "verbose", no_argument, NULL, 'v' }, + { "help", no_argument, NULL, 'h' }, +@@ -816,11 +830,16 @@ main(int argc, char *argv[]) + while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { + switch (c) { + case 'u': ++#ifdef HAVE_PAM + wl.new_user = optarg; + if (getuid() != 0) { + fprintf(stderr, "weston: Permission denied. -u allowed for root only\n"); + exit(EXIT_FAILURE); + } ++#else ++ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n"); ++ exit(EXIT_FAILURE); ++#endif + break; + case 't': + tty = optarg; +@@ -872,8 +891,10 @@ main(int argc, char *argv[]) + if (setup_tty(&wl, tty) < 0) + exit(EXIT_FAILURE); + ++#ifdef HAVE_PAM + if (wl.new_user && setup_pam(&wl) < 0) + exit(EXIT_FAILURE); ++#endif + + if (setup_launcher_socket(&wl) < 0) + exit(EXIT_FAILURE); +diff --git a/meson_options.txt b/meson_options.txt +index 239bd2d..99e4ec3 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -73,6 +73,13 @@ option( + ) + + option( ++ 'pam', ++ type: 'boolean', ++ value: true, ++ description: 'Define if PAM is available' ++) ++ ++option( + 'xwayland', + type: 'boolean', + value: true, diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch b/meta-xilinx-mali400/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch new file mode 100644 index 00000000..a4444e5d --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch @@ -0,0 +1,23 @@ +Fix atomic modesetting with musl + +atomic modesetting seems to fail with drm weston backend and this patch fixes +it, below errors are seen before weston exits + +atomic: couldn't commit new state: Invalid argument + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158] +Signed-off-by: Khem Raj + +--- a/libweston/backend-drm/kms.c ++++ b/libweston/backend-drm/kms.c +@@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr + wl_list_for_each(plane, &b->plane_list, link) { + drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n", + (unsigned long) plane->plane_id); +- plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0); +- plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0); ++ //plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0); ++ //plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0); + } + + flags |= DRM_MODE_ATOMIC_ALLOW_MODESET; diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/systemd-notify.weston-start b/meta-xilinx-mali400/recipes-graphics/wayland/weston/systemd-notify.weston-start new file mode 100644 index 00000000..a97e7b38 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/systemd-notify.weston-start @@ -0,0 +1,9 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: Huawei Inc. +# SPDX-License-Identifier: Apache-2.0 + + +if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then + add_weston_module "systemd-notify.so" +fi diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.desktop b/meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.desktop new file mode 100644 index 00000000..1086ae8b --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=Weston +Comment=Wayland Compostitor +Exec=weston +Icon=weston +Terminal=false +Categories=Utility; diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.png b/meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.png new file mode 100644 index 00000000..ea8b7e0e Binary files /dev/null and b/meta-xilinx-mali400/recipes-graphics/wayland/weston/weston.png differ diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston/xwayland.weston-start b/meta-xilinx-mali400/recipes-graphics/wayland/weston/xwayland.weston-start new file mode 100644 index 00000000..db384b1a --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston/xwayland.weston-start @@ -0,0 +1,5 @@ +#!/bin/sh + +if type Xwayland >/dev/null 2>/dev/null; then + mkdir -p /tmp/.X11-unix +fi diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston_13.%.bbappend b/meta-xilinx-mali400/recipes-graphics/wayland/weston_13.%.bbappend new file mode 100644 index 00000000..3ee9cafa --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston_13.%.bbappend @@ -0,0 +1,12 @@ +FILESEXTRAPATHS:prepend:zynqmp := "${THISDIR}/files:" + +require weston.inc + +ZYNQMP_WARN_DEFAULT = "0" +ZYNQMP_WARN_DEFAULT:zynqmp = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '0', d)}" +ZYNQMP_WARN = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${ZYNQMP_WARN_DEFAULT}', '0', d)}" + +python() { + if d.getVar('ZYNQMP_WARN') == "1": + 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'))) +} diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bb b/meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bb new file mode 100644 index 00000000..a534b1b7 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bb @@ -0,0 +1,148 @@ +SUMMARY = "Weston, a Wayland compositor" +DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" +HOMEPAGE = "http://wayland.freedesktop.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ + file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" + +# We want this version to be "newer" then 10, only if libmali and mali400 are both enabled +ORIG_PE := "${PE}" +MALI_PE = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '1', '${ORIG_PE}', d)}" +PE = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', '${MALI_PE}', '${ORIG_PE}', d)}" + +SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ + file://weston.png \ + file://weston.desktop \ + file://xwayland.weston-start \ + file://systemd-notify.weston-start \ + file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ + file://0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch \ + file://0001-meson.build-fix-incorrect-header.patch \ + file://0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch \ +" + +SRC_URI:append:libc-musl = " file://dont-use-plane-add-prop.patch " + +SRC_URI[sha256sum] = "5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe" + +UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" + +inherit meson pkgconfig useradd features_check +# depends on virtual/egl +# weston-init requires pam enabled if started via systemd +REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" + +DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0" +DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" + +LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}" + +WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" + +EXTRA_OEMESON += "-Dbackend-default=auto -Dpipewire=false" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl clients', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ + ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ + launch \ + image-jpeg \ + screenshare \ + shell-desktop \ + shell-fullscreen \ + shell-ivi" + +# +# Compositor choices +# +# Weston on KMS +PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev" +# Weston on Wayland (nested Weston) +PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2" +# Weston on X11 +PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo" +# Headless Weston +PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false" +# Weston on framebuffer +PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev" +# Weston on RDP +PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp" +# weston-launch +PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm" +# VA-API desktop recorder +PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva" +# Weston with EGL support +PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl" +# Weston with lcms support +PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms" +# Weston with webp support +PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp" +# Weston with systemd-login support +PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus" +# Weston with Xwayland support (requires X11 and Wayland) +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false" +# colord CMS support +PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord" +# Clients support +PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" +# Virtual remote output with GStreamer on DRM backend +PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base" +# Weston with PAM support +PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam" +# Weston with screen-share support +PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false" +# Traditional desktop shell +PACKAGECONFIG[shell-desktop] = "-Dshell-desktop=true,-Dshell-desktop=false" +# Fullscreen shell +PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=false" +# In-Vehicle Infotainment (IVI) shell +PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false" +# JPEG image loading support +PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" + +do_install:append() { + # Weston doesn't need the .la files to load modules, so wipe them + rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la + + # If X11, ship a desktop file to launch it + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then + install -d ${D}${datadir}/applications + install ${WORKDIR}/weston.desktop ${D}${datadir}/applications + + install -d ${D}${datadir}/icons/hicolor/48x48/apps + install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then + chmod u+s ${D}${bindir}/weston-launch + fi +} + +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ + libweston-${WESTON_MAJOR_VERSION} ${PN}-examples" + +FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so" +FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}" + +FILES:libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so" +SUMMARY:libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'." + +FILES:${PN}-examples = "${bindir}/*" + +FILES:${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so" +RDEPENDS:${PN}-xwayland += "xwayland" + +RDEPENDS:${PN} += "xkeyboard-config" +RRECOMMENDS:${PN} = "weston-init liberation-fonts" +RRECOMMENDS:${PN}-dev += "wayland-protocols" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "--system weston-launch" diff --git a/meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bbappend b/meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bbappend new file mode 100644 index 00000000..80512ac3 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/wayland/weston_9.0.0.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend:zynqmp := "${THISDIR}/files/9.0.0:${THISDIR}/files:" + +require weston.inc diff --git a/meta-xilinx-mali400/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/meta-xilinx-mali400/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend new file mode 100644 index 00000000..03823f6e --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend @@ -0,0 +1,6 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-graphics/xwayland/xwayland_%.bbappend b/meta-xilinx-mali400/recipes-graphics/xwayland/xwayland_%.bbappend new file mode 100644 index 00000000..c1005f11 --- /dev/null +++ b/meta-xilinx-mali400/recipes-graphics/xwayland/xwayland_%.bbappend @@ -0,0 +1,7 @@ +# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific +DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" +MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" +MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" +PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" +PACKAGE_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-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bbappend b/meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bbappend new file mode 100644 index 00000000..81c660a5 --- /dev/null +++ b/meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' file://99-mali-device.rules', '', d)}" diff --git a/meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules b/meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules new file mode 100644 index 00000000..89ec5f78 --- /dev/null +++ b/meta-xilinx-mali400/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-mali-device.rules @@ -0,0 +1,2 @@ +# Device rules for GPU MALI-400 drivers. +ACTION=="add", SUBSYSTEM=="misc", KERNEL=="mali", MODE="0660", GROUP="video", TAG+="uaccess" diff --git a/meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx-mali400.inc b/meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx-mali400.inc new file mode 100644 index 00000000..e49e5377 --- /dev/null +++ b/meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx-mali400.inc @@ -0,0 +1,3 @@ +# Enable DRM_LIMA support if DISTRO_FEATURES != 'libmali' and MACHINE_FEATURES mali400 is enabled +MALI_FEATURE = "${@bb.utils.contains('DISTRO_FEATURES', 'libmali', '', 'features/drm-lima/drm-lima.scc', d)}" +KERNEL_FEATURES:append = "${@bb.utils.contains('MACHINE_FEATURES', 'mali400', ' ${MALI_FEATURE}', '', d)}" diff --git a/meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx_%.bbappend b/meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx_%.bbappend new file mode 100644 index 00000000..8b6d657c --- /dev/null +++ b/meta-xilinx-mali400/recipes-kernel/linux/linux-xlnx_%.bbappend @@ -0,0 +1 @@ +require linux-xlnx-mali400.inc diff --git a/meta-xilinx-multimedia/recipes-multimedia/gstreamer/FIXME/gstreamer1.0-plugins-base_%.bbappend b/meta-xilinx-multimedia/recipes-multimedia/gstreamer/FIXME/gstreamer1.0-plugins-base_%.bbappend deleted file mode 100644 index 03823f6e..00000000 --- a/meta-xilinx-multimedia/recipes-multimedia/gstreamer/FIXME/gstreamer1.0-plugins-base_%.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific -DEFAULT_PACKAGE_ARCH := "${PACKAGE_ARCH}" -MALI_PACKAGE_ARCH[vardepsexclude] = "MACHINE_ARCH" -MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtual/libgles1') == 'libmali-xlnx' else '${DEFAULT_PACKAGE_ARCH}'}" -PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" -PACKAGE_ARCH = "${@bb.utils.contains_any('DEPENDS', 'virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" -- cgit v1.2.3-54-g00ecf