Skip to content

Commit

Permalink
drm/msm/sde: check for ppsplit topology from current state
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Shubhashree Dhar committed Aug 5, 2019
1 parent 20c5e69 commit 4ecdf5c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/gpu/drm/msm/sde/sde_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,14 +1391,24 @@ static u32 _sde_crtc_get_displays_affected(struct drm_crtc *crtc,
{
struct sde_crtc *sde_crtc;
struct sde_crtc_state *crtc_state;
struct drm_encoder *encoder;
u32 disp_bitmask = 0;
int i;
bool is_ppsplit = false;

sde_crtc = to_sde_crtc(crtc);
crtc_state = to_sde_crtc_state(state);

list_for_each_entry(encoder,
&crtc->dev->mode_config.encoder_list, head) {
if (encoder->crtc != state->crtc)
continue;

is_ppsplit |= sde_encoder_is_topology_ppsplit(encoder);
}

/* pingpong split: one ROI, one LM, two physical displays */
if (crtc_state->is_ppsplit) {
if (is_ppsplit) {
u32 lm_split_width = crtc_state->lm_bounds[0].w / 2;
struct sde_rect *roi = &crtc_state->lm_roi[0];

Expand Down
18 changes: 18 additions & 0 deletions drivers/gpu/drm/msm/sde/sde_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,24 @@ bool sde_encoder_in_clone_mode(struct drm_encoder *drm_enc)
return false;
}

bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc)
{
struct sde_encoder_virt *sde_enc;
struct sde_encoder_phys *master;

if (!drm_enc)
return false;

sde_enc = to_sde_encoder_virt(drm_enc);
master = sde_enc->cur_master;

if (!master || !master->connector)
return false;

return (sde_connector_get_topology_name(master->connector)
== SDE_RM_TOPOLOGY_PPSPLIT);
}

static int sde_encoder_virt_atomic_check(
struct drm_encoder *drm_enc,
struct drm_crtc_state *crtc_state,
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/msm/sde/sde_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ void sde_encoder_recovery_events_handler(struct drm_encoder *encoder,
*/
bool sde_encoder_in_clone_mode(struct drm_encoder *enc);

/**
*sde_encoder_is_topology_ppsplit - checks if the current encoder is in
ppsplit topology.
*@drm_enc: Pointer to drm encoder structure
*@Return: true if the present topology is ppsplit
*/
bool sde_encoder_is_topology_ppsplit(struct drm_encoder *drm_enc);

/**
* sde_encoder_is_primary_display - checks if underlying display is primary
* display or not.
Expand Down

1 comment on commit 4ecdf5c

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already cherry-picked, see: aeb5d45

Please sign in to comment.