private_output->regist_change_cb = 1;
}
- } else
- _tdm_display_destroy_caps_output(&private_output->caps);
+ ret = _tdm_display_update_caps_output(private_display, pipe, output_backend,
+ &private_output->caps);
+ if (ret != TDM_ERROR_NONE)
+ return ret;
+ } else {
+ tdm_caps_output new_caps;
- ret = _tdm_display_update_caps_output(private_display, pipe, output_backend,
- &private_output->caps);
- if (ret != TDM_ERROR_NONE)
- return ret;
+ ret = _tdm_display_update_caps_output(private_display, pipe, output_backend,
+ &new_caps);
+ if (ret != TDM_ERROR_NONE)
+ return ret;
+
+ /* FIXME: This is very ugly. need to fix after the TDM ABI is changed. */
+ if (private_output->caps.status != new_caps.status) {
+ _tdm_display_destroy_caps_output(&private_output->caps);
+ private_output->caps = new_caps;
+ private_output->current_mode = NULL;
+ } else {
+ tdm_output_mode *old_modes = private_output->caps.modes;
+ unsigned int old_mode_count = private_output->caps.mode_count;
+ if (new_caps.modes)
+ free(new_caps.modes);
+ new_caps.modes = old_modes;
+ new_caps.mode_count = old_mode_count;
+ if (private_output->caps.props)
+ free(private_output->caps.props);
+ private_output->caps = new_caps;
+ }
+ }
layers = func_output->output_get_layers(output_backend, &layer_count, &ret);
if (ret != TDM_ERROR_NONE)
break;
}
}
+
+ _tdm_display_destroy_caps_output(&caps);
}
/* ordering : main output is first */
/* below functions should be implemented in backend side */
TDM_RETURN_VAL_IF_FAIL(func_display != NULL, TDM_ERROR_BAD_MODULE);
- TDM_RETURN_VAL_IF_FAIL(func_display->display_get_capabilitiy, TDM_ERROR_BAD_MODULE);
+// TDM_RETURN_VAL_IF_FAIL(func_display->display_get_capabilitiy, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_display->display_get_outputs, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_output->output_get_capability, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_output->output_get_layers, TDM_ERROR_BAD_MODULE);
TDM_RETURN_VAL_IF_FAIL(func_layer->layer_get_capability, TDM_ERROR_BAD_MODULE);
- ret = func_display->display_get_capabilitiy(private_display->bdata, &private_display->caps_display);
+ if (func_display->display_get_capability)
+ ret = func_display->display_get_capability(private_display->bdata, &private_display->caps_display);
+ else
+ ret = func_display->display_get_capabilitiy(private_display->bdata, &private_display->caps_display);
if (ret != TDM_ERROR_NONE) {
- TDM_ERR("display_get_capabilitiy() failed");
+ TDM_ERR("display_get_capability() failed");
return TDM_ERROR_BAD_MODULE;
}
private_display->bdata = module_data->init((tdm_display *)private_display, &ret);
TDM_TRACE_END();
if (ret != TDM_ERROR_NONE) {
- TDM_ERR("'%s' init failed", file);
+ TDM_ERR("failed to init '%s' module", module_data->name);
goto failed_load;
}
goto failed_load;
}
- TDM_INFO("Success to load module(%s)", file);
+ TDM_INFO("Success to load '%s' module", module_data->name);
return TDM_ERROR_NONE;
failed_load:
free(private_display);
g_private_display = NULL;
+ if (tdm_debug_dump_dir) {
+ free(tdm_debug_dump_dir);
+ tdm_debug_dump_dir = NULL;
+ }
+
_pthread_mutex_unlock(&gLock);
TDM_INFO("done");
snprintf(temp, sizeof(temp), "%s", dump_str);
arg = strtok_r(temp, ",", &end);
+ TDM_GOTO_IF_FAIL(arg != NULL, done);
if (!strncmp(arg, "none", 4)) {
tdm_debug_dump = 0;
+ TDM_SNPRINTF(reply, len, "path: %s\n", (tdm_debug_dump_dir)?:"unknown");
if (tdm_debug_dump_dir) {
free(tdm_debug_dump_dir);
tdm_debug_dump_dir = NULL;
}
- TDM_SNPRINTF(reply, len, "path: %s\n", path);
goto done;
}
tdm_private_layer *l = NULL;
LIST_FOR_EACH_ENTRY(l, &o->layer_list, link) {
char str[TDM_PATH_LEN];
- if (l->usable)
+ if (l->usable || l->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO)
continue;
snprintf(str, TDM_PATH_LEN, "layer_%d_%d", o->index, l->index);
tdm_helper_dump_buffer_str(l->showing_buffer, path, str);
return TDM_ERROR_NONE;
}
+
+
+static void
+_tdm_display_ttrace_vblank_cb(tdm_vblank *vblank, tdm_error error, unsigned int sequence,
+ unsigned int tv_sec, unsigned int tv_usec, void *user_data)
+{
+ tdm_error ret = TDM_ERROR_NONE;
+
+ TDM_TRACE_MARK(VBlank);
+
+ ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL);
+ TDM_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
+}
+
+INTERN tdm_error
+tdm_display_enable_ttrace_vblank(tdm_display *dpy, tdm_output *output, int enable)
+{
+ static tdm_vblank *vblank = NULL;
+ tdm_error ret = TDM_ERROR_NONE;
+
+ if (!enable) {
+ if (vblank)
+ tdm_vblank_destroy(vblank);
+ vblank = NULL;
+ return TDM_ERROR_NONE;
+ } else {
+ const tdm_output_mode *mode = NULL;
+
+ if (vblank)
+ return TDM_ERROR_NONE;
+
+ vblank = tdm_vblank_create(dpy, output, &ret);
+ TDM_RETURN_VAL_IF_FAIL(vblank != NULL, ret);
+
+ ret = tdm_output_get_mode(output, &mode);
+ TDM_GOTO_IF_FAIL(mode != NULL, enable_fail);
+
+ ret = tdm_vblank_set_fps(vblank, mode->vrefresh);
+ TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail);
+
+ ret = tdm_vblank_set_enable_fake(vblank, 1);
+ TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail);
+
+ ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL);
+ TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail);
+ }
+
+ return TDM_ERROR_NONE;
+
+enable_fail:
+ if (vblank)
+ tdm_vblank_destroy(vblank);
+ vblank = NULL;
+ return ret;
+}
+