drm/msm/sde: use current encoders to determine crtc interface
Instead of using the cached interface type, which is updated during fence preparation time, determine interface type by enumerating over all matching encoders and query the interface directly. This avoids pontential stale interface types due to changing connector state. CRs-Fixed: 2009714 Change-Id: I31e1350cc62cafb5f014c0f32514d0692dec42d0 Signed-off-by: Alan Kwong <akwong@codeaurora.org>
This commit is contained in:
parent
9e89f2eed8
commit
b72cb5dea4
2 changed files with 19 additions and 15 deletions
|
@ -367,12 +367,6 @@ void sde_crtc_prepare_commit(struct drm_crtc *crtc,
|
||||||
cstate->is_rt = true;
|
cstate->is_rt = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cstate->num_connectors > 0 && cstate->connectors[0]->encoder)
|
|
||||||
cstate->intf_mode = sde_encoder_get_intf_mode(
|
|
||||||
cstate->connectors[0]->encoder);
|
|
||||||
else
|
|
||||||
cstate->intf_mode = INTF_MODE_NONE;
|
|
||||||
|
|
||||||
/* prepare main output fence */
|
/* prepare main output fence */
|
||||||
sde_fence_prepare(&sde_crtc->output_fence);
|
sde_fence_prepare(&sde_crtc->output_fence);
|
||||||
}
|
}
|
||||||
|
@ -423,6 +417,22 @@ static void _sde_crtc_complete_flip(struct drm_crtc *crtc,
|
||||||
spin_unlock_irqrestore(&dev->event_lock, flags);
|
spin_unlock_irqrestore(&dev->event_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum sde_intf_mode sde_crtc_get_intf_mode(struct drm_crtc *crtc)
|
||||||
|
{
|
||||||
|
struct drm_encoder *encoder;
|
||||||
|
|
||||||
|
if (!crtc || !crtc->dev) {
|
||||||
|
SDE_ERROR("invalid crtc\n");
|
||||||
|
return INTF_MODE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
drm_for_each_encoder(encoder, crtc->dev)
|
||||||
|
if (encoder->crtc == crtc)
|
||||||
|
return sde_encoder_get_intf_mode(encoder);
|
||||||
|
|
||||||
|
return INTF_MODE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
static void sde_crtc_vblank_cb(void *data)
|
static void sde_crtc_vblank_cb(void *data)
|
||||||
{
|
{
|
||||||
struct drm_crtc *crtc = (struct drm_crtc *)data;
|
struct drm_crtc *crtc = (struct drm_crtc *)data;
|
||||||
|
@ -1658,7 +1668,7 @@ static int sde_crtc_debugfs_state_show(struct seq_file *s, void *v)
|
||||||
|
|
||||||
seq_printf(s, "num_connectors: %d\n", cstate->num_connectors);
|
seq_printf(s, "num_connectors: %d\n", cstate->num_connectors);
|
||||||
seq_printf(s, "is_rt: %d\n", cstate->is_rt);
|
seq_printf(s, "is_rt: %d\n", cstate->is_rt);
|
||||||
seq_printf(s, "intf_mode: %d\n", cstate->intf_mode);
|
seq_printf(s, "intf_mode: %d\n", sde_crtc_get_intf_mode(crtc));
|
||||||
seq_printf(s, "bw_ctl: %llu\n", cstate->cur_perf.bw_ctl);
|
seq_printf(s, "bw_ctl: %llu\n", cstate->cur_perf.bw_ctl);
|
||||||
seq_printf(s, "core_clk_rate: %u\n", cstate->cur_perf.core_clk_rate);
|
seq_printf(s, "core_clk_rate: %u\n", cstate->cur_perf.core_clk_rate);
|
||||||
seq_printf(s, "max_per_pipe_ib: %llu\n",
|
seq_printf(s, "max_per_pipe_ib: %llu\n",
|
||||||
|
|
|
@ -246,16 +246,10 @@ void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file);
|
||||||
bool sde_crtc_is_rt(struct drm_crtc *crtc);
|
bool sde_crtc_is_rt(struct drm_crtc *crtc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sde_crtc_get_intf_mode - get interface mode of the given crtc
|
* sde_crtc_get_intf_mode - get primary interface mode of the given crtc
|
||||||
* @crtc: Pointert to crtc
|
* @crtc: Pointert to crtc
|
||||||
*/
|
*/
|
||||||
static inline enum sde_intf_mode sde_crtc_get_intf_mode(struct drm_crtc *crtc)
|
enum sde_intf_mode sde_crtc_get_intf_mode(struct drm_crtc *crtc);
|
||||||
{
|
|
||||||
struct sde_crtc_state *cstate =
|
|
||||||
crtc ? to_sde_crtc_state(crtc->state) : NULL;
|
|
||||||
|
|
||||||
return cstate ? cstate->intf_mode : INTF_MODE_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sde_core_perf_crtc_is_wb - check if writeback is primary output of this crtc
|
* sde_core_perf_crtc_is_wb - check if writeback is primary output of this crtc
|
||||||
|
|
Loading…
Add table
Reference in a new issue