diff options
Diffstat (limited to 'arch/x86/kernel/sysfb_efi.c')
-rw-r--r-- | arch/x86/kernel/sysfb_efi.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c index 8eb67a670b10..653b7f617b61 100644 --- a/arch/x86/kernel/sysfb_efi.c +++ b/arch/x86/kernel/sysfb_efi.c | |||
@@ -230,9 +230,55 @@ static const struct dmi_system_id efifb_dmi_system_table[] __initconst = { | |||
230 | {}, | 230 | {}, |
231 | }; | 231 | }; |
232 | 232 | ||
233 | /* | ||
234 | * Some devices have a portrait LCD but advertise a landscape resolution (and | ||
235 | * pitch). We simply swap width and height for these devices so that we can | ||
236 | * correctly deal with some of them coming with multiple resolutions. | ||
237 | */ | ||
238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { | ||
239 | { | ||
240 | /* | ||
241 | * Lenovo MIIX310-10ICR, only some batches have the troublesome | ||
242 | * 800x1280 portrait screen. Luckily the portrait version has | ||
243 | * its own BIOS version, so we match on that. | ||
244 | */ | ||
245 | .matches = { | ||
246 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
247 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"), | ||
248 | DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"), | ||
249 | }, | ||
250 | }, | ||
251 | { | ||
252 | /* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */ | ||
253 | .matches = { | ||
254 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
255 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
256 | "Lenovo MIIX 320-10ICR"), | ||
257 | }, | ||
258 | }, | ||
259 | { | ||
260 | /* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */ | ||
261 | .matches = { | ||
262 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
263 | DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, | ||
264 | "Lenovo ideapad D330-10IGM"), | ||
265 | }, | ||
266 | }, | ||
267 | {}, | ||
268 | }; | ||
269 | |||
233 | __init void sysfb_apply_efi_quirks(void) | 270 | __init void sysfb_apply_efi_quirks(void) |
234 | { | 271 | { |
235 | if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || | 272 | if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI || |
236 | !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) | 273 | !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) |
237 | dmi_check_system(efifb_dmi_system_table); | 274 | dmi_check_system(efifb_dmi_system_table); |
275 | |||
276 | if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI && | ||
277 | dmi_check_system(efifb_dmi_swap_width_height)) { | ||
278 | u16 temp = screen_info.lfb_width; | ||
279 | |||
280 | screen_info.lfb_width = screen_info.lfb_height; | ||
281 | screen_info.lfb_height = temp; | ||
282 | screen_info.lfb_linelength = 4 * screen_info.lfb_width; | ||
283 | } | ||
238 | } | 284 | } |