Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev/sis: Remove dependency on screen_info

When built-in, the sis driver tries to detect the current display mode
from the global screen_info state. That state is only for architecture
and firmware code. Drivers should not use it directly as it's not
guaranteed to contain valid information.

Remove the mode-detection code from sis. Drivers that want to detect a
pre-set mode on probe should read the hardware registers directly.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Thomas Zimmermann and committed by
Helge Deller
7452b319 29328fb0

-37
-37
drivers/video/fbdev/sis/sis_main.c
··· 27 27 #include <linux/errno.h> 28 28 #include <linux/string.h> 29 29 #include <linux/mm.h> 30 - #include <linux/screen_info.h> 31 30 #include <linux/slab.h> 32 31 #include <linux/fb.h> 33 32 #include <linux/selection.h> ··· 255 256 if((!j) && !quiet) 256 257 printk(KERN_ERR "sisfb: Invalid mode '%s'\n", nameptr); 257 258 } 258 - 259 - #ifndef MODULE 260 - static void sisfb_get_vga_mode_from_kernel(void) 261 - { 262 - #ifdef CONFIG_X86 263 - char mymode[32]; 264 - int mydepth = screen_info.lfb_depth; 265 - 266 - if(screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) return; 267 - 268 - if( (screen_info.lfb_width >= 320) && (screen_info.lfb_width <= 2048) && 269 - (screen_info.lfb_height >= 200) && (screen_info.lfb_height <= 1536) && 270 - (mydepth >= 8) && (mydepth <= 32) ) { 271 - 272 - if(mydepth == 24) mydepth = 32; 273 - 274 - sprintf(mymode, "%ux%ux%u", screen_info.lfb_width, 275 - screen_info.lfb_height, 276 - mydepth); 277 - 278 - printk(KERN_DEBUG 279 - "sisfb: Using vga mode %s pre-set by kernel as default\n", 280 - mymode); 281 - 282 - sisfb_search_mode(mymode, true); 283 - } 284 - #endif 285 - return; 286 - } 287 - #endif 288 259 289 260 static void __init 290 261 sisfb_search_crt2type(const char *name) ··· 5869 5900 ivideo->pcifunc = PCI_FUNC(pdev->devfn); 5870 5901 ivideo->subsysvendor = pdev->subsystem_vendor; 5871 5902 ivideo->subsysdevice = pdev->subsystem_device; 5872 - 5873 - #ifndef MODULE 5874 - if(sisfb_mode_idx == -1) { 5875 - sisfb_get_vga_mode_from_kernel(); 5876 - } 5877 - #endif 5878 5903 5879 5904 ivideo->chip = chipinfo->chip; 5880 5905 ivideo->chip_real_id = chipinfo->chip;