Skip to content

Commit 7452b31

Browse files
Thomas Zimmermannhdeller
authored andcommitted
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 <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 29328fb commit 7452b31

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

drivers/video/fbdev/sis/sis_main.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <linux/errno.h>
2828
#include <linux/string.h>
2929
#include <linux/mm.h>
30-
#include <linux/screen_info.h>
3130
#include <linux/slab.h>
3231
#include <linux/fb.h>
3332
#include <linux/selection.h>
@@ -257,36 +256,6 @@ static void sisfb_search_mode(char *name, bool quiet)
257256
printk(KERN_ERR "sisfb: Invalid mode '%s'\n", nameptr);
258257
}
259258

260-
#ifndef MODULE
261-
static void sisfb_get_vga_mode_from_kernel(void)
262-
{
263-
#ifdef CONFIG_X86
264-
char mymode[32];
265-
int mydepth = screen_info.lfb_depth;
266-
267-
if(screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) return;
268-
269-
if( (screen_info.lfb_width >= 320) && (screen_info.lfb_width <= 2048) &&
270-
(screen_info.lfb_height >= 200) && (screen_info.lfb_height <= 1536) &&
271-
(mydepth >= 8) && (mydepth <= 32) ) {
272-
273-
if(mydepth == 24) mydepth = 32;
274-
275-
sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
276-
screen_info.lfb_height,
277-
mydepth);
278-
279-
printk(KERN_DEBUG
280-
"sisfb: Using vga mode %s pre-set by kernel as default\n",
281-
mymode);
282-
283-
sisfb_search_mode(mymode, true);
284-
}
285-
#endif
286-
return;
287-
}
288-
#endif
289-
290259
static void __init
291260
sisfb_search_crt2type(const char *name)
292261
{
@@ -5901,12 +5870,6 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
59015870
ivideo->subsysvendor = pdev->subsystem_vendor;
59025871
ivideo->subsysdevice = pdev->subsystem_device;
59035872

5904-
#ifndef MODULE
5905-
if(sisfb_mode_idx == -1) {
5906-
sisfb_get_vga_mode_from_kernel();
5907-
}
5908-
#endif
5909-
59105873
ivideo->chip = chipinfo->chip;
59115874
ivideo->chip_real_id = chipinfo->chip;
59125875
ivideo->sisvga_engine = chipinfo->vgaengine;

0 commit comments

Comments
 (0)