drm_panel_orientation_quirks.c 20 KB

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