/* create or replace the target_window when the output mode is set */
if (output_data->hwc_enable) {
- ret = vc4_hwc_initailize_target_window(output_data->hwc_data, mode->hdisplay, mode->vdisplay);
+ ret = vc4_hwc_target_window_set_info(output_data->hwc_data, mode->hdisplay, mode->vdisplay);
if (ret != TDM_ERROR_NONE) {
- TDM_ERR("create target hwc window failed (%d)", ret);
+ TDM_ERR("set info target hwc window failed (%d)", ret);
return ret;
}
}
{
tdm_vc4_hwc_data *hwc_data = NULL;
tdm_vc4_output_data *output_data = output;
+ tdm_error ret = TDM_ERROR_NONE;
if (!output_data) {
TDM_ERR("invalid params");
output_data->hwc_data = hwc_data;
+ ret = vc4_hwc_initailize_target_window(output_data->hwc_data);
+ if (ret != TDM_ERROR_NONE) {
+ TDM_ERR("create target hwc window failed (%d)", ret);
+ free(hwc_data);
+ if (error)
+ *error = ret;
+ return NULL;
+ }
+
if (error)
*error = TDM_ERROR_NONE;
}
tdm_error
-vc4_hwc_initailize_target_window(tdm_vc4_hwc_data *hwc_data, int width, int height)
+vc4_hwc_target_window_set_info(tdm_vc4_hwc_data *hwc_data, int width, int height)
{
tdm_hwc_window_info info = {0};
- tdm_error ret = TDM_ERROR_NONE;
tdm_vc4_hwc_window_data *target_hwc_window;
+ tdm_error ret = TDM_ERROR_NONE;
RETURN_VAL_IF_FAIL(hwc_data, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_data->target_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+
+ target_hwc_window = hwc_data->target_hwc_window;
info.dst_pos.x = 0;
info.dst_pos.y = 0;
- info.dst_pos.h = height;
- info.dst_pos.w = width;
+ info.dst_pos.h = width;
+ info.dst_pos.w = height;
info.src_config.pos.x = 0;
info.src_config.pos.y = 0;
- info.src_config.pos.h = height;
- info.src_config.pos.w = width;
+ info.src_config.pos.h = width;
+ info.src_config.pos.w = height;
info.src_config.size.h = width;
info.src_config.size.v = height;
info.src_config.format = TBM_FORMAT_ARGB8888;
+ ret = vc4_hwc_window_set_info(target_hwc_window, &info);
+ if (ret != TDM_ERROR_NONE) {
+ TDM_ERR("set info target hwc window failed (%d)", ret);
+ return TDM_ERROR_OPERATION_FAILED;
+ }
+
+ return TDM_ERROR_NONE;
+}
+
+tdm_error
+vc4_hwc_initailize_target_window(tdm_vc4_hwc_data *hwc_data)
+{
+ tdm_hwc_window_info info = {0};
+ tdm_error ret = TDM_ERROR_NONE;
+ tdm_vc4_hwc_window_data *target_hwc_window;
+
+ RETURN_VAL_IF_FAIL(hwc_data, TDM_ERROR_INVALID_PARAMETER);
+
+ info.dst_pos.x = 0;
+ info.dst_pos.y = 0;
+ info.dst_pos.h = 2;
+ info.dst_pos.w = 1;
+
+ info.src_config.pos.x = 0;
+ info.src_config.pos.y = 0;
+ info.src_config.pos.h = 2;
+ info.src_config.pos.w = 1;
+
+ info.src_config.size.h = 2;
+ info.src_config.size.v = 1;
+ info.src_config.format = TBM_FORMAT_ARGB8888;
+
target_hwc_window = _vc4_hwc_create_window(hwc_data, &info, &ret);
if (ret != TDM_ERROR_NONE) {
TDM_ERR("create target hwc window failed (%d)", ret);