aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/samsung/mali/common/mali_l2_cache.c
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.org>2013-02-23 01:33:12 +0000
committercodeworkx <codeworkx@cyanogenmod.org>2013-02-23 01:33:12 +0000
commit3536d5c6bfd05e861b3b430d4de36fdf31afa5e1 (patch)
tree996624e7f343759ffe3a98a43ac0f6e03355399e /drivers/media/video/samsung/mali/common/mali_l2_cache.c
parentc715892450ed51c52a1b3b885090ad470f11643a (diff)
downloadkernel_samsung_smdk4412-3536d5c6bfd05e861b3b430d4de36fdf31afa5e1.zip
kernel_samsung_smdk4412-3536d5c6bfd05e861b3b430d4de36fdf31afa5e1.tar.gz
kernel_samsung_smdk4412-3536d5c6bfd05e861b3b430d4de36fdf31afa5e1.tar.bz2
mali: update to r3p1-01rel1
Change-Id: I38a5488af2f2a64e2851826cdbc475ef5727c965
Diffstat (limited to 'drivers/media/video/samsung/mali/common/mali_l2_cache.c')
-rw-r--r--drivers/media/video/samsung/mali/common/mali_l2_cache.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/media/video/samsung/mali/common/mali_l2_cache.c b/drivers/media/video/samsung/mali/common/mali_l2_cache.c
index aa5cc54..b7267f1 100644
--- a/drivers/media/video/samsung/mali/common/mali_l2_cache.c
+++ b/drivers/media/video/samsung/mali/common/mali_l2_cache.c
@@ -194,44 +194,60 @@ u32 mali_l2_cache_get_id(struct mali_l2_cache_core *cache)
mali_bool mali_l2_cache_core_set_counter_src0(struct mali_l2_cache_core *cache, u32 counter)
{
u32 value = 0; /* disabled src */
+ mali_bool core_is_on;
MALI_DEBUG_ASSERT_POINTER(cache);
- MALI_DEBUG_ASSERT(counter < (1 << 7)); /* the possible values are 0-127 */
+
+ core_is_on = mali_l2_cache_lock_power_state(cache);
_mali_osk_lock_wait(cache->counter_lock, _MALI_OSK_LOCKMODE_RW);
cache->counter_src0 = counter;
- if (counter != MALI_HW_CORE_NO_COUNTER)
+ if (MALI_HW_CORE_NO_COUNTER != counter)
{
value = counter;
}
- mali_hw_core_register_write(&cache->hw_core, MALI400_L2_CACHE_REGISTER_PERFCNT_SRC0, value);
+ if (MALI_TRUE == core_is_on)
+ {
+ mali_hw_core_register_write(&cache->hw_core, MALI400_L2_CACHE_REGISTER_PERFCNT_SRC0, value);
+ }
_mali_osk_lock_signal(cache->counter_lock, _MALI_OSK_LOCKMODE_RW);
+
+ mali_l2_cache_unlock_power_state(cache);
+
return MALI_TRUE;
}
mali_bool mali_l2_cache_core_set_counter_src1(struct mali_l2_cache_core *cache, u32 counter)
{
u32 value = 0; /* disabled src */
+ mali_bool core_is_on;
MALI_DEBUG_ASSERT_POINTER(cache);
- MALI_DEBUG_ASSERT(counter < (1 << 7)); /* the possible values are 0-127 */
+
+ core_is_on = mali_l2_cache_lock_power_state(cache);
_mali_osk_lock_wait(cache->counter_lock, _MALI_OSK_LOCKMODE_RW);
cache->counter_src1 = counter;
- if (counter != MALI_HW_CORE_NO_COUNTER)
+ if (MALI_HW_CORE_NO_COUNTER != counter)
{
value = counter;
}
- mali_hw_core_register_write(&cache->hw_core, MALI400_L2_CACHE_REGISTER_PERFCNT_SRC1, value);
+ if (MALI_TRUE == core_is_on)
+ {
+ mali_hw_core_register_write(&cache->hw_core, MALI400_L2_CACHE_REGISTER_PERFCNT_SRC1, value);
+ }
_mali_osk_lock_signal(cache->counter_lock, _MALI_OSK_LOCKMODE_RW);
+
+ mali_l2_cache_unlock_power_state(cache);
+
return MALI_TRUE;
}