mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
rk fb: from rk3368 fb only need to reserved 1 framebuffer
Signed-off-by: hjc <hjc@rock-chips.com>
This commit is contained in:
parent
6608228a9e
commit
6219706cdb
|
|
@ -4632,6 +4632,7 @@ static int rk3368_lcdc_probe(struct platform_device *pdev)
|
|||
dev_drv->id = lcdc_dev->id;
|
||||
dev_drv->ops = &lcdc_drv_ops;
|
||||
dev_drv->lcdc_win_num = ARRAY_SIZE(lcdc_win);
|
||||
dev_drv->reserved_fb = 1;/*only need reserved 1 buffer*/
|
||||
spin_lock_init(&lcdc_dev->reg_lock);
|
||||
|
||||
lcdc_dev->irq = platform_get_irq(pdev, 0);
|
||||
|
|
|
|||
|
|
@ -3439,7 +3439,7 @@ static int rk_fb_alloc_buffer(struct fb_info *fbi)
|
|||
win = dev_drv->win[win_id];
|
||||
|
||||
if (!strcmp(fbi->fix.id, "fb0")) {
|
||||
fb_mem_size = get_fb_size();
|
||||
fb_mem_size = get_fb_size(dev_drv->reserved_fb);
|
||||
#if defined(CONFIG_ION_ROCKCHIP)
|
||||
if (rk_fb_alloc_buffer_by_ion(fbi, win, fb_mem_size) < 0)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ int rk_fb_set_prmry_screen(struct rk_screen *screen)
|
|||
return 0;
|
||||
}
|
||||
|
||||
size_t get_fb_size(void)
|
||||
size_t get_fb_size(u8 reserved_fb)
|
||||
{
|
||||
size_t size = 0;
|
||||
u32 xres = 0;
|
||||
|
|
@ -44,12 +44,15 @@ size_t get_fb_size(void)
|
|||
|
||||
/* align as 64 bytes(16*4) in an odd number of times */
|
||||
xres = ALIGN_64BYTE_ODD_TIMES(xres, ALIGN_PIXEL_64BYTE_RGB8888);
|
||||
|
||||
#if defined(CONFIG_THREE_FB_BUFFER)
|
||||
if (reserved_fb == 1) {
|
||||
size = (xres * yres << 2);/*one buffer*/
|
||||
} else {
|
||||
#if defined(CONFIG_THREE_FB_BUFFER)
|
||||
size = (xres * yres << 2) * 3; /* three buffer */
|
||||
#else
|
||||
#else
|
||||
size = (xres * yres << 2) << 1; /* two buffer */
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return ALIGN(size, SZ_1M);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -648,6 +648,7 @@ struct rk_lcdc_driver {
|
|||
int uboot_logo;
|
||||
int bcsh_init_status;
|
||||
bool cabc_pwm_pol;
|
||||
u8 reserved_fb;
|
||||
};
|
||||
|
||||
struct rk_fb_par {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ struct rk29fb_info {
|
|||
};
|
||||
|
||||
extern void set_lcd_info(struct rk_screen *screen, struct rk29lcd_info *lcd_info);
|
||||
extern size_t get_fb_size(void);
|
||||
extern size_t get_fb_size(u8 reserved_fb);
|
||||
|
||||
extern void set_tv_info(struct rk_screen *screen);
|
||||
extern void set_hdmi_info(struct rk_screen *screen);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user