@@ -89,12 +89,9 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
89
89
unsigned long size , void * * handles )
90
90
{
91
91
efi_graphics_output_protocol_t * gop , * first_gop ;
92
- u16 width , height ;
93
- u32 pixels_per_scan_line ;
94
- u32 ext_lfb_base ;
92
+ efi_graphics_output_protocol_mode_t * mode ;
93
+ efi_graphics_output_mode_info_t * info = NULL ;
95
94
efi_physical_addr_t fb_base ;
96
- efi_pixel_bitmask_t pixel_info ;
97
- int pixel_format ;
98
95
efi_status_t status ;
99
96
efi_handle_t h ;
100
97
int i ;
@@ -103,8 +100,6 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
103
100
gop = NULL ;
104
101
105
102
for_each_efi_handle (h , handles , size , i ) {
106
- efi_graphics_output_protocol_mode_t * mode ;
107
- efi_graphics_output_mode_info_t * info = NULL ;
108
103
efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID ;
109
104
bool conout_found = false;
110
105
void * dummy = NULL ;
@@ -129,15 +124,7 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
129
124
* backed by real hardware. The workaround is to search
130
125
* for a GOP implementing the ConOut protocol, and if
131
126
* one isn't found, to just fall back to the first GOP.
132
- */
133
- width = info -> horizontal_resolution ;
134
- height = info -> vertical_resolution ;
135
- pixel_format = info -> pixel_format ;
136
- pixel_info = info -> pixel_information ;
137
- pixels_per_scan_line = info -> pixels_per_scan_line ;
138
- fb_base = efi_table_attr (mode , frame_buffer_base );
139
-
140
- /*
127
+ *
141
128
* Once we've found a GOP supporting ConOut,
142
129
* don't bother looking any further.
143
130
*/
@@ -152,21 +139,24 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
152
139
return EFI_NOT_FOUND ;
153
140
154
141
/* EFI framebuffer */
142
+ mode = efi_table_attr (first_gop , mode );
143
+ info = efi_table_attr (mode , info );
144
+
155
145
si -> orig_video_isVGA = VIDEO_TYPE_EFI ;
156
146
157
- si -> lfb_width = width ;
158
- si -> lfb_height = height ;
159
- si -> lfb_base = fb_base ;
147
+ si -> lfb_width = info -> horizontal_resolution ;
148
+ si -> lfb_height = info -> vertical_resolution ;
160
149
161
- ext_lfb_base = (u64 )(unsigned long )fb_base >> 32 ;
162
- if (ext_lfb_base ) {
150
+ fb_base = efi_table_attr (mode , frame_buffer_base );
151
+ si -> lfb_base = fb_base ;
152
+ si -> ext_lfb_base = (u64 )(unsigned long )fb_base >> 32 ;
153
+ if (si -> ext_lfb_base )
163
154
si -> capabilities |= VIDEO_CAPABILITY_64BIT_BASE ;
164
- si -> ext_lfb_base = ext_lfb_base ;
165
- }
166
155
167
156
si -> pages = 1 ;
168
157
169
- setup_pixel_info (si , pixels_per_scan_line , pixel_info , pixel_format );
158
+ setup_pixel_info (si , info -> pixels_per_scan_line ,
159
+ info -> pixel_information , info -> pixel_format );
170
160
171
161
si -> lfb_size = si -> lfb_linelength * si -> lfb_height ;
172
162
0 commit comments