return TDM_ERROR_NONE;
}
+void
+_tdm_display_enable_dump_current(tdm_private_display *private_display, char *path)
+{
+ tdm_private_module *b = NULL;
+ tdm_private_output *o = NULL;
+
+ LIST_FOR_EACH_ENTRY(b, &private_display->module_list, link) {
+ LIST_FOR_EACH_ENTRY(o, &b->output_list, link) {
+ if (o->caps.capabilities & TDM_OUTPUT_CAPABILITY_HWC) {
+ tdm_private_hwc *private_hwc = NULL;
+ tdm_private_hwc_window *w = NULL;
+ int index = 0;
+ private_hwc = o->private_hwc;
+ if (private_hwc->display_target_buffer) {
+ char str[TDM_PATH_LEN];
+ snprintf(str, TDM_PATH_LEN, "window_%d_target", private_hwc->index);
+ tdm_helper_dump_buffer_str(private_hwc->display_target_buffer, path, str);
+ }
+ LIST_FOR_EACH_ENTRY(w, &private_hwc->hwc_window_list, link) {
+ char str[TDM_PATH_LEN];
+ if (!w->display_buffer)
+ continue;
+ if (w->composition_type != TDM_HWC_WIN_COMPOSITION_DEVICE)
+ continue;
+ snprintf(str, TDM_PATH_LEN, "window_%d_%d", private_hwc->index, index++);
+ tdm_helper_dump_buffer_str(w->display_buffer, path, str);
+ }
+ } else {
+ tdm_private_layer *l = NULL;
+ LIST_FOR_EACH_ENTRY(l, &o->layer_list, link) {
+ char str[TDM_PATH_LEN];
+ if (l->usable || l->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO)
+ continue;
+ if (!l->showing_buffer)
+ continue;
+ snprintf(str, TDM_PATH_LEN, "layer_%d_%d", o->index, l->index);
+ tdm_helper_dump_buffer_str(l->showing_buffer->buffer, path, str);
+ }
+ }
+ }
+ }
+}
+
INTERN tdm_error
tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_str, char *reply, int *len)
{
TDM_GOTO_IF_FAIL(path != NULL, done);
if (!strncmp(arg, "current", 7)) {
- tdm_private_module *b = NULL;
- tdm_private_output *o = NULL;
-
if (!private_display) {
TDM_WRN("no private_display");
goto done;
}
- LIST_FOR_EACH_ENTRY(b, &private_display->module_list, link) {
- LIST_FOR_EACH_ENTRY(o, &b->output_list, link) {
- tdm_private_layer *l = NULL;
- LIST_FOR_EACH_ENTRY(l, &o->layer_list, link) {
- char str[TDM_PATH_LEN];
- if (l->usable || l->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO)
- continue;
- if (!l->showing_buffer)
- continue;
- snprintf(str, TDM_PATH_LEN, "layer_%d_%d", o->index, l->index);
- tdm_helper_dump_buffer_str(l->showing_buffer->buffer, path, str);
- }
- }
- }
-
+ _tdm_display_enable_dump_current(private_display, path);
TDM_SNPRINTF(reply, len, "path: %s\n", path);
goto done;
}