msm: mdss: add fb sysfs property to indicate how to split layer

When source split is enabled, a layer can be split into two at layer
mixer (LM) rather than splitting into two source pipes. But splitting
at LM is not always optimal from power and performance aspects. Display
panel properties and information about other system resource including
other layers dictate the best balance between power and performance of
this layer split. i.e 1080p video layer can always be sent through
single pipe on 1440x2560 portrait panel but that leads to higher MDP
clock compared splitting 1080p video layer into two source pipes. Since
decision to split the layer into two is done by user-land, aid in their
decision by providing information if they should split such layer or not.

Change-Id: I1009412f127423aee3f083dd2ea879dbaf2ed2ae
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
This commit is contained in:
Ujwal Patel 2014-06-03 12:53:11 -07:00 committed by David Keitel
parent 25e5789688
commit 2bda05c8b0

View file

@ -527,6 +527,21 @@ static int mdss_fb_lpm_enable(struct msm_fb_data_type *mfd, int mode)
return 0;
}
static ssize_t mdss_fb_get_src_split_info(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct fb_info *fbi = dev_get_drvdata(dev);
struct msm_fb_data_type *mfd = fbi->par;
int ret = 0;
if ((mfd->split_mode == MDP_SPLIT_MODE_LM) &&
(fbi->var.yres > 2048) && (fbi->var.yres > fbi->var.xres))
ret = scnprintf(buf, PAGE_SIZE,
"src_split_always\n");
return ret;
}
static DEVICE_ATTR(msm_fb_type, S_IRUGO, mdss_fb_get_type, NULL);
static DEVICE_ATTR(msm_fb_split, S_IRUGO | S_IWUSR, mdss_fb_show_split,
mdss_fb_store_split);
@ -535,6 +550,8 @@ static DEVICE_ATTR(idle_time, S_IRUGO | S_IWUSR | S_IWGRP,
mdss_fb_get_idle_time, mdss_fb_set_idle_time);
static DEVICE_ATTR(idle_notify, S_IRUGO, mdss_fb_get_idle_notify, NULL);
static DEVICE_ATTR(msm_fb_panel_info, S_IRUGO, mdss_fb_get_panel_info, NULL);
static DEVICE_ATTR(msm_fb_src_split_info, S_IRUGO, mdss_fb_get_src_split_info,
NULL);
static struct attribute *mdss_fb_attrs[] = {
&dev_attr_msm_fb_type.attr,
@ -543,6 +560,7 @@ static struct attribute *mdss_fb_attrs[] = {
&dev_attr_idle_time.attr,
&dev_attr_idle_notify.attr,
&dev_attr_msm_fb_panel_info.attr,
&dev_attr_msm_fb_src_split_info.attr,
NULL,
};