video: rockchip: add win property node for application layer
authorHuang Jiachai <hjc@rock-chips.com>
Mon, 1 Feb 2016 02:02:49 +0000 (10:02 +0800)
committerHuang Jiachai <hjc@rock-chips.com>
Wed, 2 Mar 2016 11:50:16 +0000 (19:50 +0800)
Change-Id: I2e96d531d8fd1cf9eda665e4912501e4bec4d954
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
drivers/video/rockchip/lcdc/rk3368_lcdc.c
drivers/video/rockchip/rk_fb.c
drivers/video/rockchip/rkfb_sysfs.c
include/linux/rk_fb.h

index 16b7a375c0a7461ad83174c52010912272c5dff0..a1786d5346dbf3af99d7d112337a29dfa1dc4a52 100644 (file)
@@ -53,30 +53,42 @@ module_param(dbg_thresd, int, S_IRUGO | S_IWUSR);
 #define EARLY_TIME 500 /*us*/
 static struct rk_lcdc_win lcdc_win[] = {
        [0] = {
-              .name = "win0",
-              .id = 0,
-              .support_3d = false,
-              },
+               .name = "win0",
+               .id = 0,
+               .property.feature = SUPPORT_WIN_IDENTIFY | SUPPORT_SCALE |
+                                       SUPPORT_YUV,
+               .property.max_input_x = 4096,
+               .property.max_input_y = 2304
+               },
        [1] = {
-              .name = "win1",
-              .id = 1,
-              .support_3d = false,
-              },
+               .name = "win1",
+               .id = 1,
+               .property.feature = SUPPORT_WIN_IDENTIFY | SUPPORT_SCALE |
+                                       SUPPORT_YUV,
+               .property.max_input_x = 4096,
+               .property.max_input_y = 2304
+               },
        [2] = {
-              .name = "win2",
-              .id = 2,
-              .support_3d = false,
-              },
+               .name = "win2",
+               .id = 2,
+               .property.feature = SUPPORT_WIN_IDENTIFY | SUPPORT_MULTI_AREA,
+               .property.max_input_x = 4096,
+               .property.max_input_y = 2304
+               },
        [3] = {
-              .name = "win3",
-              .id = 3,
-              .support_3d = false,
-              },
+               .name = "win3",
+               .id = 3,
+               .property.feature = SUPPORT_WIN_IDENTIFY | SUPPORT_MULTI_AREA,
+               .property.max_input_x = 4096,
+               .property.max_input_y = 2304
+               },
        [4] = {
-              .name = "hwc",
-              .id = 4,
-              .support_3d = false,
-              }
+               .name = "hwc",
+               .id = 4,
+               .property.feature = SUPPORT_WIN_IDENTIFY | SUPPORT_HWC_LAYER,
+               .property.max_input_x = 128,
+               .property.max_input_y = 128
+               },
 };
 
 static int rk3368_lcdc_set_bcsh(struct rk_lcdc_driver *dev_drv, bool enable);
index 9fb1a5eeb20f76b6f27e35d70d18f517a9c1ba94..04029f75100d83528dd2a0ab5bbe86e0b3e197c9 100644 (file)
@@ -3946,6 +3946,9 @@ static int init_lcdc_win(struct rk_lcdc_driver *dev_drv,
                strcpy(win->name, def_win[i].name);
                win->id = def_win[i].id;
                win->support_3d = def_win[i].support_3d;
+               win->property.feature = def_win[i].property.feature;
+               win->property.max_input_x = def_win[i].property.max_input_x;
+               win->property.max_input_y = def_win[i].property.max_input_y;
                dev_drv->win[i] = win;
        }
 
index 99e2dcf4c462d404459437cc0a58d91a9ddc30b1..7fc7cd8f80ae35ec097536a0992d31a79dde62d4 100644 (file)
@@ -1194,6 +1194,23 @@ static ssize_t show_lcdc_id(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%d\n", dev_drv->id);
 }
 
+static ssize_t show_win_property(struct device *dev,
+                           struct device_attribute *attr,
+                           char *buf)
+{
+       struct fb_info *fbi = dev_get_drvdata(dev);
+       struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
+       struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
+       int win_id = 0;
+
+       win_id = dev_drv->ops->fb_get_win_id(dev_drv, fbi->fix.id);
+       return snprintf(buf, PAGE_SIZE,
+                       "feature: %d, max_input_x: %d, max_input_y: %d\n",
+                       dev_drv->win[win_id]->property.feature,
+                       dev_drv->win[win_id]->property.max_input_x,
+                       dev_drv->win[win_id]->property.max_input_y);
+}
+
 static struct device_attribute rkfb_attrs[] = {
        __ATTR(phys_addr, S_IRUGO, show_phys, NULL),
        __ATTR(virt_addr, S_IRUGO, show_virt, NULL),
@@ -1213,6 +1230,7 @@ static struct device_attribute rkfb_attrs[] = {
        __ATTR(bcsh, S_IRUGO | S_IWUSR, show_dsp_bcsh, set_dsp_bcsh),
        __ATTR(scale, S_IRUGO | S_IWUSR, show_scale, set_scale),
        __ATTR(lcdcid, S_IRUGO, show_lcdc_id, NULL),
+       __ATTR(win_property, S_IRUGO, show_win_property, NULL),
 };
 
 int rkfb_create_sysfs(struct fb_info *fbi)
index 9601168822ec8a47c87f69e0f8becad75de4d69f..dcb9251617ec0525ab498e6c254ead7aaa49161d 100755 (executable)
@@ -280,6 +280,21 @@ struct rk_vop_property {
        u32 max_output_y;
 };
 
+enum rk_win_feature {
+       SUPPORT_WIN_IDENTIFY    = BIT(0),
+       SUPPORT_SCALE           = BIT(1),
+       SUPPORT_YUV             = BIT(2),
+       SUPPORT_YUV10BIT        = BIT(3),
+       SUPPORT_MULTI_AREA      = BIT(4),
+       SUPPORT_HWC_LAYER       = BIT(5)
+};
+
+struct rk_win_property {
+       u32 feature;
+       u32 max_input_x;
+       u32 max_input_y;
+};
+
 struct rk_fb_rgb {
        struct fb_bitfield red;
        struct fb_bitfield green;
@@ -412,6 +427,7 @@ struct rk_lcdc_win_area {
 struct rk_lcdc_win {
        char name[5];
        int id;
+       struct rk_win_property property;
        bool state;             /*on or off*/
        bool last_state;                /*on or off*/
        u32 pseudo_pal[16];