static void
_tc_tdm_test_server_cb_output_mode_change(tdm_output *output, unsigned int index, void *user_data)
{
+ tdm_hwc *hwc = NULL;
+ tdm_region fb_damage;
const tdm_output_mode *modes, *mode;
int count = 0;
+ uint32_t num = 0;
tdm_error ret;
+ tbm_surface_h buffer = NULL;
ret = tdm_output_get_available_modes(output, &modes, &count);
TDM_UT_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
ret = tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_ON);
TDM_UT_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
- ret = tdm_output_commit(output, 0, NULL, NULL);
- TDM_UT_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
+ if (tc_tdm_output_is_hwc_enable(output)) {
+ hwc = tdm_output_get_hwc(output, &ret);
+ TDM_UT_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
+
+ TDM_UT_RETURN_IF_FAIL(tc_tdm_buffer_create(mode->hdisplay, mode->vdisplay, TBM_FORMAT_ARGB8888, TBM_BO_SCANOUT, true, 1, &buffer) == true);
+
+ memset(&fb_damage, 0, sizeof(fb_damage));
+ ret = tdm_hwc_set_client_target_buffer(hwc, buffer, fb_damage);
+ TDM_UT_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, failed);
+
+ ret = tdm_hwc_validate(hwc, NULL, 0, &num);
+ TDM_UT_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, failed);
+
+ ret = tdm_hwc_accept_validation(hwc);
+ TDM_UT_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, failed);
+
+ ret = tdm_hwc_commit(hwc, 0, NULL, NULL);
+ TDM_UT_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, failed);
+
+ tbm_surface_internal_unref(buffer);
+ } else {
+ ret = tdm_output_commit(output, 0, NULL, NULL);
+ TDM_UT_RETURN_IF_FAIL(ret == TDM_ERROR_NONE);
+ }
+
+ return;
+
+failed:
+ tbm_surface_internal_unref(buffer);
}
static void