Loading drivers/gpu/drm/msm/sde/sde_crtc.c +21 −8 Original line number Diff line number Diff line Loading @@ -4487,28 +4487,41 @@ static int pstate_cmp(const void *a, const void *b) } static int _sde_crtc_excl_rect_overlap_check(struct plane_state pstates[], int cnt, int curr_cnt, struct sde_rect *excl_rect, int z_pos) int cnt, int curr_cnt, struct sde_rect *excl_rect) { struct sde_rect dst_rect, intersect; int i, rc = -EINVAL; const struct drm_plane_state *pstate; /* start checking from next plane */ for (i = curr_cnt; i < cnt; i++) { for (i = 0; i < cnt; i++) { if (i == curr_cnt) continue; pstate = pstates[i].drm_pstate; POPULATE_RECT(&dst_rect, pstate->crtc_x, pstate->crtc_y, pstate->crtc_w, pstate->crtc_h, false); sde_kms_rect_intersect(&dst_rect, excl_rect, &intersect); /* complete intersection of excl_rect is required */ if (intersect.w == excl_rect->w && intersect.h == excl_rect->h /* next plane may be on same z-order */ && z_pos != pstates[i].stage) { /* intersecting rect should be in another z_order */ && pstates[curr_cnt].stage != pstates[i].stage) { rc = 0; goto end; } } SDE_ERROR("excl rect does not find top overlapping rect\n"); SDE_ERROR( "no overlapping rect for [%d] z_pos:%d, excl_rect:{%d,%d,%d,%d}\n", i, pstates[curr_cnt].stage, excl_rect->x, excl_rect->y, excl_rect->w, excl_rect->h); for (i = 0; i < cnt; i++) { pstate = pstates[i].drm_pstate; SDE_ERROR("[%d] p:%d, z_pos:%d, src:{%d,%d,%d,%d}\n", i, pstate->plane->base.id, pstates[i].stage, pstate->crtc_x, pstate->crtc_y, pstate->crtc_w, pstate->crtc_h); } end: return rc; } Loading Loading @@ -4550,9 +4563,9 @@ static int _sde_crtc_excl_dim_layer_check(struct drm_crtc_state *state, pstate = pstates[i].drm_pstate; sde_pstate = to_sde_plane_state(pstate); if (sde_pstate->excl_rect.w && sde_pstate->excl_rect.h) { /* check overlap on all top z-order */ /* check overlap on any other z-order */ rc = _sde_crtc_excl_rect_overlap_check(pstates, cnt, i + 1, &sde_pstate->excl_rect, pstates[i].stage); i, &sde_pstate->excl_rect); if (rc) goto end; } Loading Loading
drivers/gpu/drm/msm/sde/sde_crtc.c +21 −8 Original line number Diff line number Diff line Loading @@ -4487,28 +4487,41 @@ static int pstate_cmp(const void *a, const void *b) } static int _sde_crtc_excl_rect_overlap_check(struct plane_state pstates[], int cnt, int curr_cnt, struct sde_rect *excl_rect, int z_pos) int cnt, int curr_cnt, struct sde_rect *excl_rect) { struct sde_rect dst_rect, intersect; int i, rc = -EINVAL; const struct drm_plane_state *pstate; /* start checking from next plane */ for (i = curr_cnt; i < cnt; i++) { for (i = 0; i < cnt; i++) { if (i == curr_cnt) continue; pstate = pstates[i].drm_pstate; POPULATE_RECT(&dst_rect, pstate->crtc_x, pstate->crtc_y, pstate->crtc_w, pstate->crtc_h, false); sde_kms_rect_intersect(&dst_rect, excl_rect, &intersect); /* complete intersection of excl_rect is required */ if (intersect.w == excl_rect->w && intersect.h == excl_rect->h /* next plane may be on same z-order */ && z_pos != pstates[i].stage) { /* intersecting rect should be in another z_order */ && pstates[curr_cnt].stage != pstates[i].stage) { rc = 0; goto end; } } SDE_ERROR("excl rect does not find top overlapping rect\n"); SDE_ERROR( "no overlapping rect for [%d] z_pos:%d, excl_rect:{%d,%d,%d,%d}\n", i, pstates[curr_cnt].stage, excl_rect->x, excl_rect->y, excl_rect->w, excl_rect->h); for (i = 0; i < cnt; i++) { pstate = pstates[i].drm_pstate; SDE_ERROR("[%d] p:%d, z_pos:%d, src:{%d,%d,%d,%d}\n", i, pstate->plane->base.id, pstates[i].stage, pstate->crtc_x, pstate->crtc_y, pstate->crtc_w, pstate->crtc_h); } end: return rc; } Loading Loading @@ -4550,9 +4563,9 @@ static int _sde_crtc_excl_dim_layer_check(struct drm_crtc_state *state, pstate = pstates[i].drm_pstate; sde_pstate = to_sde_plane_state(pstate); if (sde_pstate->excl_rect.w && sde_pstate->excl_rect.h) { /* check overlap on all top z-order */ /* check overlap on any other z-order */ rc = _sde_crtc_excl_rect_overlap_check(pstates, cnt, i + 1, &sde_pstate->excl_rect, pstates[i].stage); i, &sde_pstate->excl_rect); if (rc) goto end; } Loading