struct wl_tdm *tdm;
struct list_head output_list;
+ unsigned int enable_ttrace;
+ unsigned int stamp;
+
tdm_private_client_vblank *temp_vblank;
} tdm_private_client;
_tdm_client_vblank_cb_stamp(void *data, struct wl_tdm_vblank *wl_tdm_vblank, uint32_t stamp)
{
tdm_private_client_vblank *private_vblank = data;
+ tdm_private_client *private_client;
TDM_RETURN_IF_FAIL(private_vblank != NULL);
private_vblank->stamp = stamp;
+
+ TDM_RETURN_IF_FAIL(private_vblank->private_output != NULL);
+ private_client = private_vblank->private_output->private_client;
+
+ private_client->stamp = stamp;
}
/* LCOV_EXCL_START */
_tdm_client_vblank_cb_ttrace(void *data, struct wl_tdm_vblank *wl_tdm_vblank, uint32_t enable)
{
tdm_private_client_vblank *private_vblank = data;
+ tdm_private_client *private_client;
TDM_RETURN_IF_FAIL(private_vblank != NULL);
private_vblank->enable_ttrace = enable;
+
+ TDM_RETURN_IF_FAIL(private_vblank->private_output != NULL);
+ private_client = private_vblank->private_output->private_client;
+
+ private_client->enable_ttrace = enable;
}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
private_client = (tdm_private_client*)client;
+ if (private_client->enable_ttrace)
+ TDM_TRACE_ASYNC_BEGIN((int)private_client->stamp, "TDM_Client_Events:%u", (unsigned int)private_client->stamp);
+
wl_display_dispatch(private_client->display);
+ if (private_client->enable_ttrace)
+ TDM_TRACE_ASYNC_END((int)private_client->stamp, "TDM_Client_Events:%u", (unsigned int)private_client->stamp);
+
return TDM_ERROR_NONE;
/* LCOV_EXCL_STOP */
}
tdm_ttrace_module = 0;
else if (!strncmp(arg, "all", 3))
tdm_ttrace_module = 0xFFFFFFFF;
+ else if (!strncmp(arg, "vsync", 5))
+ tdm_ttrace_module |= TDM_TTRACE_VSYNC;
+ else if (!strncmp(arg, "client_vblank", 13))
+ tdm_ttrace_module |= TDM_TTRACE_CLIENT_VBLANK;
+ else if (!strncmp(arg, "server_vblank", 13))
+ tdm_ttrace_module |= TDM_TTRACE_SERVER_VBLANK;
else if (!strncmp(arg, "vblank", 6))
tdm_ttrace_module |= TDM_TTRACE_VBLANK;
- else if (!strncmp(arg, "client", 6))
- tdm_ttrace_module |= TDM_TTRACE_CLIENT;
else if (!strncmp(arg, "layer", 5))
tdm_ttrace_module |= TDM_TTRACE_LAYER;
else if (!strncmp(arg, "pp", 2))
TDM_SNPRINTF(reply, len, "ttrace debugging... '%s' %x\n", ttrace, tdm_ttrace_module);
- if (tdm_ttrace_module & TDM_TTRACE_VBLANK)
+ if (tdm_ttrace_module & TDM_TTRACE_VSYNC)
tdm_display_enable_ttrace_vblank(private_display, output, 1);
else
tdm_display_enable_ttrace_vblank(private_display, NULL, 0);
- if (tdm_ttrace_module & TDM_TTRACE_CLIENT)
+ if (tdm_ttrace_module & TDM_TTRACE_CLIENT_VBLANK)
tdm_server_enable_ttrace_client_vblank(private_display, output, 1);
else
tdm_server_enable_ttrace_client_vblank(private_display, NULL, 0);
},
{
"ttrace", _tdm_monitor_server_ttrace,
- "enable/disable ttrace (module: none, vblank, client, layer, pp, capture, all",
+ "enable/disable ttrace (module: none,vsync,client_vblank,server_vblank,vblank,layer,pp,capture,all",
"<module>[@<output_idx>]",
NULL
},
enum {
TDM_TTRACE_NONE,
- TDM_TTRACE_VBLANK = (1 << 0),
- TDM_TTRACE_CLIENT = (1 << 1),
- TDM_TTRACE_LAYER = (1 << 2),
- TDM_TTRACE_PP = (1 << 3),
- TDM_TTRACE_CAPTURE = (1 << 4),
+ TDM_TTRACE_VSYNC = (1 << 0),
+ TDM_TTRACE_CLIENT_VBLANK = (1 << 1),
+ TDM_TTRACE_SERVER_VBLANK = (1 << 2),
+ TDM_TTRACE_VBLANK = (1 << 3),
+ TDM_TTRACE_LAYER = (1 << 4),
+ TDM_TTRACE_PP = (1 << 5),
+ TDM_TTRACE_CAPTURE = (1 << 6),
};
typedef enum {
TDM_DBG("req_id(%d) done", wait_info->req_id);
vblank_info = wait_info->vblank_info;
+
+ if (tdm_ttrace_module & TDM_TTRACE_SERVER_VBLANK)
+ TDM_TRACE_ASYNC_END((int)wait_info->req_time, "TDM_Server_Vblank:%u", vblank_info->stamp);
+
wl_tdm_vblank_send_done(vblank_info->resource, wait_info->req_id,
sequence, tv_sec, tv_usec, error);
if (tdm_debug_module & TDM_DEBUG_VBLANK)
TDM_DBG("req_id(%d) wait", req_id);
+ if (tdm_ttrace_module & TDM_TTRACE_SERVER_VBLANK)
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_Server_Vblank:%u", vblank_info->stamp);
+
ret = tdm_vblank_wait(vblank_info->vblank, req_sec, req_usec, interval, _tdm_server_cb_vblank, wait_info);
tdm_vblank_get_enable_fake(vblank_info->vblank, &enable_fake);
if (tdm_debug_module & TDM_DEBUG_VBLANK)
TDM_DBG("req_id(%d) wait", req_id);
+ if (tdm_ttrace_module & TDM_TTRACE_SERVER_VBLANK)
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_Server_Vblank:%u", vblank_info->stamp);
+
ret = tdm_vblank_wait_seq(vblank_info->vblank, req_sec, req_usec, sequence, _tdm_server_cb_vblank, wait_info);
tdm_vblank_get_enable_fake(vblank_info->vblank, &enable_fake);
wl_tdm_vblank_send_stamp(vblank_info->resource, vblank_info->stamp);
- if (tdm_ttrace_module & TDM_TTRACE_CLIENT) {
+ if (tdm_ttrace_module & TDM_TTRACE_CLIENT_VBLANK) {
tdm_output *output = tdm_display_get_output(private_loop->dpy, tdm_ttrace_output, NULL);
if (output == output_info->output)
wl_tdm_vblank_send_ttrace(vblank_info->resource, 1);
VDB("wait(%p) last(%.6f) sequence(%u) done", wait_info, private_vblank->last_time, wait_info->target_seq);
+ if (tdm_ttrace_module & TDM_TTRACE_VBLANK)
+ TDM_TRACE_ASYNC_END((int)wait_info->req_time, "TDM_Vblank:%u", (unsigned int)private_vblank->stamp);
+
if (wait_info->func)
wait_info->func(private_vblank, TDM_ERROR_NONE, wait_info->target_seq,
tv_sec, tv_usec, wait_info->user_data);
private_vblank->last_interval = hw_interval;
+ if (tdm_ttrace_module & TDM_TTRACE_VBLANK)
+ TDM_TRACE_ASYNC_BEGIN((int)wait_info->req_time, "TDM_Vblank:%u", (unsigned int)private_vblank->stamp);
+
if (private_vblank->add_front)
ret = tdm_output_wait_vblank_add_front(private_vblank->output, hw_interval, 0,
_tdm_vblank_cb_vblank_HW, wait_info);