"Chrome無法開啟設定檔, 請檢查權限"等等之類的提示框
man google-chrome之後, 發現在config底下有些設定檔在裡面...所以我先刪了它之後重新再次安裝Chrome就ok了 !
# rm -rf ~/.config/google-chrome
# rm -rf ~/.config/google-chrome
kernel/linux/include/fb.h <- 定義許多相關FB的結構,變量和define
kernel/driver/video/fbmem.c <- 實現核心層和使用者層之間的ioctl
#cat /dev/fb0
if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
printk("unable to get major %d for fb devs\n", FB_MAJOR);
static const struct file_operations fb_fops = {
.owner = THIS_MODULE,
.read = fb_read,
.write = fb_write,
.unlocked_ioctl = fb_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = fb_compat_ioctl,
#endif
.mmap = fb_mmap,
.open = fb_open,
.release = fb_release,
#ifdef HAVE_ARCH_FB_UNMAPPED_AREA
.get_unmapped_area = get_fb_unmapped_area,
#endif
#ifdef CONFIG_FB_DEFERRED_IO
.fsync = fb_deferred_io_fsync,
#endif
};
int fbidx = iminor(inode);
struct fb_info *info;
if (fbidx >= FB_MAX)
return -ENODEV;
info = registered_fb[fbidx];
file->private_data = info;
if (info->fbops->fb_open) {
res = info->fbops->fb_open(info,1);
if (res)
module_put(info->fbops->owner);
}
#define FBIOGET_VSCREENINFO 0x4600
#define FBIOPUT_VSCREENINFO 0x4601
#define FBIOGET_FSCREENINFO 0x4602
#define FBIOGETCMAP 0x4604
#define FBIOPUTCMAP 0x4605
#define FBIOPAN_DISPLAY 0x4606
#define FBIOGET_CON2FBMAP 0x460F
#define FBIOPUT_CON2FBMAP 0x4610
#define FBIO_ALLOC 0x4613
#define FBIO_FREE 0x4614
#define FBIOGET_GLYPH 0x4615
#define FBIOGET_HWCINFO 0x4616
#define FBIOPUT_MODEINFO 0x4617
#define FBIOGET_DISPINFO 0x4618
#vim testfb.c
#include
#include
#include
#include
/* Frame Buffer Test on Ubuntu 10.4 */
int main()
{
int fp = 0;
struct fb_var_screeninfo varinfo;
struct fb_fix_screeninfo fixinfo;
fp = open("/dev/fb0",O_RDWR);
printf("fp = %d\n",fp);
if(!fp)
{
printf("Error : Can not open /dev/fb0\n");
exit(1);
}
if (ioctl(fp,FBIOGET_FSCREENINFO,&fixinfo))
{
printf("Error reading fixed information\n");
exit(1);
}
if (ioctl(fp,FBIOGET_VSCREENINFO,&varinfo))
{
printf("Error reading variable information\n");
exit(1);
}
printf("The mem is :%d\n",fixinfo.smem_len);
printf("The line_length is :%d\n",fixinfo.line_length);
printf("The xres is :%d\n",varinfo.xres);
printf("The yres is :%d\n",varinfo.yres);
printf("bits_per_pixel is :%d\n",varinfo.bits_per_pixel);
close (fp);
}
#sudo su -
#gcc -o testfb testfb.c
#./testfb
fp = 3
The mem is :65536
The line_length is :80
The xres is :640
The yres is :480
bits_per_pixel is :4
/* Map registers.*/
fbi->reg_base = ioremap_nocache(res->start, res->end - res->start);
if (fbi->reg_base == NULL) {
ret = -ENOMEM;
goto failed;
}
/* Allocate framebuffer memory.*/
fbi->fb_size = PAGE_ALIGN(DEFAULT_FB_SIZE);
fbi->fb_start = dma_alloc_writecombine(fbi->dev, fbi->fb_size + PAGE_SIZE,
&fbi->fb_start_dma,
GFP_KERNEL);
if (fbi->fb_start == NULL) {
ret = -ENOMEM;
goto failed;
}
static inline void __iomem * ioremap_nocache(unsigned long offset,
unsigned long size)
{
return ioremap(offset, size);
}
/* default fb buffer size VGA-32bits double buffer */
#define DEFAULT_FB_SIZE (640 * 480 * 8 + PAGE_SIZE)
info->fbops = &pxa950fb_gfx_ops;
static struct fb_ops pxa950fb_gfx_ops = {
.owner = THIS_MODULE,
.fb_blank = pxa950fb_gfx_blank,
.fb_ioctl = pxa950fb_gfx_ioctl,
.fb_check_var = pxa950fb_check_var,
.fb_set_par = pxa950fb_set_par,
.fb_setcolreg = pxa950fb_setcolreg, /* TODO */
.fb_pan_display = pxa950fb_pan_display,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
};
pxa950fb_set_par(info);
register_framebuffer(info);
device_create_file(&pdev->dev, &dev_attr_vsync);
info = framebuffer_alloc(sizeof(struct pxa950fb_info), &pdev->dev);
if (info == NULL)
return -ENOMEM;
/* Initialize private data */
fbi = info->par;
fbi->fb_info = info;
platform_set_drvdata(pdev, fbi);
fbi->clk_lcd = clk_lcd;
fbi->clk_axi = clk_axi;
fbi->clk_dsi0 = clk_dsi0;
fbi->clk_dsi1 = clk_dsi1;
fbi->dev = &pdev->dev;
fbi->on = 1;
fbi->is_blanked = 0;
fbi->suspend = 0;
fbi->debug = 0;
fbi->pix_fmt_out = mi->pix_fmt_out;
fbi->active = mi->active;
fbi->invert_pixclock = mi->invert_pixclock;
fbi->panel_rbswap = mi->panel_rbswap;
fbi->panel_type = mi->panel_type;
fbi->mixer[0] = mi->mixer0;
fbi->mixer[1] = mi->mixer1;
fbi->power = mi->pxa950fb_lcd_power;
fbi->dsi_reset = mi->pxa950fb_dsi_reset;
fbi->window = 0; /*wge 9 and channel 0 is used for fb0*/
fbi->user_addr = 0;
fbi->eof_intr_en = 1;
fbi->vsync_en = 0;
fbi->eof_handler = NULL;
struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
{
#define BYTES_PER_LONG (BITS_PER_LONG/8)
#define PADDING (BYTES_PER_LONG - (sizeof(struct fb_info) % BYTES_PER_LONG))
int fb_info_size = sizeof(struct fb_info);
struct fb_info *info;
char *p;
if (size)
fb_info_size += PADDING;
p = kzalloc(fb_info_size + size, GFP_KERNEL);
if (!p)
return NULL;
info = (struct fb_info *) p;
if (size)
info->par = p + fb_info_size;
info->device = dev;
#ifdef CONFIG_FB_BACKLIGHT
mutex_init(&info->bl_curve_mutex);
#endif
return info;
#undef PADDING
#undef BYTES_PER_LONG
}
EXPORT_SYMBOL(framebuffer_alloc);
info = framebuffer_alloc(sizeof(struct pxa950fb_info), &pdev->dev);
if (info == NULL)
return -ENOMEM;
/* Initialize private data */
fbi = info->par;
fbi->fb_info = info;
platform_set_drvdata(pdev, fbi);
#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
void dev_set_drvdata(struct device *dev, void *data)
{
int error;
if (!dev)
return;
if (!dev->p) {
error = device_private_init(dev);
if (error)
return;
}
dev->p->driver_data = data;
}
EXPORT_SYMBOL(dev_set_drvdata);
static struct pxa950fb_mach_info saarb_lcd_info __initdata = {
.id = "Base",
.modes = video_modes,
.num_modes = ARRAY_SIZE(video_modes),
.pix_fmt_in = PIX_FMTIN_RGB_16,
.pix_fmt_out = PIX_FMTOUT_24_RGB888,
.panel_type = LCD_Controller_Active,
/* .mixer0 = LCD_M2PARALELL_CONVERTER,*/
.mixer0 = LCD_MIXER_DISABLE,
.mixer1 = LCD_M2DSI1,
.active = 1,
.pxa950fb_lcd_power = espon_lcd_power,
.pxa950fb_dsi_reset = tavorpv2_saarb_dsi_reset,
.invert_pixclock = 1,
};
static struct fb_videomode video_modes[] = {
[0] = {
.pixclock = 41701,
.refresh = 60,
.xres = 480,
.yres = 800,
.hsync_len = 19,
.left_margin = 40,
.right_margin = 59,
.vsync_len = 9,
.upper_margin = 4,
.lower_margin = 9,
.sync = 0,
},
};
static void __init saarb_init(void)
{
.......
#if defined(CONFIG_FB_PXA950)
pxa3xx_mfp_config(ARRAY_AND_SIZE(lcd_mfp_cfg));
saarb_init_lcd();
#endif
........
}
static void __init saarb_init_lcd(void)
{
set_pxa950_fb_info(&saarb_lcd_info);
set_pxa950_fb_ovly_info(&saarb_lcd_ovly_info);
}
void __init set_pxa950_fb_info(struct pxa950fb_mach_info *info)
{
pxa_register_device(&pxa950_device_fb, info);
}
struct platform_device pxa950_device_fb = {
.name = "pxa950-fb",
.id = -1,
.dev = {
.dma_mask = &fb_dma_mask,
.coherent_dma_mask = 0xffffffff,
},
.num_resources = ARRAY_SIZE(pxa950fb_resources),
.resource = pxa950fb_resources,
};
.resource = pxa950fb_resources,
static struct resource pxa950fb_resources[] = {
[0] = {
.start = 0x44100000,
.end = 0x4410ffff,
.flags= IORESOURCE_MEM,
},
[1] = {
.start = IRQ_LCDGLOBAL,
.end = IRQ_LCDGLOBAL,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start= IRQ_LCDPARALLEL,
.end= IRQ_LCDPARALLEL,
.flags= IORESOURCE_IRQ,
},
[3] = {
.start= IRQ_DSI0,
.end = IRQ_DSI0,
.flags = IORESOURCE_IRQ,
}
[4] = {
.start = IRQ_DSI1,
.end = IRQ_DSI1,
.flags = IORESOURCE_IRQ,
},
};
void __init set_pxa950_fb_info(struct pxa950fb_mach_info *info)
{
pxa_register_device(&pxa950_device_fb, info);
}
void __init pxa_register_device(struct platform_device *dev, void *data)
{
int ret;
dev->dev.platform_data = data;
ret = platform_device_register(dev);
if (ret)
&dev_err(&dev->dev, "unable to register device: %d\n", ret);
}
static int __devinit pxa950fb_gfx_init(void)
{
#ifdef CONFIG_PXA3xx_DVFM
dvfm_register("pxa950-fb", &dvfm_dev_idx);
#endif
return platform_driver_register(&pxa950fb_gfx_driver);
}
static struct platform_driver pxa950fb_gfx_driver = {
.driver = {
.name = "pxa950-fb",
.owner = THIS_MODULE,
},
.probe = pxa950fb_gfx_probe,
};
struct pxa950fb_mach_info *mi;
struct fb_info *info = 0;
struct pxa950fb_info *fbi = 0;
struct resource *res;
struct clk *clk_lcd, *clk_dsi0, *clk_dsi1, *clk_axi;
int irq_ctl, irq_conv[2], ret;
int i;
u32 converter;
mi = pdev->dev.platform_data;
if (mi == NULL) {
dev_err(&pdev->dev, "no platform data defined\n");
return -EINVAL;
}