static int
_sprd_hwc_window_can_set_on_hw_layer(tdm_sprd_hwc_window_data *hwc_window_data)
{
- if (!_sprd_hwc_window_has_reserved_buffer(hwc_window_data))
- return 0;
-
if (hwc_window_data->info.transform != TDM_TRANSFORM_NORMAL)
return 0;
goto set_clients_below;
/* NUM_UI_LAYSERS is 1, so device_count always 1 at this point */
- for (i = 0; i < device_count; i++) {
+ while (device_count > 0) {
/* for video */
if (composited_list[next_idx]->client_type == TDM_COMPOSITION_VIDEO) {
composited_list[next_idx]->validated_type = TDM_COMPOSITION_VIDEO;
continue;
}
+ /* set clients below when sprd can not set the window to the hw layer */
+ if (!_sprd_hwc_window_can_set_on_hw_layer(composited_list[next_idx]))
+ break;
+
/* set the buffer_queue constraint */
composited_list[next_idx]->constraints = TDM_CONSTRAINT_BUFFER_QUEUE;
- if (!_sprd_hwc_window_can_set_on_hw_layer(composited_list[next_idx])) {
+
+ /* set clients below when the hwc_window does not have the reserved buffer */
+ if (!_sprd_hwc_window_has_reserved_buffer(composited_list[next_idx])) {
composited_list[next_idx]->validated_type = TDM_COMPOSITION_CLIENT;
composited_list[next_idx]->lzpos = -1;
next_idx++;