Lines Matching refs:fb_info
32 struct fb_info *registered_fb[FB_MAX] __read_mostly;
38 struct fb_info *get_fb_info(unsigned int idx) in get_fb_info()
40 struct fb_info *fb_info; in get_fb_info() local
46 fb_info = registered_fb[idx]; in get_fb_info()
47 if (fb_info) in get_fb_info()
48 refcount_inc(&fb_info->count); in get_fb_info()
51 return fb_info; in get_fb_info()
54 void put_fb_info(struct fb_info *fb_info) in put_fb_info() argument
56 if (!refcount_dec_and_test(&fb_info->count)) in put_fb_info()
58 if (fb_info->fbops->fb_destroy) in put_fb_info()
59 fb_info->fbops->fb_destroy(fb_info); in put_fb_info()
132 char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size) in fb_get_buffer_offset()
166 fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) in fb_pan_display()
203 static int fb_check_caps(struct fb_info *info, struct fb_var_screeninfo *var, in fb_check_caps()
224 fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) in fb_set_var()
343 fb_blank(struct fb_info *info, int blank) in fb_blank()
364 static int fb_check_foreignness(struct fb_info *fi) in fb_check_foreignness()
389 static int do_register_framebuffer(struct fb_info *fb_info) in do_register_framebuffer() argument
394 if (fb_check_foreignness(fb_info)) in do_register_framebuffer()
404 fb_info->node = i; in do_register_framebuffer()
405 refcount_set(&fb_info->count, 1); in do_register_framebuffer()
406 mutex_init(&fb_info->lock); in do_register_framebuffer()
407 mutex_init(&fb_info->mm_lock); in do_register_framebuffer()
409 fb_device_create(fb_info); in do_register_framebuffer()
411 if (fb_info->pixmap.addr == NULL) { in do_register_framebuffer()
412 fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL); in do_register_framebuffer()
413 if (fb_info->pixmap.addr) { in do_register_framebuffer()
414 fb_info->pixmap.size = FBPIXMAPSIZE; in do_register_framebuffer()
415 fb_info->pixmap.buf_align = 1; in do_register_framebuffer()
416 fb_info->pixmap.scan_align = 1; in do_register_framebuffer()
417 fb_info->pixmap.access_align = 32; in do_register_framebuffer()
418 fb_info->pixmap.flags = FB_PIXMAP_DEFAULT; in do_register_framebuffer()
421 fb_info->pixmap.offset = 0; in do_register_framebuffer()
423 if (bitmap_empty(fb_info->pixmap.blit_x, FB_MAX_BLIT_WIDTH)) in do_register_framebuffer()
424 bitmap_fill(fb_info->pixmap.blit_x, FB_MAX_BLIT_WIDTH); in do_register_framebuffer()
426 if (bitmap_empty(fb_info->pixmap.blit_y, FB_MAX_BLIT_HEIGHT)) in do_register_framebuffer()
427 bitmap_fill(fb_info->pixmap.blit_y, FB_MAX_BLIT_HEIGHT); in do_register_framebuffer()
429 if (!fb_info->modelist.prev || !fb_info->modelist.next) in do_register_framebuffer()
430 INIT_LIST_HEAD(&fb_info->modelist); in do_register_framebuffer()
432 if (fb_info->skip_vt_switch) in do_register_framebuffer()
433 pm_vt_switch_required(fb_info->device, false); in do_register_framebuffer()
435 pm_vt_switch_required(fb_info->device, true); in do_register_framebuffer()
437 fb_var_to_videomode(&mode, &fb_info->var); in do_register_framebuffer()
438 fb_add_videomode(&mode, &fb_info->modelist); in do_register_framebuffer()
439 registered_fb[i] = fb_info; in do_register_framebuffer()
444 event.info = fb_info; in do_register_framebuffer()
449 return fbcon_fb_registered(fb_info); in do_register_framebuffer()
452 static void unbind_console(struct fb_info *fb_info) in unbind_console() argument
454 int i = fb_info->node; in unbind_console()
456 if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) in unbind_console()
459 fbcon_fb_unbind(fb_info); in unbind_console()
462 static void unlink_framebuffer(struct fb_info *fb_info) in unlink_framebuffer() argument
466 i = fb_info->node; in unlink_framebuffer()
467 if (WARN_ON(i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)) in unlink_framebuffer()
470 fb_device_destroy(fb_info); in unlink_framebuffer()
471 pm_vt_switch_unregister(fb_info->device); in unlink_framebuffer()
472 unbind_console(fb_info); in unlink_framebuffer()
475 static void do_unregister_framebuffer(struct fb_info *fb_info) in do_unregister_framebuffer() argument
477 unlink_framebuffer(fb_info); in do_unregister_framebuffer()
478 if (fb_info->pixmap.addr && in do_unregister_framebuffer()
479 (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT)) { in do_unregister_framebuffer()
480 kfree(fb_info->pixmap.addr); in do_unregister_framebuffer()
481 fb_info->pixmap.addr = NULL; in do_unregister_framebuffer()
484 fb_destroy_modelist(&fb_info->modelist); in do_unregister_framebuffer()
485 registered_fb[fb_info->node] = NULL; in do_unregister_framebuffer()
490 event.info = fb_info; in do_unregister_framebuffer()
494 fbcon_fb_unregistered(fb_info); in do_unregister_framebuffer()
497 put_fb_info(fb_info); in do_unregister_framebuffer()
510 register_framebuffer(struct fb_info *fb_info) in register_framebuffer() argument
515 ret = do_register_framebuffer(fb_info); in register_framebuffer()
539 unregister_framebuffer(struct fb_info *fb_info) in unregister_framebuffer() argument
542 do_unregister_framebuffer(fb_info); in unregister_framebuffer()
549 struct fb_info *info = data; in devm_unregister_framebuffer()
565 devm_register_framebuffer(struct device *dev, struct fb_info *fb_info) in devm_register_framebuffer() argument
569 ret = register_framebuffer(fb_info); in devm_register_framebuffer()
573 return devm_add_action_or_reset(dev, devm_unregister_framebuffer, fb_info); in devm_register_framebuffer()
586 void fb_set_suspend(struct fb_info *info, int state) in fb_set_suspend()
649 int fb_new_modelist(struct fb_info *info) in fb_new_modelist()