A Antonino A. Daplas #
Message details and related content
Hi, Video mode handling in fbdev-2.6 is becoming better, but is still not in the same league as with fbdev-2.4. The reason is that the upper vt layer does not have any information about the video mode itself which leaves the lower fbdev layer to fill in or replace the fields in a partial/incorrect fb_var_sreeninfo structure (var). This limitation is partly alleviated by using fb_find_mode() to pass a complete var. fb_find_mode() will look for entries in a database in which most entries are not compatible with the graphics/display combination. The driver will still need to "massage" the contents of var to make it work with the particular combination. Secondly, the current system does not preserve the entire graphics per-console settings (such as bpp, virtual resolution, etc). Thirdly, fb_find_mode() requires that the mode database need to stay in the memory for the entire lifetime of fbdev/fbcon, increasing the kernel's memory footprint. Finally, this requires that all drivers are capable of guaranteeing a working display without any user intervention. Most fbdev developers are proposing to bring back the per-display var structures to ease the difficulty of video mode handling. This proposal is countered by a few (notably James) in that it severely increases the memory footprint of the kernel. How about a compromise then? The fb_var_screeninfo structure contains the following: a. settings of the graphics card b. settings of the attached display c. fields used internally by core fbdev/fbcon which has no relevance in video mode setting (ie, xoffset, yoffset) Instead of saving the entire var, we just save the settings of the graphics card. Settings of the attached display will be replaced by pointers to entries in a mode database. Internally used fields will not be saved, as these are typically handled by fbcon for each mode switch. One requirement is the creation of a mode database that is valid and private to the driver. This database must also be capable of adding new entries to its