projects
/
platform
/
core
/
uifw
/
libtdm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add sw_timer param
[platform/core/uifw/libtdm.git]
/
tools
/
tdm_test_client.c
diff --git
a/tools/tdm_test_client.c
b/tools/tdm_test_client.c
index
ed88d8a
..
fcedae5
100644
(file)
--- a/
tools/tdm_test_client.c
+++ b/
tools/tdm_test_client.c
@@
-32,17
+32,18
@@
DEALINGS IN THE SOFTWARE.
#include <poll.h>
#include <errno.h>
#include <time.h>
#include <poll.h>
#include <errno.h>
#include <time.h>
+#include <stdint.h>
#include <tdm_client.h>
#include <tdm_helper.h>
static int
#include <tdm_client.h>
#include <tdm_helper.h>
static int
-get_time_in_mi
lli
s(void)
+get_time_in_mi
cro
s(void)
{
struct timespec tp;
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
{
struct timespec tp;
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
- return (int)(tp.tv_sec * 1000
) + (tp.tv_nsec / 1000
000L);
+ return (int)(tp.tv_sec * 1000
000) + (tp.tv_nsec / 1
000L);
return 0;
}
return 0;
}
@@
-51,12
+52,19
@@
static void
_client_vblank_handler(unsigned int sequence, unsigned int tv_sec,
unsigned int tv_usec, void *user_data)
{
_client_vblank_handler(unsigned int sequence, unsigned int tv_sec,
unsigned int tv_usec, void *user_data)
{
- int temp1, temp2;
+ int client, vblank;
+ static int prev = 0;
-
temp1 = (int)user_data
;
-
temp2 = get_time_in_millis()
;
+
client = get_time_in_micros()
;
+
vblank = tv_sec * 1000000 + tv_usec
;
- printf("%d ms\n", temp2 - temp1);
+ if (vblank - prev > 16966 || vblank - prev < 16366) /* +0.3 ~ -0.3 ms */
+ printf("vblank : %d us\n", vblank - prev);
+
+ if (client - vblank > 2000) /* 2ms */
+ printf("kernel -> tdm-client: %d us\n", client - vblank);
+
+ prev = vblank;
}
}
@@
-87,9
+95,8
@@
main(int argc, char *argv[])
while (1) {
int ret;
while (1) {
int ret;
- error = tdm_client_wait_vblank(client, "unknown-0", 1, 0,
- _client_vblank_handler,
- (void*)get_time_in_millis());
+ error = tdm_client_wait_vblank(client, "unknown-0", 1, 1, 0,
+ _client_vblank_handler, NULL);
if (error != TDM_CLIENT_ERROR_NONE) {
printf("tdm_client_wait_vblank failed\n");
goto done;
if (error != TDM_CLIENT_ERROR_NONE) {
printf("tdm_client_wait_vblank failed\n");
goto done;