1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * drm_panel_orientation_quirks.c -- Quirks for non-normal panel orientation 4 * 5 * Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com> 6 * 7 * Note the quirks in this file are shared with fbdev/efifb and as such 8 * must not depend on other drm code. 9 */ 10 11 #include <linux/dmi.h> 12 #include <linux/module.h> 13 #include <drm/drm_connector.h> 14 #include <drm/drm_utils.h> 15 16 #ifdef CONFIG_DMI 17 18 /* 19 * Some x86 clamshell design devices use portrait tablet screens and a display 20 * engine which cannot rotate in hardware, so we need to rotate the fbcon to 21 * compensate. Unfortunately these (cheap) devices also typically have quite 22 * generic DMI data, so we match on a combination of DMI data, screen resolution 23 * and a list of known BIOS dates to avoid false positives. 24 */ 25 26 struct drm_dmi_panel_orientation_data { 27 int width; 28 int height; 29 const char * const *bios_dates; 30 int orientation; 31 }; 32 33 static const struct drm_dmi_panel_orientation_data gpd_micropc = { 34 .width = 720, 35 .height = 1280, 36 .bios_dates = (const char * const []){ "04/26/2019", 37 NULL }, 38 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 39 }; 40 41 static const struct drm_dmi_panel_orientation_data gpd_onemix2s = { 42 .width = 1200, 43 .height = 1920, 44 .bios_dates = (const char * const []){ "05/21/2018", "10/26/2018", 45 "03/04/2019", NULL }, 46 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 47 }; 48 49 static const struct drm_dmi_panel_orientation_data gpd_pocket = { 50 .width = 1200, 51 .height = 1920, 52 .bios_dates = (const char * const []){ "05/26/2017", "06/28/2017", 53 "07/05/2017", "08/07/2017", NULL }, 54 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 55 }; 56 57 static const struct drm_dmi_panel_orientation_data gpd_pocket2 = { 58 .width = 1200, 59 .height = 1920, 60 .bios_dates = (const char * const []){ "06/28/2018", "08/28/2018", 61 "12/07/2018", NULL }, 62 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 63 }; 64 65 static const struct drm_dmi_panel_orientation_data gpd_win = { 66 .width = 720, 67 .height = 1280, 68 .bios_dates = (const char * const []){ 69 "10/25/2016", "11/18/2016", "12/23/2016", "12/26/2016", 70 "02/21/2017", "03/20/2017", "05/25/2017", NULL }, 71 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 72 }; 73 74 static const struct drm_dmi_panel_orientation_data gpd_win2 = { 75 .width = 720, 76 .height = 1280, 77 .bios_dates = (const char * const []){ 78 "12/07/2017", "05/24/2018", "06/29/2018", NULL }, 79 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 80 }; 81 82 static const struct drm_dmi_panel_orientation_data itworks_tw891 = { 83 .width = 800, 84 .height = 1280, 85 .bios_dates = (const char * const []){ "10/16/2015", NULL }, 86 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 87 }; 88 89 static const struct drm_dmi_panel_orientation_data onegx1_pro = { 90 .width = 1200, 91 .height = 1920, 92 .bios_dates = (const char * const []){ "12/17/2020", NULL }, 93 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 94 }; 95 96 static const struct drm_dmi_panel_orientation_data lcd640x960_leftside_up = { 97 .width = 640, 98 .height = 960, 99 .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, 100 }; 101 102 static const struct drm_dmi_panel_orientation_data lcd720x1280_rightside_up = { 103 .width = 720, 104 .height = 1280, 105 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 106 }; 107 108 static const struct drm_dmi_panel_orientation_data lcd800x1280_leftside_up = { 109 .width = 800, 110 .height = 1280, 111 .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, 112 }; 113 114 static const struct drm_dmi_panel_orientation_data lcd800x1280_rightside_up = { 115 .width = 800, 116 .height = 1280, 117 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 118 }; 119 120 static const struct drm_dmi_panel_orientation_data lcd1080x1920_leftside_up = { 121 .width = 1080, 122 .height = 1920, 123 .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, 124 }; 125 126 static const struct drm_dmi_panel_orientation_data lcd1080x1920_rightside_up = { 127 .width = 1080, 128 .height = 1920, 129 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 130 }; 131 132 static const struct drm_dmi_panel_orientation_data lcd1200x1920_leftside_up = { 133 .width = 1200, 134 .height = 1920, 135 .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, 136 }; 137 138 static const struct drm_dmi_panel_orientation_data lcd1200x1920_rightside_up = { 139 .width = 1200, 140 .height = 1920, 141 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 142 }; 143 144 static const struct drm_dmi_panel_orientation_data lcd1280x1920_rightside_up = { 145 .width = 1280, 146 .height = 1920, 147 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 148 }; 149 150 static const struct drm_dmi_panel_orientation_data lcd1600x2560_leftside_up = { 151 .width = 1600, 152 .height = 2560, 153 .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, 154 }; 155 156 static const struct drm_dmi_panel_orientation_data lcd1600x2560_rightside_up = { 157 .width = 1600, 158 .height = 2560, 159 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 160 }; 161 162 static const struct dmi_system_id orientation_data[] = { 163 { /* Acer One 10 (S1003) */ 164 .matches = { 165 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"), 166 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"), 167 }, 168 .driver_data = (void *)&lcd800x1280_rightside_up, 169 }, { /* Acer Switch V 10 (SW5-017) */ 170 .matches = { 171 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"), 172 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"), 173 }, 174 .driver_data = (void *)&lcd800x1280_rightside_up, 175 }, { /* Anbernic Win600 */ 176 .matches = { 177 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Anbernic"), 178 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Win600"), 179 }, 180 .driver_data = (void *)&lcd720x1280_rightside_up, 181 }, { /* Asus T100HA */ 182 .matches = { 183 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 184 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"), 185 }, 186 .driver_data = (void *)&lcd800x1280_leftside_up, 187 }, { /* Asus T101HA */ 188 .matches = { 189 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 190 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"), 191 }, 192 .driver_data = (void *)&lcd800x1280_rightside_up, 193 }, { /* Asus T103HAF */ 194 .matches = { 195 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 196 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T103HAF"), 197 }, 198 .driver_data = (void *)&lcd800x1280_rightside_up, 199 }, { /* AYA NEO AYANEO 2/2S */ 200 .matches = { 201 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), 202 DMI_MATCH(DMI_PRODUCT_NAME, "AYANEO 2"), 203 }, 204 .driver_data = (void *)&lcd1200x1920_rightside_up, 205 }, { /* AYA NEO 2021 */ 206 .matches = { 207 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYADEVICE"), 208 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AYA NEO 2021"), 209 }, 210 .driver_data = (void *)&lcd800x1280_rightside_up, 211 }, { /* AYA NEO AIR */ 212 .matches = { 213 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), 214 DMI_MATCH(DMI_PRODUCT_NAME, "AIR"), 215 }, 216 .driver_data = (void *)&lcd1080x1920_leftside_up, 217 }, { /* AYA NEO Flip DS Bottom Screen */ 218 .matches = { 219 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), 220 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FLIP DS"), 221 }, 222 .driver_data = (void *)&lcd640x960_leftside_up, 223 }, { /* AYA NEO Flip KB/DS Top Screen */ 224 .matches = { 225 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), 226 DMI_MATCH(DMI_PRODUCT_NAME, "FLIP"), 227 }, 228 .driver_data = (void *)&lcd1080x1920_leftside_up, 229 }, { /* AYA NEO Founder */ 230 .matches = { 231 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYA NEO"), 232 DMI_MATCH(DMI_PRODUCT_NAME, "AYA NEO Founder"), 233 }, 234 .driver_data = (void *)&lcd800x1280_rightside_up, 235 }, { /* AYA NEO GEEK */ 236 .matches = { 237 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), 238 DMI_MATCH(DMI_PRODUCT_NAME, "GEEK"), 239 }, 240 .driver_data = (void *)&lcd800x1280_rightside_up, 241 }, { /* AYA NEO NEXT */ 242 .matches = { 243 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 244 DMI_MATCH(DMI_BOARD_NAME, "NEXT"), 245 }, 246 .driver_data = (void *)&lcd800x1280_rightside_up, 247 }, { /* AYA NEO KUN */ 248 .matches = { 249 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AYANEO"), 250 DMI_MATCH(DMI_BOARD_NAME, "KUN"), 251 }, 252 .driver_data = (void *)&lcd1600x2560_rightside_up, 253 }, { /* AYA NEO SLIDE */ 254 .matches = { 255 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), 256 DMI_MATCH(DMI_PRODUCT_NAME, "SLIDE"), 257 }, 258 .driver_data = (void *)&lcd1080x1920_leftside_up, 259 }, { /* AYN Loki Max */ 260 .matches = { 261 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"), 262 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Loki Max"), 263 }, 264 .driver_data = (void *)&lcd1080x1920_leftside_up, 265 }, { /* AYN Loki Zero */ 266 .matches = { 267 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"), 268 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Loki Zero"), 269 }, 270 .driver_data = (void *)&lcd1080x1920_leftside_up, 271 }, { /* Chuwi HiBook (CWI514) */ 272 .matches = { 273 DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"), 274 DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), 275 /* Above matches are too generic, add bios-date match */ 276 DMI_MATCH(DMI_BIOS_DATE, "05/07/2016"), 277 }, 278 .driver_data = (void *)&lcd1200x1920_rightside_up, 279 }, { /* Chuwi Hi10 Pro (CWI529) */ 280 .matches = { 281 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Hampoo"), 282 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Hi10 pro tablet"), 283 }, 284 .driver_data = (void *)&lcd1200x1920_rightside_up, 285 }, { /* Dynabook K50 */ 286 .matches = { 287 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dynabook Inc."), 288 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "dynabook K50/FR"), 289 }, 290 .driver_data = (void *)&lcd800x1280_leftside_up, 291 }, { /* GPD MicroPC (generic strings, also match on bios date) */ 292 .matches = { 293 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), 294 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 295 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), 296 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 297 }, 298 .driver_data = (void *)&gpd_micropc, 299 }, { /* GPD MicroPC (later BIOS versions with proper DMI strings) */ 300 .matches = { 301 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), 302 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MicroPC"), 303 }, 304 .driver_data = (void *)&lcd720x1280_rightside_up, 305 }, { /* GPD Win Max */ 306 .matches = { 307 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), 308 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G1619-01"), 309 }, 310 .driver_data = (void *)&lcd800x1280_rightside_up, 311 }, { /* 312 * GPD Pocket, note that the DMI data is less generic then 313 * it seems, devices with a board-vendor of "AMI Corporation" 314 * are quite rare, as are devices which have both board- *and* 315 * product-id set to "Default String" 316 */ 317 .matches = { 318 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 319 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 320 DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), 321 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 322 }, 323 .driver_data = (void *)&gpd_pocket, 324 }, { /* GPD Pocket 2 (generic strings, also match on bios date) */ 325 .matches = { 326 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), 327 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 328 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), 329 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 330 }, 331 .driver_data = (void *)&gpd_pocket2, 332 }, { /* GPD Win (same note on DMI match as GPD Pocket) */ 333 .matches = { 334 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 335 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 336 DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), 337 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 338 }, 339 .driver_data = (void *)&gpd_win, 340 }, { /* GPD Win 2 (too generic strings, also match on bios date) */ 341 .matches = { 342 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), 343 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 344 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), 345 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 346 }, 347 .driver_data = (void *)&gpd_win2, 348 }, { /* GPD Win 2 (correct DMI strings) */ 349 .matches = { 350 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), 351 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "WIN2") 352 }, 353 .driver_data = (void *)&lcd720x1280_rightside_up, 354 }, { /* GPD Win 3 */ 355 .matches = { 356 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), 357 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G1618-03") 358 }, 359 .driver_data = (void *)&lcd720x1280_rightside_up, 360 }, { /* GPD Win Mini */ 361 .matches = { 362 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), 363 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G1617-01") 364 }, 365 .driver_data = (void *)&lcd1080x1920_rightside_up, 366 }, { /* I.T.Works TW891 */ 367 .matches = { 368 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."), 369 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "TW891"), 370 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."), 371 DMI_EXACT_MATCH(DMI_BOARD_NAME, "TW891"), 372 }, 373 .driver_data = (void *)&itworks_tw891, 374 }, { /* KD Kurio Smart C15200 2-in-1 */ 375 .matches = { 376 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "KD Interactive"), 377 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Kurio Smart"), 378 DMI_EXACT_MATCH(DMI_BOARD_NAME, "KDM960BCP"), 379 }, 380 .driver_data = (void *)&lcd800x1280_rightside_up, 381 }, { /* 382 * Lenovo Ideapad Miix 310 laptop, only some production batches 383 * have a portrait screen, the resolution checks makes the quirk 384 * apply only to those batches. 385 */ 386 .matches = { 387 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 388 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80SG"), 389 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"), 390 }, 391 .driver_data = (void *)&lcd800x1280_rightside_up, 392 }, { /* Lenovo Ideapad Miix 320 */ 393 .matches = { 394 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 395 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"), 396 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"), 397 }, 398 .driver_data = (void *)&lcd800x1280_rightside_up, 399 }, { /* Lenovo Ideapad D330-10IGM (HD) */ 400 .matches = { 401 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 402 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGM"), 403 }, 404 .driver_data = (void *)&lcd800x1280_rightside_up, 405 }, { /* Lenovo Ideapad D330-10IGM (FHD) */ 406 .matches = { 407 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 408 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGM"), 409 }, 410 .driver_data = (void *)&lcd1200x1920_rightside_up, 411 }, { /* Lenovo Ideapad D330-10IGL (HD) */ 412 .matches = { 413 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 414 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGL"), 415 }, 416 .driver_data = (void *)&lcd800x1280_rightside_up, 417 }, { /* Lenovo IdeaPad Duet 3 10IGL5 */ 418 .matches = { 419 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 420 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"), 421 }, 422 .driver_data = (void *)&lcd1200x1920_rightside_up, 423 }, { /* Lenovo Legion Go 8APU1 */ 424 .matches = { 425 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 426 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Legion Go 8APU1"), 427 }, 428 .driver_data = (void *)&lcd1600x2560_leftside_up, 429 }, { /* Lenovo Yoga Book X90F / X90L */ 430 .matches = { 431 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), 432 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), 433 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), 434 }, 435 .driver_data = (void *)&lcd1200x1920_rightside_up, 436 }, { /* Lenovo Yoga Book X91F / X91L */ 437 .matches = { 438 /* Non exact match to match F + L versions */ 439 DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), 440 }, 441 .driver_data = (void *)&lcd1200x1920_rightside_up, 442 }, { /* Lenovo Yoga Tablet 2 830F / 830L */ 443 .matches = { 444 /* 445 * Note this also matches the Lenovo Yoga Tablet 2 1050F/L 446 * since that uses the same mainboard. The resolution match 447 * will limit this to only matching on the 830F/L. Neither has 448 * any external video outputs so those are not a concern. 449 */ 450 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."), 451 DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"), 452 DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"), 453 /* Partial match on beginning of BIOS version */ 454 DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"), 455 }, 456 .driver_data = (void *)&lcd1200x1920_rightside_up, 457 }, { /* Lenovo Yoga Tab 3 X90F */ 458 .matches = { 459 DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), 460 DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), 461 }, 462 .driver_data = (void *)&lcd1600x2560_rightside_up, 463 }, { /* Nanote UMPC-01 */ 464 .matches = { 465 DMI_MATCH(DMI_SYS_VENDOR, "RWC CO.,LTD"), 466 DMI_MATCH(DMI_PRODUCT_NAME, "UMPC-01"), 467 }, 468 .driver_data = (void *)&lcd1200x1920_rightside_up, 469 }, { /* OneGX1 Pro */ 470 .matches = { 471 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SYSTEM_MANUFACTURER"), 472 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SYSTEM_PRODUCT_NAME"), 473 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Default string"), 474 }, 475 .driver_data = (void *)&onegx1_pro, 476 }, { /* OneXPlayer */ 477 .matches = { 478 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONE-NETBOOK TECHNOLOGY CO., LTD."), 479 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"), 480 }, 481 .driver_data = (void *)&lcd1600x2560_leftside_up, 482 }, { /* OneXPlayer Mini (Intel) */ 483 .matches = { 484 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONE-NETBOOK TECHNOLOGY CO., LTD."), 485 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"), 486 }, 487 .driver_data = (void *)&lcd1200x1920_leftside_up, 488 }, { /* OrangePi Neo */ 489 .matches = { 490 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "OrangePi"), 491 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "NEO-01"), 492 }, 493 .driver_data = (void *)&lcd1200x1920_rightside_up, 494 }, { /* Samsung GalaxyBook 10.6 */ 495 .matches = { 496 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), 497 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Galaxy Book 10.6"), 498 }, 499 .driver_data = (void *)&lcd1280x1920_rightside_up, 500 }, { /* Valve Steam Deck (Jupiter) */ 501 .matches = { 502 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"), 503 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Jupiter"), 504 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"), 505 }, 506 .driver_data = (void *)&lcd800x1280_rightside_up, 507 }, { /* Valve Steam Deck (Galileo) */ 508 .matches = { 509 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"), 510 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Galileo"), 511 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"), 512 }, 513 .driver_data = (void *)&lcd800x1280_rightside_up, 514 }, { /* VIOS LTH17 */ 515 .matches = { 516 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VIOS"), 517 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"), 518 }, 519 .driver_data = (void *)&lcd800x1280_rightside_up, 520 }, { /* One Mix 2S (generic strings, also match on bios date) */ 521 .matches = { 522 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), 523 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), 524 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), 525 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 526 }, 527 .driver_data = (void *)&gpd_onemix2s, 528 }, 529 {} 530 }; 531 532 /** 533 * drm_get_panel_orientation_quirk - Check for panel orientation quirks 534 * @width: width in pixels of the panel 535 * @height: height in pixels of the panel 536 * 537 * This function checks for platform specific (e.g. DMI based) quirks 538 * providing info on panel_orientation for systems where this cannot be 539 * probed from the hard-/firm-ware. To avoid false-positive this function 540 * takes the panel resolution as argument and checks that against the 541 * resolution expected by the quirk-table entry. 542 * 543 * Note this function is also used outside of the drm-subsys, by for example 544 * the efifb code. Because of this this function gets compiled into its own 545 * kernel-module when built as a module. 546 * 547 * Returns: 548 * A DRM_MODE_PANEL_ORIENTATION_* value if there is a quirk for this system, 549 * or DRM_MODE_PANEL_ORIENTATION_UNKNOWN if there is no quirk. 550 */ 551 int drm_get_panel_orientation_quirk(int width, int height) 552 { 553 const struct dmi_system_id *match; 554 const struct drm_dmi_panel_orientation_data *data; 555 const char *bios_date; 556 int i; 557 558 for (match = dmi_first_match(orientation_data); 559 match; 560 match = dmi_first_match(match + 1)) { 561 data = match->driver_data; 562 563 if (data->width != width || 564 data->height != height) 565 continue; 566 567 if (!data->bios_dates) 568 return data->orientation; 569 570 bios_date = dmi_get_system_info(DMI_BIOS_DATE); 571 if (!bios_date) 572 continue; 573 574 i = match_string(data->bios_dates, -1, bios_date); 575 if (i >= 0) 576 return data->orientation; 577 } 578 579 return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; 580 } 581 EXPORT_SYMBOL(drm_get_panel_orientation_quirk); 582 583 #else 584 585 /* There are no quirks for non x86 devices yet */ 586 int drm_get_panel_orientation_quirk(int width, int height) 587 { 588 return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; 589 } 590 EXPORT_SYMBOL(drm_get_panel_orientation_quirk); 591 592 #endif 593 594 MODULE_DESCRIPTION("Quirks for non-normal panel orientation"); 595 MODULE_LICENSE("Dual MIT/GPL"); 596