/* vc4 output */
tdm_vc4_layer *tdm_vc4_output_get_layer_data(tdm_vc4_output *output_data, int layer_zops);
-hal_tdm_error tdm_vc4_output_prepare_mirror_commit(tdm_vc4_output *output_data, tbm_surface_h surface);
+hal_tdm_error tdm_vc4_output_prepare_mirror_commit(tdm_vc4_output *output_data, tdm_vc4_output *src_output_data);
/* vc4 hwc */
hal_tdm_error tdm_vc4_hwc_initailize_target_window(tdm_vc4_hwc *hwc_data);
}
hal_tdm_error
-tdm_vc4_output_prepare_mirror_commit(tdm_vc4_output *output_data, tbm_surface_h surface)
+tdm_vc4_output_prepare_mirror_commit(tdm_vc4_output *output_data, tdm_vc4_output *src_output_data)
{
tdm_vc4_layer *layer_data = NULL;
tdm_vc4_layer_info info;
tbm_surface_info_s surf_info;
+ tbm_surface_h surface;
hal_tdm_error ret;
hal_tdm_pos dst_pos;
TDM_BACKEND_RETURN_VAL_IF_FAIL(output_data, HAL_TDM_ERROR_INVALID_PARAMETER);
- TDM_BACKEND_RETURN_VAL_IF_FAIL(surface, HAL_TDM_ERROR_INVALID_PARAMETER);
-
TDM_BACKEND_RETURN_VAL_IF_FAIL(output_data->current_mode, HAL_TDM_ERROR_OPERATION_FAILED);
+ surface = src_output_data->hwc_data->target_hwc_window->surface;
+ TDM_BACKEND_RETURN_VAL_IF_FAIL(surface, HAL_TDM_ERROR_INVALID_PARAMETER);
+
layer_data = tdm_vc4_output_get_layer_data(output_data, 0);
TDM_BACKEND_RETURN_VAL_IF_FAIL(layer_data, HAL_TDM_ERROR_OPERATION_FAILED);
info.src_config.format = TBM_FORMAT_ARGB8888;
info.src_config.pos.x = 0;
info.src_config.pos.y = 0;
- info.src_config.pos.w = surf_info.width;
- info.src_config.pos.h = surf_info.height;
+ info.src_config.pos.w = src_output_data->current_mode->hdisplay;
+ info.src_config.pos.h = src_output_data->current_mode->vdisplay;
info.dst_pos.x = dst_pos.x;
info.dst_pos.y = dst_pos.y;
info.dst_pos.w = output_data->current_mode->hdisplay;
/* prepare_mirror_commit for mirroring */
if (output_data->mirror_dst_output_data) {
ret = tdm_vc4_output_prepare_mirror_commit(output_data->mirror_dst_output_data,
- hwc_data->target_hwc_window->surface);
+ hwc_data->output_data);
if (ret != HAL_TDM_ERROR_NONE)
TDM_BACKEND_ERR("fail to prepare mirror_commit.");
}