mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Merge "disp: msm: sde: set ctl preference for built in displays"
This commit is contained in:
commit
2ae11f78dd
4 changed files with 65 additions and 6 deletions
|
|
@ -2994,6 +2994,9 @@ struct drm_connector *sde_connector_init(struct drm_device *dev,
|
|||
_sde_connector_lm_preference(c_conn, sde_kms,
|
||||
display_info.display_type);
|
||||
|
||||
sde_hw_ctl_set_preference(sde_kms->catalog,
|
||||
display_info.display_type);
|
||||
|
||||
SDE_DEBUG("connector %d attach encoder %d\n",
|
||||
c_conn->base.base.id, encoder->base.id);
|
||||
|
||||
|
|
|
|||
|
|
@ -1919,6 +1919,8 @@ static int sde_ctl_parse_dt(struct device_node *np,
|
|||
ctl_prop[HW_DISP].prop_name, i, &disp_pref);
|
||||
if (disp_pref && !strcmp(disp_pref, "primary"))
|
||||
set_bit(SDE_CTL_PRIMARY_PREF, &ctl->features);
|
||||
if (disp_pref && !strcmp(disp_pref, "secondary"))
|
||||
set_bit(SDE_CTL_SECONDARY_PREF, &ctl->features);
|
||||
if ((i < MAX_SPLIT_DISPLAY_CTL) &&
|
||||
!(IS_SDE_CTL_REV_100(sde_cfg->ctl_rev)))
|
||||
set_bit(SDE_CTL_SPLIT_DISPLAY, &ctl->features);
|
||||
|
|
@ -1937,6 +1939,43 @@ static int sde_ctl_parse_dt(struct device_node *np,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void sde_hw_ctl_set_preference(struct sde_mdss_cfg *sde_cfg,
|
||||
uint32_t disp_type)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
if (!IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
|
||||
return;
|
||||
|
||||
if (disp_type == SDE_CONNECTOR_PRIMARY) {
|
||||
for (i = 0; i < sde_cfg->ctl_count; i++) {
|
||||
/* Exit if already set in dt file*/
|
||||
if (sde_cfg->ctl[i].features & BIT(SDE_CTL_PRIMARY_PREF))
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < sde_cfg->ctl_count; i++) {
|
||||
/* Set preference here*/
|
||||
if (!(sde_cfg->ctl[i].features & BIT(SDE_CTL_SECONDARY_PREF))) {
|
||||
set_bit(SDE_CTL_PRIMARY_PREF, &sde_cfg->ctl[i].features);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (disp_type == SDE_CONNECTOR_SECONDARY) {
|
||||
for (i = 0; i < sde_cfg->ctl_count; i++) {
|
||||
/* Exit if already set in dt file*/
|
||||
if (sde_cfg->ctl[i].features & BIT(SDE_CTL_SECONDARY_PREF))
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < sde_cfg->ctl_count; i++) {
|
||||
/* Set preference here*/
|
||||
if (!(sde_cfg->ctl[i].features & BIT(SDE_CTL_PRIMARY_PREF))) {
|
||||
set_bit(SDE_CTL_SECONDARY_PREF, &sde_cfg->ctl[i].features);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sde_hw_mixer_set_preference(struct sde_mdss_cfg *sde_cfg, u32 num_lm,
|
||||
uint32_t disp_type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -467,6 +467,7 @@ enum {
|
|||
SDE_CTL_SPLIT_DISPLAY = 0x1,
|
||||
SDE_CTL_PINGPONG_SPLIT,
|
||||
SDE_CTL_PRIMARY_PREF,
|
||||
SDE_CTL_SECONDARY_PREF,
|
||||
SDE_CTL_ACTIVE_CFG,
|
||||
SDE_CTL_UIDLE,
|
||||
SDE_CTL_UNIFIED_DSPP_FLUSH,
|
||||
|
|
@ -1659,6 +1660,13 @@ struct sde_mdss_cfg *sde_hw_catalog_init(struct drm_device *dev);
|
|||
*/
|
||||
void sde_hw_catalog_deinit(struct sde_mdss_cfg *sde_cfg);
|
||||
|
||||
/**
|
||||
* sde_hw_ctl_set_preference - set CTL preference for display
|
||||
* @sde_cfg: pointer to mdss cfg
|
||||
* @disp_type: type of display primary/secondary
|
||||
*/
|
||||
void sde_hw_ctl_set_preference(struct sde_mdss_cfg *sde_cfg,
|
||||
uint32_t disp_type);
|
||||
/**
|
||||
* sde_hw_catalog_irq_offset_list_delete - delete the irq_offset_list
|
||||
* maintained by the catalog
|
||||
|
|
|
|||
|
|
@ -1227,7 +1227,8 @@ static int _sde_rm_reserve_ctls(
|
|||
while (_sde_rm_get_hw_locked(rm, &iter)) {
|
||||
const struct sde_hw_ctl *ctl = to_sde_hw_ctl(iter.blk->hw);
|
||||
unsigned long features = ctl->caps->features;
|
||||
bool has_split_display, has_ppsplit, primary_pref;
|
||||
bool has_split_display, has_ppsplit, primary_pref, secondary_pref;
|
||||
bool is_conn_primary, is_conn_secondary;
|
||||
|
||||
if (RESERVED_BY_OTHER(iter.blk, rsvp))
|
||||
continue;
|
||||
|
|
@ -1235,6 +1236,11 @@ static int _sde_rm_reserve_ctls(
|
|||
has_split_display = BIT(SDE_CTL_SPLIT_DISPLAY) & features;
|
||||
has_ppsplit = BIT(SDE_CTL_PINGPONG_SPLIT) & features;
|
||||
primary_pref = BIT(SDE_CTL_PRIMARY_PREF) & features;
|
||||
secondary_pref = BIT(SDE_CTL_SECONDARY_PREF) & features;
|
||||
is_conn_primary = (reqs->hw_res.display_type ==
|
||||
SDE_CONNECTOR_PRIMARY) ? true : false;
|
||||
is_conn_secondary = (reqs->hw_res.display_type ==
|
||||
SDE_CONNECTOR_SECONDARY) ? true : false;
|
||||
|
||||
SDE_DEBUG("ctl %d caps 0x%lX\n", iter.blk->id, features);
|
||||
|
||||
|
|
@ -1242,18 +1248,21 @@ static int _sde_rm_reserve_ctls(
|
|||
* bypass rest feature checks on finding CTL preferred
|
||||
* for primary displays.
|
||||
*/
|
||||
if (!primary_pref && !_ctl_ids) {
|
||||
if (!primary_pref && !secondary_pref && !_ctl_ids) {
|
||||
if (top->needs_split_display != has_split_display)
|
||||
continue;
|
||||
|
||||
if (top->top_name == SDE_RM_TOPOLOGY_PPSPLIT &&
|
||||
!has_ppsplit)
|
||||
continue;
|
||||
} else if (!(reqs->hw_res.display_type ==
|
||||
SDE_CONNECTOR_PRIMARY && primary_pref) && !_ctl_ids) {
|
||||
|
||||
if (is_conn_primary || is_conn_secondary)
|
||||
continue;
|
||||
} else if (!((is_conn_primary && primary_pref) ||
|
||||
(is_conn_secondary && secondary_pref)) && !_ctl_ids) {
|
||||
SDE_DEBUG(
|
||||
"display pref not met. display_type: %d primary_pref: %d\n",
|
||||
reqs->hw_res.display_type, primary_pref);
|
||||
"display pref not met. display_type: %d features: 0x%lX\n",
|
||||
reqs->hw_res.display_type, features);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue