Skip to content

Commit 4ecdf5c

Browse files
author
Shubhashree Dhar
committed
drm/msm/sde: check for ppsplit topology from current state
During pm suspend-resume cases, topology is reset and ppsplit flag is set to false based on previous connector state. This leads to incorrect interface config resulting in pptimeout. Made changes to update the ppsplit flag based on current connector state to avoid this. Change-Id: Id42313036eda98e5109083b0d57a778f1262f3fd Signed-off-by: Shubhashree Dhar <[email protected]>
1 parent 20c5e69 commit 4ecdf5c

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

drivers/gpu/drm/msm/sde/sde_crtc.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,14 +1391,24 @@ static u32 _sde_crtc_get_displays_affected(struct drm_crtc *crtc,
13911391
{
13921392
struct sde_crtc *sde_crtc;
13931393
struct sde_crtc_state *crtc_state;
1394+
struct drm_encoder *encoder;
13941395
u32 disp_bitmask = 0;
13951396
int i;
1397+
bool is_ppsplit = false;
13961398

13971399
sde_crtc = to_sde_crtc(crtc);
13981400
crtc_state = to_sde_crtc_state(state);
13991401

1402+
list_for_each_entry(encoder,
1403+
&crtc->dev->mode_config.encoder_list, head) {
1404+
if (encoder->crtc != state->crtc)
1405+
continue;
1406+
1407+
is_ppsplit |= sde_encoder_is_topology_ppsplit(encoder);
1408+
}
1409+
14001410
/* pingpong split: one ROI, one LM, two physical displays */
1401-
if (crtc_state->is_ppsplit) {
1411+
if (is_ppsplit) {
14021412
u32 lm_split_width = crtc_state->lm_bounds[0].w / 2;
14031413
struct sde_rect *roi = &crtc_state->lm_roi[0];
14041414

drivers/gpu/drm/msm/sde/sde_encoder.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,24 @@ bool sde_encoder_in_clone_mode(struct drm_encoder *drm_enc)
943943
return false;
944944
}
945945

946+
bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc)
947+
{
948+
struct sde_encoder_virt *sde_enc;
949+
struct sde_encoder_phys *master;
950+
951+
if (!drm_enc)
952+
return false;
953+
954+
sde_enc = to_sde_encoder_virt(drm_enc);
955+
master = sde_enc->cur_master;
956+
957+
if (!master || !master->connector)
958+
return false;
959+
960+
return (sde_connector_get_topology_name(master->connector)
961+
== SDE_RM_TOPOLOGY_PPSPLIT);
962+
}
963+
946964
static int sde_encoder_virt_atomic_check(
947965
struct drm_encoder *drm_enc,
948966
struct drm_crtc_state *crtc_state,

drivers/gpu/drm/msm/sde/sde_encoder.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@ void sde_encoder_recovery_events_handler(struct drm_encoder *encoder,
284284
*/
285285
bool sde_encoder_in_clone_mode(struct drm_encoder *enc);
286286

287+
/**
288+
*sde_encoder_is_topology_ppsplit - checks if the current encoder is in
289+
ppsplit topology.
290+
*@drm_enc: Pointer to drm encoder structure
291+
*@Return: true if the present topology is ppsplit
292+
*/
293+
bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc);
294+
287295
/**
288296
* sde_encoder_is_primary_display - checks if underlying display is primary
289297
* display or not.

0 commit comments

Comments
 (0)