mirror of
https://github.com/torvalds/linux.git
synced 2026-06-11 08:03:05 +02:00
video: rockchip: add win property node for application layer
Change-Id: I2e96d531d8fd1cf9eda665e4912501e4bec4d954 Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
This commit is contained in:
parent
adb92c7648
commit
07aae424ae
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user