diff options
author | qctecmdr <qctecmdr@localhost> | 2019-07-12 16:50:22 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-07-12 16:50:22 -0700 |
commit | b700d98e0eb637bbeca648d171d961fc78883c4e (patch) | |
tree | 9afcd09e20a5e3751eadc9ec7b2dbf1fa0d1754c /msm/dp/dp_display.c | |
parent | a30c33a6eb3f385b246d598b00e0eadad2ea2b3d (diff) | |
parent | 98434934c630151eca01492b40a391972f76ebcd (diff) | |
download | display-drivers-b700d98e0eb637bbeca648d171d961fc78883c4e.tar.gz |
Merge "disp: msm: dp: filter modes based on sde resource availability"
Diffstat (limited to 'msm/dp/dp_display.c')
-rw-r--r-- | msm/dp/dp_display.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index a2899742..39eb0799 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -1869,7 +1869,8 @@ end: static enum drm_mode_status dp_display_validate_mode( struct dp_display *dp_display, - void *panel, struct drm_display_mode *mode) + void *panel, struct drm_display_mode *mode, + const struct msm_resource_caps_info *avail_res) { struct dp_display_private *dp; struct drm_dp_link *link_info; @@ -1882,8 +1883,10 @@ static enum drm_mode_status dp_display_validate_mode( int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar, rate; struct dp_display_mode dp_mode; bool dsc_en; + u32 num_lm = 0; - if (!dp_display || !mode || !panel) { + if (!dp_display || !mode || !panel || + !avail_res || !avail_res->max_mixer_width) { pr_err("invalid params\n"); return mode_status; } @@ -1926,6 +1929,15 @@ static enum drm_mode_status dp_display_validate_mode( goto end; } + num_lm = (avail_res->max_mixer_width <= mode->hdisplay) ? + 2 : 1; + if (num_lm > avail_res->num_lm || + (num_lm == 2 && !avail_res->num_3dmux)) { + DP_MST_DEBUG("num_lm:%d, req lm:%d 3dmux:%d\n", num_lm, + avail_res->num_lm, avail_res->num_3dmux); + goto end; + } + /* * If the connector exists in the mst connector list and if debug is * enabled for that connector, use the mst connector settings from the |