summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2012-04-28 06:44:30 +0800
committerXianzhong <b07117@freescale.com>2012-04-29 00:47:58 +0800
commit5f5288b61bc0596dbe1436a65f0bdf52b8d855cb (patch)
tree41a54e7957d9417c03bc0591722f2bdf0ae99433 /drivers
parent15294851a2b934b5babb8a9c678f4afd357b7606 (diff)
ENGR00181165 gpu-viv: use high precision method for delay
Reduce gpu kernel delay to improve driver performance Signed-off-by: Xianzhong <b07117@freescale.com> Acked-by: Lily Zhang
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h9
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c12
2 files changed, 18 insertions, 3 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
index c96ece999b1a..73b666a37570 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
@@ -769,4 +769,13 @@
# define gcdALPHA_KILL_IN_SHADER 1
#endif
+/* gcdHIGH_PRECISION_DELAY_ENABLE
+ *
+ * Enable high precision schedule delay with 1ms unit. otherwise schedule delay up to 10ms.
+ * Browser app performance will have obvious drop without this enablement
+ */
+#ifndef gcdHIGH_PRECISION_DELAY_ENABLE
+# define gcdHIGH_PRECISION_DELAY_ENABLE 1
+#endif
+
#endif /* __gc_hal_options_h_ */
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index 510b0300e3c4..cf0ccc2d4e2b 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -3761,13 +3761,18 @@ gckOS_Delay(
IN gctUINT32 Delay
)
{
- struct timeval now;
- unsigned long jiffies;
-
gcmkHEADER_ARG("Os=0x%X Delay=%u", Os, Delay);
if (Delay > 0)
{
+#if gcdHIGH_PRECISION_DELAY_ENABLE
+ ktime_t wait = ns_to_ktime(Delay * 1000 * 1000);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_hrtimeout(&wait, HRTIMER_MODE_REL);
+#else
+ struct timeval now;
+ unsigned long jiffies;
+
/* Convert milliseconds into seconds and microseconds. */
now.tv_sec = Delay / 1000;
now.tv_usec = (Delay % 1000) * 1000;
@@ -3777,6 +3782,7 @@ gckOS_Delay(
/* Schedule timeout. */
schedule_timeout_interruptible(jiffies);
+#endif
}
/* Success. */