|
@@ -1924,55 +1924,35 @@ static int _sde_rm_make_next_rsvp(struct sde_rm *rm, struct drm_encoder *enc,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-static int _sde_rm_update_pipe_cnt_from_active(
|
|
|
+static int _sde_rm_update_active_only_pipes(
|
|
|
struct sde_splash_display *splash_display,
|
|
|
u32 active_pipes_mask)
|
|
|
{
|
|
|
+ struct sde_sspp_index_info *pipe_info;
|
|
|
int i;
|
|
|
- u32 sspp_present = 0, space_remain = 0;
|
|
|
|
|
|
if (!active_pipes_mask) {
|
|
|
return 0;
|
|
|
} else if (!splash_display) {
|
|
|
SDE_ERROR("invalid splash display provided\n");
|
|
|
return -EINVAL;
|
|
|
- } else if (splash_display->pipe_cnt >=
|
|
|
- ARRAY_SIZE(splash_display->pipes)) {
|
|
|
- SDE_ERROR("no room to add active pipes to pipe array\n");
|
|
|
- return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- for (i = 0; i < splash_display->pipe_cnt; i++)
|
|
|
- sspp_present |= BIT(splash_display->pipes[i].sspp);
|
|
|
-
|
|
|
- space_remain = ARRAY_SIZE(splash_display->pipes)
|
|
|
- - splash_display->pipe_cnt;
|
|
|
-
|
|
|
+ pipe_info = &splash_display->pipe_info;
|
|
|
for (i = SSPP_VIG0; i < SSPP_MAX; i++) {
|
|
|
- /* Skip planes already present in the array */
|
|
|
- if (!(active_pipes_mask & BIT(i)) ||
|
|
|
- (sspp_present & BIT(i)))
|
|
|
+ if (!(active_pipes_mask & BIT(i)))
|
|
|
continue;
|
|
|
|
|
|
- if (space_remain < R_MAX) {
|
|
|
- SDE_ERROR("not enough room to add active pipe %d", i);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
+ if (test_bit(i, pipe_info->pipes) || test_bit(i, pipe_info->virt_pipes))
|
|
|
+ continue;
|
|
|
|
|
|
/*
|
|
|
- * A plane in active but not sspp_present indicates a non-pixel
|
|
|
+ * A pipe is active but not staged indicates a non-pixel
|
|
|
* plane. Register both rectangles as we can't differentiate
|
|
|
*/
|
|
|
- splash_display->pipes[splash_display->pipe_cnt].sspp = i;
|
|
|
- splash_display->pipes[splash_display->pipe_cnt].is_virtual =
|
|
|
- false;
|
|
|
- splash_display->pipe_cnt++;
|
|
|
- space_remain--;
|
|
|
- splash_display->pipes[splash_display->pipe_cnt].sspp = i;
|
|
|
- splash_display->pipes[splash_display->pipe_cnt].is_virtual =
|
|
|
- true;
|
|
|
- splash_display->pipe_cnt++;
|
|
|
- space_remain--;
|
|
|
+ set_bit(i, pipe_info->pipes);
|
|
|
+ set_bit(i, pipe_info->virt_pipes);
|
|
|
+ SDE_DEBUG("pipe %d is active:0x%x but not staged\n", i, active_pipes_mask);
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
@@ -1990,10 +1970,10 @@ static int _sde_rm_get_hw_blk_for_cont_splash(struct sde_rm *rm,
|
|
|
struct sde_hw_ctl *ctl,
|
|
|
struct sde_splash_display *splash_display)
|
|
|
{
|
|
|
- u32 lm_reg, max_cnt, active_pipes_mask = 0;
|
|
|
+ u32 active_pipes_mask = 0;
|
|
|
struct sde_rm_hw_iter iter_lm, iter_dsc;
|
|
|
struct sde_kms *sde_kms;
|
|
|
- size_t start_count;
|
|
|
+ size_t pipes_per_lm;
|
|
|
|
|
|
if (!rm || !ctl || !splash_display) {
|
|
|
SDE_ERROR("invalid input parameters\n");
|
|
@@ -2001,7 +1981,6 @@ static int _sde_rm_get_hw_blk_for_cont_splash(struct sde_rm *rm,
|
|
|
}
|
|
|
|
|
|
sde_kms = container_of(rm, struct sde_kms, rm);
|
|
|
- max_cnt = ARRAY_SIZE(splash_display->pipes);
|
|
|
|
|
|
sde_rm_init_hw_iter(&iter_lm, 0, SDE_HW_BLK_LM);
|
|
|
sde_rm_init_hw_iter(&iter_dsc, 0, SDE_HW_BLK_DSC);
|
|
@@ -2009,48 +1988,28 @@ static int _sde_rm_get_hw_blk_for_cont_splash(struct sde_rm *rm,
|
|
|
if (splash_display->lm_cnt >= MAX_DATA_PATH_PER_DSIPLAY)
|
|
|
break;
|
|
|
|
|
|
- lm_reg = ctl->ops.read_ctl_layers(ctl, iter_lm.blk->id);
|
|
|
- if (!lm_reg)
|
|
|
- continue;
|
|
|
-
|
|
|
- splash_display->lm_ids[splash_display->lm_cnt++] =
|
|
|
- iter_lm.blk->id;
|
|
|
- SDE_DEBUG("lm_cnt=%d lm_reg[%d]=0x%x\n", splash_display->lm_cnt,
|
|
|
- iter_lm.blk->id - LM_0, lm_reg);
|
|
|
-
|
|
|
- start_count = splash_display->pipe_cnt;
|
|
|
if (ctl->ops.get_staged_sspp) {
|
|
|
- struct sde_sspp_index_info *start =
|
|
|
- &splash_display->pipes[
|
|
|
- splash_display->pipe_cnt];
|
|
|
-
|
|
|
- splash_display->pipe_cnt += ctl->ops.get_staged_sspp(
|
|
|
- ctl, iter_lm.blk->id, start,
|
|
|
- max_cnt - splash_display->pipe_cnt);
|
|
|
- }
|
|
|
-
|
|
|
- if (sde_kms->splash_data.type == SDE_VM_HANDOFF) {
|
|
|
- /* Allow VM handoff without any pipes, as it is a
|
|
|
- * valid case to have NULL commit before the
|
|
|
- * transition.
|
|
|
- */
|
|
|
- SDE_DEBUG("VM handoff with no pipes staged\n");
|
|
|
- } else if (start_count == splash_display->pipe_cnt) {
|
|
|
- SDE_ERROR("no pipes detected on LM-%d\n",
|
|
|
- iter_lm.blk->id - LM_0);
|
|
|
- return 0;
|
|
|
- } else if (splash_display->pipe_cnt > max_cnt) {
|
|
|
- SDE_ERROR("found %d pipes exceed max of %d\n",
|
|
|
- splash_display->pipe_cnt, max_cnt);
|
|
|
- return 0;
|
|
|
+ // reset bordercolor from previous LM
|
|
|
+ splash_display->pipe_info.bordercolor = false;
|
|
|
+ pipes_per_lm = ctl->ops.get_staged_sspp(
|
|
|
+ ctl, iter_lm.blk->id,
|
|
|
+ &splash_display->pipe_info);
|
|
|
+ if (pipes_per_lm ||
|
|
|
+ splash_display->pipe_info.bordercolor) {
|
|
|
+ splash_display->lm_ids[splash_display->lm_cnt++] =
|
|
|
+ iter_lm.blk->id;
|
|
|
+ SDE_DEBUG("lm_cnt=%d lm_id %d pipe_cnt%d\n",
|
|
|
+ splash_display->lm_cnt,
|
|
|
+ iter_lm.blk->id - LM_0,
|
|
|
+ pipes_per_lm);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (ctl->ops.get_active_pipes)
|
|
|
active_pipes_mask = ctl->ops.get_active_pipes(ctl);
|
|
|
|
|
|
- if (_sde_rm_update_pipe_cnt_from_active(splash_display,
|
|
|
- active_pipes_mask))
|
|
|
+ if (_sde_rm_update_active_only_pipes(splash_display, active_pipes_mask))
|
|
|
return 0;
|
|
|
|
|
|
while (_sde_rm_get_hw_locked(rm, &iter_dsc)) {
|