@@ -92,7 +92,7 @@ void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
9292 })
9393
9494#ifdef CONFIG_EFI
95- static int __init efifb_set_system (const struct dmi_system_id * id )
95+ static int __init efifb_set_system (struct screen_info * si , const struct dmi_system_id * id )
9696{
9797 struct efifb_dmi_info * info = id -> driver_data ;
9898
@@ -101,14 +101,14 @@ static int __init efifb_set_system(const struct dmi_system_id *id)
101101 return 0 ;
102102
103103 /* Trust the bootloader over the DMI tables */
104- if (screen_info . lfb_base == 0 ) {
104+ if (si -> lfb_base == 0 ) {
105105#if defined(CONFIG_PCI )
106106 struct pci_dev * dev = NULL ;
107107 int found_bar = 0 ;
108108#endif
109109 if (info -> base ) {
110- screen_info . lfb_base = choose_value (info -> base ,
111- screen_info . lfb_base , OVERRIDE_BASE ,
110+ si -> lfb_base = choose_value (info -> base ,
111+ si -> lfb_base , OVERRIDE_BASE ,
112112 info -> flags );
113113
114114#if defined(CONFIG_PCI )
@@ -135,49 +135,53 @@ static int __init efifb_set_system(const struct dmi_system_id *id)
135135
136136 start = pci_resource_start (dev , i );
137137 end = pci_resource_end (dev , i );
138- if (screen_info .lfb_base >= start &&
139- screen_info .lfb_base < end ) {
138+ if (si -> lfb_base >= start && si -> lfb_base < end ) {
140139 found_bar = 1 ;
141140 break ;
142141 }
143142 }
144143 }
145144 if (!found_bar )
146- screen_info . lfb_base = 0 ;
145+ si -> lfb_base = 0 ;
147146#endif
148147 }
149148 }
150- if (screen_info . lfb_base ) {
151- screen_info . lfb_linelength = choose_value (info -> stride ,
152- screen_info . lfb_linelength , OVERRIDE_STRIDE ,
149+ if (si -> lfb_base ) {
150+ si -> lfb_linelength = choose_value (info -> stride ,
151+ si -> lfb_linelength , OVERRIDE_STRIDE ,
153152 info -> flags );
154- screen_info . lfb_width = choose_value (info -> width ,
155- screen_info . lfb_width , OVERRIDE_WIDTH ,
153+ si -> lfb_width = choose_value (info -> width ,
154+ si -> lfb_width , OVERRIDE_WIDTH ,
156155 info -> flags );
157- screen_info . lfb_height = choose_value (info -> height ,
158- screen_info . lfb_height , OVERRIDE_HEIGHT ,
156+ si -> lfb_height = choose_value (info -> height ,
157+ si -> lfb_height , OVERRIDE_HEIGHT ,
159158 info -> flags );
160- if (screen_info . orig_video_isVGA == 0 )
161- screen_info . orig_video_isVGA = VIDEO_TYPE_EFI ;
159+ if (si -> orig_video_isVGA == 0 )
160+ si -> orig_video_isVGA = VIDEO_TYPE_EFI ;
162161 } else {
163- screen_info . lfb_linelength = 0 ;
164- screen_info . lfb_width = 0 ;
165- screen_info . lfb_height = 0 ;
166- screen_info . orig_video_isVGA = 0 ;
162+ si -> lfb_linelength = 0 ;
163+ si -> lfb_width = 0 ;
164+ si -> lfb_height = 0 ;
165+ si -> orig_video_isVGA = 0 ;
167166 return 0 ;
168167 }
169168
170169 printk (KERN_INFO "efifb: dmi detected %s - framebuffer at 0x%08x "
171170 "(%dx%d, stride %d)\n" , id -> ident ,
172- screen_info . lfb_base , screen_info . lfb_width ,
173- screen_info . lfb_height , screen_info . lfb_linelength );
171+ si -> lfb_base , si -> lfb_width ,
172+ si -> lfb_height , si -> lfb_linelength );
174173
175174 return 1 ;
176175}
177176
177+ static int __init efifb_set_system_callback (const struct dmi_system_id * id )
178+ {
179+ return efifb_set_system (& screen_info , id );
180+ }
181+
178182#define EFIFB_DMI_SYSTEM_ID (vendor , name , enumid ) \
179183 { \
180- efifb_set_system, \
184+ efifb_set_system_callback, \
181185 name, \
182186 { \
183187 DMI_MATCH(DMI_BIOS_VENDOR, vendor), \
@@ -347,12 +351,13 @@ static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
347351 {},
348352};
349353
350- static bool efifb_overlaps_pci_range (const struct of_pci_range * range )
354+ static bool efifb_overlaps_pci_range (const struct screen_info * si ,
355+ const struct of_pci_range * range )
351356{
352- u64 fb_base = screen_info . lfb_base ;
357+ u64 fb_base = si -> lfb_base ;
353358
354- if (screen_info . capabilities & VIDEO_CAPABILITY_64BIT_BASE )
355- fb_base |= (u64 )(unsigned long )screen_info . ext_lfb_base << 32 ;
359+ if (si -> capabilities & VIDEO_CAPABILITY_64BIT_BASE )
360+ fb_base |= (u64 )(unsigned long )si -> ext_lfb_base << 32 ;
356361
357362 return fb_base >= range -> cpu_addr &&
358363 fb_base < (range -> cpu_addr + range -> size );
@@ -374,7 +379,7 @@ static struct device_node *find_pci_overlap_node(void)
374379 }
375380
376381 for_each_of_pci_range (& parser , & range )
377- if (efifb_overlaps_pci_range (& range ))
382+ if (efifb_overlaps_pci_range (& screen_info , & range ))
378383 return np ;
379384 }
380385 return NULL ;
@@ -412,19 +417,19 @@ static const struct fwnode_operations efifb_fwnode_ops = {
412417
413418static struct fwnode_handle efifb_fwnode ;
414419
415- __init void sysfb_apply_efi_quirks (void )
420+ __init void sysfb_apply_efi_quirks (struct screen_info * si )
416421{
417- if (screen_info . orig_video_isVGA != VIDEO_TYPE_EFI ||
418- !(screen_info . capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS ))
422+ if (si -> orig_video_isVGA != VIDEO_TYPE_EFI ||
423+ !(si -> capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS ))
419424 dmi_check_system (efifb_dmi_system_table );
420425
421- if (screen_info . orig_video_isVGA == VIDEO_TYPE_EFI )
426+ if (si -> orig_video_isVGA == VIDEO_TYPE_EFI )
422427 dmi_check_system (efifb_dmi_swap_width_height );
423428}
424429
425- __init void sysfb_set_efifb_fwnode (struct platform_device * pd )
430+ __init void sysfb_set_efifb_fwnode (const struct screen_info * si , struct platform_device * pd )
426431{
427- if (screen_info . orig_video_isVGA == VIDEO_TYPE_EFI && IS_ENABLED (CONFIG_PCI )) {
432+ if (si -> orig_video_isVGA == VIDEO_TYPE_EFI && IS_ENABLED (CONFIG_PCI )) {
428433 fwnode_init (& efifb_fwnode , & efifb_fwnode_ops );
429434 pd -> dev .fwnode = & efifb_fwnode ;
430435 }
0 commit comments