* [PATCH] fbdev/sis: Remove dependency on screen_info
@ 2024-01-03 12:13 Thomas Zimmermann
2024-01-08 9:16 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Zimmermann @ 2024-01-03 12:13 UTC (permalink / raw)
To: deller, javierm; +Cc: linux-fbdev, dri-devel, Thomas Zimmermann
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>
---
drivers/video/fbdev/sis/sis_main.c | 37 ------------------------------
1 file changed, 37 deletions(-)
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 6ad47b6b6004..803ccb6aa479 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -27,7 +27,6 @@
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
-#include <linux/screen_info.h>
#include <linux/slab.h>
#include <linux/fb.h>
#include <linux/selection.h>
@@ -257,36 +256,6 @@ static void sisfb_search_mode(char *name, bool quiet)
printk(KERN_ERR "sisfb: Invalid mode '%s'\n", nameptr);
}
-#ifndef MODULE
-static void sisfb_get_vga_mode_from_kernel(void)
-{
-#ifdef CONFIG_X86
- char mymode[32];
- int mydepth = screen_info.lfb_depth;
-
- if(screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) return;
-
- if( (screen_info.lfb_width >= 320) && (screen_info.lfb_width <= 2048) &&
- (screen_info.lfb_height >= 200) && (screen_info.lfb_height <= 1536) &&
- (mydepth >= 8) && (mydepth <= 32) ) {
-
- if(mydepth == 24) mydepth = 32;
-
- sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
- screen_info.lfb_height,
- mydepth);
-
- printk(KERN_DEBUG
- "sisfb: Using vga mode %s pre-set by kernel as default\n",
- mymode);
-
- sisfb_search_mode(mymode, true);
- }
-#endif
- return;
-}
-#endif
-
static void __init
sisfb_search_crt2type(const char *name)
{
@@ -5901,12 +5870,6 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ivideo->subsysvendor = pdev->subsystem_vendor;
ivideo->subsysdevice = pdev->subsystem_device;
-#ifndef MODULE
- if(sisfb_mode_idx == -1) {
- sisfb_get_vga_mode_from_kernel();
- }
-#endif
-
ivideo->chip = chipinfo->chip;
ivideo->chip_real_id = chipinfo->chip;
ivideo->sisvga_engine = chipinfo->vgaengine;
base-commit: 25232eb8a9ac7fa0dac7e846a4bf7fba2b6db39a
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fbdev/sis: Remove dependency on screen_info
2024-01-03 12:13 [PATCH] fbdev/sis: Remove dependency on screen_info Thomas Zimmermann
@ 2024-01-08 9:16 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2024-01-08 9:16 UTC (permalink / raw)
To: Thomas Zimmermann, javierm; +Cc: linux-fbdev, dri-devel
On 1/3/24 13:13, Thomas Zimmermann wrote:
> 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>
> ---
> drivers/video/fbdev/sis/sis_main.c | 37 ------------------------------
> 1 file changed, 37 deletions(-)
applied to fbdev git tree.
Thanks!
Helge
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-08 9:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-03 12:13 [PATCH] fbdev/sis: Remove dependency on screen_info Thomas Zimmermann
2024-01-08 9:16 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).