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
correct email address
[platform/core/uifw/libtdm.git]
/
tools
/
tdm_test_server.c
diff --git
a/tools/tdm_test_server.c
b/tools/tdm_test_server.c
index
ff7b542
..
535462f
100644
(file)
--- a/
tools/tdm_test_server.c
+++ b/
tools/tdm_test_server.c
@@
-9,7
+9,7
@@
* Taeheon Kim <th908.kim@samsung.com>,
* YoungJun Cho <yj44.cho@samsung.com>,
* SooChan Lim <sc1.lim@samsung.com>,
* Taeheon Kim <th908.kim@samsung.com>,
* YoungJun Cho <yj44.cho@samsung.com>,
* SooChan Lim <sc1.lim@samsung.com>,
- * Boram Park <
sc1.lim
@samsung.com>
+ * Boram Park <
boram1288.park
@samsung.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
@@
-45,11
+45,11
@@
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
-#include
<tdm.h>
-#include
<tdm_log.h>
-#include
<tdm_list.h>
-#include
<tdm_helper.h>
-#include
<tdm_backend.h>
+#include
"tdm.h"
+#include
"tdm_log.h"
+#include
"tdm_list.h"
+#include
"tdm_helper.h"
+#include
"tdm_backend.h"
#include "tdm_macro.h"
#include "tdm_private.h"
#include "tdm_macro.h"
#include "tdm_private.h"
@@
-183,7
+183,6
@@
usage(char *app_name)
printf("\t%s\n", usages[t].desc);
}
printf("\n");
printf("\t%s\n", usages[t].desc);
}
printf("\n");
- exit(0);
}
////////////////////////////////////////////////////////////////////////////////
}
////////////////////////////////////////////////////////////////////////////////
@@
-316,6
+315,7
@@
struct _tdm_test_server {
tdm_display *display;
};
tdm_display *display;
};
+static void destroy(tdm_test_server *data);
static void run_test(tdm_test_server *data);
static void output_setup(tdm_test_server_output *o);
static void layer_show_buffer(tdm_test_server_layer *l, tbm_surface_h b);
static void run_test(tdm_test_server *data);
static void output_setup(tdm_test_server_output *o);
static void layer_show_buffer(tdm_test_server_layer *l, tbm_surface_h b);
@@
-517,6
+517,7
@@
parse_args(tdm_test_server *data, int argc, char *argv[])
if (argc < 2) {
usage(argv[0]);
if (argc < 2) {
usage(argv[0]);
+ destroy(data);
exit(0);
}
exit(0);
}
@@
-597,6
+598,7
@@
parse_args(tdm_test_server *data, int argc, char *argv[])
data->do_vblank = 1;
} else {
usage(argv[0]);
data->do_vblank = 1;
} else {
usage(argv[0]);
+ destroy(data);
exit(0);
}
}
exit(0);
}
}
@@
-639,7
+641,9
@@
interpret_args(tdm_test_server *data)
for (i = 0; i < output_count; i++) {
tdm_output *output = tdm_display_get_output(data->display, i, NULL);
tdm_output_conn_status status;
for (i = 0; i < output_count; i++) {
tdm_output *output = tdm_display_get_output(data->display, i, NULL);
tdm_output_conn_status status;
- tdm_output_get_conn_status(output, &status);
+ ret = tdm_output_get_conn_status(output, &status);
+ TDM_EXIT_IF_FAIL(ret == TDM_ERROR_NONE);
+
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
o = calloc(1, sizeof * o);
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
o = calloc(1, sizeof * o);
@@
-793,6
+797,7
@@
destroy(tdm_test_server *data)
tdm_test_server_pp *p = NULL, *pp = NULL;
tdm_test_server_capture *c = NULL, *cc = NULL;
tdm_test_server_prop *w = NULL, *ww = NULL;
tdm_test_server_pp *p = NULL, *pp = NULL;
tdm_test_server_capture *c = NULL, *cc = NULL;
tdm_test_server_prop *w = NULL, *ww = NULL;
+ tdm_error ret;
int i;
LIST_FOR_EACH_ENTRY_SAFE(c, cc, &data->capture_list, link) {
int i;
LIST_FOR_EACH_ENTRY_SAFE(c, cc, &data->capture_list, link) {
@@
-811,9
+816,11
@@
destroy(tdm_test_server *data)
LIST_FOR_EACH_ENTRY_SAFE(o, oo, &data->output_list, link) {
LIST_FOR_EACH_ENTRY_SAFE(l, ll, &o->layer_list, link) {
LIST_FOR_EACH_ENTRY_SAFE(o, oo, &data->output_list, link) {
LIST_FOR_EACH_ENTRY_SAFE(l, ll, &o->layer_list, link) {
- tdm_layer_unset_buffer(l->layer);
+ ret = tdm_layer_unset_buffer(l->layer);
+ TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
}
}
- tdm_layer_commit(l->layer, NULL, NULL);
+ ret = tdm_layer_commit(l->layer, NULL, NULL);
+ TDM_EXIT_IF_FAIL(ret == TDM_ERROR_NONE);
}
LIST_FOR_EACH_ENTRY_SAFE(p, pp, &data->pp_list, link) {
}
LIST_FOR_EACH_ENTRY_SAFE(p, pp, &data->pp_list, link) {
@@
-930,7
+937,7
@@
output_setup(tdm_test_server_output *o)
}
if (!best)
best = &modes[i];
}
if (!best)
best = &modes[i];
- if (modes[i].
flags
& TDM_OUTPUT_MODE_TYPE_PREFERRED)
+ if (modes[i].
type
& TDM_OUTPUT_MODE_TYPE_PREFERRED)
prefer = &modes[i];
}
if (!found && prefer) {
prefer = &modes[i];
}
if (!found && prefer) {
@@
-1038,7
+1045,8
@@
layer_show_buffer(tdm_test_server_layer *l, tbm_surface_h b)
TDM_EXIT_IF_FAIL(tb != NULL);
tb->in_use = 1;
TDM_EXIT_IF_FAIL(tb != NULL);
tb->in_use = 1;
- tdm_buffer_add_release_handler(b, layer_cb_buffer_release, NULL);
+ ret = tdm_buffer_add_release_handler(b, layer_cb_buffer_release, NULL);
+ TDM_EXIT_IF_FAIL(ret == TDM_ERROR_NONE);
if (data->do_vblank)
ret = tdm_layer_commit(l->layer, layer_cb_commit, l);
if (data->do_vblank)
ret = tdm_layer_commit(l->layer, layer_cb_commit, l);
@@
-1358,6
+1366,7
@@
capture_setup(tdm_test_server_capture *c, tbm_surface_h b)
c->info.dst_config.size.v = info.height;
}
c->info.dst_config.format = info.format;
c->info.dst_config.size.v = info.height;
}
c->info.dst_config.format = info.format;
+ c->info.type = TDM_CAPTURE_TYPE_ONESHOT;
ret = tdm_capture_set_info(c->capture, &c->info);
TDM_EXIT_IF_FAIL(ret == TDM_ERROR_NONE);
ret = tdm_capture_set_info(c->capture, &c->info);
TDM_EXIT_IF_FAIL(ret == TDM_ERROR_NONE);
@@
-1424,8
+1433,10
@@
run_test(tdm_test_server *data)
printf("enter test loop\n");
printf("enter test loop\n");
- while (1)
- tdm_display_handle_events(data->display);
+ while (1) {
+ ret = tdm_display_handle_events(data->display);
+ TDM_EXIT_IF_FAIL(ret == TDM_ERROR_NONE);
+ }
destroy(data);
destroy(data);