video: fbdev: msm: add TWM mode sysfs node

Userspace SW will use this sysfs node to
notify TWM entry and exit.

Change-Id: I72730620ce7bca32439054e7ef3f17ae7fe29e19
Signed-off-by: Venkata Prahlad Valluru <vvalluru@codeaurora.org>
tirimbino
Venkata Prahlad Valluru 5 years ago committed by Gerrit - the friendly Code Review server
parent 63066422d3
commit fb24f216ea
  1. 1
      drivers/video/fbdev/msm/mdss.h
  2. 42
      drivers/video/fbdev/msm/mdss_mdp.c
  3. 9
      drivers/video/fbdev/msm/mdss_mdp_overlay.c

@ -512,6 +512,7 @@ struct mdss_data_type {
u32 min_prefill_lines; /* this changes within different chipsets */
u32 props;
bool twm_en;
int handoff_pending;
bool idle_pc;
struct mdss_perf_tune perf_tune;

@ -2889,13 +2889,55 @@ static ssize_t mdss_mdp_store_max_limit_bw(struct device *dev,
return len;
}
static ssize_t mdss_mdp_store_twm(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
u32 data = -1;
ssize_t rc = 0;
if (!mdata) {
pr_err("Invalid mdata structure\n");
return -EINVAL;
}
rc = kstrtoint(buf, 10, &data);
if (rc) {
pr_err("kstrtoint failed. rc=%zd\n", rc);
return rc;
}
mdata->twm_en = data ? true : false;
pr_err("TWM : %s\n", (mdata->twm_en) ?
"ENABLED" : "DISABLED");
return len;
}
static ssize_t mdss_mdp_show_twm(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
ssize_t ret = 0;
if (!mdata) {
pr_err("Invalid mdata structure\n");
return -EINVAL;
}
pr_err("TWM : %s\n", (mdata->twm_en) ?
"ENABLED" : "DISABLED");
ret = snprintf(buf, PAGE_SIZE, "%d\n", mdata->twm_en);
return ret;
}
static DEVICE_ATTR(caps, 0444, mdss_mdp_show_capabilities, NULL);
static DEVICE_ATTR(bw_mode_bitmap, 0664,
mdss_mdp_read_max_limit_bw, mdss_mdp_store_max_limit_bw);
static DEVICE_ATTR(twm_enable, 0664, mdss_mdp_show_twm, mdss_mdp_store_twm);
static struct attribute *mdp_fs_attrs[] = {
&dev_attr_caps.attr,
&dev_attr_bw_mode_bitmap.attr,
&dev_attr_twm_enable.attr,
NULL
};

@ -6422,6 +6422,13 @@ static void mdss_mdp_signal_retire_fence(struct msm_fb_data_type *mfd,
pr_debug("Signaled (%d) pending retire fence\n", retire_cnt);
}
static bool mdss_mdp_is_twm_en(void)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
return (mdata && mdata->twm_en);
}
int mdss_mdp_overlay_init(struct msm_fb_data_type *mfd)
{
struct device *dev = mfd->fbi->dev;
@ -6464,7 +6471,7 @@ int mdss_mdp_overlay_init(struct msm_fb_data_type *mfd)
mdp5_interface->signal_retire_fence = mdss_mdp_signal_retire_fence;
mdp5_interface->enable_panel_disable_mode =
mdss_mdp_enable_panel_disable_mode;
mdp5_interface->is_twm_en = NULL;
mdp5_interface->is_twm_en = mdss_mdp_is_twm_en;
/*
* Register footswitch control only for primary fb pm

Loading…
Cancel
Save