}
static int
+_vc4_hwc_cursor_buffer_unset(tdm_vc4_hwc_window_data *hwc_window_data)
+{
+ hwc_window_data->surface = NULL;
+ hwc_window_data->cursor_img_surface = 0;
+
+ hwc_window_data->info.src_config.pos.w = hwc_window_data->cursor_img.width;
+ hwc_window_data->info.src_config.pos.h = hwc_window_data->cursor_img.height;
+ hwc_window_data->info.dst_pos.w = hwc_window_data->cursor_img.width;
+ hwc_window_data->info.dst_pos.h = hwc_window_data->cursor_img.height;
+
+ return 1;
+}
+
+static int
_vc4_hwc_cursor_buffer_set(tdm_vc4_hwc_data *hwc_data, tdm_vc4_hwc_window_data *hwc_window_data)
{
tbm_surface_h cursor_tsurface = NULL;
int src_stride;
int i;
- if (!hwc_window_data->cursor_img_refresh)
+ if (!hwc_window_data->cursor_img_refresh && hwc_window_data->surface)
return 1;
img_w = hwc_window_data->cursor_img.width;
tbm_surface_unmap(hwc_data->cursor_tsurface);
hwc_window_data->surface = hwc_data->cursor_tsurface;
+ hwc_window_data->cursor_img_surface = 1;
/* fix the dst_pos info of the cursor window */
hwc_window_data->info.src_config.pos.w = new_w;
/* set the hwc_windows to the layers */
LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &hwc_data->hwc_window_list, link) {
if (hwc_window_data->validated_type == TDM_HWC_WIN_COMPOSITION_NONE ||
- hwc_window_data->validated_type == TDM_HWC_WIN_COMPOSITION_CLIENT)
+ hwc_window_data->validated_type == TDM_HWC_WIN_COMPOSITION_CLIENT) {
+
+ if (hwc_window_data->cursor_img_surface)
+ _vc4_hwc_cursor_buffer_unset(hwc_window_data);
+
continue;
+ }
if (hwc_window_data == hwc_data->target_hwc_window)
continue;