[Title] modified usb FRAME_TIMER_FREQ
authorgiwoong.kim <giwoong.kim@samsung.com>
Fri, 6 Apr 2012 16:35:35 +0000 (01:35 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Fri, 6 Apr 2012 16:35:35 +0000 (01:35 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

hw/usb-uhci.c
tizen/src/skin/maruskin_operation.c

index 7c02042..660c733 100644 (file)
 #include "iov.h"
 #include "dma.h"
 
+#ifdef CONFIG_MARU
+#include "kvm.h"
+#include "hax.h"
+#endif
+
 //#define DEBUG
 //#define DEBUG_DUMP_DATA
 
@@ -429,8 +434,18 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
     case 0x00:
         if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
             /* start frame processing */
+#ifdef CONFIG_MARU
+            if (kvm_enabled() || hax_enabled()) { //kvm or haxm machine
+                s->expire_time = qemu_get_clock_ns(vm_clock) +
+                    (get_ticks_per_sec() / FRAME_TIMER_FREQ);
+            } else {
+                s->expire_time = qemu_get_clock_ns(vm_clock) +
+                    (get_ticks_per_sec() / (FRAME_TIMER_FREQ / 2));
+            }
+#else
             s->expire_time = qemu_get_clock_ns(vm_clock) +
                 (get_ticks_per_sec() / FRAME_TIMER_FREQ);
+#endif
             qemu_mod_timer(s->frame_timer, qemu_get_clock_ns(vm_clock));
             s->status &= ~UHCI_STS_HCHALTED;
         } else if (!(val & UHCI_CMD_RS)) {
@@ -1063,7 +1078,15 @@ static void uhci_frame_timer(void *opaque)
     UHCIState *s = opaque;
 
     /* prepare the timer for the next frame */
+#ifdef CONFIG_MARU
+    if (kvm_enabled() || hax_enabled()) { //kvm or haxm machine
+        s->expire_time += (get_ticks_per_sec() / FRAME_TIMER_FREQ);
+    } else {
+        s->expire_time += (get_ticks_per_sec() / (FRAME_TIMER_FREQ / 2));
+    }
+#else
     s->expire_time += (get_ticks_per_sec() / FRAME_TIMER_FREQ);
+#endif
 
     if (!(s->cmd & UHCI_CMD_RS)) {
         /* Full stop */
index 8c9f97e..6a346d6 100644 (file)
@@ -81,11 +81,13 @@ void do_mouse_event( int event_type, int x, int y, int z )
         ERR( "undefined mouse event type:%d\n", event_type );
     }
 
+#if 0
 #ifdef _WIN32
     Sleep(1);
 #else
     usleep(1000);
 #endif
+#endif
 }
 
 void do_key_event( int event_type, int keycode, int key_location )