struct _tdm_sprd_hwc_window_data {
struct list_head link;
- /* data which are fixed at initializing */
tdm_sprd_hwc_data *hwc_data;
- /* not fixed data below */
- tdm_hwc_window_info info;
- int info_changed;
+ tdm_hwc_window_info info; /* latest window information */
+ tbm_surface_h surface; /* latest buffer to be set */
+ tdm_hwc_window_composition client_type; /* composition type set by client(compositor) */
- tdm_sprd_display_buffer *display_buffer;
- int display_buffer_changed;
- int enabled_flag;
-
- /* client_type stores the initial type given to us by client(compositor) */
- tdm_hwc_window_composition client_type;
- /* validated_type stores the type after running Validate */
- tdm_hwc_window_composition validated_type;
+ tdm_hwc_window_composition validated_type; /* composition type after validation */
+ int zpos; /* layer's zpos to be assigned after validation */
int constraints;
tbm_surface_queue_h tqueue;
-
- int zpos;
};
uint32_t tdm_sprd_format_to_drm_format(tbm_format format);
int falgs = 0;
RETURN_VAL_IF_FAIL(hwc_window_data != NULL, 0);
- RETURN_VAL_IF_FAIL(hwc_window_data->display_buffer != NULL, 0);
+ RETURN_VAL_IF_FAIL(hwc_window_data->surface != NULL, 0);
- bo = tbm_surface_internal_get_bo(hwc_window_data->display_buffer->buffer, 0);
+ bo = tbm_surface_internal_get_bo(hwc_window_data->surface, 0);
RETURN_VAL_IF_FAIL(bo != NULL, 0);
falgs = tbm_bo_get_flags(bo);
static int
_sprd_can_set_hwc_window_on_hw_layer(tdm_sprd_hwc_window_data *hwc_window_data)
{
- if (!hwc_window_data->display_buffer)
- return 0;
-
if (!_sprd_hwc_window_is_reserved_buffer(hwc_window_data))
return 0;
RETURN_VAL_IF_FAIL(layer_data, TDM_ERROR_OPERATION_FAILED);
- if (hwc_window_data == NULL || hwc_window_data->display_buffer == NULL) {
+ if (hwc_window_data == NULL || hwc_window_data->surface == NULL) {
if (layer_data->display_buffer)
ret = sprd_layer_unset_buffer(layer_data);
RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
} else {
ret = sprd_layer_set_info((tdm_layer *)layer_data, (tdm_info_layer *)&(hwc_window_data->info));
RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
- RETURN_VAL_IF_FAIL(hwc_window_data->display_buffer != NULL, TDM_ERROR_INVALID_PARAMETER);
- ret = sprd_layer_set_buffer(layer_data, hwc_window_data->display_buffer->buffer);
+ RETURN_VAL_IF_FAIL(hwc_window_data->surface != NULL, TDM_ERROR_INVALID_PARAMETER);
+ ret = sprd_layer_set_buffer(layer_data, hwc_window_data->surface);
RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
}
sprd_hwc_window_set_buffer(tdm_hwc_window *hwc_window, tbm_surface_h surface)
{
tdm_sprd_hwc_window_data *hwc_window_data = hwc_window;
- tdm_sprd_hwc_data *hwc_data;
- tdm_sprd_output_data *output_data;
- tdm_sprd_data *sprd_data;
tdm_error err = TDM_ERROR_OPERATION_FAILED;
- tdm_sprd_display_buffer *display_buffer = NULL;
-
RETURN_VAL_IF_FAIL(hwc_window_data != NULL, err);
- hwc_data = hwc_window_data->hwc_data;
- RETURN_VAL_IF_FAIL(hwc_data != NULL, err);
- output_data = hwc_data->output_data;
- RETURN_VAL_IF_FAIL(hwc_data != NULL, err);
- sprd_data = output_data->sprd_data;
- RETURN_VAL_IF_FAIL(sprd_data != NULL, err);
-
- if (!surface) {
- hwc_window_data->display_buffer = NULL;
- return TDM_ERROR_NONE;
- }
-
- display_buffer = tdm_sprd_display_find_buffer(sprd_data, surface);
- if (!display_buffer) {
- display_buffer = tdm_sprd_display_creat_buffer(sprd_data, surface, &err);
- RETURN_VAL_IF_FAIL(display_buffer != NULL, err);
- LIST_ADDTAIL(&display_buffer->link, &sprd_data->buffer_list);
- }
- if (hwc_window_data->display_buffer == display_buffer)
+ if (hwc_window_data->surface == surface)
return TDM_ERROR_NONE;
- hwc_window_data->display_buffer = display_buffer;
+ hwc_window_data->surface = surface;
return TDM_ERROR_NONE;
}