disp: msm: sde: modify check for active datapaths
In some cases like suspend and cwb concurrencies, the number of mixers in the sde_crtc structure can become zero. Add support to get the number of mixers from topology in those cases to avoid incorrect resource allocation request. Change-Id: Id9b82e805ff50a107ad06514b4e41c0917abdf33 Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
This commit is contained in:

committed by
Nilaan Gunabalachandran

orang tua
7116441b24
melakukan
5541a20748
@@ -4945,6 +4945,43 @@ end:
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* sde_crtc_get_num_datapath - get the number of datapath active
|
||||
* of primary connector
|
||||
* @crtc: Pointer to DRM crtc object
|
||||
* @connector: Pointer to DRM connector object of WB in CWB case
|
||||
*/
|
||||
int sde_crtc_get_num_datapath(struct drm_crtc *crtc,
|
||||
struct drm_connector *connector)
|
||||
{
|
||||
struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
|
||||
struct sde_connector_state *sde_conn_state = NULL;
|
||||
struct drm_connector *conn;
|
||||
struct drm_connector_list_iter conn_iter;
|
||||
|
||||
if (!sde_crtc || !connector) {
|
||||
SDE_DEBUG("Invalid argument\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sde_crtc->num_mixers)
|
||||
return sde_crtc->num_mixers;
|
||||
|
||||
drm_connector_list_iter_begin(crtc->dev, &conn_iter);
|
||||
drm_for_each_connector_iter(conn, &conn_iter) {
|
||||
if (conn->state && conn->state->crtc == crtc &&
|
||||
conn != connector)
|
||||
sde_conn_state = to_sde_connector_state(conn->state);
|
||||
}
|
||||
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
|
||||
if (sde_conn_state)
|
||||
return sde_conn_state->mode_info.topology.num_lm;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sde_crtc_vblank(struct drm_crtc *crtc, bool en)
|
||||
{
|
||||
struct sde_crtc *sde_crtc;
|
||||
|
@@ -502,17 +502,6 @@ static inline int sde_crtc_get_mixer_height(struct sde_crtc *sde_crtc,
|
||||
cstate->ds_cfg[0].lm_height : mode->vdisplay);
|
||||
}
|
||||
|
||||
/**
|
||||
* sde_crtc_get_num_datapath - get the number of datapath active
|
||||
* @crtc: Pointer to drm crtc object
|
||||
*/
|
||||
static inline int sde_crtc_get_num_datapath(struct drm_crtc *crtc)
|
||||
{
|
||||
struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
|
||||
|
||||
return sde_crtc ? sde_crtc->num_mixers : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* sde_crtc_frame_pending - retun the number of pending frames
|
||||
* @crtc: Pointer to drm crtc object
|
||||
@@ -892,4 +881,13 @@ void sde_crtc_static_img_control(struct drm_crtc *crtc,
|
||||
*/
|
||||
void sde_crtc_static_cache_read_kickoff(struct drm_crtc *crtc);
|
||||
|
||||
/**
|
||||
* sde_crtc_get_num_datapath - get the number of datapath active
|
||||
* of primary connector
|
||||
* @crtc: Pointer to DRM crtc object
|
||||
* @connector: Pointer to DRM connector object of WB in CWB case
|
||||
*/
|
||||
int sde_crtc_get_num_datapath(struct drm_crtc *crtc,
|
||||
struct drm_connector *connector);
|
||||
|
||||
#endif /* _SDE_CRTC_H_ */
|
||||
|
@@ -1954,7 +1954,7 @@ static int _sde_rm_populate_requirements(
|
||||
struct sde_rm_requirements *reqs)
|
||||
{
|
||||
const struct drm_display_mode *mode = &crtc_state->mode;
|
||||
int i;
|
||||
int i, num_lm;
|
||||
|
||||
reqs->top_ctrl = sde_connector_get_property(conn_state,
|
||||
CONNECTOR_PROP_TOPOLOGY_CONTROL);
|
||||
@@ -2002,9 +2002,18 @@ static int _sde_rm_populate_requirements(
|
||||
*/
|
||||
reqs->topology =
|
||||
&rm->topology_tbl[SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE];
|
||||
if (sde_crtc_get_num_datapath(crtc_state->crtc) == 1)
|
||||
|
||||
num_lm = sde_crtc_get_num_datapath(crtc_state->crtc,
|
||||
conn_state->connector);
|
||||
|
||||
if (num_lm == 1)
|
||||
reqs->topology =
|
||||
&rm->topology_tbl[SDE_RM_TOPOLOGY_SINGLEPIPE];
|
||||
else if (num_lm == 0)
|
||||
SDE_ERROR("Primary layer mixer is not set\n");
|
||||
|
||||
SDE_EVT32(num_lm, reqs->topology->num_lm,
|
||||
reqs->topology->top_name, reqs->topology->num_ctl);
|
||||
}
|
||||
|
||||
SDE_DEBUG("top_ctrl: 0x%llX num_h_tiles: %d\n", reqs->top_ctrl,
|
||||
|
Reference in New Issue
Block a user