#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);
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;
}
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),
__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)
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;
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];