diff options
author | Sidath Senanayake <sidaths@google.com> | 2021-06-17 17:58:22 +0100 |
---|---|---|
committer | Sidath Senanayake <sidaths@google.com> | 2021-06-17 17:58:22 +0100 |
commit | 2bfaaa5f53c45ab7b4f6daba20e92ef6d16ab53b (patch) | |
tree | 8cd2a6a47f2a590ed7bed11afdcb9e52f7232c4f /mali_kbase/tests | |
parent | fca8613cfcf585bf9113dca96a05daea9fd89794 (diff) | |
download | gpu-2bfaaa5f53c45ab7b4f6daba20e92ef6d16ab53b.tar.gz |
Mali Valhall DDK r32p1 BETA KMD
Provenance: 59f633569 (collaborate/google/android/v_r32p1-00bet0)
VX504X08X-BU-00000-r32p1-00bet0 - Valhall Android DDK
VX504X08X-BU-60000-r32p1-00bet0 - Valhall Android Document Bundle
VX504X08X-DC-11001-r32p1-00bet0 - Valhall Android DDK Software Errata
VX504X08X-SW-99006-r32p1-00bet0 - Valhall Android Renderscript AOSP parts
Signed-off-by: Sidath Senanayake <sidaths@google.com>
Change-Id: I6c9fc6e1e9f2e58bc804eb79582ad7afaafdef1b
Diffstat (limited to 'mali_kbase/tests')
30 files changed, 269 insertions, 319 deletions
diff --git a/mali_kbase/tests/Kbuild b/mali_kbase/tests/Kbuild index cf9d7fd..eaa88f4 100644 --- a/mali_kbase/tests/Kbuild +++ b/mali_kbase/tests/Kbuild @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # -# (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. +# (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. # # This program is free software and is provided to you under the terms of the # GNU General Public License version 2 as published by the Free Software @@ -18,6 +18,13 @@ # # +ccflags-y += -I$(src)/include \ + -I$(src) + +subdir-ccflags-y += -I$(src)/include \ + -I$(src) + obj-$(CONFIG_MALI_KUTF) += kutf/ -obj-$(CONFIG_MALI_IRQ_LATENCY) += mali_kutf_irq_test/ -obj-$(CONFIG_MALI_CLK_RATE_TRACE_PORTAL) += mali_kutf_clk_rate_trace/kernel/ +obj-$(CONFIG_MALI_KUTF_IRQ_TEST) += mali_kutf_irq_test/ +obj-$(CONFIG_MALI_KUTF_CLK_RATE_TRACE) += mali_kutf_clk_rate_trace/kernel/ + diff --git a/mali_kbase/tests/Kconfig b/mali_kbase/tests/Kconfig index cf2a23a..2468361 100644 --- a/mali_kbase/tests/Kconfig +++ b/mali_kbase/tests/Kconfig @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # -# (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. +# (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. # # This program is free software and is provided to you under the terms of the # GNU General Public License version 2 as published by the Free Software @@ -18,6 +18,40 @@ # # -source "drivers/gpu/arm/midgard/tests/kutf/Kconfig" -source "drivers/gpu/arm/midgard/tests/mali_kutf_irq_test/Kconfig" -source "drivers/gpu/arm/midgard/tests/mali_kutf_clk_rate_trace/kernel/Kconfig" +menuconfig MALI_KUTF + bool "Build Mali Kernel Unit Test Framework modules" + depends on MALI_MIDGARD && MALI_DEBUG + default y if MALI_DEBUG + help + This option will build the Mali testing framework modules. + + Modules: + - kutf.ko + - kutf_test.ko + +config MALI_KUTF_IRQ_TEST + bool "Build Mali KUTF IRQ test module" + depends on MALI_KUTF + default y + help + This option will build the IRQ latency measurement test module. + It can determine the latency of the Mali GPU IRQ on your system. + + Modules: + - mali_kutf_irq_test.ko + +config MALI_KUTF_CLK_RATE_TRACE + bool "Build Mali KUTF Clock rate trace test module" + depends on MALI_KUTF + default y + help + This option will build the clock rate trace portal test module. + It can test the clocks integration into the platform and exercise some + basic trace test in the system. + + Modules: + - mali_kutf_clk_rate_trace_test_portal.ko + + +comment "Enable MALI_DEBUG for KUTF modules support" + depends on MALI_MIDGARD && !MALI_DEBUG && MALI_KUTF diff --git a/mali_kbase/tests/Mconfig b/mali_kbase/tests/Mconfig index a21810b..167facd 100644 --- a/mali_kbase/tests/Mconfig +++ b/mali_kbase/tests/Mconfig @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-2.0 +# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note # # (C) COPYRIGHT 2018-2021 ARM Limited. All rights reserved. # @@ -18,32 +18,44 @@ # # +menuconfig MALI_KUTF + bool "Build Mali Kernel Unit Test Framework modules" + depends on MALI_MIDGARD && MALI_DEBUG + default y if BACKEND_KERNEL && MALI_DEBUG + help + This option will build the Mali testing framework modules. + + Modules: + - kutf.ko + - kutf_test.ko + +config MALI_KUTF_IRQ_TEST + bool "Build Mali KUTF IRQ test module" + depends on MALI_KUTF + default y + help + This option will build the IRQ latency measurement test module. + It can determine the latency of the Mali GPU IRQ on your system. + + Modules: + - mali_kutf_irq_test.ko + +config MALI_KUTF_CLK_RATE_TRACE + bool "Build Mali KUTF Clock rate trace test module" + depends on MALI_KUTF + default y + help + This option will build the clock rate trace portal test module. + It can test the clocks integration into the platform and exercise some + basic trace test in the system. + + Modules: + - mali_kutf_clk_rate_trace_test_portal.ko + + +# Enable MALI_DEBUG for KUTF modules support + config UNIT_TEST_KERNEL_MODULES - bool - default y if UNIT_TEST_CODE && BACKEND_KERNEL - default n - -config BUILD_IPA_TESTS - bool - default y if UNIT_TEST_KERNEL_MODULES && MALI_DEVFREQ - default n - -config BUILD_IPA_UNIT_TESTS - bool - default y if NO_MALI && BUILD_IPA_TESTS - default n - -config BUILD_CSF_TESTS - bool - default y if UNIT_TEST_KERNEL_MODULES && GPU_HAS_CSF - default n - -config BUILD_ARBIF_TESTS - bool - default y if UNIT_TEST_CODE && MALI_ARBITER_SUPPORT - default n - -config BUILD_ARBIF_KERNEL_TESTS - bool - default y if BUILD_KERNEL_MODULES && BUILD_ARBIF_TESTS - default n + bool + default y if UNIT_TEST_CODE && BACKEND_KERNEL + default n diff --git a/mali_kbase/tests/build.bp b/mali_kbase/tests/build.bp new file mode 100644 index 0000000..9d6137d --- /dev/null +++ b/mali_kbase/tests/build.bp @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * + * (C) COPYRIGHT 2021 ARM Limited. All rights reserved. + * + * This program is free software and is provided to you under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation, and any use by you of this program is subject to the terms + * of such GNU license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you can access it online at + * http://www.gnu.org/licenses/gpl-2.0.html. + * + */ + +bob_defaults { + name: "kernel_test_includes", + local_include_dirs: [ + "include", + "./../../", + "./../", + "./" + ], +} + +bob_defaults { + name: "kernel_test_configs", + mali_kutf: { + kbuild_options: ["CONFIG_MALI_KUTF=y"], + }, + unit_test_kernel_modules: { + kbuild_options: ["CONFIG_UNIT_TEST_KERNEL_MODULES=y"], + }, +} diff --git a/mali_kbase/tests/include/kutf/kutf_helpers.h b/mali_kbase/tests/include/kutf/kutf_helpers.h index 3b8613a..5cd1498 100644 --- a/mali_kbase/tests/include/kutf/kutf_helpers.h +++ b/mali_kbase/tests/include/kutf/kutf_helpers.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/include/kutf/kutf_helpers_user.h b/mali_kbase/tests/include/kutf/kutf_helpers_user.h index 49aad29..10cce4f 100644 --- a/mali_kbase/tests/include/kutf/kutf_helpers_user.h +++ b/mali_kbase/tests/include/kutf/kutf_helpers_user.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/include/kutf/kutf_mem.h b/mali_kbase/tests/include/kutf/kutf_mem.h index 47c4bea..e729e72 100644 --- a/mali_kbase/tests/include/kutf/kutf_mem.h +++ b/mali_kbase/tests/include/kutf/kutf_mem.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/include/kutf/kutf_resultset.h b/mali_kbase/tests/include/kutf/kutf_resultset.h index 1f2dcfa..e869c5e 100644 --- a/mali_kbase/tests/include/kutf/kutf_resultset.h +++ b/mali_kbase/tests/include/kutf/kutf_resultset.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/include/kutf/kutf_suite.h b/mali_kbase/tests/include/kutf/kutf_suite.h index 426e435..910717e 100644 --- a/mali_kbase/tests/include/kutf/kutf_suite.h +++ b/mali_kbase/tests/include/kutf/kutf_suite.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/include/kutf/kutf_utils.h b/mali_kbase/tests/include/kutf/kutf_utils.h index e5e2f02..c72a2cf 100644 --- a/mali_kbase/tests/include/kutf/kutf_utils.h +++ b/mali_kbase/tests/include/kutf/kutf_utils.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/kutf/Kbuild b/mali_kbase/tests/kutf/Kbuild index bd6540c..61f6385 100644 --- a/mali_kbase/tests/kutf/Kbuild +++ b/mali_kbase/tests/kutf/Kbuild @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # -# (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. +# (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. # # This program is free software and is provided to you under the terms of the # GNU General Public License version 2 as published by the Free Software @@ -18,8 +18,14 @@ # # -ccflags-y += -I$(src)/../include +ifeq ($(CONFIG_MALI_KUTF),y) +obj-m += kutf.o -obj-$(CONFIG_MALI_KUTF) += kutf.o - -kutf-y := kutf_mem.o kutf_resultset.o kutf_suite.o kutf_utils.o kutf_helpers.o kutf_helpers_user.o +kutf-y := \ + kutf_mem.o \ + kutf_resultset.o \ + kutf_suite.o \ + kutf_utils.o \ + kutf_helpers.o \ + kutf_helpers_user.o +endif diff --git a/mali_kbase/tests/kutf/Kconfig b/mali_kbase/tests/kutf/Kconfig deleted file mode 100644 index 7ea95b6..0000000 --- a/mali_kbase/tests/kutf/Kconfig +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. -# -# This program is free software and is provided to you under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation, and any use by you of this program is subject to the terms -# of such GNU license. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# - -config MALI_KUTF - tristate "Mali Kernel Unit Test Framework" - default m - help - Enables MALI testing framework. To compile it as a module, - choose M here - this will generate a single module called kutf. diff --git a/mali_kbase/tests/kutf/Makefile b/mali_kbase/tests/kutf/Makefile deleted file mode 100644 index 041f539..0000000 --- a/mali_kbase/tests/kutf/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# (C) COPYRIGHT 2014-2017, 2020 ARM Limited. All rights reserved. -# -# This program is free software and is provided to you under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation, and any use by you of this program is subject to the terms -# of such GNU license. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# - -# linux build system bootstrap for out-of-tree module - -# default to building for the host -ARCH ?= $(shell uname -m) - -ifeq ($(KDIR),) -$(error Must specify KDIR to point to the kernel to target)) -endif - -all: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) $(SCONS_CONFIGS) EXTRA_CFLAGS=-I$(CURDIR)/../include modules - -clean: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean diff --git a/mali_kbase/tests/kutf/build.bp b/mali_kbase/tests/kutf/build.bp index 707a053..89edae9 100644 --- a/mali_kbase/tests/kutf/build.bp +++ b/mali_kbase/tests/kutf/build.bp @@ -1,7 +1,7 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * - * (C) COPYRIGHT 2018-2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2018-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -22,8 +22,9 @@ bob_kernel_module { name: "kutf", defaults: [ - "kernel_defaults", - "kutf_includes", + "mali_kbase_shared_config_defaults", + "kernel_test_configs", + "kernel_test_includes", ], srcs: [ "Kbuild", @@ -34,9 +35,8 @@ bob_kernel_module { "kutf_suite.c", "kutf_utils.c", ], - kbuild_options: ["CONFIG_MALI_KUTF=m"], enabled: false, - base_build_kutf: { + mali_kutf: { enabled: true, }, } diff --git a/mali_kbase/tests/kutf/kutf_helpers.c b/mali_kbase/tests/kutf/kutf_helpers.c index 13923fa..b5614e7 100644 --- a/mali_kbase/tests/kutf/kutf_helpers.c +++ b/mali_kbase/tests/kutf/kutf_helpers.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/kutf/kutf_helpers_user.c b/mali_kbase/tests/kutf/kutf_helpers_user.c index 84c63be..fa76e62 100644 --- a/mali_kbase/tests/kutf/kutf_helpers_user.c +++ b/mali_kbase/tests/kutf/kutf_helpers_user.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/kutf/kutf_mem.c b/mali_kbase/tests/kutf/kutf_mem.c index b005b68..e8f148a 100644 --- a/mali_kbase/tests/kutf/kutf_mem.c +++ b/mali_kbase/tests/kutf/kutf_mem.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/kutf/kutf_resultset.c b/mali_kbase/tests/kutf/kutf_resultset.c index 1eea08c..dd1ffe7 100644 --- a/mali_kbase/tests/kutf/kutf_resultset.c +++ b/mali_kbase/tests/kutf/kutf_resultset.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/kutf/kutf_suite.c b/mali_kbase/tests/kutf/kutf_suite.c index 4b1dde4..215bfab 100644 --- a/mali_kbase/tests/kutf/kutf_suite.c +++ b/mali_kbase/tests/kutf/kutf_suite.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2014, 2017-2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -1158,7 +1158,7 @@ void kutf_test_abort(struct kutf_context *context) } EXPORT_SYMBOL(kutf_test_abort); -#ifdef CONFIG_DEBUG_FS +#if IS_ENABLED(CONFIG_DEBUG_FS) /** * init_kutf_core() - Module entry point. diff --git a/mali_kbase/tests/kutf/kutf_utils.c b/mali_kbase/tests/kutf/kutf_utils.c index f0dad1f..00381eb 100644 --- a/mali_kbase/tests/kutf/kutf_utils.c +++ b/mali_kbase/tests/kutf/kutf_utils.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2014, 2017, 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2014, 2017, 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kbuild b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kbuild index 00b2a41..c340525 100644 --- a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kbuild +++ b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kbuild @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # -# (C) COPYRIGHT 2020 ARM Limited. All rights reserved. +# (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved. # # This program is free software and is provided to you under the terms of the # GNU General Public License version 2 as published by the Free Software @@ -18,8 +18,8 @@ # # -ccflags-y += -I$(src)/../include -I$(src)/../../../ -I$(src)/../../ -I$(src)/../../backend/gpu -I$(srctree)/drivers/staging/android - -obj-$(CONFIG_MALI_CLK_RATE_TRACE_PORTAL) += mali_kutf_clk_rate_trace_test_portal.o +ifeq ($(CONFIG_MALI_KUTF_CLK_RATE_TRACE),y) +obj-m += mali_kutf_clk_rate_trace_test_portal.o mali_kutf_clk_rate_trace_test_portal-y := mali_kutf_clk_rate_trace_test.o +endif diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kconfig b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kconfig deleted file mode 100644 index 51c2d27..0000000 --- a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Kconfig +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# (C) COPYRIGHT 2020 ARM Limited. All rights reserved. -# -# This program is free software and is provided to you under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation, and any use by you of this program is subject to the terms -# of such GNU license. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# - -config CONFIG_MALI_CLK_RATE_TRACE_PORTAL - tristate "Mali GPU Clock Trace Test portal" - depends on MALI_MIDGARD && MALI_DEBUG && MALI_KUTF - default m - help - This option will build a test module mali_kutf_clk_rate_trace_test_portal - that can test the clocks integration into the platform and exercise some - basic trace test in the system. Choosing M here will generate a single - module called mali_kutf_clk_rate_trace_test_portal. diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Makefile b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Makefile deleted file mode 100644 index 950acd8..0000000 --- a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# (C) COPYRIGHT 2020 ARM Limited. All rights reserved. -# -# This program is free software and is provided to you under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation, and any use by you of this program is subject to the terms -# of such GNU license. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# - -ifneq ($(KERNELRELEASE),) - -ccflags-y := \ - -DMALI_UNIT_TEST=$(MALI_UNIT_TEST) \ - -DMALI_CUSTOMER_RELEASE=$(MALI_CUSTOMER_RELEASE) \ - -I$(src)/../../include \ - -I$(src)/../../../../../../../include \ - -I$(src)/../../../../ \ - -I$(src)/../../../ \ - -I$(src)/../../../backend/gpu \ - -I$(src)/../../../debug \ - -I$(src)/../../../debug/backend \ - -I$(src)/ \ - -I$(srctree)/drivers/staging/android \ - -I$(srctree)/include/linux - -obj-m := mali_kutf_clk_rate_trace_test_portal.o -mali_kutf_clk_rate_trace_test_portal-y := mali_kutf_clk_rate_trace_test.o - -else -# linux build system bootstrap for out-of-tree module - -# default to building for the host -ARCH ?= $(shell uname -m) - -ifeq ($(KDIR),) -$(error Must specify KDIR to point to the kernel to target)) -endif - -all: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) KBUILD_EXTRA_SYMBOLS="$(CURDIR)/../../kutf/Module.symvers $(CURDIR)/../../../Module.symvers" modules - -clean: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean - -endif diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/build.bp b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/build.bp index c16b3de..225ad69 100644 --- a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/build.bp +++ b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/build.bp @@ -1,7 +1,7 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * - * (C) COPYRIGHT 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -23,20 +23,21 @@ bob_kernel_module { name: "mali_kutf_clk_rate_trace_test_portal", defaults: [ "mali_kbase_shared_config_defaults", + "kernel_test_configs", "kernel_test_includes", ], srcs: [ - "../mali_kutf_clk_rate_trace_test.h", - "Makefile", + "Kbuild", "mali_kutf_clk_rate_trace_test.c", + "../mali_kutf_clk_rate_trace_test.h", ], extra_symbols: [ "mali_kbase", "kutf", ], enabled: false, - base_build_kutf: { + mali_kutf_clk_rate_trace: { + kbuild_options: ["CONFIG_MALI_KUTF_CLK_RATE_TRACE=y"], enabled: true, - kbuild_options: ["CONFIG_MALI_CLK_RATE_TRACE_PORTAL=m"], }, } diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c index bd091fa..a0dca7e 100644 --- a/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c +++ b/mali_kbase/tests/mali_kutf_clk_rate_trace/kernel/mali_kutf_clk_rate_trace_test.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * - * (C) COPYRIGHT 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -32,9 +32,9 @@ #include <linux/sched.h> #endif #include "mali_kbase.h" -#include "mali_kbase_irq_internal.h" -#include "mali_kbase_pm_internal.h" -#include "mali_kbase_clk_rate_trace_mgr.h" +#include "backend/gpu/mali_kbase_irq_internal.h" +#include "backend/gpu/mali_kbase_pm_internal.h" +#include "backend/gpu/mali_kbase_clk_rate_trace_mgr.h" #include <kutf/kutf_suite.h> #include <kutf/kutf_utils.h> @@ -114,14 +114,15 @@ struct kbasep_cmd_name_pair { }; struct kbasep_cmd_name_pair kbasep_portal_cmd_name_map[] = { - {PORTAL_CMD_GET_CLK_RATE_MGR, GET_CLK_RATE_MGR}, - {PORTAL_CMD_GET_CLK_RATE_TRACE, GET_CLK_RATE_TRACE}, - {PORTAL_CMD_GET_TRACE_SNAPSHOT, GET_TRACE_SNAPSHOT}, - {PORTAL_CMD_INC_PM_CTX_CNT, INC_PM_CTX_CNT}, - {PORTAL_CMD_DEC_PM_CTX_CNT, DEC_PM_CTX_CNT}, - {PORTAL_CMD_CLOSE_PORTAL, CLOSE_PORTAL}, - {PORTAL_CMD_INVOKE_NOTIFY_42KHZ, INVOKE_NOTIFY_42KHZ}, - }; + { PORTAL_CMD_GET_PLATFORM, GET_PLATFORM }, + { PORTAL_CMD_GET_CLK_RATE_MGR, GET_CLK_RATE_MGR }, + { PORTAL_CMD_GET_CLK_RATE_TRACE, GET_CLK_RATE_TRACE }, + { PORTAL_CMD_GET_TRACE_SNAPSHOT, GET_TRACE_SNAPSHOT }, + { PORTAL_CMD_INC_PM_CTX_CNT, INC_PM_CTX_CNT }, + { PORTAL_CMD_DEC_PM_CTX_CNT, DEC_PM_CTX_CNT }, + { PORTAL_CMD_CLOSE_PORTAL, CLOSE_PORTAL }, + { PORTAL_CMD_INVOKE_NOTIFY_42KHZ, INVOKE_NOTIFY_42KHZ }, +}; /* Global pointer for the kutf_portal_trace_write() to use. When * this pointer is engaged, new requests for create fixture will fail @@ -137,8 +138,16 @@ static void kutf_portal_trace_write( u32 index, u32 new_rate) { struct clk_trace_snapshot *snapshot; - struct kutf_clk_rate_trace_fixture_data *data = container_of( - listener, struct kutf_clk_rate_trace_fixture_data, listener); + struct kutf_clk_rate_trace_fixture_data *data; + + if (listener == NULL) { + pr_err("%s - index: %u, new_rate: %u, listener is NULL\n", + __func__, index, new_rate); + return; + } + + data = container_of(listener, struct kutf_clk_rate_trace_fixture_data, + listener); lockdep_assert_held(&data->kbdev->pm.clk_rtm.lock); @@ -180,11 +189,10 @@ static void kutf_set_pm_ctx_idle(struct kutf_context *context) if (WARN_ON(data->pm_ctx_cnt > 0)) return; - - kbase_pm_context_idle(data->kbdev); #if !MALI_USE_CSF kbase_pm_release_gpu_cycle_counter(data->kbdev); #endif + kbase_pm_context_idle(data->kbdev); } static char const *kutf_clk_trace_do_change_pm_ctx(struct kutf_context *context, @@ -408,6 +416,63 @@ static char const *kutf_clk_trace_do_close_portal(struct kutf_context *context, return errmsg; } +/** + * kutf_clk_trace_do_get_platform() - Gets platform information + * @context: KUTF context + * @cmd: The decoded portal input request + * + * Checks the gpu node in the device tree to see if arbitration is enabled + * If so determines device tree whether platform is PV or PTM + * + * Return: A string to indicate the platform (PV/PTM/GPU/UNKNOWN) + */ +static char const *kutf_clk_trace_do_get_platform( + struct kutf_context *context, + struct clk_trace_portal_input *cmd) +{ + int seq = cmd->cmd_input.u.val_u64 & 0xFF; + char const *errmsg = NULL; + const void *arbiter_if_node = NULL; + const void *power_node = NULL; + const char *platform = "GPU"; +#if defined(CONFIG_MALI_ARBITER_SUPPORT) && defined(CONFIG_OF) + struct kutf_clk_rate_trace_fixture_data *data = context->fixture; + + arbiter_if_node = + of_get_property(data->kbdev->dev->of_node, "arbiter_if", NULL); +#endif + if (arbiter_if_node) { + power_node = of_find_compatible_node(NULL, NULL, + "arm,mali-gpu-power"); + if (power_node) { + platform = "PV"; + } else { + power_node = of_find_compatible_node(NULL, NULL, + "arm,mali-ptm"); + if (power_node) + platform = "PTM"; + else + platform = "UNKNOWN"; + } + } else { + platform = "GPU"; + } + + pr_debug("%s - platform is %s\n", __func__, platform); + snprintf(portal_msg_buf, PORTAL_MSG_LEN, + "{SEQ:%d, PLATFORM:%s}", seq, platform); + + WARN_ON(cmd->portal_cmd != PORTAL_CMD_GET_PLATFORM); + + if (kutf_helper_send_named_str(context, "ACK", portal_msg_buf)) { + pr_warn("Error in sending ack for " CLOSE_PORTAL "reuquest\n"); + errmsg = kutf_dsprintf(&context->fixture_pool, + "Error in sending ack for " GET_PLATFORM "request"); + } + + return errmsg; +} + static bool kutf_clk_trace_dequeue_portal_cmd(struct kutf_context *context, struct clk_trace_portal_input *cmd) { @@ -461,6 +526,9 @@ static bool kutf_clk_trace_process_portal_cmd(struct kutf_context *context, WARN_ON(cmd->portal_cmd == PORTAL_CMD_INVALID); switch (cmd->portal_cmd) { + case PORTAL_CMD_GET_PLATFORM: + errmsg = kutf_clk_trace_do_get_platform(context, cmd); + break; case PORTAL_CMD_GET_CLK_RATE_MGR: /* Fall through */ case PORTAL_CMD_GET_CLK_RATE_TRACE: @@ -613,7 +681,7 @@ void kutf_clk_trace_barebone_check(struct kutf_context *context) kutf_clk_trace_flag_result(context, KUTF_RESULT_FAIL, msg); else if (!data->total_update_cnt) { msg = kutf_dsprintf(&context->fixture_pool, - "No trace update seen during the test!"); + "No trace update seen during the test!"); kutf_clk_trace_flag_result(context, KUTF_RESULT_WARN, msg); } } diff --git a/mali_kbase/tests/mali_kutf_clk_rate_trace/mali_kutf_clk_rate_trace_test.h b/mali_kbase/tests/mali_kutf_clk_rate_trace/mali_kutf_clk_rate_trace_test.h index 600b025..878eddc 100644 --- a/mali_kbase/tests/mali_kutf_clk_rate_trace/mali_kutf_clk_rate_trace_test.h +++ b/mali_kbase/tests/mali_kutf_clk_rate_trace/mali_kutf_clk_rate_trace_test.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* * - * (C) COPYRIGHT 2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -30,6 +30,8 @@ * enum kbasep_clk_rate_trace_req - request command to the clock rate trace * service portal. * + * @PORTAL_CMD_GET_PLATFORM: Request the platform that the tests are + * to be run on. * @PORTAL_CMD_GET_CLK_RATE_MGR: Request the clock trace manager internal * data record. On a positive acknowledgement * the prevailing clock rates and the GPU idle @@ -73,6 +75,7 @@ */ /* PORTAL_CMD_INVALID must be the last one, serving the size */ enum kbasep_clk_rate_trace_req { + PORTAL_CMD_GET_PLATFORM, PORTAL_CMD_GET_CLK_RATE_MGR, PORTAL_CMD_GET_CLK_RATE_TRACE, PORTAL_CMD_GET_TRACE_SNAPSHOT, @@ -121,6 +124,7 @@ enum kbasep_clk_rate_trace_req { * Note, at the close, PM_CTX_CNT is 1. The PM_CTX_CNT will internally be * dropped down to 0 as part of the portal close clean up. */ +#define GET_PLATFORM "GET_PLATFORM" #define GET_CLK_RATE_MGR "GET_CLK_RATE_MGR" #define GET_CLK_RATE_TRACE "GET_CLK_RATE_TRACE" #define GET_TRACE_SNAPSHOT "GET_TRACE_SNAPSHOT" diff --git a/mali_kbase/tests/mali_kutf_irq_test/Kbuild b/mali_kbase/tests/mali_kutf_irq_test/Kbuild index cc38cb8..6f4a536 100644 --- a/mali_kbase/tests/mali_kutf_irq_test/Kbuild +++ b/mali_kbase/tests/mali_kutf_irq_test/Kbuild @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # -# (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. +# (C) COPYRIGHT 2017, 2020-2021 ARM Limited. All rights reserved. # # This program is free software and is provided to you under the terms of the # GNU General Public License version 2 as published by the Free Software @@ -18,8 +18,8 @@ # # -ccflags-y += -I$(src)/../include -I$(src)/../../../ -I$(src)/../../ -I$(src)/../../backend/gpu -I$(srctree)/drivers/staging/android - -obj-$(CONFIG_MALI_IRQ_LATENCY) += mali_kutf_irq_test.o +ifeq ($(CONFIG_MALI_KUTF_IRQ_TEST),y) +obj-m += mali_kutf_irq_test.o mali_kutf_irq_test-y := mali_kutf_irq_test_main.o +endif diff --git a/mali_kbase/tests/mali_kutf_irq_test/Kconfig b/mali_kbase/tests/mali_kutf_irq_test/Kconfig deleted file mode 100644 index e28106b..0000000 --- a/mali_kbase/tests/mali_kutf_irq_test/Kconfig +++ /dev/null @@ -1,28 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# (C) COPYRIGHT 2017, 2020 ARM Limited. All rights reserved. -# -# This program is free software and is provided to you under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation, and any use by you of this program is subject to the terms -# of such GNU license. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# - -config MALI_IRQ_LATENCY - tristate "Mali GPU IRQ latency measurement" - depends on MALI_MIDGARD && MALI_DEBUG && MALI_KUTF - default m - help - This option will build a test module mali_kutf_irq_test that - can determine the latency of the Mali GPU IRQ on your system. - Choosing M here will generate a single module called mali_kutf_irq_test. diff --git a/mali_kbase/tests/mali_kutf_irq_test/Makefile b/mali_kbase/tests/mali_kutf_irq_test/Makefile deleted file mode 100644 index cbec0d3..0000000 --- a/mali_kbase/tests/mali_kutf_irq_test/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# (C) COPYRIGHT 2015, 2017-2018, 2020 ARM Limited. All rights reserved. -# -# This program is free software and is provided to you under the terms of the -# GNU General Public License version 2 as published by the Free Software -# Foundation, and any use by you of this program is subject to the terms -# of such GNU license. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, you can access it online at -# http://www.gnu.org/licenses/gpl-2.0.html. -# -# - -# linux build system bootstrap for out-of-tree module - -# default to building for the host -ARCH ?= $(shell uname -m) - -ifeq ($(KDIR),) -$(error Must specify KDIR to point to the kernel to target)) -endif - -TEST_CCFLAGS := \ - -DMALI_UNIT_TEST=$(MALI_UNIT_TEST) \ - -DMALI_CUSTOMER_RELEASE=$(MALI_CUSTOMER_RELEASE) \ - -DMALI_USE_CSF=$(MALI_USE_CSF) \ - $(SCONS_CFLAGS) \ - -I$(CURDIR)/../include \ - -I$(CURDIR)/../../../../../../include \ - -I$(CURDIR)/../../../ \ - -I$(CURDIR)/../../ \ - -I$(CURDIR)/../../backend/gpu \ - -I$(CURDIR)/../../debug \ - -I$(CURDIR)/../../debug/backend \ - -I$(CURDIR)/ \ - -I$(srctree)/drivers/staging/android \ - -I$(srctree)/include/linux - -all: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) $(SCONS_CONFIGS) EXTRA_CFLAGS="$(TEST_CCFLAGS)" KBUILD_EXTRA_SYMBOLS="$(CURDIR)/../kutf/Module.symvers $(CURDIR)/../../Module.symvers" modules - -clean: - $(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean diff --git a/mali_kbase/tests/mali_kutf_irq_test/build.bp b/mali_kbase/tests/mali_kutf_irq_test/build.bp index 58021c8..155875b 100644 --- a/mali_kbase/tests/mali_kutf_irq_test/build.bp +++ b/mali_kbase/tests/mali_kutf_irq_test/build.bp @@ -1,7 +1,7 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * - * (C) COPYRIGHT 2018-2020 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2018-2021 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -23,6 +23,7 @@ bob_kernel_module { name: "mali_kutf_irq_test", defaults: [ "mali_kbase_shared_config_defaults", + "kernel_test_configs", "kernel_test_includes", ], srcs: [ @@ -34,8 +35,8 @@ bob_kernel_module { "kutf", ], enabled: false, - base_build_kutf: { + mali_kutf_irq_test: { + kbuild_options: ["CONFIG_MALI_KUTF_IRQ_TEST=y"], enabled: true, - kbuild_options: ["CONFIG_MALI_IRQ_LATENCY=m"], }, } |