summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorAdrian Salido-Moreno <adrianm@codeaurora.org>2014-07-23 13:10:15 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:33:29 -0700
commit44f6d6b7b256c0ccdbdf841d4e14bacb3cd32fcf (patch)
tree6aef99a1fe1fafcd64f4dac6ad41a88abe815720 /drivers/video/fbdev
parent8a3c8dd0916767ca1139c457ce9a0e3759d8c01a (diff)
msm: mdss: configure panel split based on configuration
Current code assumes when Dual DSI configuration is used that width will be twice the left panel resolution. This may not always be the case and should instead look at the configuration to get this information. Change-Id: I5c2ac608f46d7c0ce1acbffe002d69fca44afaf7 Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_fb.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c
index 4d650a727078..bc2fe4f961c5 100644
--- a/drivers/video/fbdev/msm/mdss_fb.c
+++ b/drivers/video/fbdev/msm/mdss_fb.c
@@ -276,16 +276,27 @@ static ssize_t mdss_fb_get_type(struct device *dev,
return ret;
}
+static int mdss_fb_get_panel_xres(struct mdss_panel_info *pinfo)
+{
+ struct mdss_panel_data *pdata;
+ int xres;
+
+ pdata = container_of(pinfo, struct mdss_panel_data, panel_info);
+
+ xres = pinfo->xres;
+ if (pdata->next)
+ xres += mdss_fb_get_panel_xres(&pdata->next->panel_info);
+
+ return xres;
+}
+
static inline int mdss_fb_validate_split(int left, int right,
struct msm_fb_data_type *mfd)
{
int rc = -EINVAL;
- u32 panel_xres = mfd->panel_info->xres;
+ u32 panel_xres = mdss_fb_get_panel_xres(mfd->panel_info);
/* more validate condition could be added if needed */
if (left && right) {
- if (is_panel_split(mfd))
- panel_xres *= 2;
-
if (panel_xres == left + right) {
mfd->split_fb_left = left;
mfd->split_fb_right = right;
@@ -293,7 +304,8 @@ static inline int mdss_fb_validate_split(int left, int right,
}
} else {
if (is_split_lm(mfd)) {
- mfd->split_fb_left = mfd->split_fb_right = panel_xres;
+ mfd->split_fb_left = mfd->panel_info->xres;
+ mfd->split_fb_right = panel_xres - mfd->split_fb_left;
rc = 0;
} else {
mfd->split_fb_left = mfd->split_fb_right = 0;
@@ -1812,9 +1824,7 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
return ret;
}
- var->xres = panel_info->xres;
- if (is_panel_split(mfd))
- var->xres *= 2;
+ var->xres = mdss_fb_get_panel_xres(panel_info);
fix->type = panel_info->is_3d_panel;
if (mfd->mdp.fb_stride)