osd: need information whether current OSD is blanked or not [1/1]
authorJian Cao <jian.cao@amlogic.com>
Mon, 17 Dec 2018 06:19:16 +0000 (14:19 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 18 Dec 2018 08:41:37 +0000 (00:41 -0800)
PD#SWPL-3254

Problem:
need information whether current OSD is blanked or not

Solution:
add sysfs node osd_status

Verify:
verified on u212

Change-Id: Ie73417f08c648a750a881af375800aae57a48762
Signed-off-by: Jian Cao <jian.cao@amlogic.com>
drivers/amlogic/media/osd/osd_fb.c

index 8739c75..de68fbb 100644 (file)
@@ -3070,6 +3070,15 @@ static ssize_t store_osd_plane_alpha(
        return count;
 }
 
+static ssize_t show_osd_status(struct device *device,
+                              struct device_attribute *attr,
+                              char *buf)
+{
+       struct fb_info *fb_info = dev_get_drvdata(device);
+
+       return snprintf(buf, PAGE_SIZE, "osd[%d] enable: %d\n",
+                               fb_info->node, osd_hw.enable[fb_info->node]);
+}
 
 static inline  int str2lower(char *str)
 {
@@ -3279,6 +3288,8 @@ static struct device_attribute osd_attrs[] = {
                        show_osd_dimm, store_osd_dimm),
        __ATTR(osd_plane_alpha, 0644,
                        show_osd_plane_alpha, store_osd_plane_alpha),
+       __ATTR(osd_status, 0444,
+                       show_osd_status, NULL),
 
 };
 
@@ -3327,6 +3338,8 @@ static struct device_attribute osd_attrs_viu2[] = {
                        show_osd_afbc_format, store_osd_afbc_format),
        __ATTR(osd_rotate, 0644,
                        show_osd_rotate, store_osd_rotate),
+       __ATTR(osd_status, 0444,
+                       show_osd_status, NULL),
 };
 
 #ifdef CONFIG_PM