aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/arm/mali/linux
diff options
context:
space:
mode:
authorChunsang Jeong <chunsang.jeong@linaro.org>2011-09-26 11:19:41 -0600
committerTushar Behera <tushar.behera@linaro.org>2012-06-20 11:14:55 +0530
commit8a3a9046bb1d8faaeee8dff7303337d7877b8b5f (patch)
treea7e0d0304655faf1619fcf0c53db1bd29368de9a /drivers/gpu/arm/mali/linux
parent29c1948dcb12f044ba59833bf46d21fa279bbcb5 (diff)
Updated Mali and UMP driver with r2p1-05rel1 released at 1st Apr from ARM.
Signed-off-by: Chunsang Jeong <chunsang.jeong@linaro.org>
Diffstat (limited to 'drivers/gpu/arm/mali/linux')
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_device_pause_resume.c16
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_device_pause_resume.h2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_kernel_ioctl.h3
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_kernel_linux.c29
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_kernel_linux.h2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_kernel_pm.c84
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_kernel_pm.h2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_linux_pm.h3
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_linux_pm_testsuite.h2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_atomics.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_indir_mmap.h2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_irq.c47
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_locks.c19
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_low_level_mem.c4
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_mali.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_math.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_memory.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_misc.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_notification.c100
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_pm.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_specific.h2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_time.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_osk_timers.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_ukk_core.c31
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_ukk_mem.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_ukk_pp.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_ukk_profiling.c2
-rwxr-xr-x[-rw-r--r--]drivers/gpu/arm/mali/linux/mali_ukk_wrappers.h3
29 files changed, 240 insertions, 135 deletions
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(&notification->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);