sde_edid_parser.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  5. */
  6. #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
  7. #include <drm/drm_edid.h>
  8. #include <linux/hdmi.h>
  9. #include "sde_kms.h"
  10. #include "sde_edid_parser.h"
  11. #include "sde/sde_connector.h"
  12. #define DBC_START_OFFSET 4
  13. #define EDID_DTD_LEN 18
  14. enum data_block_types {
  15. RESERVED,
  16. AUDIO_DATA_BLOCK,
  17. VIDEO_DATA_BLOCK,
  18. VENDOR_SPECIFIC_DATA_BLOCK,
  19. SPEAKER_ALLOCATION_DATA_BLOCK,
  20. VESA_DTC_DATA_BLOCK,
  21. RESERVED2,
  22. USE_EXTENDED_TAG
  23. };
  24. static u8 *sde_find_edid_extension(struct edid *edid, int ext_id)
  25. {
  26. u8 *edid_ext = NULL;
  27. int i;
  28. /* No EDID or EDID extensions */
  29. if (edid == NULL || edid->extensions == 0)
  30. return NULL;
  31. /* Find CEA extension */
  32. for (i = 0; i < edid->extensions; i++) {
  33. edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
  34. if (edid_ext[0] == ext_id)
  35. break;
  36. }
  37. if (i == edid->extensions)
  38. return NULL;
  39. return edid_ext;
  40. }
  41. static u8 *sde_find_cea_extension(struct edid *edid)
  42. {
  43. return sde_find_edid_extension(edid, SDE_CEA_EXT);
  44. }
  45. static int
  46. sde_cea_db_payload_len(const u8 *db)
  47. {
  48. return db[0] & 0x1f;
  49. }
  50. static int
  51. sde_cea_db_tag(const u8 *db)
  52. {
  53. return db[0] >> 5;
  54. }
  55. static int
  56. sde_cea_revision(const u8 *cea)
  57. {
  58. return cea[1];
  59. }
  60. static int
  61. sde_cea_db_offsets(const u8 *cea, int *start, int *end)
  62. {
  63. /* Data block offset in CEA extension block */
  64. *start = 4;
  65. *end = cea[2];
  66. if (*end == 0)
  67. *end = 127;
  68. if (*end < 4 || *end > 127)
  69. return -ERANGE;
  70. return 0;
  71. }
  72. #define sde_for_each_cea_db(cea, i, start, end) \
  73. for ((i) = (start); \
  74. (i) < (end) && (i) + sde_cea_db_payload_len(&(cea)[(i)]) < (end); \
  75. (i) += sde_cea_db_payload_len(&(cea)[(i)]) + 1)
  76. static bool sde_cea_db_is_hdmi_hf_vsdb(const u8 *db)
  77. {
  78. int hdmi_id;
  79. if (sde_cea_db_tag(db) != VENDOR_SPECIFIC_DATA_BLOCK)
  80. return false;
  81. if (sde_cea_db_payload_len(db) < 7)
  82. return false;
  83. hdmi_id = db[1] | (db[2] << 8) | (db[3] << 16);
  84. return hdmi_id == HDMI_FORUM_IEEE_OUI;
  85. }
  86. static const u8 *_sde_edid_find_block(const u8 *in_buf, u32 start_offset,
  87. u8 type, u8 *len)
  88. {
  89. /* the start of data block collection, start of Video Data Block */
  90. u32 offset = start_offset;
  91. u32 dbc_offset = in_buf[2];
  92. SDE_EDID_DEBUG("%s +", __func__);
  93. /*
  94. * * edid buffer 1, byte 2 being 4 means no non-DTD/Data block
  95. * collection present.
  96. * * edid buffer 1, byte 2 being 0 means no non-DTD/DATA block
  97. * collection present and no DTD data present.
  98. */
  99. if ((dbc_offset == 0) || (dbc_offset == 4)) {
  100. SDE_EDID_DEBUG("EDID: no DTD or non-DTD data present\n");
  101. return NULL;
  102. }
  103. while (offset < dbc_offset) {
  104. u8 block_len = in_buf[offset] & 0x1F;
  105. if ((offset + block_len <= dbc_offset) &&
  106. (in_buf[offset] >> 5) == type) {
  107. *len = block_len;
  108. SDE_EDID_DEBUG("block=%d found @ 0x%x w/ len=%d\n",
  109. type, offset, block_len);
  110. return in_buf + offset;
  111. }
  112. offset += 1 + block_len;
  113. }
  114. return NULL;
  115. }
  116. static void sde_edid_extract_vendor_id(struct sde_edid_ctrl *edid_ctrl)
  117. {
  118. char *vendor_id;
  119. u32 id_codes;
  120. SDE_EDID_DEBUG("%s +", __func__);
  121. if (!edid_ctrl) {
  122. SDE_ERROR("%s: invalid input\n", __func__);
  123. return;
  124. }
  125. vendor_id = edid_ctrl->vendor_id;
  126. id_codes = ((u32)edid_ctrl->edid->mfg_id[0] << 8) +
  127. edid_ctrl->edid->mfg_id[1];
  128. vendor_id[0] = 'A' - 1 + ((id_codes >> 10) & 0x1F);
  129. vendor_id[1] = 'A' - 1 + ((id_codes >> 5) & 0x1F);
  130. vendor_id[2] = 'A' - 1 + (id_codes & 0x1F);
  131. vendor_id[3] = 0;
  132. SDE_EDID_DEBUG("vendor id is %s ", vendor_id);
  133. SDE_EDID_DEBUG("%s -", __func__);
  134. }
  135. static void _sde_edid_update_dc_modes(
  136. struct drm_connector *connector, struct sde_edid_ctrl *edid_ctrl)
  137. {
  138. int i, start, end;
  139. u8 *edid_ext, *hdmi;
  140. struct drm_display_info *disp_info;
  141. u32 hdmi_dc_yuv_modes = 0;
  142. SDE_EDID_DEBUG("%s +\n", __func__);
  143. if (!connector || !edid_ctrl) {
  144. SDE_ERROR("invalid input\n");
  145. return;
  146. }
  147. disp_info = &connector->display_info;
  148. edid_ext = sde_find_cea_extension(edid_ctrl->edid);
  149. if (!edid_ext) {
  150. SDE_DEBUG("no cea extension\n");
  151. return;
  152. }
  153. if (sde_cea_db_offsets(edid_ext, &start, &end))
  154. return;
  155. sde_for_each_cea_db(edid_ext, i, start, end) {
  156. if (sde_cea_db_is_hdmi_hf_vsdb(&edid_ext[i])) {
  157. hdmi = &edid_ext[i];
  158. if (sde_cea_db_payload_len(hdmi) < 7)
  159. continue;
  160. if (hdmi[7] & DRM_EDID_YCBCR420_DC_30) {
  161. hdmi_dc_yuv_modes |= DRM_EDID_YCBCR420_DC_30;
  162. SDE_EDID_DEBUG("Y420 30-bit supported\n");
  163. }
  164. if (hdmi[7] & DRM_EDID_YCBCR420_DC_36) {
  165. hdmi_dc_yuv_modes |= DRM_EDID_YCBCR420_DC_36;
  166. SDE_EDID_DEBUG("Y420 36-bit supported\n");
  167. }
  168. if (hdmi[7] & DRM_EDID_YCBCR420_DC_48) {
  169. hdmi_dc_yuv_modes |= DRM_EDID_YCBCR420_DC_36;
  170. SDE_EDID_DEBUG("Y420 48-bit supported\n");
  171. }
  172. }
  173. }
  174. disp_info->edid_hdmi_dc_modes |= hdmi_dc_yuv_modes;
  175. SDE_EDID_DEBUG("%s -\n", __func__);
  176. }
  177. static void _sde_edid_extract_audio_data_blocks(
  178. struct sde_edid_ctrl *edid_ctrl)
  179. {
  180. u8 len = 0;
  181. u8 adb_max = 0;
  182. const u8 *adb = NULL;
  183. u32 offset = DBC_START_OFFSET;
  184. u8 *cea = NULL;
  185. if (!edid_ctrl) {
  186. SDE_ERROR("invalid edid_ctrl\n");
  187. return;
  188. }
  189. SDE_EDID_DEBUG("%s +", __func__);
  190. cea = sde_find_cea_extension(edid_ctrl->edid);
  191. if (!cea) {
  192. SDE_DEBUG("CEA extension not found\n");
  193. return;
  194. }
  195. edid_ctrl->adb_size = 0;
  196. memset(edid_ctrl->audio_data_block, 0,
  197. sizeof(edid_ctrl->audio_data_block));
  198. do {
  199. len = 0;
  200. adb = _sde_edid_find_block(cea, offset, AUDIO_DATA_BLOCK,
  201. &len);
  202. if ((adb == NULL) || (len > MAX_AUDIO_DATA_BLOCK_SIZE ||
  203. adb_max >= MAX_NUMBER_ADB)) {
  204. if (!edid_ctrl->adb_size) {
  205. SDE_DEBUG("No/Invalid Audio Data Block\n");
  206. return;
  207. }
  208. continue;
  209. }
  210. memcpy(edid_ctrl->audio_data_block + edid_ctrl->adb_size,
  211. adb + 1, len);
  212. offset = (adb - cea) + 1 + len;
  213. edid_ctrl->adb_size += len;
  214. adb_max++;
  215. } while (adb);
  216. SDE_EDID_DEBUG("%s -", __func__);
  217. }
  218. static void sde_edid_parse_hdr_plus_info(struct drm_connector *connector,
  219. const u8 *db)
  220. {
  221. struct sde_connector *c_conn;
  222. c_conn = to_sde_connector(connector);
  223. c_conn->hdr_plus_app_ver = db[5] & VSVDB_HDR10_PLUS_APP_VER_MASK;
  224. }
  225. static void sde_edid_parse_vsvdb_info(struct drm_connector *connector,
  226. const u8 *db)
  227. {
  228. u8 db_len = 0;
  229. u32 ieee_code = 0;
  230. SDE_EDID_DEBUG("%s +\n", __func__);
  231. db_len = sde_cea_db_payload_len(db);
  232. if (db_len < 5)
  233. return;
  234. /* Bytes 2-4: IEEE 24-bit code, LSB first */
  235. ieee_code = db[2] | (db[3] << 8) | (db[4] << 16);
  236. if (ieee_code == VSVDB_HDR10_PLUS_IEEE_CODE)
  237. sde_edid_parse_hdr_plus_info(connector, db);
  238. SDE_EDID_DEBUG("%s -\n", __func__);
  239. }
  240. static bool sde_edid_is_luminance_value_present(u32 block_length,
  241. enum luminance_value value)
  242. {
  243. return block_length > NO_LUMINANCE_DATA && value <= block_length;
  244. }
  245. /*
  246. * sde_edid_parse_hdr_db - Parse the HDR extended block
  247. * @connector: connector for the external sink
  248. * @db: start of the HDR extended block
  249. *
  250. * Parses the HDR extended block to extract sink info for @connector.
  251. */
  252. static void
  253. sde_edid_parse_hdr_db(struct drm_connector *connector, const u8 *db)
  254. {
  255. u8 len = 0;
  256. struct sde_connector *c_conn;
  257. c_conn = to_sde_connector(connector);
  258. if (!db)
  259. return;
  260. len = db[0] & 0x1f;
  261. /* Byte 3: Electro-Optical Transfer Functions */
  262. c_conn->hdr_eotf = db[2] & 0x3F;
  263. /* Byte 4: Static Metadata Descriptor Type 1 */
  264. c_conn->hdr_metadata_type_one = (db[3] & BIT(0));
  265. /* Byte 5: Desired Content Maximum Luminance */
  266. if (sde_edid_is_luminance_value_present(len, MAXIMUM_LUMINANCE))
  267. c_conn->hdr_max_luminance = db[MAXIMUM_LUMINANCE];
  268. /* Byte 6: Desired Content Max Frame-average Luminance */
  269. if (sde_edid_is_luminance_value_present(len, FRAME_AVERAGE_LUMINANCE))
  270. c_conn->hdr_avg_luminance = db[FRAME_AVERAGE_LUMINANCE];
  271. /* Byte 7: Desired Content Min Luminance */
  272. if (sde_edid_is_luminance_value_present(len, MINIMUM_LUMINANCE))
  273. c_conn->hdr_min_luminance = db[MINIMUM_LUMINANCE];
  274. c_conn->hdr_supported = true;
  275. SDE_EDID_DEBUG("HDR electro-optical %d\n", c_conn->hdr_eotf);
  276. SDE_EDID_DEBUG("metadata desc 1 %d\n", c_conn->hdr_metadata_type_one);
  277. SDE_EDID_DEBUG("max luminance %d\n", c_conn->hdr_max_luminance);
  278. SDE_EDID_DEBUG("avg luminance %d\n", c_conn->hdr_avg_luminance);
  279. SDE_EDID_DEBUG("min luminance %d\n", c_conn->hdr_min_luminance);
  280. }
  281. /*
  282. * drm_extract_clrmetry_db - Parse the HDMI colorimetry extended block
  283. * @connector: connector corresponding to the HDMI sink
  284. * @db: start of the HDMI colorimetry extended block
  285. *
  286. * Parses the HDMI colorimetry block to extract sink info for @connector.
  287. */
  288. static void
  289. sde_parse_clrmetry_db(struct drm_connector *connector, const u8 *db)
  290. {
  291. struct sde_connector *c_conn;
  292. c_conn = to_sde_connector(connector);
  293. if (!db) {
  294. DRM_ERROR("invalid db\n");
  295. return;
  296. }
  297. /* Byte 3 Bit 0: xvYCC_601 */
  298. if (db[2] & BIT(0))
  299. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_601;
  300. /* Byte 3 Bit 1: xvYCC_709 */
  301. if (db[2] & BIT(1))
  302. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_709;
  303. /* Byte 3 Bit 2: sYCC_601 */
  304. if (db[2] & BIT(2))
  305. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_sYCC_601;
  306. /* Byte 3 Bit 3: ADOBE_YCC_601 */
  307. if (db[2] & BIT(3))
  308. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_ADOBE_YCC_601;
  309. /* Byte 3 Bit 4: ADOBE_RGB */
  310. if (db[2] & BIT(4))
  311. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_ADOBE_RGB;
  312. /* Byte 3 Bit 5: BT2020_CYCC */
  313. if (db[2] & BIT(5))
  314. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_CYCC;
  315. /* Byte 3 Bit 6: BT2020_YCC */
  316. if (db[2] & BIT(6))
  317. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_YCC;
  318. /* Byte 3 Bit 7: BT2020_RGB */
  319. if (db[2] & BIT(7))
  320. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_RGB;
  321. /* Byte 4 Bit 7: DCI-P3 */
  322. if (db[3] & BIT(7))
  323. c_conn->color_enc_fmt |= DRM_EDID_CLRMETRY_DCI_P3;
  324. DRM_DEBUG_KMS("colorimetry fmts = 0x%x\n", c_conn->color_enc_fmt);
  325. }
  326. /*
  327. * sde_edid_parse_extended_blk_info - Parse the HDMI extended tag blocks
  328. * @connector: connector corresponding to external sink
  329. * @edid: handle to the EDID structure
  330. * Parses the all extended tag blocks extract sink info for @connector.
  331. */
  332. static void
  333. sde_edid_parse_extended_blk_info(struct drm_connector *connector,
  334. struct edid *edid)
  335. {
  336. const u8 *cea = sde_find_cea_extension(edid);
  337. const u8 *db = NULL;
  338. if (cea && sde_cea_revision(cea) >= 3) {
  339. int i, start, end;
  340. if (sde_cea_db_offsets(cea, &start, &end))
  341. return;
  342. sde_for_each_cea_db(cea, i, start, end) {
  343. db = &cea[i];
  344. if (sde_cea_db_tag(db) == USE_EXTENDED_TAG) {
  345. SDE_EDID_DEBUG("found ext tag block = %d\n",
  346. db[1]);
  347. switch (db[1]) {
  348. case VENDOR_SPECIFIC_VIDEO_DATA_BLOCK:
  349. sde_edid_parse_vsvdb_info(connector,
  350. db);
  351. break;
  352. case HDR_STATIC_METADATA_DATA_BLOCK:
  353. sde_edid_parse_hdr_db(connector, db);
  354. break;
  355. case COLORIMETRY_EXTENDED_DATA_BLOCK:
  356. sde_parse_clrmetry_db(connector, db);
  357. default:
  358. break;
  359. }
  360. }
  361. }
  362. }
  363. }
  364. static void _sde_edid_extract_speaker_allocation_data(
  365. struct sde_edid_ctrl *edid_ctrl)
  366. {
  367. u8 len;
  368. const u8 *sadb = NULL;
  369. u8 *cea = NULL;
  370. if (!edid_ctrl) {
  371. SDE_ERROR("invalid edid_ctrl\n");
  372. return;
  373. }
  374. SDE_EDID_DEBUG("%s +", __func__);
  375. cea = sde_find_cea_extension(edid_ctrl->edid);
  376. if (!cea) {
  377. SDE_DEBUG("CEA extension not found\n");
  378. return;
  379. }
  380. sadb = _sde_edid_find_block(cea, DBC_START_OFFSET,
  381. SPEAKER_ALLOCATION_DATA_BLOCK, &len);
  382. if ((sadb == NULL) || (len != MAX_SPKR_ALLOC_DATA_BLOCK_SIZE)) {
  383. SDE_DEBUG("No/Invalid Speaker Allocation Data Block\n");
  384. return;
  385. }
  386. memcpy(edid_ctrl->spkr_alloc_data_block, sadb + 1, len);
  387. edid_ctrl->sadb_size = len;
  388. SDE_EDID_DEBUG("speaker alloc data SP byte = %08x %s%s%s%s%s%s%s\n",
  389. sadb[1],
  390. (sadb[1] & BIT(0)) ? "FL/FR," : "",
  391. (sadb[1] & BIT(1)) ? "LFE," : "",
  392. (sadb[1] & BIT(2)) ? "FC," : "",
  393. (sadb[1] & BIT(3)) ? "RL/RR," : "",
  394. (sadb[1] & BIT(4)) ? "RC," : "",
  395. (sadb[1] & BIT(5)) ? "FLC/FRC," : "",
  396. (sadb[1] & BIT(6)) ? "RLC/RRC," : "");
  397. SDE_EDID_DEBUG("%s -", __func__);
  398. }
  399. struct sde_edid_ctrl *sde_edid_init(void)
  400. {
  401. struct sde_edid_ctrl *edid_ctrl = NULL;
  402. SDE_EDID_DEBUG("%s +\n", __func__);
  403. edid_ctrl = kzalloc(sizeof(*edid_ctrl), GFP_KERNEL);
  404. if (!edid_ctrl) {
  405. SDE_ERROR("edid_ctrl alloc failed\n");
  406. return NULL;
  407. }
  408. memset((edid_ctrl), 0, sizeof(*edid_ctrl));
  409. SDE_EDID_DEBUG("%s -\n", __func__);
  410. return edid_ctrl;
  411. }
  412. void sde_free_edid(void **input)
  413. {
  414. struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(*input);
  415. SDE_EDID_DEBUG("%s +", __func__);
  416. kfree(edid_ctrl->edid);
  417. edid_ctrl->edid = NULL;
  418. }
  419. void sde_edid_deinit(void **input)
  420. {
  421. struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(*input);
  422. SDE_EDID_DEBUG("%s +", __func__);
  423. sde_free_edid((void *)&edid_ctrl);
  424. kfree(edid_ctrl);
  425. SDE_EDID_DEBUG("%s -", __func__);
  426. }
  427. int _sde_edid_update_modes(struct drm_connector *connector,
  428. void *input)
  429. {
  430. int rc = 0;
  431. struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input);
  432. SDE_EDID_DEBUG("%s +", __func__);
  433. if (edid_ctrl->edid) {
  434. drm_connector_update_edid_property(connector,
  435. edid_ctrl->edid);
  436. rc = drm_add_edid_modes(connector, edid_ctrl->edid);
  437. _sde_edid_update_dc_modes(connector, edid_ctrl);
  438. sde_edid_parse_extended_blk_info(connector,
  439. edid_ctrl->edid);
  440. SDE_EDID_DEBUG("%s -", __func__);
  441. return rc;
  442. }
  443. drm_connector_update_edid_property(connector, NULL);
  444. SDE_EDID_DEBUG("%s null edid -", __func__);
  445. return rc;
  446. }
  447. u8 sde_get_edid_checksum(void *input)
  448. {
  449. struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input);
  450. struct edid *edid = NULL, *last_block = NULL;
  451. u8 *raw_edid = NULL;
  452. if (!edid_ctrl || !edid_ctrl->edid) {
  453. SDE_ERROR("invalid edid input\n");
  454. return 0;
  455. }
  456. edid = edid_ctrl->edid;
  457. raw_edid = (u8 *)edid;
  458. raw_edid += (edid->extensions * EDID_LENGTH);
  459. last_block = (struct edid *)raw_edid;
  460. if (last_block)
  461. return last_block->checksum;
  462. SDE_ERROR("Invalid block, no checksum\n");
  463. return 0;
  464. }
  465. bool sde_detect_hdmi_monitor(void *input)
  466. {
  467. struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input);
  468. return drm_detect_hdmi_monitor(edid_ctrl->edid);
  469. }
  470. void sde_parse_edid(void *input)
  471. {
  472. struct sde_edid_ctrl *edid_ctrl;
  473. if (!input) {
  474. SDE_ERROR("Invalid input\n");
  475. return;
  476. }
  477. edid_ctrl = (struct sde_edid_ctrl *)(input);
  478. if (edid_ctrl->edid) {
  479. sde_edid_extract_vendor_id(edid_ctrl);
  480. _sde_edid_extract_audio_data_blocks(edid_ctrl);
  481. _sde_edid_extract_speaker_allocation_data(edid_ctrl);
  482. } else {
  483. SDE_ERROR("edid not present\n");
  484. }
  485. }
  486. void sde_get_edid(struct drm_connector *connector,
  487. struct i2c_adapter *adapter, void **input)
  488. {
  489. struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(*input);
  490. edid_ctrl->edid = drm_get_edid(connector, adapter);
  491. SDE_EDID_DEBUG("%s +\n", __func__);
  492. if (!edid_ctrl->edid)
  493. SDE_ERROR("EDID read failed\n");
  494. if (edid_ctrl->edid)
  495. sde_parse_edid(edid_ctrl);
  496. SDE_EDID_DEBUG("%s -\n", __func__);
  497. };