Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

efi: sysfb_efi: Convert swap width and height quirk to a callback

Convert the swapping of width and height quirk to a callback.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Melissa Wen <mwen@igalia.com>
Cc: linux-efi@vger.kernel.org
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Melissa Wen <mwen@igalia.com> # v3
[ardb: use local var to refer to screen_info]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by

Tvrtko Ursulin and committed by
Ard Biesheuvel
7f2f1fd6 449b87e8

+18 -8
+18 -8
drivers/firmware/efi/sysfb_efi.c
··· 231 231 {}, 232 232 }; 233 233 234 + static int __init efifb_swap_width_height(const struct dmi_system_id *id) 235 + { 236 + struct screen_info *si = &screen_info; 237 + u32 bpp = __screen_info_lfb_bits_per_pixel(si); 238 + 239 + swap(si->lfb_width, si->lfb_height); 240 + si->lfb_linelength = bpp * si->lfb_width / BITS_PER_BYTE; 241 + 242 + return 1; 243 + } 244 + 234 245 /* 235 246 * Some devices have a portrait LCD but advertise a landscape resolution (and 236 247 * pitch). We simply swap width and height for these devices so that we can ··· 259 248 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"), 260 249 DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"), 261 250 }, 251 + .callback = efifb_swap_width_height, 262 252 }, 263 253 { 264 254 /* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */ ··· 268 256 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, 269 257 "Lenovo MIIX 320-10ICR"), 270 258 }, 259 + .callback = efifb_swap_width_height, 271 260 }, 272 261 { 273 262 /* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */ ··· 277 264 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, 278 265 "Lenovo ideapad D330-10IGM"), 279 266 }, 267 + .callback = efifb_swap_width_height, 280 268 }, 281 269 { 282 270 /* Lenovo IdeaPad Duet 3 10IGL5 with 1200x1920 portrait screen */ ··· 286 272 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, 287 273 "IdeaPad Duet 3 10IGL5"), 288 274 }, 275 + .callback = efifb_swap_width_height, 289 276 }, 290 277 { 291 278 /* Lenovo Yoga Book X91F / X91L */ ··· 295 280 /* Non exact match to match F + L versions */ 296 281 DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), 297 282 }, 283 + .callback = efifb_swap_width_height, 298 284 }, 299 285 {}, 300 286 }; ··· 371 355 !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS)) 372 356 dmi_check_system(efifb_dmi_system_table); 373 357 374 - if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI && 375 - dmi_check_system(efifb_dmi_swap_width_height)) { 376 - u32 bpp = __screen_info_lfb_bits_per_pixel(&screen_info); 377 - 378 - swap(screen_info.lfb_width, screen_info.lfb_height); 379 - screen_info.lfb_linelength = bpp * screen_info.lfb_width / 380 - BITS_PER_BYTE; 381 - } 358 + if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) 359 + dmi_check_system(efifb_dmi_swap_width_height); 382 360 } 383 361 384 362 __init void sysfb_set_efifb_fwnode(struct platform_device *pd)