intel_bios.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. /*
  2. * Copyright (c) 2006 Intel Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  16. *
  17. * Authors:
  18. * Eric Anholt <eric@anholt.net>
  19. *
  20. */
  21. #include <drm/drmP.h>
  22. #include <drm/drm.h>
  23. #include <drm/gma_drm.h>
  24. #include "psb_drv.h"
  25. #include "psb_intel_drv.h"
  26. #include "psb_intel_reg.h"
  27. #include "intel_bios.h"
  28. #define SLAVE_ADDR1 0x70
  29. #define SLAVE_ADDR2 0x72
  30. static void *find_section(struct bdb_header *bdb, int section_id)
  31. {
  32. u8 *base = (u8 *)bdb;
  33. int index = 0;
  34. u16 total, current_size;
  35. u8 current_id;
  36. /* skip to first section */
  37. index += bdb->header_size;
  38. total = bdb->bdb_size;
  39. /* walk the sections looking for section_id */
  40. while (index < total) {
  41. current_id = *(base + index);
  42. index++;
  43. current_size = *((u16 *)(base + index));
  44. index += 2;
  45. if (current_id == section_id)
  46. return base + index;
  47. index += current_size;
  48. }
  49. return NULL;
  50. }
  51. static void
  52. parse_edp(struct drm_psb_private *dev_priv, struct bdb_header *bdb)
  53. {
  54. struct bdb_edp *edp;
  55. struct edp_power_seq *edp_pps;
  56. struct edp_link_params *edp_link_params;
  57. uint8_t panel_type;
  58. edp = find_section(bdb, BDB_EDP);
  59. dev_priv->edp.bpp = 18;
  60. if (!edp) {
  61. if (dev_priv->edp.support) {
  62. DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported, assume %dbpp panel color depth.\n",
  63. dev_priv->edp.bpp);
  64. }
  65. return;
  66. }
  67. panel_type = dev_priv->panel_type;
  68. switch ((edp->color_depth >> (panel_type * 2)) & 3) {
  69. case EDP_18BPP:
  70. dev_priv->edp.bpp = 18;
  71. break;
  72. case EDP_24BPP:
  73. dev_priv->edp.bpp = 24;
  74. break;
  75. case EDP_30BPP:
  76. dev_priv->edp.bpp = 30;
  77. break;
  78. }
  79. /* Get the eDP sequencing and link info */
  80. edp_pps = &edp->power_seqs[panel_type];
  81. edp_link_params = &edp->link_params[panel_type];
  82. dev_priv->edp.pps = *edp_pps;
  83. DRM_DEBUG_KMS("EDP timing in vbt t1_t3 %d t8 %d t9 %d t10 %d t11_t12 %d\n",
  84. dev_priv->edp.pps.t1_t3, dev_priv->edp.pps.t8,
  85. dev_priv->edp.pps.t9, dev_priv->edp.pps.t10,
  86. dev_priv->edp.pps.t11_t12);
  87. dev_priv->edp.rate = edp_link_params->rate ? DP_LINK_BW_2_7 :
  88. DP_LINK_BW_1_62;
  89. switch (edp_link_params->lanes) {
  90. case 0:
  91. dev_priv->edp.lanes = 1;
  92. break;
  93. case 1:
  94. dev_priv->edp.lanes = 2;
  95. break;
  96. case 3:
  97. default:
  98. dev_priv->edp.lanes = 4;
  99. break;
  100. }
  101. DRM_DEBUG_KMS("VBT reports EDP: Lane_count %d, Lane_rate %d, Bpp %d\n",
  102. dev_priv->edp.lanes, dev_priv->edp.rate, dev_priv->edp.bpp);
  103. switch (edp_link_params->preemphasis) {
  104. case 0:
  105. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_0;
  106. break;
  107. case 1:
  108. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_3_5;
  109. break;
  110. case 2:
  111. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_6;
  112. break;
  113. case 3:
  114. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_9_5;
  115. break;
  116. }
  117. switch (edp_link_params->vswing) {
  118. case 0:
  119. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_400;
  120. break;
  121. case 1:
  122. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_600;
  123. break;
  124. case 2:
  125. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_800;
  126. break;
  127. case 3:
  128. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_1200;
  129. break;
  130. }
  131. DRM_DEBUG_KMS("VBT reports EDP: VSwing %d, Preemph %d\n",
  132. dev_priv->edp.vswing, dev_priv->edp.preemphasis);
  133. }
  134. static u16
  135. get_blocksize(void *p)
  136. {
  137. u16 *block_ptr, block_size;
  138. block_ptr = (u16 *)((char *)p - 2);
  139. block_size = *block_ptr;
  140. return block_size;
  141. }
  142. static void fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
  143. struct lvds_dvo_timing *dvo_timing)
  144. {
  145. panel_fixed_mode->hdisplay = (dvo_timing->hactive_hi << 8) |
  146. dvo_timing->hactive_lo;
  147. panel_fixed_mode->hsync_start = panel_fixed_mode->hdisplay +
  148. ((dvo_timing->hsync_off_hi << 8) | dvo_timing->hsync_off_lo);
  149. panel_fixed_mode->hsync_end = panel_fixed_mode->hsync_start +
  150. dvo_timing->hsync_pulse_width;
  151. panel_fixed_mode->htotal = panel_fixed_mode->hdisplay +
  152. ((dvo_timing->hblank_hi << 8) | dvo_timing->hblank_lo);
  153. panel_fixed_mode->vdisplay = (dvo_timing->vactive_hi << 8) |
  154. dvo_timing->vactive_lo;
  155. panel_fixed_mode->vsync_start = panel_fixed_mode->vdisplay +
  156. dvo_timing->vsync_off;
  157. panel_fixed_mode->vsync_end = panel_fixed_mode->vsync_start +
  158. dvo_timing->vsync_pulse_width;
  159. panel_fixed_mode->vtotal = panel_fixed_mode->vdisplay +
  160. ((dvo_timing->vblank_hi << 8) | dvo_timing->vblank_lo);
  161. panel_fixed_mode->clock = dvo_timing->clock * 10;
  162. panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
  163. if (dvo_timing->hsync_positive)
  164. panel_fixed_mode->flags |= DRM_MODE_FLAG_PHSYNC;
  165. else
  166. panel_fixed_mode->flags |= DRM_MODE_FLAG_NHSYNC;
  167. if (dvo_timing->vsync_positive)
  168. panel_fixed_mode->flags |= DRM_MODE_FLAG_PVSYNC;
  169. else
  170. panel_fixed_mode->flags |= DRM_MODE_FLAG_NVSYNC;
  171. /* Some VBTs have bogus h/vtotal values */
  172. if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
  173. panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
  174. if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
  175. panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
  176. drm_mode_set_name(panel_fixed_mode);
  177. }
  178. static void parse_backlight_data(struct drm_psb_private *dev_priv,
  179. struct bdb_header *bdb)
  180. {
  181. struct bdb_lvds_backlight *vbt_lvds_bl = NULL;
  182. struct bdb_lvds_backlight *lvds_bl;
  183. u8 p_type = 0;
  184. void *bl_start = NULL;
  185. struct bdb_lvds_options *lvds_opts
  186. = find_section(bdb, BDB_LVDS_OPTIONS);
  187. dev_priv->lvds_bl = NULL;
  188. if (lvds_opts)
  189. p_type = lvds_opts->panel_type;
  190. else
  191. return;
  192. bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
  193. vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;
  194. lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
  195. if (!lvds_bl) {
  196. dev_err(dev_priv->dev->dev, "out of memory for backlight data\n");
  197. return;
  198. }
  199. memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
  200. dev_priv->lvds_bl = lvds_bl;
  201. }
  202. /* Try to find integrated panel data */
  203. static void parse_lfp_panel_data(struct drm_psb_private *dev_priv,
  204. struct bdb_header *bdb)
  205. {
  206. struct bdb_lvds_options *lvds_options;
  207. struct bdb_lvds_lfp_data *lvds_lfp_data;
  208. struct bdb_lvds_lfp_data_entry *entry;
  209. struct lvds_dvo_timing *dvo_timing;
  210. struct drm_display_mode *panel_fixed_mode;
  211. /* Defaults if we can't find VBT info */
  212. dev_priv->lvds_dither = 0;
  213. dev_priv->lvds_vbt = 0;
  214. lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
  215. if (!lvds_options)
  216. return;
  217. dev_priv->lvds_dither = lvds_options->pixel_dither;
  218. dev_priv->panel_type = lvds_options->panel_type;
  219. if (lvds_options->panel_type == 0xff)
  220. return;
  221. lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
  222. if (!lvds_lfp_data)
  223. return;
  224. entry = &lvds_lfp_data->data[lvds_options->panel_type];
  225. dvo_timing = &entry->dvo_timing;
  226. panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode),
  227. GFP_KERNEL);
  228. if (panel_fixed_mode == NULL) {
  229. dev_err(dev_priv->dev->dev, "out of memory for fixed panel mode\n");
  230. return;
  231. }
  232. dev_priv->lvds_vbt = 1;
  233. fill_detail_timing_data(panel_fixed_mode, dvo_timing);
  234. if (panel_fixed_mode->htotal > 0 && panel_fixed_mode->vtotal > 0) {
  235. dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode;
  236. drm_mode_debug_printmodeline(panel_fixed_mode);
  237. } else {
  238. dev_dbg(dev_priv->dev->dev, "ignoring invalid LVDS VBT\n");
  239. dev_priv->lvds_vbt = 0;
  240. kfree(panel_fixed_mode);
  241. }
  242. return;
  243. }
  244. /* Try to find sdvo panel data */
  245. static void parse_sdvo_panel_data(struct drm_psb_private *dev_priv,
  246. struct bdb_header *bdb)
  247. {
  248. struct bdb_sdvo_lvds_options *sdvo_lvds_options;
  249. struct lvds_dvo_timing *dvo_timing;
  250. struct drm_display_mode *panel_fixed_mode;
  251. dev_priv->sdvo_lvds_vbt_mode = NULL;
  252. sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
  253. if (!sdvo_lvds_options)
  254. return;
  255. dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS);
  256. if (!dvo_timing)
  257. return;
  258. panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
  259. if (!panel_fixed_mode)
  260. return;
  261. fill_detail_timing_data(panel_fixed_mode,
  262. dvo_timing + sdvo_lvds_options->panel_type);
  263. dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode;
  264. return;
  265. }
  266. static void parse_general_features(struct drm_psb_private *dev_priv,
  267. struct bdb_header *bdb)
  268. {
  269. struct bdb_general_features *general;
  270. /* Set sensible defaults in case we can't find the general block */
  271. dev_priv->int_tv_support = 1;
  272. dev_priv->int_crt_support = 1;
  273. general = find_section(bdb, BDB_GENERAL_FEATURES);
  274. if (general) {
  275. dev_priv->int_tv_support = general->int_tv_support;
  276. dev_priv->int_crt_support = general->int_crt_support;
  277. dev_priv->lvds_use_ssc = general->enable_ssc;
  278. if (dev_priv->lvds_use_ssc) {
  279. dev_priv->lvds_ssc_freq
  280. = general->ssc_freq ? 100 : 96;
  281. }
  282. }
  283. }
  284. static void
  285. parse_sdvo_device_mapping(struct drm_psb_private *dev_priv,
  286. struct bdb_header *bdb)
  287. {
  288. struct sdvo_device_mapping *p_mapping;
  289. struct bdb_general_definitions *p_defs;
  290. struct child_device_config *p_child;
  291. int i, child_device_num, count;
  292. u16 block_size;
  293. p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
  294. if (!p_defs) {
  295. DRM_DEBUG_KMS("No general definition block is found, unable to construct sdvo mapping.\n");
  296. return;
  297. }
  298. /* judge whether the size of child device meets the requirements.
  299. * If the child device size obtained from general definition block
  300. * is different with sizeof(struct child_device_config), skip the
  301. * parsing of sdvo device info
  302. */
  303. if (p_defs->child_dev_size != sizeof(*p_child)) {
  304. /* different child dev size . Ignore it */
  305. DRM_DEBUG_KMS("different child size is found. Invalid.\n");
  306. return;
  307. }
  308. /* get the block size of general definitions */
  309. block_size = get_blocksize(p_defs);
  310. /* get the number of child device */
  311. child_device_num = (block_size - sizeof(*p_defs)) /
  312. sizeof(*p_child);
  313. count = 0;
  314. for (i = 0; i < child_device_num; i++) {
  315. p_child = &(p_defs->devices[i]);
  316. if (!p_child->device_type) {
  317. /* skip the device block if device type is invalid */
  318. continue;
  319. }
  320. if (p_child->slave_addr != SLAVE_ADDR1 &&
  321. p_child->slave_addr != SLAVE_ADDR2) {
  322. /*
  323. * If the slave address is neither 0x70 nor 0x72,
  324. * it is not a SDVO device. Skip it.
  325. */
  326. continue;
  327. }
  328. if (p_child->dvo_port != DEVICE_PORT_DVOB &&
  329. p_child->dvo_port != DEVICE_PORT_DVOC) {
  330. /* skip the incorrect SDVO port */
  331. DRM_DEBUG_KMS("Incorrect SDVO port. Skip it\n");
  332. continue;
  333. }
  334. DRM_DEBUG_KMS("the SDVO device with slave addr %2x is found on"
  335. " %s port\n",
  336. p_child->slave_addr,
  337. (p_child->dvo_port == DEVICE_PORT_DVOB) ?
  338. "SDVOB" : "SDVOC");
  339. p_mapping = &(dev_priv->sdvo_mappings[p_child->dvo_port - 1]);
  340. if (!p_mapping->initialized) {
  341. p_mapping->dvo_port = p_child->dvo_port;
  342. p_mapping->slave_addr = p_child->slave_addr;
  343. p_mapping->dvo_wiring = p_child->dvo_wiring;
  344. p_mapping->ddc_pin = p_child->ddc_pin;
  345. p_mapping->i2c_pin = p_child->i2c_pin;
  346. p_mapping->initialized = 1;
  347. DRM_DEBUG_KMS("SDVO device: dvo=%x, addr=%x, wiring=%d, ddc_pin=%d, i2c_pin=%d\n",
  348. p_mapping->dvo_port,
  349. p_mapping->slave_addr,
  350. p_mapping->dvo_wiring,
  351. p_mapping->ddc_pin,
  352. p_mapping->i2c_pin);
  353. } else {
  354. DRM_DEBUG_KMS("Maybe one SDVO port is shared by "
  355. "two SDVO device.\n");
  356. }
  357. if (p_child->slave2_addr) {
  358. /* Maybe this is a SDVO device with multiple inputs */
  359. /* And the mapping info is not added */
  360. DRM_DEBUG_KMS("there exists the slave2_addr. Maybe this"
  361. " is a SDVO device with multiple inputs.\n");
  362. }
  363. count++;
  364. }
  365. if (!count) {
  366. /* No SDVO device info is found */
  367. DRM_DEBUG_KMS("No SDVO device info is found in VBT\n");
  368. }
  369. return;
  370. }
  371. static void
  372. parse_driver_features(struct drm_psb_private *dev_priv,
  373. struct bdb_header *bdb)
  374. {
  375. struct bdb_driver_features *driver;
  376. driver = find_section(bdb, BDB_DRIVER_FEATURES);
  377. if (!driver)
  378. return;
  379. if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
  380. dev_priv->edp.support = 1;
  381. /* This bit means to use 96Mhz for DPLL_A or not */
  382. if (driver->primary_lfp_id)
  383. dev_priv->dplla_96mhz = true;
  384. else
  385. dev_priv->dplla_96mhz = false;
  386. }
  387. static void
  388. parse_device_mapping(struct drm_psb_private *dev_priv,
  389. struct bdb_header *bdb)
  390. {
  391. struct bdb_general_definitions *p_defs;
  392. struct child_device_config *p_child, *child_dev_ptr;
  393. int i, child_device_num, count;
  394. u16 block_size;
  395. p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
  396. if (!p_defs) {
  397. DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
  398. return;
  399. }
  400. /* judge whether the size of child device meets the requirements.
  401. * If the child device size obtained from general definition block
  402. * is different with sizeof(struct child_device_config), skip the
  403. * parsing of sdvo device info
  404. */
  405. if (p_defs->child_dev_size != sizeof(*p_child)) {
  406. /* different child dev size . Ignore it */
  407. DRM_DEBUG_KMS("different child size is found. Invalid.\n");
  408. return;
  409. }
  410. /* get the block size of general definitions */
  411. block_size = get_blocksize(p_defs);
  412. /* get the number of child device */
  413. child_device_num = (block_size - sizeof(*p_defs)) /
  414. sizeof(*p_child);
  415. count = 0;
  416. /* get the number of child devices that are present */
  417. for (i = 0; i < child_device_num; i++) {
  418. p_child = &(p_defs->devices[i]);
  419. if (!p_child->device_type) {
  420. /* skip the device block if device type is invalid */
  421. continue;
  422. }
  423. count++;
  424. }
  425. if (!count) {
  426. DRM_DEBUG_KMS("no child dev is parsed from VBT\n");
  427. return;
  428. }
  429. dev_priv->child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL);
  430. if (!dev_priv->child_dev) {
  431. DRM_DEBUG_KMS("No memory space for child devices\n");
  432. return;
  433. }
  434. dev_priv->child_dev_num = count;
  435. count = 0;
  436. for (i = 0; i < child_device_num; i++) {
  437. p_child = &(p_defs->devices[i]);
  438. if (!p_child->device_type) {
  439. /* skip the device block if device type is invalid */
  440. continue;
  441. }
  442. child_dev_ptr = dev_priv->child_dev + count;
  443. count++;
  444. memcpy((void *)child_dev_ptr, (void *)p_child,
  445. sizeof(*p_child));
  446. }
  447. return;
  448. }
  449. /**
  450. * psb_intel_init_bios - initialize VBIOS settings & find VBT
  451. * @dev: DRM device
  452. *
  453. * Loads the Video BIOS and checks that the VBT exists. Sets scratch registers
  454. * to appropriate values.
  455. *
  456. * VBT existence is a sanity check that is relied on by other i830_bios.c code.
  457. * Note that it would be better to use a BIOS call to get the VBT, as BIOSes may
  458. * feed an updated VBT back through that, compared to what we'll fetch using
  459. * this method of groping around in the BIOS data.
  460. *
  461. * Returns 0 on success, nonzero on failure.
  462. */
  463. int psb_intel_init_bios(struct drm_device *dev)
  464. {
  465. struct drm_psb_private *dev_priv = dev->dev_private;
  466. struct pci_dev *pdev = dev->pdev;
  467. struct vbt_header *vbt = NULL;
  468. struct bdb_header *bdb = NULL;
  469. u8 __iomem *bios = NULL;
  470. size_t size;
  471. int i;
  472. dev_priv->panel_type = 0xff;
  473. /* XXX Should this validation be moved to intel_opregion.c? */
  474. if (dev_priv->opregion.vbt) {
  475. struct vbt_header *vbt = dev_priv->opregion.vbt;
  476. if (memcmp(vbt->signature, "$VBT", 4) == 0) {
  477. DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
  478. vbt->signature);
  479. bdb = (struct bdb_header *)((char *)vbt + vbt->bdb_offset);
  480. } else
  481. dev_priv->opregion.vbt = NULL;
  482. }
  483. if (bdb == NULL) {
  484. bios = pci_map_rom(pdev, &size);
  485. if (!bios)
  486. return -1;
  487. /* Scour memory looking for the VBT signature */
  488. for (i = 0; i + 4 < size; i++) {
  489. if (!memcmp(bios + i, "$VBT", 4)) {
  490. vbt = (struct vbt_header *)(bios + i);
  491. break;
  492. }
  493. }
  494. if (!vbt) {
  495. dev_err(dev->dev, "VBT signature missing\n");
  496. pci_unmap_rom(pdev, bios);
  497. return -1;
  498. }
  499. bdb = (struct bdb_header *)(bios + i + vbt->bdb_offset);
  500. }
  501. /* Grab useful general dxefinitions */
  502. parse_general_features(dev_priv, bdb);
  503. parse_driver_features(dev_priv, bdb);
  504. parse_lfp_panel_data(dev_priv, bdb);
  505. parse_sdvo_panel_data(dev_priv, bdb);
  506. parse_sdvo_device_mapping(dev_priv, bdb);
  507. parse_device_mapping(dev_priv, bdb);
  508. parse_backlight_data(dev_priv, bdb);
  509. parse_edp(dev_priv, bdb);
  510. if (bios)
  511. pci_unmap_rom(pdev, bios);
  512. return 0;
  513. }
  514. /**
  515. * Destroy and free VBT data
  516. */
  517. void psb_intel_destroy_bios(struct drm_device *dev)
  518. {
  519. struct drm_psb_private *dev_priv = dev->dev_private;
  520. kfree(dev_priv->sdvo_lvds_vbt_mode);
  521. kfree(dev_priv->lfp_lvds_vbt_mode);
  522. kfree(dev_priv->lvds_bl);
  523. }