summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libhal-backend-tdm-vc4/tdm_backend_vc4.h2
-rw-r--r--src/libhal-backend-tdm-vc4/tdm_vc4_display.c12
-rw-r--r--src/libhal-backend-tdm-vc4/tdm_vc4_hwc.c2
3 files changed, 9 insertions, 7 deletions
diff --git a/src/libhal-backend-tdm-vc4/tdm_backend_vc4.h b/src/libhal-backend-tdm-vc4/tdm_backend_vc4.h
index 4961001..7ee3a84 100644
--- a/src/libhal-backend-tdm-vc4/tdm_backend_vc4.h
+++ b/src/libhal-backend-tdm-vc4/tdm_backend_vc4.h
@@ -122,7 +122,7 @@ void tdm_vc4_display_destroy_buffer_list(tdm_vc4_display *display_data
/* 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);
diff --git a/src/libhal-backend-tdm-vc4/tdm_vc4_display.c b/src/libhal-backend-tdm-vc4/tdm_vc4_display.c
index 5b6ff68..1c10338 100644
--- a/src/libhal-backend-tdm-vc4/tdm_vc4_display.c
+++ b/src/libhal-backend-tdm-vc4/tdm_vc4_display.c
@@ -2337,19 +2337,21 @@ _vc4_output_data_center_rect_get(int src_w, int src_h, int dst_w, int dst_h, hal
}
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);
@@ -2366,8 +2368,8 @@ tdm_vc4_output_prepare_mirror_commit(tdm_vc4_output *output_data, tbm_surface_h
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;
diff --git a/src/libhal-backend-tdm-vc4/tdm_vc4_hwc.c b/src/libhal-backend-tdm-vc4/tdm_vc4_hwc.c
index 2e9ee8f..7df2a26 100644
--- a/src/libhal-backend-tdm-vc4/tdm_vc4_hwc.c
+++ b/src/libhal-backend-tdm-vc4/tdm_vc4_hwc.c
@@ -881,7 +881,7 @@ vc4_hwc_accept_validation(hal_tdm_hwc *hwc)
/* 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.");
}