}
static int
-_get_primary_layer_zpos(tdm_exynos_output_data *exynos_output)
+_get_primary_layer_zpos(tdm_exynos_output_data *output_data)
{
tdm_exynos_layer_data *layer = NULL;
- LIST_FOR_EACH_ENTRY(layer, &exynos_output->layer_list, link) {
+ LIST_FOR_EACH_ENTRY(layer, &output_data->layer_list, link) {
if (layer->capabilities & TDM_LAYER_CAPABILITY_PRIMARY)
return layer->zpos;
}
static tdm_exynos_hwc_window_data *
_find_maped_hwc_window_to_layer(struct list_head *hwc_wnds, int layer_zpos)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- if (hw->assigned_layer_zpos == layer_zpos &&
- (hw->validated_type == TDM_COMPOSITION_DEVICE ||
- hw->validated_type == TDM_COMPOSITION_CURSOR ||
- hw->is_device_to_client_transition))
- return hw;
+ if (hwc_window_data->assigned_layer_zpos == layer_zpos &&
+ (hwc_window_data->validated_type == TDM_COMPOSITION_DEVICE ||
+ hwc_window_data->validated_type == TDM_COMPOSITION_CURSOR ||
+ hwc_window_data->is_device_to_client_transition))
+ return hwc_window_data;
}
return NULL;
_update_layers_info(tdm_exynos_output_data *output_data)
{
tdm_exynos_layer_data *layer = NULL;
- tdm_exynos_hwc_window_data *hw;
+ tdm_exynos_hwc_window_data *hwc_window_data;
int primary_layer_zpos = _get_primary_layer_zpos(output_data);
tdm_error ret;
LIST_FOR_EACH_ENTRY(layer, &output_data->layer_list, link) {
if (output_data->need_target_window && layer->zpos == primary_layer_zpos)
- hw = output_data->target_hwc_window;
+ hwc_window_data = output_data->target_hwc_window;
else
- hw = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, layer->zpos);
+ hwc_window_data = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, layer->zpos);
- if (hw) {
+ if (hwc_window_data) {
ret = exynos_layer_set_info((tdm_layer *)layer,
- (tdm_info_layer *)&(hw->info));
+ (tdm_info_layer *)&(hwc_window_data->info));
if (ret != TDM_ERROR_NONE)
TDM_ERR("cannot set info to layer with %d zpos", layer->zpos);
}
static int
_is_device_to_client_transition_finished(struct list_head *hwc_wnds)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link) {
/* do not skip hwc_wnds with NONE composition type
* 'cause it may lead to dead lock state (we won't be
* able to exit from 'device to client transition' state);
* been composited to the target buffer, so to face with
* such situation we don't skip NONE hwcs */
- if (hw->is_device_to_client_transition)
+ if (hwc_window_data->is_device_to_client_transition)
goto work;
}
/* as we reset ALL hwc_wnds to CLIENT when we encountered with a need to
* make the smooth transition we have to wait till ALL they being composited
* (being presented on the target window) */
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- if (hw->is_device_to_client_transition && !hw->present_on_target_wnd)
+ if (hwc_window_data->is_device_to_client_transition && !hwc_window_data->present_on_target_wnd)
return 0;
}
static void
_reset_hwc_windows_grabbed_layer_zpos(struct list_head *hwc_window_list)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_window_list, link) {
- hw->grabbed_layer_zpos = -1;
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_window_list, link) {
+ hwc_window_data->grabbed_layer_zpos = -1;
}
}
static int
_is_device_to_client_transition(struct list_head *hwc_window_list)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_window_list, link)
- if (hw->is_device_to_client_transition)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_window_list, link)
+ if (hwc_window_data->is_device_to_client_transition)
return 1;
return 0;
_tdm_exynos_display_prepare_commit(tdm_exynos_output_data *output_data) {
tdm_exynos_layer_data *layer = NULL;
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
int primary_layer_zpos = _get_primary_layer_zpos(output_data);
int device_to_client_transition_finished;
_set_hwc_window_buffer_to_layer(layer, output_data->target_hwc_window);
/* preempt the hwc_wnd which was mapped to the primary layer */
- hw = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, primary_layer_zpos);
- if (hw)
- hw->assigned_layer_zpos = -1;
+ hwc_window_data = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, primary_layer_zpos);
+ if (hwc_window_data)
+ hwc_window_data->assigned_layer_zpos = -1;
_update_layers_info(output_data);
}
* has finished, we trigger a revalidate event to reevaluate the overlay policy */
tdm_backend_trigger_need_validate_event(output_data);
- hw = NULL;
+ hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, &output_data->hwc_window_list, link)
- hw->is_device_to_client_transition = 0;
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link)
+ hwc_window_data->is_device_to_client_transition = 0;
}
if (_is_device_to_client_transition(&output_data->hwc_window_list))
if (output_data->video_hwc_window && layer->zpos == output_data->video_hwc_window->assigned_layer_zpos)
continue;
- hw = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, layer->zpos);
- if (hw)
- hw->grabbed_layer_zpos = layer->zpos;
- _set_hwc_window_buffer_to_layer(layer, hw);
+ hwc_window_data = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, layer->zpos);
+ if (hwc_window_data)
+ hwc_window_data->grabbed_layer_zpos = layer->zpos;
+ _set_hwc_window_buffer_to_layer(layer, hwc_window_data);
}
return TDM_ERROR_NONE;
}
tdm_error
-tdm_exynos_output_insert_hwc_window(tdm_exynos_output_data *output, tdm_exynos_hwc_window_data *hwc_window)
+tdm_exynos_output_insert_hwc_window(tdm_exynos_output_data *output, tdm_exynos_hwc_window_data *hwc_window_data)
{
tdm_exynos_hwc_window_data *item = NULL;
LIST_FOR_EACH_ENTRY_REV(item, &output->hwc_window_list, link) {
- if (item == hwc_window)
+ if (item == hwc_window_data)
return TDM_ERROR_OPERATION_FAILED;
- if (item->zpos <= hwc_window->zpos)
+ if (item->zpos <= hwc_window_data->zpos)
break;
}
- LIST_INSERT_AFTER(&item->link, &hwc_window->link);
+ LIST_INSERT_AFTER(&item->link, &hwc_window_data->link);
return TDM_ERROR_NONE;
}
int
-_exynos_output_get_changed_number(tdm_exynos_output_data *exynos_output)
+_exynos_output_get_changed_number(tdm_exynos_output_data *output_data)
{
int num = 0;
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- if (hw->client_type != hw->validated_type)
+ if (hwc_window_data->client_type != hwc_window_data->validated_type)
num++;
}
tdm_hwc_window *
_exynos_output_hwc_window_create(tdm_output *output, tdm_hwc_window_info *info, tdm_error *error)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = NULL;
- tdm_exynos_output_data *exynos_output = output;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
+ tdm_exynos_output_data *output_data = output;
if (error)
*error = TDM_ERROR_NONE;
- if (!exynos_output) {
+ if (!output_data) {
TDM_ERR("invalid params");
if (error)
*error = TDM_ERROR_INVALID_PARAMETER;
return NULL;
}
- exynos_hwc_window = calloc(1, sizeof(tdm_exynos_hwc_window_data));
- if (!exynos_hwc_window) {
+ hwc_window_data = calloc(1, sizeof(tdm_exynos_hwc_window_data));
+ if (!hwc_window_data) {
TDM_ERR("alloc failed");
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
return NULL;
}
- if ((exynos_hwc_window->exynos_data = exynos_output->exynos_data) == NULL) {
+ if ((hwc_window_data->exynos_data = output_data->exynos_data) == NULL) {
TDM_ERR("invalid params");
if (error)
*error = TDM_ERROR_INVALID_PARAMETER;
goto fail;
}
- exynos_hwc_window->output_data = output;
- exynos_hwc_window->zpos = 0;
- exynos_hwc_window->prev_validated_type = TDM_COMPOSITION_NONE;
+ hwc_window_data->output_data = output;
+ hwc_window_data->zpos = 0;
+ hwc_window_data->prev_validated_type = TDM_COMPOSITION_NONE;
if (info)
- memcpy(&exynos_hwc_window->info, info, sizeof(tdm_hwc_window_info));
+ memcpy(&hwc_window_data->info, info, sizeof(tdm_hwc_window_info));
- LIST_INITHEAD(&exynos_hwc_window->link);
+ LIST_INITHEAD(&hwc_window_data->link);
- return exynos_hwc_window;
+ return hwc_window_data;
fail:
- if (exynos_hwc_window)
- free(exynos_hwc_window);
+ if (hwc_window_data)
+ free(hwc_window_data);
return NULL;
}
tdm_hwc_window *
exynos_output_hwc_window_create(tdm_output *output, tdm_error *error)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = NULL;
- tdm_exynos_output_data *exynos_output = output;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
+ tdm_exynos_output_data *output_data = output;
- exynos_hwc_window = _exynos_output_hwc_window_create(exynos_output, NULL, error);
- if (exynos_hwc_window == NULL)
+ hwc_window_data = _exynos_output_hwc_window_create(output_data, NULL, error);
+ if (hwc_window_data == NULL)
return NULL;
- tdm_exynos_output_insert_hwc_window(exynos_output, exynos_hwc_window);
+ tdm_exynos_output_insert_hwc_window(output_data, hwc_window_data);
- TDM_DBG("hwc_window(%p) create", exynos_hwc_window);
+ TDM_DBG("hwc_window_data(%p) create", hwc_window_data);
if (error)
*error = TDM_ERROR_NONE;
- return exynos_hwc_window;
+ return hwc_window_data;
}
tdm_error
exynos_output_hwc_window_destroy(tdm_output *output, tdm_hwc_window *hwc_window)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
tdm_exynos_output_data *output_data;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- output_data = exynos_hwc_window->output_data;
+ output_data = hwc_window_data->output_data;
RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- if (output_data->video_hwc_window == exynos_hwc_window)
+ if (output_data->video_hwc_window == hwc_window_data)
output_data->video_hwc_window = NULL;
- LIST_DEL(&exynos_hwc_window->link);
+ LIST_DEL(&hwc_window_data->link);
- free(exynos_hwc_window);
+ free(hwc_window_data);
return TDM_ERROR_NONE;
}
return "unknown";
}
-/* If there is only 1 visible hwc_window it should be placed on the
+/* If there is only 1 visible hwc_window_data it should be placed on the
* primary layer. The primary layer should always be used.
*/
static int
static void
_update_windows_previous_type(struct list_head *hwc_wnds)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link)
- hw->prev_validated_type = hw->validated_type;
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link)
+ hwc_window_data->prev_validated_type = hwc_window_data->validated_type;
}
static void
_reset_composition_types(struct list_head *hwc_window_list)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE) {
- hw->validated_type = TDM_COMPOSITION_NONE;
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE) {
+ hwc_window_data->validated_type = TDM_COMPOSITION_NONE;
} else {
- hw->validated_type = TDM_COMPOSITION_CLIENT;
+ hwc_window_data->validated_type = TDM_COMPOSITION_CLIENT;
}
- hw->assigned_layer_zpos = -1;
+ hwc_window_data->assigned_layer_zpos = -1;
}
}
static int
-_can_set_hwc_window_on_hw_layer(tdm_exynos_hwc_window_data *hw)
+_can_set_hwc_window_on_hw_layer(tdm_exynos_hwc_window_data *hwc_window_data)
{
- if (!hw->surface)
+ if (!hwc_window_data->surface)
return 0;
- if (hw->info.transform != TDM_TRANSFORM_NORMAL)
+ if (hwc_window_data->info.transform != TDM_TRANSFORM_NORMAL)
return 0;
- if (hw->info.src_config.pos.w != hw->info.dst_pos.w)
+ if (hwc_window_data->info.src_config.pos.w != hwc_window_data->info.dst_pos.w)
return 0;
- if (hw->info.src_config.pos.h != hw->info.dst_pos.h)
+ if (hwc_window_data->info.src_config.pos.h != hwc_window_data->info.dst_pos.h)
return 0;
- if (!IS_RGB(hw->info.src_config.format))
+ if (!IS_RGB(hwc_window_data->info.src_config.format))
return 0;
- if (hw->info.dst_pos.x > hw->output_data->current_mode->hdisplay ||
- hw->info.dst_pos.y > hw->output_data->current_mode->vdisplay)
+ if (hwc_window_data->info.dst_pos.x > hwc_window_data->output_data->current_mode->hdisplay ||
+ hwc_window_data->info.dst_pos.y > hwc_window_data->output_data->current_mode->vdisplay)
return 0;
- if (hw->info.src_config.pos.w < MIN_WIDTH || hw->info.src_config.pos.w % 2)
+ if (hwc_window_data->info.src_config.pos.w < MIN_WIDTH || hwc_window_data->info.src_config.pos.w % 2)
return 0;
return 1;
}
/* The current algorithm map target_window to primary layer. If primary layer
- * is not needed another hwc_window is mapped to primary layer. Algorithm have
+ * is not needed another hwc_window_data is mapped to primary layer. Algorithm have
* two iteration:
* 1) map hwc_windows to layers in order from top layer to primary layer(non-inclusive);
* 2) map hwc_windows to layers in order from bottom layer to primary layer.
* hwc_windows that are not mapped to layers are composited to target_window.
*
* The result of mapping 4 windows(num_layers = 3, primary_layer_zpos = 1):
- * hwc_window 3 zpos(DEVICE -> DEVICE) (it is mapped to layer with 2 zpos)
- * hwc_window 2 zpos(DEVICE -> CLIENT) (it is composited on primary layer)
- * hwc_window 1 zpos(DEVICE -> CLIENT) (it is composited on primary layer)
- * hwc_window 0 zpos(DEVICE -> DEVICE) (it is mapped to layer with 0 zpos)
+ * hwc_window_data 3 zpos(DEVICE -> DEVICE) (it is mapped to layer with 2 zpos)
+ * hwc_window_data 2 zpos(DEVICE -> CLIENT) (it is composited on primary layer)
+ * hwc_window_data 1 zpos(DEVICE -> CLIENT) (it is composited on primary layer)
+ * hwc_window_data 0 zpos(DEVICE -> DEVICE) (it is mapped to layer with 0 zpos)
*
* The result of mapping 3 windows(num_layers = 3, primary_layer_zpos = 1):
- * hwc_window 2 zpos(DEVICE -> DEVICE) (it is mapped to layer with 2 zpos)
- * hwc_window 1 zpos(DEVICE -> DEVICE) (it is mapped to primary layer)
- * hwc_window 0 zpos(DEVICE -> DEVICE) (it is mapped to layer with 0 zpos)
+ * hwc_window_data 2 zpos(DEVICE -> DEVICE) (it is mapped to layer with 2 zpos)
+ * hwc_window_data 1 zpos(DEVICE -> DEVICE) (it is mapped to primary layer)
+ * hwc_window_data 0 zpos(DEVICE -> DEVICE) (it is mapped to layer with 0 zpos)
*
* The result of mapping 1 windows(num_layers = 3, primary_layer_zpos = 1):
- * hwc_window 0 zpos(DEVICE -> DEVICE) (it is mapped to primary layer)
+ * hwc_window_data 0 zpos(DEVICE -> DEVICE) (it is mapped to primary layer)
*
* The result of mapping 2 windows(num_layers = 3, primary_layer_zpos = 1):
- * hwc_window 1 zpos(DEVICE -> DEVICE) (it is mapped to layer with 2 zpos)
- * hwc_window 0 zpos(CLIENT -> CLIENT) (it is composited on primary layer)
+ * hwc_window_data 1 zpos(DEVICE -> DEVICE) (it is mapped to layer with 2 zpos)
+ * hwc_window_data 0 zpos(CLIENT -> CLIENT) (it is composited on primary layer)
*
* The result of mapping 2 windows(num_layers = 3, primary_layer_zpos = 1):
- * hwc_window 1 zpos(CLIENT -> CLIENT) (it is composited on primary layer)
- * hwc_window 0 zpos(DEVICE -> DEVICE) (it is mapped to layer with 0 zpos)
+ * hwc_window_data 1 zpos(CLIENT -> CLIENT) (it is composited on primary layer)
+ * hwc_window_data 0 zpos(DEVICE -> DEVICE) (it is mapped to layer with 0 zpos)
*/
static void
-_map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
+_map_hwc_windows_to_layers(tdm_exynos_output_data *output_data)
{
int layer_zpos;
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
int max_hw_layer_zpos;
int need_target_window = 0;
- int primary_layer_zpos = _get_primary_layer_zpos(exynos_output);
+ int primary_layer_zpos = _get_primary_layer_zpos(output_data);
int num_skip_layers = 0;
int num_bottom_layer_with_primary = primary_layer_zpos + 1;
- int num_unmarked_layers = _get_number_of_visible_windows(&exynos_output->hwc_window_list);
+ int num_unmarked_layers = _get_number_of_visible_windows(&output_data->hwc_window_list);
- _reset_composition_types(&exynos_output->hwc_window_list);
+ _reset_composition_types(&output_data->hwc_window_list);
/* Map hwc_windows to layers in order from top layer to primary layer(non-inclusive).
- * If top hwc_window should be placed on primary layer it is not necessary
+ * If top hwc_window_data should be placed on primary layer it is not necessary
* this iteration because we cannot use layers above primary layer */
- if (!_top_window_should_be_placed_on_fb_layer(&exynos_output->hwc_window_list)) {
- layer_zpos = LIST_LENGTH(&exynos_output->layer_list);
- LIST_FOR_EACH_ENTRY_REV(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ if (!_top_window_should_be_placed_on_fb_layer(&output_data->hwc_window_list)) {
+ layer_zpos = LIST_LENGTH(&output_data->layer_list);
+ LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
layer_zpos--;
/* break if we have reached primary layer(remaining hwc_windows
* will be mapped in the next iteration) or the composition type of
- * current hwc_window is not TDM_COMPOSITION_DEVICE or hwc_window cannot
- * be set on hw layer*/
- if ((hw->client_type == TDM_COMPOSITION_DEVICE || hw->client_type == TDM_COMPOSITION_CURSOR) &&
+ * current hwc_window_data is not TDM_COMPOSITION_DEVICE or hwc_window_data cannot
+ * be set on hwc_window_data layer*/
+ if ((hwc_window_data->client_type == TDM_COMPOSITION_DEVICE || hwc_window_data->client_type == TDM_COMPOSITION_CURSOR) &&
layer_zpos != primary_layer_zpos) {
- if (_can_set_hwc_window_on_hw_layer(hw)) {
- hw->validated_type = hw->client_type;
+ if (_can_set_hwc_window_on_hw_layer(hwc_window_data)) {
+ hwc_window_data->validated_type = hwc_window_data->client_type;
num_unmarked_layers--;
- hw->assigned_layer_zpos = layer_zpos;
+ hwc_window_data->assigned_layer_zpos = layer_zpos;
continue;
}
}
}
}
- /* if there is the video hwc_window the bottom layer is used for it */
- if (exynos_output->video_hwc_window)
+ /* if there is the video hwc_window_data the bottom layer is used for it */
+ if (output_data->video_hwc_window)
num_bottom_layer_with_primary--;
if (num_unmarked_layers > num_bottom_layer_with_primary)
max_hw_layer_zpos--;
/* The number of layers which need to be skipped because it should always set
- * on primary layer hwc_window
+ * on primary layer hwc_window_data
*/
num_skip_layers = num_bottom_layer_with_primary - num_unmarked_layers;
layer_zpos = -1;
if (num_skip_layers > 0)
layer_zpos += num_skip_layers;
- /* don't map hwc_window to layer with the video hwc_window */
- if (exynos_output->video_hwc_window)
+ /* don't map hwc_window_data to layer with the video hwc_window_data */
+ if (output_data->video_hwc_window)
layer_zpos++;
/* map hwc_windows to layers in order from bottom layer to primary layer
- * (inclusive if primary layer can be used for hwc_window(target_window is not used)) */
- LIST_FOR_EACH_ENTRY(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ * (inclusive if primary layer can be used for hwc_window_data(target_window is not used)) */
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
layer_zpos++;
/* break if the remaining windows are already marked in the
* previous iteration */
- if (hw->validated_type == TDM_COMPOSITION_DEVICE || hw->validated_type == TDM_COMPOSITION_CURSOR)
+ if (hwc_window_data->validated_type == TDM_COMPOSITION_DEVICE || hwc_window_data->validated_type == TDM_COMPOSITION_CURSOR)
break;
- /* break if we have reached max hw layer or the composition type of
- * current hwc_window is not TDM_COMPOSITION_DEVICE or hwc_window cannot
- * be set on hw layer */
- if ((hw->client_type == TDM_COMPOSITION_DEVICE)
+ /* break if we have reached max hwc_window_data layer or the composition type of
+ * current hwc_window_data is not TDM_COMPOSITION_DEVICE or hwc_window_data cannot
+ * be set on hwc_window_data layer */
+ if ((hwc_window_data->client_type == TDM_COMPOSITION_DEVICE)
&& layer_zpos <= max_hw_layer_zpos) {
- if (_can_set_hwc_window_on_hw_layer(hw)) {
- hw->validated_type = TDM_COMPOSITION_DEVICE;
- hw->assigned_layer_zpos = layer_zpos;
+ if (_can_set_hwc_window_on_hw_layer(hwc_window_data)) {
+ hwc_window_data->validated_type = TDM_COMPOSITION_DEVICE;
+ hwc_window_data->assigned_layer_zpos = layer_zpos;
continue;
}
}
- /* if hwc_window cannot be mapped on layer target_window is needed */
+ /* if hwc_window_data cannot be mapped on layer target_window is needed */
need_target_window = 1;
break;
}
- exynos_output->need_target_window = need_target_window;
+ output_data->need_target_window = need_target_window;
}
static int
-_need_map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
+_need_map_hwc_windows_to_layers(tdm_exynos_output_data *output_data)
{
- tdm_exynos_hwc_window_data *hw = NULL;
- tdm_exynos_output_data *output_data;
- int primary_layer_zpos = _get_primary_layer_zpos(exynos_output);
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
+ int primary_layer_zpos = _get_primary_layer_zpos(output_data);
int hw_window_is_maped_on_primary_layer = 0;
int need_target_window = 0;
- LIST_FOR_EACH_ENTRY(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- if (primary_layer_zpos == hw->assigned_layer_zpos)
+
+ if (primary_layer_zpos == hwc_window_data->assigned_layer_zpos)
hw_window_is_maped_on_primary_layer = 1;
- if (hw->prev_validated_type != hw->client_type)
+
+ if (hwc_window_data->prev_validated_type != hwc_window_data->client_type)
return 1;
- if (hw->client_type == TDM_COMPOSITION_CLIENT)
+
+ if (hwc_window_data->client_type == TDM_COMPOSITION_CLIENT)
need_target_window = 1;
- output_data = hw->output_data;
- if (output_data && output_data->video_hwc_window)
- if (output_data->video_hwc_window->assigned_layer_zpos == hw->assigned_layer_zpos)
- return 1;
+ if (output_data->video_hwc_window &&
+ output_data->video_hwc_window->assigned_layer_zpos == hwc_window_data->assigned_layer_zpos)
+ return 1;
}
- if (need_target_window != exynos_output->need_target_window)
+ if (need_target_window != output_data->need_target_window)
return 1;
- if (!hw_window_is_maped_on_primary_layer && !exynos_output->need_target_window)
+ if (!hw_window_is_maped_on_primary_layer && !output_data->need_target_window)
return 1;
return 0;
}
static void
-_print_validate_result(tdm_exynos_output_data *exynos_output)
+_print_validate_result(tdm_exynos_output_data *output_data)
{
- tdm_exynos_hwc_window_data *hw = NULL;
- int primary_layer_zpos = _get_primary_layer_zpos(exynos_output);
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
+ int primary_layer_zpos = _get_primary_layer_zpos(output_data);
- LIST_FOR_EACH_ENTRY(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- if (hw->validated_type == TDM_COMPOSITION_DEVICE || hw->validated_type == TDM_COMPOSITION_CURSOR)
- TDM_DBG(" window(%p) type: %s -> %s : is mapped to layer with %d zpos", hw,
- _comp_to_str(hw->client_type), _comp_to_str(hw->validated_type),
- hw->assigned_layer_zpos);
+ if (hwc_window_data->validated_type == TDM_COMPOSITION_DEVICE || hwc_window_data->validated_type == TDM_COMPOSITION_CURSOR)
+ TDM_DBG(" window(%p) type: %s -> %s : is mapped to layer with %d zpos", hwc_window_data,
+ _comp_to_str(hwc_window_data->client_type), _comp_to_str(hwc_window_data->validated_type),
+ hwc_window_data->assigned_layer_zpos);
else
- TDM_DBG(" window(%p) type: %s -> %s : is composited to layer with %d zpos", hw,
- _comp_to_str(hw->client_type), _comp_to_str(hw->validated_type),
+ TDM_DBG(" window(%p) type: %s -> %s : is composited to layer with %d zpos", hwc_window_data,
+ _comp_to_str(hwc_window_data->client_type), _comp_to_str(hwc_window_data->validated_type),
primary_layer_zpos);
}
}
static void
_reset_buffers_for_unvis_hwc_windows(tdm_exynos_output_data *output_data)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
if (!output_data->need_target_window)
output_data->target_hwc_window->surface = NULL;
- LIST_FOR_EACH_ENTRY(hw, &output_data->hwc_window_list, link) {
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link) {
if (!output_data->need_target_window)
- hw->present_on_target_wnd = 0;
+ hwc_window_data->present_on_target_wnd = 0;
- if (hw->client_type == TDM_COMPOSITION_NONE)
- hw->surface = NULL;
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
+ hwc_window_data->surface = NULL;
}
}
static void
_restore_windows_assigned_layer_zpos(struct list_head *hwc_wnds)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE) {
- hw->assigned_layer_zpos = -1;
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE) {
+ hwc_window_data->assigned_layer_zpos = -1;
continue;
}
- hw->assigned_layer_zpos = hw->grabbed_layer_zpos;
+ hwc_window_data->assigned_layer_zpos = hwc_window_data->grabbed_layer_zpos;
}
}
static void
_reset_windows_to_client(struct list_head *hwc_wnds)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- if (hw->grabbed_layer_zpos >= 0 &&
- hw->validated_type == TDM_COMPOSITION_CLIENT)
- hw->is_device_to_client_transition = 1;
+ if (hwc_window_data->grabbed_layer_zpos >= 0 &&
+ hwc_window_data->validated_type == TDM_COMPOSITION_CLIENT)
+ hwc_window_data->is_device_to_client_transition = 1;
- hw->validated_type = TDM_COMPOSITION_CLIENT;
+ hwc_window_data->validated_type = TDM_COMPOSITION_CLIENT;
}
}
static int
_is_reset_to_client_needed(struct list_head *hwc_wnds)
{
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE) {
- if (hw->is_device_to_client_transition)
+ LIST_FOR_EACH_ENTRY(hwc_window_data, hwc_wnds, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE) {
+ if (hwc_window_data->is_device_to_client_transition)
return 1;
continue;
}
- if (hw->grabbed_layer_zpos >= 0 &&
- hw->validated_type == TDM_COMPOSITION_CLIENT)
+ if (hwc_window_data->grabbed_layer_zpos >= 0 &&
+ hwc_window_data->validated_type == TDM_COMPOSITION_CLIENT)
return 1;
}
tdm_error
exynos_output_hwc_validate(tdm_output *output, uint32_t *num_types)
{
- tdm_exynos_output_data *exynos_output = output;
+ tdm_exynos_output_data *output_data = output;
tdm_exynos_data *exynos_data = NULL;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
RETURN_VAL_IF_FAIL(num_types != NULL, TDM_ERROR_INVALID_PARAMETER);
int need_map_hwc_windows_to_layers;
int need_reset_to_client;
int prev_need_target_window;
- exynos_data = exynos_output->exynos_data;
+ exynos_data = output_data->exynos_data;
RETURN_VAL_IF_FAIL(exynos_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- if (exynos_output->need_set_crtc) {
- exynos_output->need_target_window = 1;
+ if (output_data->need_set_crtc) {
+ output_data->need_target_window = 1;
- _reset_composition_types(&exynos_output->hwc_window_list);
+ _reset_composition_types(&output_data->hwc_window_list);
} else {
- prev_need_target_window = exynos_output->need_target_window;
+ prev_need_target_window = output_data->need_target_window;
/* if previous mapping can be used it is not needed to remap hwc_windows
* to layers */
- need_map_hwc_windows_to_layers = _need_map_hwc_windows_to_layers(exynos_output);
+ need_map_hwc_windows_to_layers = _need_map_hwc_windows_to_layers(output_data);
if (need_map_hwc_windows_to_layers)
- _map_hwc_windows_to_layers(exynos_output);
+ _map_hwc_windows_to_layers(output_data);
- need_reset_to_client = _is_reset_to_client_needed(&exynos_output->hwc_window_list);
+ need_reset_to_client = _is_reset_to_client_needed(&output_data->hwc_window_list);
if (need_reset_to_client) {
TDM_INFO("reset all hwc_wnds to CLIENT.");
- _reset_windows_to_client(&exynos_output->hwc_window_list);
- _restore_windows_assigned_layer_zpos(&exynos_output->hwc_window_list);
+ _reset_windows_to_client(&output_data->hwc_window_list);
+ _restore_windows_assigned_layer_zpos(&output_data->hwc_window_list);
- exynos_output->need_target_window = prev_need_target_window;
+ output_data->need_target_window = prev_need_target_window;
}
- _update_windows_previous_type(&exynos_output->hwc_window_list);
+ _update_windows_previous_type(&output_data->hwc_window_list);
}
- _reset_buffers_for_unvis_hwc_windows(exynos_output);
+ _reset_buffers_for_unvis_hwc_windows(output_data);
- _update_layers_info(exynos_output);
+ _update_layers_info(output_data);
- _print_validate_result(exynos_output);
+ _print_validate_result(output_data);
- *num_types = _exynos_output_get_changed_number(exynos_output);
+ *num_types = _exynos_output_get_changed_number(output_data);
if (*num_types == 0)
- exynos_output->need_validate = 0;
+ output_data->need_validate = 0;
return TDM_ERROR_NONE;
}
tdm_error
exynos_output_hwc_get_changed_composition_types(tdm_output *output,
uint32_t *num_elements,
- tdm_hwc_window **hwc_window,
+ tdm_hwc_window **hwc_wnds,
tdm_hwc_window_composition *composition_types)
{
- tdm_exynos_output_data *exynos_output = output;
+ tdm_exynos_output_data *output_data = output;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
int num = 0;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
RETURN_VAL_IF_FAIL(num_elements != NULL, TDM_ERROR_INVALID_PARAMETER);
- if ((hwc_window == NULL) || (composition_types == NULL)) {
- *num_elements = _exynos_output_get_changed_number(exynos_output);
+ if ((hwc_wnds == NULL) || (composition_types == NULL)) {
+ *num_elements = _exynos_output_get_changed_number(output_data);
return TDM_ERROR_NONE;
}
- tdm_exynos_hwc_window_data *hw = NULL;
- LIST_FOR_EACH_ENTRY_REV(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
if (num >= *num_elements)
break;
- if (hw->client_type != hw->validated_type) {
- composition_types[num] = hw->validated_type;
- hwc_window[num] = hw;
+ if (hwc_window_data->client_type != hwc_window_data->validated_type) {
+ composition_types[num] = hwc_window_data->validated_type;
+ hwc_wnds[num] = hwc_window_data;
num++;
}
}
tdm_error
exynos_output_hwc_accept_changes(tdm_output *output)
{
- tdm_exynos_output_data *exynos_output = output;
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_output_data *output_data = output;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- LIST_FOR_EACH_ENTRY_REV(hw, &exynos_output->hwc_window_list, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &output_data->hwc_window_list, link) {
+ if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
continue;
- hw->client_type = hw->validated_type;
+ hwc_window_data->client_type = hwc_window_data->validated_type;
}
- exynos_output->need_validate = 0;
+ output_data->need_validate = 0;
return TDM_ERROR_NONE;
}
tbm_surface_queue_h
exynos_output_hwc_get_target_buffer_queue(tdm_output *output, tdm_error *error)
{
- tdm_exynos_output_data *exynos_output = output;
+ tdm_exynos_output_data *output_data = output;
tbm_surface_queue_h tqueue = NULL;
if (error)
*error = TDM_ERROR_INVALID_PARAMETER;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, NULL);
+ RETURN_VAL_IF_FAIL(output_data != NULL, NULL);
- if (exynos_output->target_hwc_window == NULL) {
+ if (output_data->target_hwc_window == NULL) {
if (error)
*error = TDM_ERROR_OPERATION_FAILED;
return NULL;
}
- tqueue = exynos_hwc_window_get_tbm_buffer_queue(exynos_output->target_hwc_window, error);
+ tqueue = exynos_hwc_window_get_tbm_buffer_queue(output_data->target_hwc_window, error);
RETURN_VAL_IF_FAIL(tqueue, NULL);
if (error)
tdm_hwc_region damage, tdm_hwc_window **composited_wnds,
uint32_t num_wnds)
{
- tdm_exynos_output_data *exynos_output = output;
- tdm_exynos_hwc_window_data **exynos_hwc_window = NULL;
- tdm_exynos_hwc_window_data *hw = NULL;
+ tdm_exynos_output_data *output_data = output;
+ tdm_exynos_hwc_window_data **composited_list = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
tdm_error err;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(exynos_output->target_hwc_window != NULL, TDM_ERROR_OPERATION_FAILED);
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->target_hwc_window != NULL, TDM_ERROR_OPERATION_FAILED);
- err = exynos_hwc_window_set_buffer(exynos_output->target_hwc_window, buffer);
+ err = exynos_hwc_window_set_buffer(output_data->target_hwc_window, buffer);
RETURN_VAL_IF_FAIL(err == TDM_ERROR_NONE, err);
- err = exynos_hwc_window_set_buffer_damage(exynos_output->target_hwc_window, damage);
+ err = exynos_hwc_window_set_buffer_damage(output_data->target_hwc_window, damage);
RETURN_VAL_IF_FAIL(err == TDM_ERROR_NONE, err);
/* TODO: sergs: think about it
return TDM_ERROR_NONE;
/* to keep a list up to date with one provided by e20 */
- LIST_FOR_EACH_ENTRY(hw, &exynos_output->hwc_window_list, link)
- hw->present_on_target_wnd = 0;
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link)
+ hwc_window_data->present_on_target_wnd = 0;
- exynos_hwc_window = (tdm_exynos_hwc_window_data**)composited_wnds;
+ composited_list = (tdm_exynos_hwc_window_data**)composited_wnds;
for (uint32_t i = 0; i < num_wnds; i++)
- exynos_hwc_window[i]->present_on_target_wnd = 1;
+ composited_list[i]->present_on_target_wnd = 1;
- LIST_FOR_EACH_ENTRY(hw, &exynos_output->hwc_window_list, link)
- if (hw->present_on_target_wnd)
- TDM_INFO("hwc_wnd:%p presents on the target window.", hw);
+ LIST_FOR_EACH_ENTRY(hwc_window_data, &output_data->hwc_window_list, link)
+ if (hwc_window_data->present_on_target_wnd)
+ TDM_INFO("hwc_wnd:%p presents on the target window.", hwc_window_data);
return TDM_ERROR_NONE;
}
tdm_hwc_window *
exynos_output_hwc_create_video_window(tdm_output *output, tdm_error *error)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = NULL;
- tdm_exynos_output_data *exynos_output = output;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
+ tdm_exynos_output_data *output_data = output;
if (error)
*error = TDM_ERROR_INVALID_PARAMETER;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, NULL);
+ RETURN_VAL_IF_FAIL(output_data != NULL, NULL);
if (error)
*error = TDM_ERROR_OPERATION_FAILED;
- if (exynos_output->video_hwc_window)
+ if (output_data->video_hwc_window)
return NULL;
- exynos_hwc_window = _exynos_output_hwc_window_create(exynos_output, NULL, error);
- if (exynos_hwc_window == NULL)
+ hwc_window_data = _exynos_output_hwc_window_create(output_data, NULL, error);
+ if (hwc_window_data == NULL)
return NULL;
- exynos_hwc_window->assigned_layer_zpos = 0;
- exynos_output->video_hwc_window = exynos_hwc_window;
+ hwc_window_data->assigned_layer_zpos = 0;
+ output_data->video_hwc_window = hwc_window_data;
- TDM_DBG("hwc_window(%p) video create", exynos_hwc_window);
+ TDM_DBG("hwc_window_data(%p) video create", hwc_window_data);
if (error)
*error = TDM_ERROR_NONE;
- return exynos_hwc_window;
+ return hwc_window_data;
}
tdm_error
tbm_surface_queue_h
exynos_hwc_window_get_tbm_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = NULL;
- tdm_exynos_output_data *exynos_output = NULL;
+ tdm_exynos_hwc_window_data *hwc_window_data = NULL;
+ tdm_exynos_output_data *output_data = NULL;
tbm_surface_queue_h tqueue = NULL;
tbm_format format;
*error = TDM_ERROR_INVALID_PARAMETER;
RETURN_VAL_IF_FAIL(hwc_window != NULL, NULL);
- exynos_hwc_window = hwc_window;
- exynos_output = exynos_hwc_window->output_data;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, NULL);
- RETURN_VAL_IF_FAIL(exynos_output->video_hwc_window != exynos_hwc_window, NULL);
+ hwc_window_data = hwc_window;
+ output_data = hwc_window_data->output_data;
+ RETURN_VAL_IF_FAIL(output_data != NULL, NULL);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window != hwc_window_data, NULL);
- int wight = exynos_hwc_window->info.src_config.size.h;
- int hight = exynos_hwc_window->info.src_config.size.v;
+ int wight = hwc_window_data->info.src_config.size.h;
+ int hight = hwc_window_data->info.src_config.size.v;
- format = exynos_hwc_window->info.src_config.format;
+ format = hwc_window_data->info.src_config.format;
tqueue = tbm_surface_queue_create(3, wight, hight, format, TBM_BO_SCANOUT);
if (error)
tdm_error
exynos_hwc_window_set_zpos(tdm_hwc_window *hwc_window, uint32_t zpos)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
- tdm_exynos_output_data *exynos_output;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
+ tdm_exynos_output_data *output_data;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
RETURN_VAL_IF_FAIL(zpos < 256, TDM_ERROR_INVALID_PARAMETER);
- exynos_output = exynos_hwc_window->output_data;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(exynos_output->video_hwc_window != exynos_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+ output_data = hwc_window_data->output_data;
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window != hwc_window_data, TDM_ERROR_INVALID_PARAMETER);
- if (exynos_hwc_window->zpos == zpos)
+ if (hwc_window_data->zpos == zpos)
return TDM_ERROR_NONE;
- LIST_DEL(&exynos_hwc_window->link);
+ LIST_DEL(&hwc_window_data->link);
- exynos_hwc_window->zpos = zpos;
+ hwc_window_data->zpos = zpos;
- tdm_exynos_output_insert_hwc_window(exynos_output, exynos_hwc_window);
+ tdm_exynos_output_insert_hwc_window(output_data, hwc_window_data);
- exynos_output->need_validate = 1;
+ output_data->need_validate = 1;
return TDM_ERROR_NONE;
exynos_hwc_window_set_composition_type(tdm_hwc_window *hwc_window,
tdm_hwc_window_composition comp_type)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
- tdm_exynos_output_data *exynos_output = exynos_hwc_window->output_data;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
+ tdm_exynos_output_data *output_data = hwc_window_data->output_data;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(exynos_output->video_hwc_window != exynos_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window != hwc_window_data, TDM_ERROR_INVALID_PARAMETER);
- if (exynos_hwc_window->client_type == comp_type)
+ if (hwc_window_data->client_type == comp_type)
return TDM_ERROR_NONE;
- exynos_hwc_window->client_type = comp_type;
- exynos_output->need_validate = 1;
+ hwc_window_data->client_type = comp_type;
+ output_data->need_validate = 1;
return TDM_ERROR_NONE;
}
tdm_error
exynos_hwc_window_set_buffer_damage(tdm_hwc_window *hwc_window, tdm_hwc_region damage)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
- tdm_exynos_output_data *exynos_output = exynos_hwc_window->output_data;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
+ tdm_exynos_output_data *output_data = hwc_window_data->output_data;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
/* TODO:: */
tdm_error
exynos_hwc_window_set_info(tdm_hwc_window *hwc_window, tdm_hwc_window_info *info)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
- tdm_exynos_output_data *exynos_output;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
+ tdm_exynos_output_data *output_data;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
- exynos_output = exynos_hwc_window->output_data;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ output_data = hwc_window_data->output_data;
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- if (!memcmp(&exynos_hwc_window->info, info, sizeof(tdm_hwc_window_info)))
+ if (!memcmp(&hwc_window_data->info, info, sizeof(tdm_hwc_window_info)))
return TDM_ERROR_NONE;
- if (exynos_output->video_hwc_window == exynos_hwc_window) {
+ if (output_data->video_hwc_window == hwc_window_data) {
tdm_exynos_layer_data *layer;
- layer = _exynos_output_get_layer(exynos_output, exynos_hwc_window->assigned_layer_zpos);
+ layer = _exynos_output_get_layer(output_data, hwc_window_data->assigned_layer_zpos);
return exynos_layer_set_info(layer, (tdm_info_layer *)info);
}
- exynos_hwc_window->info = *info;
- exynos_output->need_validate = 1;
+ hwc_window_data->info = *info;
+ output_data->need_validate = 1;
return TDM_ERROR_NONE;
}
tdm_error
exynos_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h surface)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
- tdm_exynos_output_data *exynos_output;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
+ tdm_exynos_output_data *output_data;
tdm_exynos_data *exynos_data;
tdm_error err = TDM_ERROR_OPERATION_FAILED;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, err);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, err);
- exynos_output = exynos_hwc_window->output_data;
- exynos_data = exynos_hwc_window->exynos_data;
+ output_data = hwc_window_data->output_data;
+ exynos_data = hwc_window_data->exynos_data;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, err);
+ RETURN_VAL_IF_FAIL(output_data != NULL, err);
RETURN_VAL_IF_FAIL(exynos_data != NULL, err);
- if (exynos_hwc_window->surface == surface)
+ if (hwc_window_data->surface == surface)
return TDM_ERROR_NONE;
- exynos_hwc_window->surface = surface;
+ hwc_window_data->surface = surface;
return TDM_ERROR_NONE;
}
tdm_error
exynos_hwc_window_set_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- exynos_hwc_window->flags |= flags;
+ hwc_window_data->flags |= flags;
return TDM_ERROR_NONE;
}
tdm_error
exynos_hwc_window_unset_flags(tdm_hwc_window *hwc_window, tdm_hwc_window_flag flags)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
- RETURN_VAL_IF_FAIL(exynos_hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- exynos_hwc_window->flags &= ~flags;
+ hwc_window_data->flags &= ~flags;
return TDM_ERROR_NONE;
}
exynos_hwc_window_video_get_capability(tdm_hwc_window *hwc_window,
tdm_hwc_window_video_capability *video_capability)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
- tdm_exynos_output_data *exynos_output;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
+ tdm_exynos_output_data *output_data;
- RETURN_VAL_IF_FAIL(hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
- exynos_output = exynos_hwc_window->output_data;
- RETURN_VAL_IF_FAIL(exynos_output != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
+ output_data = hwc_window_data->output_data;
+ RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
RETURN_VAL_IF_FAIL(video_capability != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(exynos_output->video_hwc_window == exynos_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window == hwc_window_data, TDM_ERROR_INVALID_PARAMETER);
*video_capability = 0;
exynos_hwc_window_video_get_available_properties(tdm_hwc_window *hwc_window,
const tdm_prop **props, int *count)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
tdm_exynos_output_data *output_data;
tdm_exynos_layer_data *layer_data;
- RETURN_VAL_IF_FAIL(hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- output_data = exynos_hwc_window->output_data;
+ output_data = hwc_window_data->output_data;
RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(output_data->video_hwc_window == exynos_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window == hwc_window_data, TDM_ERROR_INVALID_PARAMETER);
- layer_data = _exynos_output_get_layer(output_data, exynos_hwc_window->assigned_layer_zpos);
+ layer_data = _exynos_output_get_layer(output_data, hwc_window_data->assigned_layer_zpos);
return exynos_layer_get_available_properties(layer_data, props, count);
}
tdm_error
exynos_hwc_window_video_get_property(tdm_hwc_window *hwc_window, unsigned int id, tdm_value *value)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
tdm_exynos_output_data *output_data;
tdm_exynos_layer_data *layer_data;
- RETURN_VAL_IF_FAIL(hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- output_data = exynos_hwc_window->output_data;
+ output_data = hwc_window_data->output_data;
RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(output_data->video_hwc_window == exynos_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window == hwc_window_data, TDM_ERROR_INVALID_PARAMETER);
- layer_data = _exynos_output_get_layer(output_data, exynos_hwc_window->assigned_layer_zpos);
+ layer_data = _exynos_output_get_layer(output_data, hwc_window_data->assigned_layer_zpos);
return exynos_layer_get_property(layer_data, id, value);
}
tdm_error
exynos_hwc_window_video_set_property(tdm_hwc_window *hwc_window, unsigned int id, tdm_value value)
{
- tdm_exynos_hwc_window_data *exynos_hwc_window = hwc_window;
+ tdm_exynos_hwc_window_data *hwc_window_data = hwc_window;
tdm_exynos_output_data *output_data;
tdm_exynos_layer_data *layer_data;
- RETURN_VAL_IF_FAIL(hwc_window != NULL, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- output_data = exynos_hwc_window->output_data;
+ output_data = hwc_window_data->output_data;
RETURN_VAL_IF_FAIL(output_data != NULL, TDM_ERROR_INVALID_PARAMETER);
- RETURN_VAL_IF_FAIL(output_data->video_hwc_window == exynos_hwc_window, TDM_ERROR_INVALID_PARAMETER);
+ RETURN_VAL_IF_FAIL(output_data->video_hwc_window == hwc_window_data, TDM_ERROR_INVALID_PARAMETER);
- layer_data = _exynos_output_get_layer(output_data, exynos_hwc_window->assigned_layer_zpos);
+ layer_data = _exynos_output_get_layer(output_data, hwc_window_data->assigned_layer_zpos);
return exynos_layer_set_property(layer_data, id, value);
}