mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
ODROID-N2: osd: support flexible length of fb size
Change-Id: Iebdb7edf12f206696394a571575dac6879c9a591
This commit is contained in:
@@ -384,6 +384,24 @@ struct ion_handle *fb_ion_handle[OSD_COUNT][OSD_MAX_BUF_NUM];
|
||||
|
||||
static int osd_cursor(struct fb_info *fbi, struct fb_cursor *var);
|
||||
|
||||
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
|
||||
static int osd_set_fb_var(int index, const struct vinfo_s *vinfo)
|
||||
{
|
||||
if ((vinfo->width < 0) || (vinfo->height < 0)) {
|
||||
pr_err("invalid vinfo\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fb_def_var[index].xres = vinfo->width;
|
||||
fb_def_var[index].yres = vinfo->height;
|
||||
fb_def_var[index].xres_virtual = vinfo->width;
|
||||
fb_def_var[index].yres_virtual = vinfo->height * 2;
|
||||
fb_def_var[index].bits_per_pixel = 32;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_ARCH_MESON64_ODROID_COMMON */
|
||||
|
||||
phys_addr_t get_fb_rmem_paddr(int index)
|
||||
{
|
||||
if (index < 0 || index > 1)
|
||||
@@ -4233,6 +4251,32 @@ static int osd_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
osd_log_info("not found display_size_default\n");
|
||||
else {
|
||||
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
|
||||
if (osd_set_fb_var(index, vinfo)) {
|
||||
/* no available vinfo, set default */
|
||||
fb_def_var[index].xres =
|
||||
var_screeninfo[0];
|
||||
fb_def_var[index].yres =
|
||||
var_screeninfo[1];
|
||||
fb_def_var[index].xres_virtual =
|
||||
var_screeninfo[2];
|
||||
fb_def_var[index].yres_virtual =
|
||||
var_screeninfo[3];
|
||||
fb_def_var[index].bits_per_pixel =
|
||||
var_screeninfo[4];
|
||||
}
|
||||
pr_info("fb def : %d %d %d %d %d\n",
|
||||
fb_def_var[index].xres,
|
||||
fb_def_var[index].yres,
|
||||
fb_def_var[index].xres_virtual,
|
||||
fb_def_var[index].yres_virtual,
|
||||
fb_def_var[index].bits_per_pixel);
|
||||
pr_info("init fbdev bpp is:%d\n",
|
||||
fb_def_var[index].bits_per_pixel);
|
||||
|
||||
if (fb_def_var[index].bits_per_pixel > 32)
|
||||
fb_def_var[index].bits_per_pixel = 32;
|
||||
#else
|
||||
fb_def_var[index].xres = var_screeninfo[0];
|
||||
fb_def_var[index].yres = var_screeninfo[1];
|
||||
fb_def_var[index].xres_virtual =
|
||||
@@ -4245,6 +4289,7 @@ static int osd_probe(struct platform_device *pdev)
|
||||
fb_def_var[index].bits_per_pixel);
|
||||
if (fb_def_var[index].bits_per_pixel > 32)
|
||||
fb_def_var[index].bits_per_pixel = 32;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user