diff options
121 files changed, 527 insertions, 1051 deletions
diff --git a/drivers/gpu/arm/mali/Makefile b/drivers/gpu/arm/mali/Makefile index 5e3466268bb5..f7af3c5717d6 100755 --- a/drivers/gpu/arm/mali/Makefile +++ b/drivers/gpu/arm/mali/Makefile @@ -72,6 +72,7 @@ USING_MALI_RUN_TIME_PM ?= 0 USING_MALI_PMM_TESTSUITE ?= 0 USING_PROFILING ?= 0 TIMESTAMP ?= default +TARGET_PLATFORM ?= default ifeq ($(USING_UMP),1) UMP_SYMVERS_FILE = ../ump/Module.symvers @@ -92,17 +93,12 @@ DEFINES += -DMALI_TIMELINE_PROFILING_ENABLED=$(USING_PROFILING) DEFINES += -DMALI_POWER_MGMT_TEST_SUITE=$(USING_MALI_PMM_TESTSUITE) DEFINES += -DMALI_PMM_RUNTIME_JOB_CONTROL_ON=$(USING_MALI_RUN_TIME_PM) -MALI_PLATFORM_FILE = platform/default/mali_platform.o - ifneq ($(call submodule_enabled, $M, PMU),0) MALI_PLATFORM_FILE = platform/mali400-pmu/mali_platform.o +else + MALI_PLATFORM_FILE = platform/$(TARGET_PLATFORM)/mali_platform.o endif -ifeq ($(USING_MALI_RUN_TIME_PM),1) - MALI_PLATFORM_FILE = platform/mali-runtimepm/mali_platform.o -endif - - DEFINES += -DUSING_MALI_PMM=$(USING_PMM) DEFINES += -DMALI_GPU_UTILIZATION=$(USING_GPU_UTILIZATION) diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m300/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m300/config.h deleted file mode 100644 index 5021cb90e916..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m300/config.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - { - .type = PMU, - .description = "Mali-300 PMU", - .base = 0xC0002000, - .irq = -1, - .mmu_id = 0 - - }, - { - .type = MALI300GP, - .description = "Mali-300 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI300PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-300 PP", - .mmu_id = 2 - }, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = -1, - .description = "Mali-300 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = -1, - .description = "Mali-300 MMU for PP", - .mmu_id = 2 - }, -#endif -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = -0x50000000, - .alloc_order = 0, /* Highest preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0xD2000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x0E000000, -#else - .base = 0xD0000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 5, /* Medium preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI300L2, - .base = 0xC0001000, - .description = "Mali-300 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1-direct/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1-direct/config.h deleted file mode 100644 index b61ec52115d8..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1-direct/config.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - - { - .type = PMU, - .description = "Mali-400 PMU", - .base = 0xC0002000, - .irq = -1, - .mmu_id = 0 - }, - { - .type = MALI400GP, - .description = "Mali-400 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI400PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-400 PP", - .mmu_id = 2 - }, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = -1, - .description = "Mali-400 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = -1, - .description = "Mali-400 MMU for PP", - .mmu_id = 2 - }, -#endif - { - .type = OS_MEMORY, - .description = "OS Memory", - .alloc_order = 10, /* Lowest preference for this memory */ - .size = 96 * 1024 * 1024, /* 96 MB */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = 0, - .alloc_order = 5, /* Medium preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0x82000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x0E000000, -#else - .base = 0x80000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 0, /* Highest preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI400L2, - .base = 0xC0001000, - .description = "Mali-400 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1-pmu/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1-pmu/config.h deleted file mode 100644 index fd42ae27a881..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1-pmu/config.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - { - .type = PMU, - .description = "Mali-400 PMU", - .base = 0xC0002000, - .irq = -1, - .mmu_id = 0 - - }, - { - .type = MALI400GP, - .description = "Mali-400 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI400PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-400 PP", - .mmu_id = 2 - }, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = -1, - .description = "Mali-400 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = -1, - .description = "Mali-400 MMU for PP", - .mmu_id = 2 - }, -#endif -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = -0x50000000, - .alloc_order = 0, /* Highest preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0xD2000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x0E000000, -#else - .base = 0xD0000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 5, /* Medium preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI400L2, - .base = 0xC0001000, - .description = "Mali-400 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1/config.h deleted file mode 100644 index 8c0ddaa87ca4..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-1/config.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - { - .type = MALI400GP, - .description = "Mali-400 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI400PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-400 PP", - .mmu_id = 2 - }, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = -1, - .description = "Mali-400 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = -1, - .description = "Mali-400 MMU for PP", - .mmu_id = 2 - }, -#endif -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = -0x50000000, - .alloc_order = 0, /* Highest preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0xD2000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x0E000000, -#else - .base = 0xD0000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 5, /* Medium preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI400L2, - .base = 0xC0001000, - .description = "Mali-400 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-2/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m400-2/config.h deleted file mode 100644 index 08f8dc6d635d..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-2/config.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - { - .type = MALI400GP, - .description = "Mali-400 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI400PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-400 PP 0", - .mmu_id = 2 - }, - { - .type = MALI400PP, - .base = 0xc000A000, - .irq = -1, - .description = "Mali-400 PP 1", - .mmu_id = 3 -}, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = -1, - .description = "Mali-400 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = -1, - .description = "Mali-400 MMU for PP 0", - .mmu_id = 2 - }, - { - .type = MMU, - .base = 0xC0005000, - .irq = -1, - .description = "Mali-400 MMU for PP 1", - .mmu_id = 3 - }, -#endif -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = -0x50000000, - .alloc_order = 0, /* Highest preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0xD2000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x0E000000, -#else - .base = 0xD0000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 5, /* Medium preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI400L2, - .base = 0xC0001000, - .description = "Mali-400 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-3/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m400-3/config.h deleted file mode 100644 index 5ea52374b908..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-3/config.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - { - .type = MALI400GP, - .description = "Mali-400 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI400PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-400 PP 0", - .mmu_id = 2 - }, - { - .type = MALI400PP, - .base = 0xc000A000, - .irq = -1, - .description = "Mali-400 PP 1", - .mmu_id = 3 - }, - { - .type = MALI400PP, - .base = 0xc000C000, - .irq = -1, - .description = "Mali-400 PP 2", - .mmu_id = 4 - }, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = 102, - .description = "Mali-400 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = 102, - .description = "Mali-400 MMU for PP 0", - .mmu_id = 2 - }, - { - .type = MMU, - .base = 0xC0005000, - .irq = 102, - .description = "Mali-400 MMU for PP 1", - .mmu_id = 3 - }, - { - .type = MMU, - .base = 0xC0006000, - .irq = 102, - .description = "Mali-400 MMU for PP 2", - .mmu_id = 4 - }, -#endif -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = -0x50000000, - .alloc_order = 0, /* Highest preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0xD2000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x0E000000, -#else - .base = 0xD0000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 5, /* Medium preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI400L2, - .base = 0xC0001000, - .description = "Mali-400 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-4/config.h b/drivers/gpu/arm/mali/arch-pb-virtex5-m400-4/config.h deleted file mode 100644 index df7c630f997b..000000000000 --- a/drivers/gpu/arm/mali/arch-pb-virtex5-m400-4/config.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -/* Configuration for the EB platform with ZBT memory enabled */ - -static _mali_osk_resource_t arch_configuration [] = -{ - { - .type = MALI400GP, - .description = "Mali-400 GP", - .base = 0xC0000000, - .irq = -1, - .mmu_id = 1 - }, - { - .type = MALI400PP, - .base = 0xc0008000, - .irq = -1, - .description = "Mali-400 PP 0", - .mmu_id = 2 - }, - { - .type = MALI400PP, - .base = 0xc000A000, - .irq = -1, - .description = "Mali-400 PP 1", - .mmu_id = 3 - }, - { - .type = MALI400PP, - .base = 0xc000C000, - .irq = -1, - .description = "Mali-400 PP 2", - .mmu_id = 4 - }, - { - .type = MALI400PP, - .base = 0xc000E000, - .irq = -1, - .description = "Mali-400 PP 3", - .mmu_id = 5 - }, -#if USING_MMU - { - .type = MMU, - .base = 0xC0003000, - .irq = 102, - .description = "Mali-400 MMU for GP", - .mmu_id = 1 - }, - { - .type = MMU, - .base = 0xC0004000, - .irq = 102, - .description = "Mali-400 MMU for PP 0", - .mmu_id = 2 - }, - { - .type = MMU, - .base = 0xC0005000, - .irq = 102, - .description = "Mali-400 MMU for PP 1", - .mmu_id = 3 - }, - { - .type = MMU, - .base = 0xC0006000, - .irq = 102, - .description = "Mali-400 MMU for PP 2", - .mmu_id = 4 - }, - { - .type = MMU, - .base = 0xC0007000, - .irq = 102, - .description = "Mali-400 MMU for PP 3", - .mmu_id = 5 - }, -#endif -#if ! ONLY_ZBT - { - .type = MEMORY, - .description = "Mali SDRAM remapped to baseboard", - .cpu_usage_adjust = -0x50000000, - .alloc_order = 0, /* Highest preference for this memory */ -#if MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 - .base = 0xD2000000, /* Reserving 32MB for UMP devicedriver */ - .size = 0x08000000, -#else - .base = 0xD0000000, - .size = 0x10000000, -#endif /* MALI_USE_UNIFIED_MEMORY_PROVIDER != 0 */ - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif -#if USING_ZBT - { - .type = MEMORY, - .description = "Mali ZBT", - .alloc_order = 5, /* Medium preference for this memory */ - .base = 0xe1000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_READABLE | _MALI_PP_WRITEABLE |_MALI_GP_READABLE | _MALI_GP_WRITEABLE - }, -#endif - { - .type = MEM_VALIDATION, - .description = "Framebuffer", - .base = 0xe0000000, - .size = 0x01000000, - .flags = _MALI_CPU_WRITEABLE | _MALI_CPU_READABLE | _MALI_PP_WRITEABLE | _MALI_PP_READABLE - }, - { - .type = MALI400L2, - .base = 0xC0001000, - .description = "Mali-400 L2 cache" - }, -}; - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/mali/common/mali_block_allocator.c b/drivers/gpu/arm/mali/common/mali_block_allocator.c index e1e56af01c13..fc80a20c8138 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_block_allocator.c +++ b/drivers/gpu/arm/mali/common/mali_block_allocator.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_block_allocator.h b/drivers/gpu/arm/mali/common/mali_block_allocator.h index d3f0f9be60ad..c3b5761e23a8 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_block_allocator.h +++ b/drivers/gpu/arm/mali/common/mali_block_allocator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_GP2.c b/drivers/gpu/arm/mali/common/mali_kernel_GP2.c index 059c44fe2c76..d6ce174abb57 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_GP2.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_GP2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_MALI200.c b/drivers/gpu/arm/mali/common/mali_kernel_MALI200.c index fde43de09d9c..c1eb8fed32d0 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_MALI200.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_MALI200.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_common.h b/drivers/gpu/arm/mali/common/mali_kernel_common.h index 1a9459bff2b8..08516c56a9f5 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_common.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_core.c b/drivers/gpu/arm/mali/common/mali_kernel_core.c index a600df55abd4..f3603cc7d0c8 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_core.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_core.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -557,25 +557,19 @@ _mali_osk_errcode_t _mali_ukk_wait_for_notification( _mali_uk_wait_for_notificat if (NULL == queue) { MALI_DEBUG_PRINT(1, ("No notification queue registered with the session. Asking userspace to stop querying\n")); - args->code.type = _MALI_NOTIFICATION_CORE_SHUTDOWN_IN_PROGRESS; + args->type = _MALI_NOTIFICATION_CORE_SHUTDOWN_IN_PROGRESS; MALI_SUCCESS; } /* receive a notification, might sleep */ - err = _mali_osk_notification_queue_receive(queue, args->code.timeout, ¬ification); - if (_MALI_OSK_ERR_TIMEOUT == err) - { - /* timeout */ - args->code.type = _MALI_NOTIFICATION_CORE_TIMEOUT; - MALI_SUCCESS; - } - else if (_MALI_OSK_ERR_OK != err) + err = _mali_osk_notification_queue_receive(queue, ¬ification); + if (_MALI_OSK_ERR_OK != err) { MALI_ERROR(err); /* errcode returned, pass on to caller */ } /* copy the buffer to the user */ - args->code.type = (_mali_uk_notification_type)notification->notification_type; + args->type = (_mali_uk_notification_type)notification->notification_type; _mali_osk_memcpy(&args->data, notification->result_buffer, notification->result_buffer_size); /* finished with the notification */ @@ -584,6 +578,36 @@ _mali_osk_errcode_t _mali_ukk_wait_for_notification( _mali_uk_wait_for_notificat MALI_SUCCESS; /* all ok */ } +_mali_osk_errcode_t _mali_ukk_post_notification( _mali_uk_post_notification_s *args ) +{ + _mali_osk_notification_t * notification; + _mali_osk_notification_queue_t *queue; + + /* check input */ + MALI_DEBUG_ASSERT_POINTER(args); + MALI_CHECK_NON_NULL(args->ctx, _MALI_OSK_ERR_INVALID_ARGS); + + queue = (_mali_osk_notification_queue_t *)mali_kernel_session_manager_slot_get(args->ctx, mali_subsystem_core_id); + + /* if the queue does not exist we're currently shutting down */ + if (NULL == queue) + { + MALI_DEBUG_PRINT(1, ("No notification queue registered with the session. Asking userspace to stop querying\n")); + MALI_SUCCESS; + } + + notification = _mali_osk_notification_create(args->type, 0); + if ( NULL == notification) + { + MALI_PRINT_ERROR( ("Failed to create notification object\n")) ; + return _MALI_OSK_ERR_NOMEM; + } + + _mali_osk_notification_queue_send(queue, notification); + + MALI_SUCCESS; /* all ok */ +} + static _mali_osk_errcode_t mali_kernel_subsystem_core_system_info_fill(_mali_system_info* info) { MALI_CHECK_NON_NULL(info, _MALI_OSK_ERR_INVALID_ARGS); diff --git a/drivers/gpu/arm/mali/common/mali_kernel_core.h b/drivers/gpu/arm/mali/common/mali_kernel_core.h index 49c78fc5fa65..3819ecc5e1cf 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_core.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_core.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.c b/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.c index 8b2a97d15452..45c280edd6af 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.h b/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.h index 745be9235e73..f626aa594559 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_descriptor_mapping.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_gp.h b/drivers/gpu/arm/mali/common/mali_kernel_gp.h index efd3b43141b4..c2467edc677f 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_gp.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_gp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.c b/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.c index 944d416e408a..af307c6ec0b2 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.h b/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.h index 8c12b50039d8..de3229a0688b 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_l2_cache.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_mem.h b/drivers/gpu/arm/mali/common/mali_kernel_mem.h index 8caafe37f465..681b6dd47c9e 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_mem.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_mem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_mem_buddy.c b/drivers/gpu/arm/mali/common/mali_kernel_mem_buddy.c index b38c132d8efc..2f0e0ffafea6 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_mem_buddy.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_mem_buddy.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.c b/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.c index 4ac6e8362b68..f43ca21cdf16 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -1247,14 +1247,12 @@ static void mali_kernel_mmu_bus_reset(mali_kernel_memory_mmu * mmu) mali_mmu_register_write(mmu, MALI_MMU_REGISTER_DTE_ADDR, mali_empty_page_directory); /* no session is active, so just activate the empty page directory */ mali_mmu_register_write(mmu, MALI_MMU_REGISTER_COMMAND, MALI_MMU_COMMAND_ENABLE_PAGING); - /* resume normal operation */ - _mali_kernel_core_broadcast_subsystem_message(MMU_KILL_STEP3_CONTINUE_JOB_HANDLING, (u32)mmu); - - MALI_DEBUG_PRINT(4, ("Page fault handling complete\n")); - /* release the extra address space reference, will schedule */ mali_memory_core_mmu_release_address_space_reference(mmu); + /* resume normal operation */ + _mali_kernel_core_broadcast_subsystem_message(MMU_KILL_STEP3_CONTINUE_JOB_HANDLING, (u32)mmu); + MALI_DEBUG_PRINT(4, ("Page fault handling complete\n")); } void mali_kernel_mmu_reset(void * input_mmu) diff --git a/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.h b/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.h index 00d2eb136a09..a199fd66b5a6 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_mem_mmu.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_mem_os.c b/drivers/gpu/arm/mali/common/mali_kernel_mem_os.c index c906af7c508f..845de935ec95 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_mem_os.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_mem_os.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_mem_os.h b/drivers/gpu/arm/mali/common/mali_kernel_mem_os.h index 0946169f79d0..ff49f8a816ab 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_mem_os.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_mem_os.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.c b/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.c index d95e44b1b07e..3b4ace05f014 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.h b/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.h index 9a47d876d949..80a2b4bb3a71 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_memory_engine.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_pp.h b/drivers/gpu/arm/mali/common/mali_kernel_pp.h index 8cf7bf76e5d2..ff1e153678c3 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_pp.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_pp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_profiling.c b/drivers/gpu/arm/mali/common/mali_kernel_profiling.c index ecabaa7a60d5..07bb894b1b47 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_profiling.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_profiling.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_profiling.h b/drivers/gpu/arm/mali/common/mali_kernel_profiling.h index eb2f68cdfd0f..5d3aa6eb841d 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_profiling.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_profiling.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_rendercore.c b/drivers/gpu/arm/mali/common/mali_kernel_rendercore.c index ee2cf8b76a48..e3027cc4f261 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_rendercore.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_rendercore.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -30,7 +30,7 @@ #define HANG_CHECK_MSECS_MIN 100 #define HANG_CHECK_MSECS_MAX 2000 /* 2 secs */ -#define HANG_CHECK_MSECS_DEFAULT (2*HANG_CHECK_MSECS_MIN) +#define HANG_CHECK_MSECS_DEFAULT 500 /* 500 ms */ #define WATCHDOG_MSECS_MIN (2*HANG_CHECK_MSECS_MIN) #define WATCHDOG_MSECS_MAX 3600000 /* 1 hour */ @@ -443,6 +443,7 @@ _mali_osk_errcode_t mali_core_renderunit_init(mali_core_renderunit * core) #endif /* USING_MALI_PMM */ core->error_recovery = MALI_FALSE; + core->in_detach_function = MALI_FALSE; core->state = CORE_IDLE; core->current_job = NULL; core->magic_nr = CORE_MAGIC_NR; @@ -1512,14 +1513,26 @@ static void mali_core_renderunit_detach_job_from_core(mali_core_renderunit* core { mali_core_job * job; mali_core_subsystem * subsystem; + mali_bool already_in_detach_function; + job = core->current_job; subsystem = core->subsystem; MALI_DEBUG_ASSERT(CORE_IDLE != core->state); - if ( NULL != job ) + /* The reset_core() called some lines below might call this detach + * funtion again. To protect the core object from being modified by + * recursive calls, the in_detach_function would track if it is an recursive call + */ + already_in_detach_function = core->in_detach_function; + + if ( MALI_FALSE == already_in_detach_function ) { - mali_core_job_set_run_time(job); - core->current_job = NULL; + core->in_detach_function = MALI_TRUE; + if ( NULL != job ) + { + mali_core_job_set_run_time(job); + core->current_job = NULL; + } } if (JOB_STATUS_END_SEG_FAULT == end_status) @@ -1531,21 +1544,26 @@ static void mali_core_renderunit_detach_job_from_core(mali_core_renderunit* core subsystem->reset_core( core, MALI_CORE_RESET_STYLE_RUNABLE ); } - if ( CORE_IDLE != core->state ) + if ( MALI_FALSE == already_in_detach_function ) { -#if MALI_GPU_UTILIZATION - mali_utilization_core_end(); -#endif - mali_core_subsystem_move_core_set_idle(core); - } + if ( CORE_IDLE != core->state ) + { + #if MALI_GPU_UTILIZATION + mali_utilization_core_end(); + #endif + mali_core_subsystem_move_core_set_idle(core); + } - if ( SUBSYSTEM_RESCHEDULE == reschedule ) - { - mali_core_subsystem_schedule(subsystem); - } - if ( NULL != job ) - { - core->subsystem->return_job_to_user(job, end_status); + core->in_detach_function = MALI_FALSE; + + if ( SUBSYSTEM_RESCHEDULE == reschedule ) + { + mali_core_subsystem_schedule(subsystem); + } + if ( NULL != job ) + { + core->subsystem->return_job_to_user(job, end_status); + } } } diff --git a/drivers/gpu/arm/mali/common/mali_kernel_rendercore.h b/drivers/gpu/arm/mali/common/mali_kernel_rendercore.h index b7fb08d26e00..80d7dd82ceab 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_rendercore.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_rendercore.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -145,6 +145,7 @@ typedef struct mali_core_renderunit _mali_osk_list_t list; /* Is always in subsystem->idle_list OR session->renderunits_working */ mali_core_status state; mali_bool error_recovery; /* Indicates if the core is waiting for external help to recover (typically the MMU) */ + mali_bool in_detach_function; struct mali_core_job * current_job; /* Current job being processed on this core ||NULL */ u32 magic_nr; _mali_osk_timer_t * timer; diff --git a/drivers/gpu/arm/mali/common/mali_kernel_session_manager.h b/drivers/gpu/arm/mali/common/mali_kernel_session_manager.h index 8cc41d7f9372..ce290d0c1c91 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_session_manager.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_session_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_subsystem.h b/drivers/gpu/arm/mali/common/mali_kernel_subsystem.h index 062d84a9c135..ba757abef0aa 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_subsystem.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_subsystem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_kernel_utilization.c b/drivers/gpu/arm/mali/common/mali_kernel_utilization.c index 304e5fb3c018..1ba122a9856e 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_utilization.c +++ b/drivers/gpu/arm/mali/common/mali_kernel_utilization.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -13,7 +13,7 @@ #include "mali_platform.h" /* Define how often to calculate and report GPU utilization, in milliseconds */ -#define MALI_GPU_UTILIZATION_TIMEOUT 10000 +#define MALI_GPU_UTILIZATION_TIMEOUT 1000 static _mali_osk_lock_t *time_data_lock; @@ -110,7 +110,7 @@ static void calculate_gpu_utilization(void* arg) _mali_osk_errcode_t mali_utilization_init(void) { - time_data_lock = _mali_osk_lock_init( _MALI_OSK_LOCKFLAG_SPINLOCK|_MALI_OSK_LOCKFLAG_NONINTERRUPTABLE, 0, 0 ); + time_data_lock = _mali_osk_lock_init( _MALI_OSK_LOCKFLAG_SPINLOCK_IRQ|_MALI_OSK_LOCKFLAG_NONINTERRUPTABLE, 0, 0 ); if (NULL == time_data_lock) { return _MALI_OSK_ERR_FAULT; @@ -131,6 +131,18 @@ _mali_osk_errcode_t mali_utilization_init(void) + +void mali_utilization_suspend(void) +{ + if (NULL != utilization_timer) + { + _mali_osk_timer_del(utilization_timer); + timer_running = MALI_FALSE; + } +} + + + void mali_utilization_term(void) { if (NULL != utilization_timer) diff --git a/drivers/gpu/arm/mali/common/mali_kernel_utilization.h b/drivers/gpu/arm/mali/common/mali_kernel_utilization.h index 05cb13b8560f..f64850067293 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_kernel_utilization.h +++ b/drivers/gpu/arm/mali/common/mali_kernel_utilization.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -31,6 +31,11 @@ void mali_utilization_term(void); void mali_utilization_core_start(void); /** + * Should be called to stop the utilization timer during system suspend + */ +void mali_utilization_suspend(void); + +/** * Should be called when a job has completed executing a job */ void mali_utilization_core_end(void); diff --git a/drivers/gpu/arm/mali/common/mali_osk.h b/drivers/gpu/arm/mali/common/mali_osk.h index 57e47682cf0a..a287a6af7dc2 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_osk.h +++ b/drivers/gpu/arm/mali/common/mali_osk.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -237,6 +237,7 @@ typedef enum _MALI_OSK_LOCKFLAG_READERWRITER = 0x4, /**< Optimise for readers/writers */ _MALI_OSK_LOCKFLAG_ORDERED = 0x8, /**< Use the order parameter; otherwise use automatic ordering */ _MALI_OSK_LOCKFLAG_ONELOCK = 0x10, /**< Each thread can only hold one lock at a time */ + _MALI_OSK_LOCKFLAG_SPINLOCK_IRQ = 0x20, /**< IRQ version of spinlock */ /** @enum _mali_osk_lock_flags_t * * Flags from 0x10000--0x80000000 are RESERVED for User-mode */ @@ -578,6 +579,14 @@ typedef struct _mali_osk_resource */ #define _MALI_OSK_IRQ_NUMBER_FAKE ((u32)0xFFFFFFF1) +/** @addtogroup _mali_osk_irq + * @{ */ + +/** @brief PMM Virtual IRQ number + */ +#define _MALI_OSK_IRQ_NUMBER_PMM ((u32)0xFFFFFFF2) + + /** @brief Initialize IRQ handling for a resource * * The _mali_osk_irq_t returned must be written into the resource-specific data @@ -1298,23 +1307,34 @@ void _mali_osk_notification_queue_send( _mali_osk_notification_queue_t *queue, _ * * Receives a single notification from the given queue. * - * If no notifciations are ready the thread will sleep until one becomes ready - * or a timeout occurs. Therefore, notifications may not be received into an + * If no notifciations are ready the thread will sleep until one becomes ready. + * Therefore, notifications may not be received into an * IRQ or 'atomic' context (that is, a context where sleeping is disallowed). * - * On timeout the result will be NULL. + * @param queue The queue to receive from + * @param result Pointer to storage of a pointer of type + * \ref _mali_osk_notification_t*. \a result will be written to such that the + * expression \a (*result) will evaluate to a pointer to a valid + * \ref _mali_osk_notification_t object, or NULL if none were received. + * @return _MALI_OSK_ERR_OK on success. _MALI_OSK_ERR_RESTARTSYSCALL if the sleep was interrupted. + */ +_mali_osk_errcode_t _mali_osk_notification_queue_receive( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result ); + +/** @brief Dequeues a notification from a queue + * + * Receives a single notification from the given queue. + * + * If no notifciations are ready the function call will return an error code. * * @param queue The queue to receive from - * @param timeout Timeout for the sleep if no notification is pending. - * If this is set to 0, then it will not sleep. * @param result Pointer to storage of a pointer of type * \ref _mali_osk_notification_t*. \a result will be written to such that the * expression \a (*result) will evaluate to a pointer to a valid * \ref _mali_osk_notification_t object, or NULL if none were received. - * @return _MALI_OSK_ERR_OK on success. _MALI_OSK_ERR_TIMEOUT if a timeout - * occurred. Otherwise, a suitable _mali_osk_errcode_t on failure. + * @return _MALI_OSK_ERR_OK on success, _MALI_OSK_ERR_ITEM_NOT_FOUND if queue was empty. */ -_mali_osk_errcode_t _mali_osk_notification_queue_receive( _mali_osk_notification_queue_t *queue, u32 timeout, _mali_osk_notification_t **result ); +_mali_osk_errcode_t _mali_osk_notification_queue_dequeue( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result ); + /** @} */ /* end group _mali_osk_notification */ diff --git a/drivers/gpu/arm/mali/common/mali_osk_bitops.h b/drivers/gpu/arm/mali/common/mali_osk_bitops.h index f262f7dad37d..28026ba1e6d3 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_osk_bitops.h +++ b/drivers/gpu/arm/mali/common/mali_osk_bitops.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_osk_list.h b/drivers/gpu/arm/mali/common/mali_osk_list.h index bc621e11103c..bfa6cdbe88ac 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_osk_list.h +++ b/drivers/gpu/arm/mali/common/mali_osk_list.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_osk_mali.h b/drivers/gpu/arm/mali/common/mali_osk_mali.h index 0b1d13a5a5d8..9a046fb91eb2 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_osk_mali.h +++ b/drivers/gpu/arm/mali/common/mali_osk_mali.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/mali_uk_types.h b/drivers/gpu/arm/mali/common/mali_uk_types.h index f420b276990c..6af29f39b444 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_uk_types.h +++ b/drivers/gpu/arm/mali/common/mali_uk_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -73,6 +73,7 @@ typedef enum _MALI_UK_GET_SYSTEM_INFO, /**< _mali_ukk_get_system_info() */ _MALI_UK_WAIT_FOR_NOTIFICATION, /**< _mali_ukk_wait_for_notification() */ _MALI_UK_GET_API_VERSION, /**< _mali_ukk_get_api_version() */ + _MALI_UK_POST_NOTIFICATION, /**< _mali_ukk_post_notification() */ /** Memory functions */ @@ -614,6 +615,7 @@ typedef enum _MALI_NOTIFICATION_CORE_TIMEOUT = (_MALI_UK_CORE_SUBSYSTEM << 16) | 0x10, _MALI_NOTIFICATION_CORE_SHUTDOWN_IN_PROGRESS = (_MALI_UK_CORE_SUBSYSTEM << 16) | 0x20, + _MALI_NOTIFICATION_APPLICATION_QUIT = (_MALI_UK_CORE_SUBSYSTEM << 16) | 0x40, /** Fragment Processor notifications */ @@ -684,14 +686,8 @@ typedef enum */ typedef struct { - void *ctx; /**< [in,out] user-kernel context (trashed on output) */ - union - { - /** [in] Number of milliseconds we should wait for a notification */ - u32 timeout; - /** [out] Type of notification available */ - _mali_uk_notification_type type; - } code; + void *ctx; /**< [in,out] user-kernel context (trashed on output) */ + _mali_uk_notification_type type; /**< [out] Type of notification available */ union { _mali_uk_gp_job_suspended_s gp_job_suspended;/**< [out] Notification data for _MALI_NOTIFICATION_GP_STALLED notification type */ @@ -699,6 +695,17 @@ typedef struct _mali_uk_pp_job_finished_s pp_job_finished; /**< [out] Notification data for _MALI_NOTIFICATION_PP_FINISHED notification type */ } data; } _mali_uk_wait_for_notification_s; + +/** @brief Arguments for _mali_ukk_post_notification() + * + * Posts the specified notification to the notification queue for this application. + * This is used to send a quit message to the callback thread. + */ +typedef struct +{ + void *ctx; /**< [in,out] user-kernel context (trashed on output) */ + _mali_uk_notification_type type; /**< [in] Type of notification to post */ +} _mali_uk_post_notification_s; /** @} */ /* end group _mali_uk_waitfornotification_s */ /** @defgroup _mali_uk_getapiversion_s Get API Version @@ -729,7 +736,7 @@ typedef struct * The 16bit integer is stored twice in a 32bit integer * For example, for version 1 the value would be 0x00010001 */ -#define _MALI_API_VERSION 6 +#define _MALI_API_VERSION 7 #define _MALI_UK_API_VERSION _MAKE_VERSION_ID(_MALI_API_VERSION) /** diff --git a/drivers/gpu/arm/mali/common/mali_ukk.h b/drivers/gpu/arm/mali/common/mali_ukk.h index 2cfd9171ecbf..981a1f07c536 100644..100755 --- a/drivers/gpu/arm/mali/common/mali_ukk.h +++ b/drivers/gpu/arm/mali/common/mali_ukk.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -284,6 +284,13 @@ _mali_osk_errcode_t _mali_ukk_get_system_info( _mali_uk_get_system_info_s *args */ _mali_osk_errcode_t _mali_ukk_wait_for_notification( _mali_uk_wait_for_notification_s *args ); +/** @brief Post a notification to the notification queue of this application. + * + * @param args see _mali_uk_post_notification_s in "mali_uk_types.h" + * @return _MALI_OSK_ERR_OK on success, otherwise a suitable _mali_osk_errcode_t on failure. + */ +_mali_osk_errcode_t _mali_ukk_post_notification( _mali_uk_post_notification_s *args ); + /** @brief Verifies if the user and kernel side of this API are compatible. * * @param args see _mali_uk_get_api_version_s in "mali_uk_types.h" diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm.c b/drivers/gpu/arm/mali/common/pmm/mali_pmm.c index af74f4f5e18f..39a5a6e21d5b 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm.c +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -30,6 +30,11 @@ static _mali_pmm_internal_state_t *pmm_state = NULL; /* Mali kernel subsystem id */ static mali_kernel_subsystem_identifier mali_subsystem_pmm_id = -1; +/* lock for SMP */ +#ifdef CONFIG_SMP +_mali_osk_lock_t *mali_pmm_lock; +#endif /* CONFIG_SMP */ + #define GET_PMM_STATE_PTR (pmm_state) /* Internal functions */ @@ -485,7 +490,7 @@ _mali_osk_errcode_t malipmm_create(_mali_osk_resource_t *resource) if( !pmm_state->iqueue ) goto pmm_fail_cleanup; /* We are creating an IRQ handler just for the worker thread it gives us */ - pmm_state->irq = _mali_osk_irq_init( _MALI_OSK_IRQ_NUMBER_FAKE, + pmm_state->irq = _mali_osk_irq_init( _MALI_OSK_IRQ_NUMBER_PMM, malipmm_irq_uhandler, malipmm_irq_bhandler, NULL, @@ -494,6 +499,10 @@ _mali_osk_errcode_t malipmm_create(_mali_osk_resource_t *resource) "PMM handler" ); if( !pmm_state->irq ) goto pmm_fail_cleanup; +#ifdef CONFIG_SMP + mali_pmm_lock = _mali_osk_lock_init((_mali_osk_lock_flags_t)( _MALI_OSK_LOCKFLAG_READERWRITER | _MALI_OSK_LOCKFLAG_ORDERED), 0, 0); + if( !mali_pmm_lock ) goto pmm_fail_cleanup; +#endif /* CONFIG_SMP */ pmm_state->lock = _mali_osk_lock_init((_mali_osk_lock_flags_t)(_MALI_OSK_LOCKFLAG_READERWRITER | _MALI_OSK_LOCKFLAG_ORDERED), 0, 75); if( !pmm_state->lock ) goto pmm_fail_cleanup; @@ -558,10 +567,15 @@ void malipmm_kernel_subsystem_terminate( mali_kernel_subsystem_identifier id ) MALI_PMM_UNLOCK(pmm_state); pmm_policy_term(pmm_state); _mali_osk_irq_term( pmm_state->irq ); +#ifdef CONFIG_SMP + _mali_osk_lock_term(mali_pmm_lock); +#endif /* CONFIG_SMP */ + _mali_osk_notification_queue_term( pmm_state->queue ); _mali_osk_notification_queue_term( pmm_state->iqueue ); if( pmm_state->pmu_initialized ) mali_platform_deinit(&t); _mali_osk_atomic_term( &(pmm_state->messages_queued) ); + MALI_PMM_LOCK_TERM(pmm_state); _mali_osk_free(pmm_state); pmm_state = NULL; } @@ -708,12 +722,18 @@ void malipmm_irq_bhandler(void *data) if( power_test_check() ) return; #endif +#ifdef CONFIG_SMP + _mali_osk_lock_wait( mali_pmm_lock, _MALI_OSK_LOCKMODE_RW ); +#endif /* CONFIG_SMP */ MALI_PMM_LOCK(pmm); /* Quick out when we are shutting down */ if( pmm->status == MALI_PMM_STATUS_OFF ) { MALI_PMM_UNLOCK(pmm); +#ifdef CONFIG_SMP + _mali_osk_lock_signal( mali_pmm_lock, _MALI_OSK_LOCKMODE_RW ); +#endif /* CONFIG_SMP */ return; } @@ -742,10 +762,11 @@ void malipmm_irq_bhandler(void *data) } MALI_PMM_UNLOCK(pmm); +#ifdef CONFIG_SMP + _mali_osk_lock_signal(mali_pmm_lock, _MALI_OSK_LOCKMODE_RW ); +#endif /* CONFIG_SMP */ } -#define MAX_PROCESS_EVENTS 5 - static void pmm_event_process( void ) { _mali_osk_errcode_t err = _MALI_OSK_ERR_OK; @@ -761,12 +782,11 @@ static void pmm_event_process( void ) * processing the messages for a long time */ process_messages = _mali_osk_atomic_read( &(pmm->messages_queued) ); - if( process_messages > MAX_PROCESS_EVENTS ) process_messages = MAX_PROCESS_EVENTS; while( process_messages > 0 ) { /* Check internal message queue first */ - err = _mali_osk_notification_queue_receive( pmm->iqueue, 0, &msg ); + err = _mali_osk_notification_queue_dequeue( pmm->iqueue, &msg ); if( err != _MALI_OSK_ERR_OK ) { @@ -775,7 +795,7 @@ static void pmm_event_process( void ) if( pmm->waiting > 0 ) pmm->waiting--; /* We aren't busy changing state, so look at real events */ - err = _mali_osk_notification_queue_receive( pmm->queue, 0, &msg ); + err = _mali_osk_notification_queue_dequeue( pmm->queue, &msg ); if( err != _MALI_OSK_ERR_OK ) { @@ -821,6 +841,13 @@ static void pmm_event_process( void ) #endif err = pmm_policy_process( pmm, event ); + + if( err != _MALI_OSK_ERR_OK ) + { + MALI_PRINT_ERROR( ("PMM: Error(%d) in policy %d when processing event message with id: %d", + err, pmm->policy, event->id) ); + } + /* Delete notification */ _mali_osk_notification_delete ( msg ); @@ -830,11 +857,6 @@ static void pmm_event_process( void ) return; } - if( err != _MALI_OSK_ERR_OK ) - { - MALI_PRINT_ERROR( ("PMM: Error(%d) in policy %d when processing event message with id: %d", - err, pmm->policy, event->id) ); - } #if MALI_PMM_TRACE MALI_PRINT( ("PMM Trace: Event processed, msgs (sent/read) = %d/%d, int msgs (sent/read) = %d/%d, no events = %d, waiting = %d\n", diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm.h b/drivers/gpu/arm/mali/common/pmm/mali_pmm.h index 2d0e2428ed0b..74a61b1cd458 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm.h +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.c b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.c index 87b6ec2c8f49..327e8b4c8538 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.c +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.h b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.h index adbb48af4fe5..83cb7f29a92b 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.h +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.c b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.c index 7020e0f733ad..643bb04553b2 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.c +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.h b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.h index da13224d955b..a158b09f6102 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.h +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_alwayson.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.c b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.c index 815d85d6a052..192647d6306b 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.c +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -184,6 +184,7 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * break; case MALI_PMM_EVENT_JOB_SCHEDULED: + /* Update idle cores to indicate active - remove these! */ pmm_cores_set_active( pmm, cores ); /* Remember when this happened */ @@ -195,6 +196,7 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * /*** FALL THROUGH to QUEUED to check POWER UP ***/ case MALI_PMM_EVENT_JOB_QUEUED: + pmm_policy_job_control_job_queued( pmm ); #if MALI_POWER_MGMT_TEST_SUITE _mali_osk_pmm_policy_events_notifications(MALI_PMM_EVENT_JOB_QUEUED); @@ -202,22 +204,24 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * break; case MALI_PMM_EVENT_DVFS_PAUSE: - pmm->is_dvfs_active = 1; + cores_subset = pmm_cores_to_power_down( pmm, cores, MALI_FALSE ); if ( cores_subset != 0 ) { if ( !pmm_power_down_okay( pmm ) ) { + pmm->is_dvfs_active = 1; pmm->status = MALI_PMM_STATUS_OS_POWER_DOWN; + pmm_save_os_event_data( pmm, event->data ); break; } } - pmm->is_dvfs_active = 0; pmm->status = MALI_PMM_STATUS_DVFS_PAUSE; _mali_osk_pmm_dvfs_operation_done( 0 ); break; case MALI_PMM_EVENT_OS_POWER_DOWN: + /* Need to power down all cores even if we need to wait for them */ cores_subset = pmm_cores_to_power_down( pmm, cores, MALI_FALSE ); if( cores_subset != 0 ) @@ -226,6 +230,7 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * if( !pmm_invoke_power_down( pmm ) ) { /* We need to wait until they are idle */ + pmm->status = MALI_PMM_STATUS_OS_POWER_DOWN; /* Save the OS data to respond later */ pmm_save_os_event_data( pmm, event->data ); @@ -240,6 +245,7 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * break; case MALI_PMM_EVENT_JOB_FINISHED: + /* Update idle cores - add these! */ pmm_cores_set_idle( pmm, cores ); #if MALI_POWER_MGMT_TEST_SUITE @@ -256,6 +262,7 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * /*** FALL THROUGH to TIMEOUT TEST as NO TIMEOUT ***/ case MALI_PMM_EVENT_TIMEOUT: + /* Main job control policy - turn off cores after inactivity */ if( job_control_timeout_valid( pmm, &data_job_control->latency, (u32)event->data ) ) { @@ -292,11 +299,12 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * switch ( event->id ) { case MALI_PMM_EVENT_DVFS_RESUME: - /* Set idle status */ - pmm->status = MALI_PMM_STATUS_IDLE; + if ( pmm->cores_powered !=0) { + pmm->cores_ack_down =0; pmm_power_down_cancel( pmm ); + pmm->status = MALI_PMM_STATUS_IDLE; } else { @@ -308,11 +316,6 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * case MALI_PMM_EVENT_OS_POWER_DOWN: /* Set waiting status */ pmm->status = MALI_PMM_STATUS_OS_WAITING; - if ( pmm->is_dvfs_active == 1 ) - { - pmm->is_dvfs_active = 0; - _mali_osk_pmm_dvfs_operation_done( 0 ); - } if ( pmm->cores_powered != 0) { if( pmm_invoke_power_down( pmm ) ) @@ -362,12 +365,17 @@ _mali_osk_errcode_t pmm_policy_process_job_control( _mali_pmm_internal_state_t * { case MALI_PMM_EVENT_INTERNAL_POWER_DOWN_ACK: + pmm_cores_set_down_ack( pmm, cores ); + if ( pmm->is_dvfs_active == 1 ) { + if( pmm_power_down_okay( pmm ) ) + { + pmm->is_dvfs_active = 0; pmm->status = MALI_PMM_STATUS_DVFS_PAUSE; - pmm->is_dvfs_active = 0; - _mali_osk_pmm_dvfs_operation_done( 0 ); + _mali_osk_pmm_dvfs_operation_done( pmm_retrieve_os_event_data( pmm ) ); + } break; } diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.h b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.h index 6cd0975761f8..455234b80bcf 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.h +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_policy_jobcontrol.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.c b/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.c index 22f9e3f357af..69193a254595 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.c +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -562,7 +562,7 @@ void pmm_fatal_reset( _mali_pmm_internal_state_t *pmm ) /* Purge the event queues */ do { - if( _mali_osk_notification_queue_receive( pmm->iqueue, 0, &msg ) == _MALI_OSK_ERR_OK ) + if( _mali_osk_notification_queue_dequeue( pmm->iqueue, &msg ) == _MALI_OSK_ERR_OK ) { _mali_osk_notification_delete ( msg ); break; @@ -571,7 +571,7 @@ void pmm_fatal_reset( _mali_pmm_internal_state_t *pmm ) do { - if( _mali_osk_notification_queue_receive( pmm->queue, 0, &msg ) == _MALI_OSK_ERR_OK ) + if( _mali_osk_notification_queue_dequeue( pmm->queue, &msg ) == _MALI_OSK_ERR_OK ) { _mali_osk_notification_delete ( msg ); break; diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.h b/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.h index 8032509adb13..f019fb67b771 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.h +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_state.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -41,6 +41,8 @@ extern "C" _mali_osk_lock_wait( pmm->lock, _MALI_OSK_LOCKMODE_RW ) #define MALI_PMM_UNLOCK(pmm) \ _mali_osk_lock_signal( pmm->lock, _MALI_OSK_LOCKMODE_RW ) +#define MALI_PMM_LOCK_TERM(pmm) \ + _mali_osk_lock_term( pmm->lock ) /* Notification type for messages */ #define MALI_PMM_NOTIFICATION_TYPE 0 diff --git a/drivers/gpu/arm/mali/common/pmm/mali_pmm_system.h b/drivers/gpu/arm/mali/common/pmm/mali_pmm_system.h index 2fec2b54d67b..f5106479e333 100644..100755 --- a/drivers/gpu/arm/mali/common/pmm/mali_pmm_system.h +++ b/drivers/gpu/arm/mali/common/pmm/mali_pmm_system.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_device_pause_resume.c b/drivers/gpu/arm/mali/linux/mali_device_pause_resume.c index 0b47efe18cfa..1c1bf3066889 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_device_pause_resume.c +++ b/drivers/gpu/arm/mali/linux/mali_device_pause_resume.c @@ -1,5 +1,5 @@ /** - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -32,7 +32,12 @@ int mali_dev_pause() int err = 0; _mali_osk_lock_wait(lock, _MALI_OSK_LOCKMODE_RW); if ((mali_dvfs_device_state == _MALI_DEVICE_SUSPEND) || (mali_device_state == _MALI_DEVICE_SUSPEND_IN_PROGRESS) - || (mali_device_state == _MALI_DEVICE_SUSPEND)) + || (mali_device_state == _MALI_DEVICE_SUSPEND) +#ifdef CONFIG_HAS_EARLYSUSPEND + || (mali_device_state == _MALI_DEVICE_EARLYSUSPEND_DISABLE_FB)) +#else + ) +#endif { err = -EPERM; } @@ -52,7 +57,12 @@ int mali_dev_resume() int err = 0; _mali_osk_lock_wait(lock, _MALI_OSK_LOCKMODE_RW); if ((mali_dvfs_device_state == _MALI_DEVICE_RESUME) || (mali_device_state == _MALI_DEVICE_SUSPEND_IN_PROGRESS) - || (mali_device_state == _MALI_DEVICE_SUSPEND)) + || (mali_device_state == _MALI_DEVICE_SUSPEND) +#ifdef CONFIG_HAS_EARLYSUSPEND + || (mali_device_state == _MALI_DEVICE_EARLYSUSPEND_DISABLE_FB)) +#else + ) +#endif { err = -EPERM; } diff --git a/drivers/gpu/arm/mali/linux/mali_device_pause_resume.h b/drivers/gpu/arm/mali/linux/mali_device_pause_resume.h index 155a3e69d485..5362f88cdbd6 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_device_pause_resume.h +++ b/drivers/gpu/arm/mali/linux/mali_device_pause_resume.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_kernel_ioctl.h b/drivers/gpu/arm/mali/linux/mali_kernel_ioctl.h index d76841e5eba8..87d94db7886e 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_kernel_ioctl.h +++ b/drivers/gpu/arm/mali/linux/mali_kernel_ioctl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -42,6 +42,7 @@ extern "C" #define MALI_IOC_GET_SYSTEM_INFO _IOR (MALI_IOC_CORE_BASE, _MALI_UK_GET_SYSTEM_INFO, _mali_uk_get_system_info_s *) #define MALI_IOC_WAIT_FOR_NOTIFICATION _IOWR(MALI_IOC_CORE_BASE, _MALI_UK_WAIT_FOR_NOTIFICATION, _mali_uk_wait_for_notification_s *) #define MALI_IOC_GET_API_VERSION _IOWR(MALI_IOC_CORE_BASE, _MALI_UK_GET_API_VERSION, _mali_uk_get_api_version_s *) +#define MALI_IOC_POST_NOTIFICATION _IOWR(MALI_IOC_CORE_BASE, _MALI_UK_POST_NOTIFICATION, _mali_uk_post_notification_s *) #define MALI_IOC_MEM_GET_BIG_BLOCK _IOWR(MALI_IOC_MEMORY_BASE, _MALI_UK_GET_BIG_BLOCK, _mali_uk_get_big_block_s *) #define MALI_IOC_MEM_FREE_BIG_BLOCK _IOW (MALI_IOC_MEMORY_BASE, _MALI_UK_FREE_BIG_BLOCK, _mali_uk_free_big_block_s *) #define MALI_IOC_MEM_INIT _IOR (MALI_IOC_MEMORY_BASE, _MALI_UK_INIT_MEM, _mali_uk_init_mem_s *) diff --git a/drivers/gpu/arm/mali/linux/mali_kernel_linux.c b/drivers/gpu/arm/mali/linux/mali_kernel_linux.c index 3c38fadf59f4..70d9bfd5b839 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_kernel_linux.c +++ b/drivers/gpu/arm/mali/linux/mali_kernel_linux.c @@ -1,5 +1,5 @@ /** - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -101,6 +101,17 @@ struct file_operations mali_fops = int mali_driver_init(void) { int err; +#if USING_MALI_PMM +#if MALI_LICENSE_IS_GPL +#ifdef CONFIG_PM + err = _mali_dev_platform_register(); + if (err) + { + return err; + } +#endif +#endif +#endif err = mali_kernel_constructor(); if (_MALI_OSK_ERR_OK != err) { @@ -150,18 +161,6 @@ int initialize_kernel_device(void) { int err; dev_t dev = 0; - -#if USING_MALI_PMM -#if MALI_LICENSE_IS_GPL -#ifdef CONFIG_PM - err = _mali_dev_platform_register(); - if (err) - { - return err; - } -#endif -#endif -#endif if (0 == mali_major) { /* auto select a major */ @@ -356,6 +355,10 @@ static int mali_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, err = get_api_version_wrapper(session_data, (_mali_uk_get_api_version_s __user *)arg); break; + case MALI_IOC_POST_NOTIFICATION: + err = post_notification_wrapper(session_data, (_mali_uk_post_notification_s __user *)arg); + break; + #if MALI_TIMELINE_PROFILING_ENABLED case MALI_IOC_PROFILING_START: err = profiling_start_wrapper(session_data, (_mali_uk_profiling_start_s __user *)arg); diff --git a/drivers/gpu/arm/mali/linux/mali_kernel_linux.h b/drivers/gpu/arm/mali/linux/mali_kernel_linux.h index bec0e24774a2..785eaca48898 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_kernel_linux.h +++ b/drivers/gpu/arm/mali/linux/mali_kernel_linux.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_kernel_pm.c b/drivers/gpu/arm/mali/linux/mali_kernel_pm.c index 915f355af073..e6c78c2f6e76 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_kernel_pm.c +++ b/drivers/gpu/arm/mali/linux/mali_kernel_pm.c @@ -1,5 +1,5 @@ /** - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -40,6 +40,10 @@ #include "mali_device_pause_resume.h" #include "mali_linux_pm.h" +#if MALI_GPU_UTILIZATION +#include "mali_kernel_utilization.h" +#endif /* MALI_GPU_UTILIZATION */ + #if MALI_POWER_MGMT_TEST_SUITE #ifdef CONFIG_PM #include "mali_linux_pm_testsuite.h" @@ -73,6 +77,7 @@ static const char* const mali_states[_MALI_MAX_DEBUG_OPERATIONS] = { [_MALI_DVFS_PAUSE_EVENT] = "dvfs_pause", [_MALI_DVFS_RESUME_EVENT] = "dvfs_resume", }; + #endif /* CONFIG_PM_DEBUG */ #if MALI_PMM_RUNTIME_JOB_CONTROL_ON @@ -109,18 +114,15 @@ _mali_osk_lock_t *lock; #if MALI_POWER_MGMT_TEST_SUITE const char* const mali_pmm_recording_events[_MALI_DEVICE_MAX_PMM_EVENTS] = { - [_MALI_DEVICE_PMM_TIMEOUT_EVENT] = "timeout", - [_MALI_DEVICE_PMM_JOB_SCHEDULING_EVENTS] = "job_scheduling", + [_MALI_DEVICE_PMM_TIMEOUT_EVENT] = "timeout", + [_MALI_DEVICE_PMM_JOB_SCHEDULING_EVENTS] = "job_scheduling", [_MALI_DEVICE_PMM_REGISTERED_CORES] = "cores", }; unsigned int mali_timeout_event_recording_on = 0; unsigned int mali_job_scheduling_events_recording_on = 0; - -#if MALI_PMM_INTERNAL_TESTING unsigned int is_mali_pmu_present = 0; -#endif /* MALI_PMM_INTERNAL_TESTING */ #endif /* MALI_POWER_MGMT_TEST_SUITE */ /* Function prototypes */ @@ -148,6 +150,8 @@ static void mali_pm_late_resume(struct early_suspend *mali_dev); #endif /* CONFIG_HAS_EARLYSUSPEND */ /* OS suspend and resume callbacks */ +#if !MALI_PMM_RUNTIME_JOB_CONTROL_ON +#ifndef CONFIG_PM_RUNTIME #if (LINUX_VERSION_CODE < KERNEL_VERSION(LINUX_KERNEL_MAJOR_VERSION,LINUX_KERNEL_MINOR_VERSION,LINUX_KERNEL_DEVELOPMENT_VERSION)) static int mali_pm_os_suspend(struct platform_device *pdev, pm_message_t state); #else @@ -159,6 +163,8 @@ static int mali_pm_os_resume(struct platform_device *pdev); #else static int mali_pm_os_resume(struct device *dev); #endif +#endif /* CONFIG_PM_RUNTIME */ +#endif /* MALI_PMM_RUNTIME_JOB_CONTROL_ON */ /* OS Hibernation suspend callback */ static int mali_pm_os_suspend_on_hibernation(struct device *dev); @@ -178,8 +184,12 @@ static const struct dev_pm_ops mali_dev_pm_ops = { #endif /* MALI_PMM_RUNTIME_JOB_CONTROL_ON */ #endif /* CONFIG_PM_RUNTIME */ +#ifndef CONFIG_PM_RUNTIME +#if !MALI_PMM_RUNTIME_JOB_CONTROL_ON .suspend = mali_pm_os_suspend, .resume = mali_pm_os_resume, +#endif /* MALI_PMM_RUNTIME_JOB_CONTROL_ON */ +#endif /* CONFIG_PM_RUNTIME */ .freeze = mali_pm_os_suspend_on_hibernation, .poweroff = mali_pm_os_suspend_on_hibernation, .thaw = mali_pm_os_resume_on_hibernation, @@ -190,10 +200,10 @@ static const struct dev_pm_ops mali_dev_pm_ops = { #if (LINUX_VERSION_CODE < KERNEL_VERSION(LINUX_KERNEL_MAJOR_VERSION,LINUX_KERNEL_MINOR_VERSION,LINUX_KERNEL_DEVELOPMENT_VERSION)) struct pm_ext_ops mali_pm_operations = { .base = { - .freeze = mali_pm_os_suspend_on_hibernation, - .thaw = mali_pm_os_resume_on_hibernation, - .poweroff = mali_pm_os_resume_on_hibernation, - .restore = mali_pm_os_resume_on_hibernation, + .freeze = mali_pm_os_suspend_on_hibernation, + .thaw = mali_pm_os_resume_on_hibernation, + .poweroff = mali_pm_os_resume_on_hibernation, + .restore = mali_pm_os_resume_on_hibernation, }, }; #endif @@ -202,8 +212,12 @@ static struct platform_driver mali_plat_driver = { .probe = mali_pm_probe, .remove = mali_pm_remove, #if (LINUX_VERSION_CODE < KERNEL_VERSION(LINUX_KERNEL_MAJOR_VERSION,LINUX_KERNEL_MINOR_VERSION,LINUX_KERNEL_DEVELOPMENT_VERSION)) +#ifndef CONFIG_PM_RUNTIME +#if !MALI_PMM_RUNTIME_JOB_CONTROL_ON .suspend = mali_pm_os_suspend, .resume = mali_pm_os_resume, +#endif /* CONFIG_PM_RUNTIME */ +#endif /* MALI_PMM_RUNTIME_JOB_CONTROL_ON */ .pm = &mali_pm_operations, #endif @@ -242,7 +256,6 @@ static void _mali_release_pm(struct device *device) } #if MALI_POWER_MGMT_TEST_SUITE -#if MALI_PMM_INTERNAL_TESTING void mali_is_pmu_present(void) { int temp = 0; @@ -255,9 +268,7 @@ void mali_is_pmu_present(void) { is_mali_pmu_present = 1; } - } -#endif /* MALI_PMM_INTERNAL_TESTING */ #endif /* MALI_POWER_MGMT_TEST_SUITE */ #endif /* MALI_LICENSE_IS_GPL */ @@ -308,6 +319,9 @@ static int mali_pm_suspend(struct device *dev) { int err = 0; _mali_osk_lock_wait(lock, _MALI_OSK_LOCKMODE_RW); +#if MALI_GPU_UTILIZATION + mali_utilization_suspend(); +#endif /* MALI_GPU_UTILIZATION */ if ((mali_device_state == _MALI_DEVICE_SUSPEND) #ifdef CONFIG_HAS_EARLYSUSPEND || mali_device_state == (_MALI_DEVICE_EARLYSUSPEND_DISABLE_FB)) @@ -325,6 +339,8 @@ static int mali_pm_suspend(struct device *dev) return err; } +#ifndef CONFIG_PM_RUNTIME +#if !MALI_PMM_RUNTIME_JOB_CONTROL_ON #if (LINUX_VERSION_CODE < KERNEL_VERSION(LINUX_KERNEL_MAJOR_VERSION,LINUX_KERNEL_MINOR_VERSION,LINUX_KERNEL_DEVELOPMENT_VERSION)) static int mali_pm_os_suspend(struct platform_device *pdev, pm_message_t state) #else @@ -335,6 +351,9 @@ static int mali_pm_os_suspend(struct device *dev) err = mali_pm_suspend(NULL); return err; } +#endif /* MALI_PMM_RUNTIME_JOB_CONTROL_ON */ +#endif /* CONFIG_PM_RUNTIME */ + #ifdef CONFIG_PM_RUNTIME #if MALI_PMM_RUNTIME_JOB_CONTROL_ON #ifndef CONFIG_HAS_EARLYSUSPEND @@ -346,6 +365,10 @@ static int mali_pwr_suspend_notifier(struct notifier_block *nb,unsigned long eve case PM_SUSPEND_PREPARE: err = mali_pm_suspend(NULL); break; + + case PM_POST_SUSPEND: + err = mali_pm_resume(NULL); + break; default: break; } @@ -391,6 +414,8 @@ static int mali_pm_resume(struct device *dev) return err; } +#ifndef CONFIG_PM_RUNTIME +#if !MALI_PMM_RUNTIME_JOB_CONTROL_ON #if (LINUX_VERSION_CODE < KERNEL_VERSION(LINUX_KERNEL_MAJOR_VERSION,LINUX_KERNEL_MINOR_VERSION,LINUX_KERNEL_DEVELOPMENT_VERSION)) static int mali_pm_os_resume(struct platform_device *pdev) #else @@ -401,6 +426,8 @@ static int mali_pm_os_resume(struct device *dev) err = mali_pm_resume(NULL); return err; } +#endif /* MALI_PMM_RUNTIME_JOB_CONTROL_ON */ +#endif /* CONFIG_PM_RUNTIME */ static int mali_pm_os_suspend_on_hibernation(struct device *dev) { @@ -457,6 +484,9 @@ static void mali_pm_early_suspend(struct early_suspend *mali_dev) case EARLY_SUSPEND_LEVEL_DISABLE_FB: MALI_DEBUG_PRINT(4, ("PMMDEBUG: Suspend level Disable framebuffer\n" )); _mali_osk_lock_wait(lock, _MALI_OSK_LOCKMODE_RW); +#if MALI_GPU_UTILIZATION + mali_utilization_suspend(); +#endif /* MALI_GPU_UTILIZATION */ if ((mali_device_state == _MALI_DEVICE_SUSPEND) || (mali_device_state == _MALI_DEVICE_EARLYSUSPEND_DISABLE_FB)) { _mali_osk_lock_signal(lock, _MALI_OSK_LOCKMODE_RW); @@ -487,6 +517,7 @@ static void mali_pm_late_resume(struct early_suspend *mali_dev) if (mali_device_state == _MALI_DEVICE_EARLYSUSPEND_DISABLE_FB) { mali_device_resume(MALI_PMM_EVENT_OS_POWER_UP, &pm_thread); + mali_dvfs_device_state = _MALI_DEVICE_RESUME; mali_device_state = _MALI_DEVICE_RESUME; } _mali_osk_lock_signal(lock, _MALI_OSK_LOCKMODE_RW); @@ -533,9 +564,7 @@ static ssize_t store_file(struct device *dev, struct device_attribute *attr, con #if MALI_POWER_MGMT_TEST_SUITE int test_flag_dvfs = 0; pwr_mgmt_status_reg = 0; -#if MALI_PMM_INTERNAL_TESTING mali_is_pmu_present(); -#endif /* MALI_PMM_INTERNAL_TESTING */ #endif if (!strncmp(buf,mali_states[_MALI_DEVICE_SUSPEND],strlen(mali_states[_MALI_DEVICE_SUSPEND]))) @@ -546,21 +575,21 @@ static ssize_t store_file(struct device *dev, struct device_attribute *attr, con #if MALI_POWER_MGMT_TEST_SUITE else if (!strncmp(buf,mali_pmm_recording_events[_MALI_DEVICE_PMM_REGISTERED_CORES],strlen(mali_pmm_recording_events[_MALI_DEVICE_PMM_REGISTERED_CORES]))) - { - MALI_DEBUG_PRINT(4, ("PMMDEBUG: MALI Device get number of registerd cores\n" )); + { + MALI_DEBUG_PRINT(4, ("PMMDEBUG: MALI Device get number of registerd cores\n" )); pwr_mgmt_status_reg = _mali_pmm_cores_list(); return count; - } + } else if (!strncmp(buf,mali_pmm_recording_events[_MALI_DEVICE_PMM_TIMEOUT_EVENT],strlen(mali_pmm_recording_events[_MALI_DEVICE_PMM_TIMEOUT_EVENT]))) - { - MALI_DEBUG_PRINT(4, ("PMMDEBUG: MALI timeout event recording is enabled\n" )); + { + MALI_DEBUG_PRINT(4, ("PMMDEBUG: MALI timeout event recording is enabled\n" )); mali_timeout_event_recording_on = 1; - } + } else if (!strncmp(buf,mali_pmm_recording_events[_MALI_DEVICE_PMM_JOB_SCHEDULING_EVENTS],strlen(mali_pmm_recording_events[_MALI_DEVICE_PMM_JOB_SCHEDULING_EVENTS]))) - { - MALI_DEBUG_PRINT(4, ("PMMDEBUG: MALI Job scheduling events recording is enabled\n" )); - mali_job_scheduling_events_recording_on = 1; - } + { + MALI_DEBUG_PRINT(4, ("PMMDEBUG: MALI Job scheduling events recording is enabled\n" )); + mali_job_scheduling_events_recording_on = 1; + } #endif /* MALI_POWER_MGMT_TEST_SUITE */ else if (!strncmp(buf,mali_states[_MALI_DEVICE_RESUME],strlen(mali_states[_MALI_DEVICE_RESUME]))) @@ -615,14 +644,10 @@ static ssize_t store_file(struct device *dev, struct device_attribute *attr, con } else { -#if MALI_PMM_INTERNAL_TESTING if (1 == is_mali_pmu_present) { -#endif /* MALI_PMM_INTERNAL_TESTING */ pwr_mgmt_status_reg = pmu_get_power_up_down_info(); -#if MALI_PMM_INTERNAL_TESTING } -#endif /* MALI_PMM_INTERNAL_TESTING */ } #endif /* MALI_POWER_MGMT_TEST_SUITE */ return count; @@ -711,6 +736,7 @@ int _mali_dev_platform_register(void) void _mali_dev_platform_unregister(void) { _mali_osk_lock_term(lock); + #ifdef CONFIG_HAS_EARLYSUSPEND unregister_early_suspend(&mali_dev_early_suspend); #endif /* CONFIG_HAS_EARLYSUSPEND */ diff --git a/drivers/gpu/arm/mali/linux/mali_kernel_pm.h b/drivers/gpu/arm/mali/linux/mali_kernel_pm.h index db910102d764..6e879fea4472 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_kernel_pm.h +++ b/drivers/gpu/arm/mali/linux/mali_kernel_pm.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_linux_pm.h b/drivers/gpu/arm/mali/linux/mali_linux_pm.h index 5871de9dfbf3..614d5e1deeee 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_linux_pm.h +++ b/drivers/gpu/arm/mali/linux/mali_linux_pm.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -36,7 +36,6 @@ typedef enum _MALI_MAX_DEBUG_OPERATIONS, } _mali_device_dvfs_events; - extern _mali_device_power_states mali_device_state; extern _mali_device_power_states mali_dvfs_device_state; extern _mali_osk_lock_t *lock; diff --git a/drivers/gpu/arm/mali/linux/mali_linux_pm_testsuite.h b/drivers/gpu/arm/mali/linux/mali_linux_pm_testsuite.h index 0def7ab77dc8..d6a920827c90 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_linux_pm_testsuite.h +++ b/drivers/gpu/arm/mali/linux/mali_linux_pm_testsuite.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_atomics.c b/drivers/gpu/arm/mali/linux/mali_osk_atomics.c index 05831c542723..cc029c4a8f85 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_atomics.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_atomics.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.c b/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.c index 7297218b9b64..b60bf8258970 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.h b/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.h index 41cb462e8e53..f87739bb8f98 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.h +++ b/drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_irq.c b/drivers/gpu/arm/mali/linux/mali_osk_irq.c index 0343063f7b6b..73ab8182815e 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_irq.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_irq.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -14,10 +14,12 @@ */ #include <linux/slab.h> /* For memory allocation */ +#include <linux/workqueue.h> #include "mali_osk.h" #include "mali_kernel_core.h" #include "mali_kernel_common.h" +#include "mali_kernel_license.h" #include "linux/interrupt.h" typedef struct _mali_osk_irq_t_struct @@ -29,6 +31,10 @@ typedef struct _mali_osk_irq_t_struct struct work_struct work_queue_irq_handle; /* Workqueue for the bottom half of the IRQ-handling. This job is activated when this core gets an IRQ.*/ } mali_osk_irq_object_t; +#if MALI_LICENSE_IS_GPL +static struct workqueue_struct *pmm_wq=NULL; +#endif + typedef void (*workqueue_func_t)(void *); typedef irqreturn_t (*irq_handler_func_t)(int, void *, struct pt_regs *); static irqreturn_t irq_handler_upper_half (int port_name, void* dev_id ); /* , struct pt_regs *regs*/ @@ -103,9 +109,15 @@ _mali_osk_irq_t *_mali_osk_irq_init( u32 irqnum, _mali_osk_irq_uhandler_t uhandl MALI_DEBUG_PRINT(2, ("Probe for irq failed\n")); } } + + irq_object->irqnum = irqnum; + irq_object->uhandler = uhandler; + irq_object->bhandler = bhandler; + irq_object->data = data; /* Is this a real IRQ handler we need? */ - if (!mali_benchmark && irqnum != _MALI_OSK_IRQ_NUMBER_FAKE) { + if (!mali_benchmark && irqnum != _MALI_OSK_IRQ_NUMBER_FAKE && irqnum != _MALI_OSK_IRQ_NUMBER_PMM) + { if (-1 == irqnum) { MALI_DEBUG_PRINT(2, ("No IRQ for core '%s' found during probe\n", description)); @@ -121,10 +133,12 @@ _mali_osk_irq_t *_mali_osk_irq_init( u32 irqnum, _mali_osk_irq_uhandler_t uhandl } } - irq_object->irqnum = irqnum; - irq_object->uhandler = uhandler; - irq_object->bhandler = bhandler; - irq_object->data = data; +#if MALI_LICENSE_IS_GPL + if ( _MALI_OSK_IRQ_NUMBER_PMM == irqnum ) + { + pmm_wq = create_workqueue("mali-pmm-wq"); + } +#endif return irq_object; } @@ -132,12 +146,31 @@ _mali_osk_irq_t *_mali_osk_irq_init( u32 irqnum, _mali_osk_irq_uhandler_t uhandl void _mali_osk_irq_schedulework( _mali_osk_irq_t *irq ) { mali_osk_irq_object_t *irq_object = (mali_osk_irq_object_t *)irq; - schedule_work(&irq_object->work_queue_irq_handle); +#if MALI_LICENSE_IS_GPL + if ( irq_object->irqnum == _MALI_OSK_IRQ_NUMBER_PMM ) + { + queue_work(pmm_wq,&irq_object->work_queue_irq_handle); + } + else + { +#endif + schedule_work(&irq_object->work_queue_irq_handle); +#if MALI_LICENSE_IS_GPL + } +#endif } void _mali_osk_irq_term( _mali_osk_irq_t *irq ) { mali_osk_irq_object_t *irq_object = (mali_osk_irq_object_t *)irq; + +#if MALI_LICENSE_IS_GPL + if(irq_object->irqnum == _MALI_OSK_IRQ_NUMBER_PMM ) + { + flush_workqueue(pmm_wq); + destroy_workqueue(pmm_wq); + } +#endif if (!mali_benchmark) { free_irq(irq_object->irqnum, irq_object); diff --git a/drivers/gpu/arm/mali/linux/mali_osk_locks.c b/drivers/gpu/arm/mali/linux/mali_osk_locks.c index a896c62c023b..79010fcdc5aa 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_locks.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_locks.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -39,6 +39,7 @@ typedef enum { _MALI_OSK_INTERNAL_LOCKTYPE_SPIN, /* Mutex, implicitly non-interruptable, use spin_lock/spin_unlock */ + _MALI_OSK_INTERNAL_LOCKTYPE_SPIN_IRQ, /* Mutex, IRQ version of spinlock, use spin_lock_irqsave/spin_unlock_irqrestore */ _MALI_OSK_INTERNAL_LOCKTYPE_MUTEX, /* Interruptable, use up()/down_interruptable() */ _MALI_OSK_INTERNAL_LOCKTYPE_MUTEX_NONINT, /* Non-Interruptable, use up()/down() */ _MALI_OSK_INTERNAL_LOCKTYPE_MUTEX_NONINT_RW, /* Non-interruptable, Reader/Writer, use {up,down}{read,write}() */ @@ -56,6 +57,7 @@ typedef enum struct _mali_osk_lock_t_struct { _mali_osk_internal_locktype type; + unsigned long flags; union { spinlock_t spinlock; @@ -76,12 +78,13 @@ _mali_osk_lock_t *_mali_osk_lock_init( _mali_osk_lock_flags_t flags, u32 initial /* Validate parameters: */ /* Flags acceptable */ MALI_DEBUG_ASSERT( 0 == ( flags & ~(_MALI_OSK_LOCKFLAG_SPINLOCK + | _MALI_OSK_LOCKFLAG_SPINLOCK_IRQ | _MALI_OSK_LOCKFLAG_NONINTERRUPTABLE | _MALI_OSK_LOCKFLAG_READERWRITER | _MALI_OSK_LOCKFLAG_ORDERED | _MALI_OSK_LOCKFLAG_ONELOCK)) ); /* Spinlocks are always non-interruptable */ - MALI_DEBUG_ASSERT( ((flags & _MALI_OSK_LOCKFLAG_SPINLOCK) && (flags & _MALI_OSK_LOCKFLAG_NONINTERRUPTABLE)) + MALI_DEBUG_ASSERT( (((flags & _MALI_OSK_LOCKFLAG_SPINLOCK) || (flags & _MALI_OSK_LOCKFLAG_SPINLOCK_IRQ)) && (flags & _MALI_OSK_LOCKFLAG_NONINTERRUPTABLE)) || !(flags & _MALI_OSK_LOCKFLAG_SPINLOCK) ); /* Parameter initial SBZ - for future expansion */ MALI_DEBUG_ASSERT( 0 == initial ); @@ -102,6 +105,12 @@ _mali_osk_lock_t *_mali_osk_lock_init( _mali_osk_lock_flags_t flags, u32 initial lock->type = _MALI_OSK_INTERNAL_LOCKTYPE_SPIN; spin_lock_init( &lock->obj.spinlock ); } + else if ( (flags & _MALI_OSK_LOCKFLAG_SPINLOCK_IRQ ) ) + { + lock->type = _MALI_OSK_INTERNAL_LOCKTYPE_SPIN_IRQ; + lock->flags = 0; + spin_lock_init( &lock->obj.spinlock ); + } else if ( (flags & _MALI_OSK_LOCKFLAG_NONINTERRUPTABLE) && (flags & _MALI_OSK_LOCKFLAG_READERWRITER) ) { @@ -154,6 +163,9 @@ _mali_osk_errcode_t _mali_osk_lock_wait( _mali_osk_lock_t *lock, _mali_osk_lock_ case _MALI_OSK_INTERNAL_LOCKTYPE_SPIN: spin_lock(&lock->obj.spinlock); break; + case _MALI_OSK_INTERNAL_LOCKTYPE_SPIN_IRQ: + spin_lock_irqsave(&lock->obj.spinlock, lock->flags); + break; case _MALI_OSK_INTERNAL_LOCKTYPE_MUTEX: if ( down_interruptible(&lock->obj.sema) ) @@ -223,6 +235,9 @@ void _mali_osk_lock_signal( _mali_osk_lock_t *lock, _mali_osk_lock_mode_t mode ) case _MALI_OSK_INTERNAL_LOCKTYPE_SPIN: spin_unlock(&lock->obj.spinlock); break; + case _MALI_OSK_INTERNAL_LOCKTYPE_SPIN_IRQ: + spin_unlock_irqrestore(&lock->obj.spinlock, lock->flags); + break; case _MALI_OSK_INTERNAL_LOCKTYPE_MUTEX: /* FALLTHROUGH */ diff --git a/drivers/gpu/arm/mali/linux/mali_osk_low_level_mem.c b/drivers/gpu/arm/mali/linux/mali_osk_low_level_mem.c index a3c812f7cf9f..730ee814e38c 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_low_level_mem.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_low_level_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -177,7 +177,7 @@ mali_io_address _mali_osk_mem_allocioregion( u32 *phys, u32 size ) /* dma_alloc_* uses a limited region of address space. On most arch/marchs * 2 to 14 MiB is available. This should be enough for the page tables, which * currently is the only user of this function. */ - virt = dma_alloc_coherent(NULL, size, phys, GFP_KERNEL | GFP_DMA32 ); + virt = dma_alloc_coherent(NULL, size, phys, GFP_KERNEL | GFP_DMA ); MALI_DEBUG_PRINT(3, ("Page table virt: 0x%x = dma_alloc_coherent(size:%d, phys:0x%x, )\n", virt, size, phys)); diff --git a/drivers/gpu/arm/mali/linux/mali_osk_mali.c b/drivers/gpu/arm/mali/linux/mali_osk_mali.c index d7ef94df0dea..b765e315e145 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_mali.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_mali.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_math.c b/drivers/gpu/arm/mali/linux/mali_osk_math.c index 3e62e519cbac..2f7fc15847bf 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_math.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_math.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_memory.c b/drivers/gpu/arm/mali/linux/mali_osk_memory.c index b1a22abaa27a..bf6679f7bac6 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_memory.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_memory.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_misc.c b/drivers/gpu/arm/mali/linux/mali_osk_misc.c index 239d9ffae41a..3afd2da736cb 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_misc.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_misc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_notification.c b/drivers/gpu/arm/mali/linux/mali_osk_notification.c index 8017d3ca5875..6eb277f37243 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_notification.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_notification.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -83,14 +83,22 @@ _mali_osk_notification_t *_mali_osk_notification_create( u32 type, u32 size ) INIT_LIST_HEAD(¬ification->list); /* allocate memory for the buffer requested */ - notification->data.result_buffer = kmalloc( size, GFP_KERNEL ); - if ( NULL == notification->data.result_buffer ) + if (0 != size) { - /* failed to buffer, cleanup */ - MALI_DEBUG_PRINT(1, ("Failed to allocate memory for notification object buffer of size %d\n", size)); - kfree(notification); - return NULL; + notification->data.result_buffer = kmalloc( size, GFP_KERNEL ); + if ( NULL == notification->data.result_buffer ) + { + /* failed to buffer, cleanup */ + MALI_DEBUG_PRINT(1, ("Failed to allocate memory for notification object buffer of size %d\n", size)); + kfree(notification); + return NULL; + } + } + else + { + notification->data.result_buffer = 0; } + /* set up the non-allocating fields */ notification->data.notification_type = type; notification->data.result_buffer_size = size; @@ -141,9 +149,38 @@ void _mali_osk_notification_queue_send( _mali_osk_notification_queue_t *queue, _ wake_up(&queue->receive_queue); } -_mali_osk_errcode_t _mali_osk_notification_queue_receive( _mali_osk_notification_queue_t *queue, u32 timeout, _mali_osk_notification_t **result ) +static int _mali_notification_queue_is_empty( _mali_osk_notification_queue_t *queue ) { + int ret; + + down(&queue->mutex); + ret = list_empty(&queue->head); + up(&queue->mutex); + return ret; +} + +_mali_osk_errcode_t _mali_osk_notification_queue_dequeue( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result ) +{ + _mali_osk_errcode_t ret = _MALI_OSK_ERR_ITEM_NOT_FOUND; _mali_osk_notification_wrapper_t *wrapper_object; + + down(&queue->mutex); + + if (!list_empty(&queue->head)) + { + wrapper_object = list_entry(queue->head.next, _mali_osk_notification_wrapper_t, list); + *result = &(wrapper_object->data); + list_del_init(&wrapper_object->list); + ret = _MALI_OSK_ERR_OK; + } + + up(&queue->mutex); + + return ret; +} + +_mali_osk_errcode_t _mali_osk_notification_queue_receive( _mali_osk_notification_queue_t *queue, _mali_osk_notification_t **result ) +{ /* check input */ MALI_DEBUG_ASSERT_POINTER( queue ); MALI_DEBUG_ASSERT_POINTER( result ); @@ -151,54 +188,13 @@ _mali_osk_errcode_t _mali_osk_notification_queue_receive( _mali_osk_notification /* default result */ *result = NULL; - /* lock queue */ - if (down_interruptible(&queue->mutex)) return _MALI_OSK_ERR_RESTARTSYSCALL; /* handle the signal, then retry */ - - /* check for a pending notification */ - while (0 != list_empty(&queue->head)) + while (_MALI_OSK_ERR_OK != _mali_osk_notification_queue_dequeue(queue, result)) { - /* no notification ready, we have to wait for one */ - int schedule_result; - /* define a wait entry */ - DEFINE_WAIT(wait); - - if( timeout == 0 ) + if (wait_event_interruptible(queue->receive_queue, !_mali_notification_queue_is_empty(queue))) { - /* Actually, don't wait for any time when nothing is in the queue */ - up(&queue->mutex); - return _MALI_OSK_ERR_TIMEOUT; + return _MALI_OSK_ERR_RESTARTSYSCALL; } - - /* prepare for exclusive wait, tag as interruptible (accept signals) */ - prepare_to_wait_exclusive(&queue->receive_queue, &wait, TASK_INTERRUPTIBLE); - - /* release the lock before waiting */ - up(&queue->mutex); - - /* if the check fails again schedule (sleep) */ - schedule_result = schedule_timeout(msecs_to_jiffies(timeout)); - - /* we're running again, wait finished (or never started) */ - finish_wait(&queue->receive_queue, &wait); - - /* check why we got scheduled */ - if (0 == schedule_result) return _MALI_OSK_ERR_TIMEOUT; /* timeout, ok, NULL will be returned */ - if (signal_pending(current)) return _MALI_OSK_ERR_RESTARTSYSCALL; /* handle the signal, then retry */ - - /* we were woken because of a new entry */ - /* lock the queue and check (with normal signal handling logic) */ - if (down_interruptible(&queue->mutex)) return _MALI_OSK_ERR_RESTARTSYSCALL; /* handle the signal, then retry */ } - /* - The while loop terminates when the list is non-empty and we hold the lock - Pop the head and release the lock - */ - wrapper_object = list_entry(queue->head.next, _mali_osk_notification_wrapper_t, list); - *result = &(wrapper_object->data); - list_del_init(&wrapper_object->list); - - up(&queue->mutex); - return _MALI_OSK_ERR_OK; /* all ok */ } diff --git a/drivers/gpu/arm/mali/linux/mali_osk_pm.c b/drivers/gpu/arm/mali/linux/mali_osk_pm.c index 60fee8330988..f13631672921 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_pm.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_pm.c @@ -1,5 +1,5 @@ /** - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_specific.h b/drivers/gpu/arm/mali/linux/mali_osk_specific.h index 6aacf17d3878..54acfdd138c4 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_specific.h +++ b/drivers/gpu/arm/mali/linux/mali_osk_specific.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_time.c b/drivers/gpu/arm/mali/linux/mali_osk_time.c index da9b8656b703..aa7962380e67 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_time.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_time.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_osk_timers.c b/drivers/gpu/arm/mali/linux/mali_osk_timers.c index 51f7028b1ee9..1cffce37461c 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_osk_timers.c +++ b/drivers/gpu/arm/mali/linux/mali_osk_timers.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_ukk_core.c b/drivers/gpu/arm/mali/linux/mali_ukk_core.c index 819977f87406..a10d1ba8a5ed 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_ukk_core.c +++ b/drivers/gpu/arm/mali/linux/mali_ukk_core.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -101,21 +101,42 @@ int wait_for_notification_wrapper(struct mali_session_data *session_data, _mali_ MALI_CHECK_NON_NULL(uargs, -EINVAL); - if (0 != get_user(kargs.code.timeout, &uargs->code.timeout)) return -EFAULT; - kargs.ctx = session_data; err = _mali_ukk_wait_for_notification(&kargs); if (_MALI_OSK_ERR_OK != err) return map_errcode(err); - if( !(_MALI_NOTIFICATION_CORE_TIMEOUT == kargs.code.type || _MALI_NOTIFICATION_CORE_SHUTDOWN_IN_PROGRESS == kargs.code.type ) ) + if( !(_MALI_NOTIFICATION_CORE_TIMEOUT == kargs.type || _MALI_NOTIFICATION_CORE_SHUTDOWN_IN_PROGRESS == kargs.type ) ) { kargs.ctx = NULL; /* prevent kernel address to be returned to user space */ if (0 != copy_to_user(uargs, &kargs, sizeof(_mali_uk_wait_for_notification_s))) return -EFAULT; } else { - if (0 != put_user(kargs.code.type, &uargs->code.type)) return -EFAULT; + if (0 != put_user(kargs.type, &uargs->type)) return -EFAULT; } return 0; } + +int post_notification_wrapper(struct mali_session_data *session_data, _mali_uk_post_notification_s __user *uargs) +{ + _mali_uk_post_notification_s kargs; + _mali_osk_errcode_t err; + + MALI_CHECK_NON_NULL(uargs, -EINVAL); + + kargs.ctx = session_data; + + if (0 != get_user(kargs.type, &uargs->type)) + { + return -EFAULT; + } + + err = _mali_ukk_post_notification(&kargs); + if (_MALI_OSK_ERR_OK != err) + { + return map_errcode(err); + } + + return 0; +} diff --git a/drivers/gpu/arm/mali/linux/mali_ukk_mem.c b/drivers/gpu/arm/mali/linux/mali_ukk_mem.c index 05214b703d32..3f67a1e33283 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_ukk_mem.c +++ b/drivers/gpu/arm/mali/linux/mali_ukk_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_ukk_pp.c b/drivers/gpu/arm/mali/linux/mali_ukk_pp.c index 31e2a6ac065e..f77a177d8651 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_ukk_pp.c +++ b/drivers/gpu/arm/mali/linux/mali_ukk_pp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_ukk_profiling.c b/drivers/gpu/arm/mali/linux/mali_ukk_profiling.c index e2973bb5e342..636bd03580e0 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_ukk_profiling.c +++ b/drivers/gpu/arm/mali/linux/mali_ukk_profiling.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/linux/mali_ukk_wrappers.h b/drivers/gpu/arm/mali/linux/mali_ukk_wrappers.h index bc0bd503a572..0bc6b87e69c5 100644..100755 --- a/drivers/gpu/arm/mali/linux/mali_ukk_wrappers.h +++ b/drivers/gpu/arm/mali/linux/mali_ukk_wrappers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -28,6 +28,7 @@ int get_system_info_size_wrapper(struct mali_session_data *session_data, _mali_u int get_system_info_wrapper(struct mali_session_data *session_data, _mali_uk_get_system_info_s __user *uargs); int wait_for_notification_wrapper(struct mali_session_data *session_data, _mali_uk_wait_for_notification_s __user *uargs); int get_api_version_wrapper(struct mali_session_data *session_data, _mali_uk_get_api_version_s __user *uargs); +int post_notification_wrapper(struct mali_session_data *session_data, _mali_uk_post_notification_s __user *uargs); int mem_init_wrapper(struct mali_session_data *session_data, _mali_uk_init_mem_s __user *uargs); int mem_term_wrapper(struct mali_session_data *session_data, _mali_uk_term_mem_s __user *uargs); int mem_map_ext_wrapper(struct mali_session_data *session_data, _mali_uk_map_external_mem_s __user * argument); diff --git a/drivers/gpu/arm/mali/platform/default/mali_platform.c b/drivers/gpu/arm/mali/platform/default/mali_platform.c index fc5b1738dfb4..36301a93a2cd 100644..100755 --- a/drivers/gpu/arm/mali/platform/default/mali_platform.c +++ b/drivers/gpu/arm/mali/platform/default/mali_platform.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/platform/mali-runtimepm/mali_platform.c b/drivers/gpu/arm/mali/platform/mali-runtimepm/mali_platform.c index cd7ae0d64b04..b8c47094177b 100644..100755 --- a/drivers/gpu/arm/mali/platform/mali-runtimepm/mali_platform.c +++ b/drivers/gpu/arm/mali/platform/mali-runtimepm/mali_platform.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/platform/mali400-pmu/mali_platform.c b/drivers/gpu/arm/mali/platform/mali400-pmu/mali_platform.c index f7319e1bcd8c..cf95b8ae09e6 100644..100755 --- a/drivers/gpu/arm/mali/platform/mali400-pmu/mali_platform.c +++ b/drivers/gpu/arm/mali/platform/mali400-pmu/mali_platform.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/platform/mali_platform.h b/drivers/gpu/arm/mali/platform/mali_platform.h index 42d65bfa0193..968125621273 100644..100755 --- a/drivers/gpu/arm/mali/platform/mali_platform.h +++ b/drivers/gpu/arm/mali/platform/mali_platform.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/regs/mali_200_regs.h b/drivers/gpu/arm/mali/regs/mali_200_regs.h index e9da7ab81101..6b30802bb2db 100644..100755 --- a/drivers/gpu/arm/mali/regs/mali_200_regs.h +++ b/drivers/gpu/arm/mali/regs/mali_200_regs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/regs/mali_gp_regs.h b/drivers/gpu/arm/mali/regs/mali_gp_regs.h index 14719a3efe92..11eb55c424e6 100644..100755 --- a/drivers/gpu/arm/mali/regs/mali_gp_regs.h +++ b/drivers/gpu/arm/mali/regs/mali_gp_regs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.c b/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.c index cddfa581e47b..a6b1d76d567f 100644..100755 --- a/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.c +++ b/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.h b/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.h index 63b3e911fb3d..96b709bc1665 100644..100755 --- a/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.h +++ b/drivers/gpu/arm/mali/timestamp-arm11-cc/mali_timestamp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.c b/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.c index cddfa581e47b..a6b1d76d567f 100644..100755 --- a/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.c +++ b/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.h b/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.h index ccee0cdc4954..11031d675cad 100644..100755 --- a/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.h +++ b/drivers/gpu/arm/mali/timestamp-default/mali_timestamp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/Makefile b/drivers/gpu/arm/ump/Makefile index b1575cc35600..7e2501d80877 100755 --- a/drivers/gpu/arm/ump/Makefile +++ b/drivers/gpu/arm/ump/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2010 ARM Limited. All rights reserved. +# Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/arch-pb-virtex5/config.h b/drivers/gpu/arm/ump/arch-pb-virtex5/config.h deleted file mode 100644 index 560eda9a419a..000000000000 --- a/drivers/gpu/arm/ump/arch-pb-virtex5/config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 2010 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 licence. - * - * A copy of the licence is included with the program, and can also be obtained from Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __ARCH_CONFIG_H__ -#define __ARCH_CONFIG_H__ - -#define ARCH_UMP_BACKEND_DEFAULT 0 -#define ARCH_UMP_MEMORY_ADDRESS_DEFAULT 0xC8000000 -#define ARCH_UMP_MEMORY_SIZE_DEFAULT 32UL * 1024UL * 1024UL - -#endif /* __ARCH_CONFIG_H__ */ diff --git a/drivers/gpu/arm/ump/common/ump_kernel_api.c b/drivers/gpu/arm/ump/common/ump_kernel_api.c index 5f4a421234c9..719370c3de71 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_api.c +++ b/drivers/gpu/arm/ump/common/ump_kernel_api.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_kernel_common.c b/drivers/gpu/arm/ump/common/ump_kernel_common.c index 2dce2c4598b9..5575a5e3b1b5 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_common.c +++ b/drivers/gpu/arm/ump/common/ump_kernel_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_kernel_common.h b/drivers/gpu/arm/ump/common/ump_kernel_common.h index c8b5541ad75f..0c55b14bc94a 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_common.h +++ b/drivers/gpu/arm/ump/common/ump_kernel_common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.c b/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.c index 5174839a2391..2531f8021279 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.c +++ b/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.h b/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.h index 319cc3b18d8c..92bbe54bd35f 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.h +++ b/drivers/gpu/arm/ump/common/ump_kernel_descriptor_mapping.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_kernel_memory_backend.h b/drivers/gpu/arm/ump/common/ump_kernel_memory_backend.h index 963bc5b4e71f..02a64707036e 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_memory_backend.h +++ b/drivers/gpu/arm/ump/common/ump_kernel_memory_backend.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_kernel_ref_drv.c b/drivers/gpu/arm/ump/common/ump_kernel_ref_drv.c index bd158086e309..5a997e222a71 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_ref_drv.c +++ b/drivers/gpu/arm/ump/common/ump_kernel_ref_drv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. @@ -178,6 +178,8 @@ _mali_osk_errcode_t _ump_ukk_allocate( _ump_uk_allocate_s *user_interaction ) new_allocation->ctx = device.backend->ctx; new_allocation->release_func = device.backend->release; + _mali_osk_lock_signal(device.secure_id_map_lock, _MALI_OSK_LOCKMODE_RW); + /* Initialize the session_memory_element, and add it to the session object */ session_memory_element->mem = new_allocation; _mali_osk_lock_wait(session_data->lock, _MALI_OSK_LOCKMODE_RW); @@ -188,7 +190,5 @@ _mali_osk_errcode_t _ump_ukk_allocate( _ump_uk_allocate_s *user_interaction ) user_interaction->size = new_allocation->size_bytes; DBG_MSG(3, ("UMP memory allocated. ID: %u, size: %lu\n", new_allocation->secure_id, new_allocation->size_bytes)); - _mali_osk_lock_signal(device.secure_id_map_lock, _MALI_OSK_LOCKMODE_RW); - return _MALI_OSK_ERR_OK; } diff --git a/drivers/gpu/arm/ump/common/ump_kernel_types.h b/drivers/gpu/arm/ump/common/ump_kernel_types.h index ca03decf7b66..dc79b6f289be 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_kernel_types.h +++ b/drivers/gpu/arm/ump/common/ump_kernel_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_osk.h b/drivers/gpu/arm/ump/common/ump_osk.h index 2f3b725a7304..73284f02b47c 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_osk.h +++ b/drivers/gpu/arm/ump/common/ump_osk.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_uk_types.h b/drivers/gpu/arm/ump/common/ump_uk_types.h index 9e61b26a64fc..b08335f61f11 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_uk_types.h +++ b/drivers/gpu/arm/ump/common/ump_uk_types.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/common/ump_ukk.h b/drivers/gpu/arm/ump/common/ump_ukk.h index b649f7e5642d..a3317fc7b21e 100644..100755 --- a/drivers/gpu/arm/ump/common/ump_ukk.h +++ b/drivers/gpu/arm/ump/common/ump_ukk.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_ioctl.h b/drivers/gpu/arm/ump/linux/ump_ioctl.h index 110ae17a56dc..b11429816ab5 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_ioctl.h +++ b/drivers/gpu/arm/ump/linux/ump_ioctl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_linux.c b/drivers/gpu/arm/ump/linux/ump_kernel_linux.c index f6043aec8ad4..c9ace611b08d 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_linux.c +++ b/drivers/gpu/arm/ump/linux/ump_kernel_linux.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_linux.h b/drivers/gpu/arm/ump/linux/ump_kernel_linux.h index b93c814ee61f..464c035974b1 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_linux.h +++ b/drivers/gpu/arm/ump/linux/ump_kernel_linux.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.c b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.c index 05e05c6136d5..e53ed4449771 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.c +++ b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.h b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.h index fa4bdccfe32c..58ebe15e5a2b 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.h +++ b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_dedicated.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.c b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.c index b6675a3c554a..09f303f78f9d 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.c +++ b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.h b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.h index f924705cf742..d6083477d723 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.h +++ b/drivers/gpu/arm/ump/linux/ump_kernel_memory_backend_os.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_memory_backend.c b/drivers/gpu/arm/ump/linux/ump_memory_backend.c index 24c71ecbc96f..1fa784835486 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_memory_backend.c +++ b/drivers/gpu/arm/ump/linux/ump_memory_backend.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_osk_atomics.c b/drivers/gpu/arm/ump/linux/ump_osk_atomics.c index ef1902e5391b..b3300ab691ae 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_osk_atomics.c +++ b/drivers/gpu/arm/ump/linux/ump_osk_atomics.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_osk_low_level_mem.c b/drivers/gpu/arm/ump/linux/ump_osk_low_level_mem.c index 6ffca396f861..7a1c5e978864 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_osk_low_level_mem.c +++ b/drivers/gpu/arm/ump/linux/ump_osk_low_level_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_osk_misc.c b/drivers/gpu/arm/ump/linux/ump_osk_misc.c index 12066eb76307..78569c4457bd 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_osk_misc.c +++ b/drivers/gpu/arm/ump/linux/ump_osk_misc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.c b/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.c index e701f1bc9eed..155635026aa4 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.c +++ b/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.h b/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.h index 9ebc35533970..b2bef1152c3b 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.h +++ b/drivers/gpu/arm/ump/linux/ump_ukk_ref_wrappers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.c b/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.c index 8b73ca86cb43..d14b631246c7 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.c +++ b/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. diff --git a/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.h b/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.h index 4892c31327e4..31afe2dca566 100644..100755 --- a/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.h +++ b/drivers/gpu/arm/ump/linux/ump_ukk_wrappers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 ARM Limited. All rights reserved. + * Copyright (C) 2010-2011 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 licence. |