DEFINE_MUTEX(registration_lock);
struct fb_info *registered_fb[FB_MAX] __read_mostly;
int num_registered_fb __read_mostly;
+int min_dynamic_fb __read_mostly;
#define for_each_registered_fb(i) \
for (i = 0; i < FB_MAX; i++) \
if (!registered_fb[i]) {} else
return -ENXIO;
num_registered_fb++;
- for (i = 0 ; i < FB_MAX; i++)
- if (!registered_fb[i])
- break;
- fb_info->node = i;
+ if (!fb_info->custom_fb_num || fb_info->node >= FB_MAX || registered_fb[fb_info->node]) {
+ for (i = min_dynamic_fb ; i < FB_MAX; i++)
+ if (!registered_fb[i])
+ break;
+ fb_info->node = i;
+ }
refcount_set(&fb_info->count, 1);
mutex_init(&fb_info->lock);
mutex_init(&fb_info->mm_lock);
fb_var_to_videomode(&mode, &fb_info->var);
fb_add_videomode(&mode, &fb_info->modelist);
- registered_fb[i] = fb_info;
+ registered_fb[fb_info->node] = fb_info;
#ifdef CONFIG_GUMSTIX_AM200EPD
{
put_fb_info(fb_info);
}
+void fb_set_lowest_dynamic_fb(int min_fb_dev)
+{
+ min_dynamic_fb = min_fb_dev;
+}
+EXPORT_SYMBOL(fb_set_lowest_dynamic_fb);
+
/**
* register_framebuffer - registers a frame buffer device
* @fb_info: frame buffer info structure
void *par;
bool skip_vt_switch; /* no VT switch on suspend/resume required */
+ bool custom_fb_num; /* Use value in node as the preferred node number */
};
/* This will go away
.fb_imageblit = sys_imageblit
/* fbmem.c */
+extern void fb_set_lowest_dynamic_fb(int min_fb_dev);
extern int register_framebuffer(struct fb_info *fb_info);
extern void unregister_framebuffer(struct fb_info *fb_info);
extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);