intel_bios.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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_EMPH_LEVEL_0;
  106. break;
  107. case 1:
  108. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_1;
  109. break;
  110. case 2:
  111. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_2;
  112. break;
  113. case 3:
  114. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_3;
  115. break;
  116. }
  117. switch (edp_link_params->vswing) {
  118. case 0:
  119. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
  120. break;
  121. case 1:
  122. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
  123. break;
  124. case 2:
  125. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
  126. break;
  127. case 3:
  128. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
  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 = kmemdup(vbt_lvds_bl, 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. dev_priv->lvds_bl = lvds_bl;
  200. }
  201. /* Try to find integrated panel data */
  202. static void parse_lfp_panel_data(struct drm_psb_private *dev_priv,
  203. struct bdb_header *bdb)
  204. {
  205. struct bdb_lvds_options *lvds_options;
  206. struct bdb_lvds_lfp_data *lvds_lfp_data;
  207. struct bdb_lvds_lfp_data_entry *entry;
  208. struct lvds_dvo_timing *dvo_timing;
  209. struct drm_display_mode *panel_fixed_mode;
  210. /* Defaults if we can't find VBT info */
  211. dev_priv->lvds_dither = 0;
  212. dev_priv->lvds_vbt = 0;
  213. lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
  214. if (!lvds_options)
  215. return;
  216. dev_priv->lvds_dither = lvds_options->pixel_dither;
  217. dev_priv->panel_type = lvds_options->panel_type;
  218. if (lvds_options->panel_type == 0xff)
  219. return;
  220. lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
  221. if (!lvds_lfp_data)
  222. return;
  223. entry = &lvds_lfp_data->data[lvds_options->panel_type];
  224. dvo_timing = &entry->dvo_timing;
  225. panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode),
  226. GFP_KERNEL);
  227. if (panel_fixed_mode == NULL) {
  228. dev_err(dev_priv->dev->dev, "out of memory for fixed panel mode\n");
  229. return;
  230. }
  231. dev_priv->lvds_vbt = 1;
  232. fill_detail_timing_data(panel_fixed_mode, dvo_timing);
  233. if (panel_fixed_mode->htotal > 0 && panel_fixed_mode->vtotal > 0) {
  234. dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode;
  235. drm_mode_debug_printmodeline(panel_fixed_mode);
  236. } else {
  237. dev_dbg(dev_priv->dev->dev, "ignoring invalid LVDS VBT\n");
  238. dev_priv->lvds_vbt = 0;
  239. kfree(panel_fixed_mode);
  240. }
  241. return;
  242. }
  243. /* Try to find sdvo panel data */
  244. static void parse_sdvo_panel_data(struct drm_psb_private *dev_priv,
  245. struct bdb_header *bdb)
  246. {
  247. struct bdb_sdvo_lvds_options *sdvo_lvds_options;
  248. struct lvds_dvo_timing *dvo_timing;
  249. struct drm_display_mode *panel_fixed_mode;
  250. dev_priv->sdvo_lvds_vbt_mode = NULL;
  251. sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
  252. if (!sdvo_lvds_options)
  253. return;
  254. dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS);
  255. if (!dvo_timing)
  256. return;
  257. panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
  258. if (!panel_fixed_mode)
  259. return;
  260. fill_detail_timing_data(panel_fixed_mode,
  261. dvo_timing + sdvo_lvds_options->panel_type);
  262. dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode;
  263. return;
  264. }
  265. static void parse_general_features(struct drm_psb_private *dev_priv,
  266. struct bdb_header *bdb)
  267. {
  268. struct bdb_general_features *general;
  269. /* Set sensible defaults in case we can't find the general block */
  270. dev_priv->int_tv_support = 1;
  271. dev_priv->int_crt_support = 1;
  272. general = find_section(bdb, BDB_GENERAL_FEATURES);
  273. if (general) {
  274. dev_priv->int_tv_support = general->int_tv_support;
  275. dev_priv->int_crt_support = general->int_crt_support;
  276. dev_priv->lvds_use_ssc = general->enable_ssc;
  277. if (dev_priv->lvds_use_ssc) {
  278. dev_priv->lvds_ssc_freq
  279. = general->ssc_freq ? 100 : 96;
  280. }
  281. }
  282. }
  283. static void
  284. parse_sdvo_device_mapping(struct drm_psb_private *dev_priv,
  285. struct bdb_header *bdb)
  286. {
  287. struct sdvo_device_mapping *p_mapping;
  288. struct bdb_general_definitions *p_defs;
  289. struct child_device_config *p_child;
  290. int i, child_device_num, count;
  291. u16 block_size;
  292. p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
  293. if (!p_defs) {
  294. DRM_DEBUG_KMS("No general definition block is found, unable to construct sdvo mapping.\n");
  295. return;
  296. }
  297. /* judge whether the size of child device meets the requirements.
  298. * If the child device size obtained from general definition block
  299. * is different with sizeof(struct child_device_config), skip the
  300. * parsing of sdvo device info
  301. */
  302. if (p_defs->child_dev_size != sizeof(*p_child)) {
  303. /* different child dev size . Ignore it */
  304. DRM_DEBUG_KMS("different child size is found. Invalid.\n");
  305. return;
  306. }
  307. /* get the block size of general definitions */
  308. block_size = get_blocksize(p_defs);
  309. /* get the number of child device */
  310. child_device_num = (block_size - sizeof(*p_defs)) /
  311. sizeof(*p_child);
  312. count = 0;
  313. for (i = 0; i < child_device_num; i++) {
  314. p_child = &(p_defs->devices[i]);
  315. if (!p_child->device_type) {
  316. /* skip the device block if device type is invalid */
  317. continue;
  318. }
  319. if (p_child->slave_addr != SLAVE_ADDR1 &&
  320. p_child->slave_addr != SLAVE_ADDR2) {
  321. /*
  322. * If the slave address is neither 0x70 nor 0x72,
  323. * it is not a SDVO device. Skip it.
  324. */
  325. continue;
  326. }
  327. if (p_child->dvo_port != DEVICE_PORT_DVOB &&
  328. p_child->dvo_port != DEVICE_PORT_DVOC) {
  329. /* skip the incorrect SDVO port */
  330. DRM_DEBUG_KMS("Incorrect SDVO port. Skip it\n");
  331. continue;
  332. }
  333. DRM_DEBUG_KMS("the SDVO device with slave addr %2x is found on"
  334. " %s port\n",
  335. p_child->slave_addr,
  336. (p_child->dvo_port == DEVICE_PORT_DVOB) ?
  337. "SDVOB" : "SDVOC");
  338. p_mapping = &(dev_priv->sdvo_mappings[p_child->dvo_port - 1]);
  339. if (!p_mapping->initialized) {
  340. p_mapping->dvo_port = p_child->dvo_port;
  341. p_mapping->slave_addr = p_child->slave_addr;
  342. p_mapping->dvo_wiring = p_child->dvo_wiring;
  343. p_mapping->ddc_pin = p_child->ddc_pin;
  344. p_mapping->i2c_pin = p_child->i2c_pin;
  345. p_mapping->initialized = 1;
  346. DRM_DEBUG_KMS("SDVO device: dvo=%x, addr=%x, wiring=%d, ddc_pin=%d, i2c_pin=%d\n",
  347. p_mapping->dvo_port,
  348. p_mapping->slave_addr,
  349. p_mapping->dvo_wiring,
  350. p_mapping->ddc_pin,
  351. p_mapping->i2c_pin);
  352. } else {
  353. DRM_DEBUG_KMS("Maybe one SDVO port is shared by "
  354. "two SDVO device.\n");
  355. }
  356. if (p_child->slave2_addr) {
  357. /* Maybe this is a SDVO device with multiple inputs */
  358. /* And the mapping info is not added */
  359. DRM_DEBUG_KMS("there exists the slave2_addr. Maybe this"
  360. " is a SDVO device with multiple inputs.\n");
  361. }
  362. count++;
  363. }
  364. if (!count) {
  365. /* No SDVO device info is found */
  366. DRM_DEBUG_KMS("No SDVO device info is found in VBT\n");
  367. }
  368. return;
  369. }
  370. static void
  371. parse_driver_features(struct drm_psb_private *dev_priv,
  372. struct bdb_header *bdb)
  373. {
  374. struct bdb_driver_features *driver;
  375. driver = find_section(bdb, BDB_DRIVER_FEATURES);
  376. if (!driver)
  377. return;
  378. if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
  379. dev_priv->edp.support = 1;
  380. /* This bit means to use 96Mhz for DPLL_A or not */
  381. if (driver->primary_lfp_id)
  382. dev_priv->dplla_96mhz = true;
  383. else
  384. dev_priv->dplla_96mhz = false;
  385. }
  386. static void
  387. parse_device_mapping(struct drm_psb_private *dev_priv,
  388. struct bdb_header *bdb)
  389. {
  390. struct bdb_general_definitions *p_defs;
  391. struct child_device_config *p_child, *child_dev_ptr;
  392. int i, child_device_num, count;
  393. u16 block_size;
  394. p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
  395. if (!p_defs) {
  396. DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
  397. return;
  398. }
  399. /* judge whether the size of child device meets the requirements.
  400. * If the child device size obtained from general definition block
  401. * is different with sizeof(struct child_device_config), skip the
  402. * parsing of sdvo device info
  403. */
  404. if (p_defs->child_dev_size != sizeof(*p_child)) {
  405. /* different child dev size . Ignore it */
  406. DRM_DEBUG_KMS("different child size is found. Invalid.\n");
  407. return;
  408. }
  409. /* get the block size of general definitions */
  410. block_size = get_blocksize(p_defs);
  411. /* get the number of child device */
  412. child_device_num = (block_size - sizeof(*p_defs)) /
  413. sizeof(*p_child);
  414. count = 0;
  415. /* get the number of child devices that are present */
  416. for (i = 0; i < child_device_num; i++) {
  417. p_child = &(p_defs->devices[i]);
  418. if (!p_child->device_type) {
  419. /* skip the device block if device type is invalid */
  420. continue;
  421. }
  422. count++;
  423. }
  424. if (!count) {
  425. DRM_DEBUG_KMS("no child dev is parsed from VBT\n");
  426. return;
  427. }
  428. dev_priv->child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL);
  429. if (!dev_priv->child_dev) {
  430. DRM_DEBUG_KMS("No memory space for child devices\n");
  431. return;
  432. }
  433. dev_priv->child_dev_num = count;
  434. count = 0;
  435. for (i = 0; i < child_device_num; i++) {
  436. p_child = &(p_defs->devices[i]);
  437. if (!p_child->device_type) {
  438. /* skip the device block if device type is invalid */
  439. continue;
  440. }
  441. child_dev_ptr = dev_priv->child_dev + count;
  442. count++;
  443. memcpy((void *)child_dev_ptr, (void *)p_child,
  444. sizeof(*p_child));
  445. }
  446. return;
  447. }
  448. /**
  449. * psb_intel_init_bios - initialize VBIOS settings & find VBT
  450. * @dev: DRM device
  451. *
  452. * Loads the Video BIOS and checks that the VBT exists. Sets scratch registers
  453. * to appropriate values.
  454. *
  455. * VBT existence is a sanity check that is relied on by other i830_bios.c code.
  456. * Note that it would be better to use a BIOS call to get the VBT, as BIOSes may
  457. * feed an updated VBT back through that, compared to what we'll fetch using
  458. * this method of groping around in the BIOS data.
  459. *
  460. * Returns 0 on success, nonzero on failure.
  461. */
  462. int psb_intel_init_bios(struct drm_device *dev)
  463. {
  464. struct drm_psb_private *dev_priv = dev->dev_private;
  465. struct pci_dev *pdev = dev->pdev;
  466. struct vbt_header *vbt = NULL;
  467. struct bdb_header *bdb = NULL;
  468. u8 __iomem *bios = NULL;
  469. size_t size;
  470. int i;
  471. dev_priv->panel_type = 0xff;
  472. /* XXX Should this validation be moved to intel_opregion.c? */
  473. if (dev_priv->opregion.vbt) {
  474. struct vbt_header *vbt = dev_priv->opregion.vbt;
  475. if (memcmp(vbt->signature, "$VBT", 4) == 0) {
  476. DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
  477. vbt->signature);
  478. bdb = (struct bdb_header *)((char *)vbt + vbt->bdb_offset);
  479. } else
  480. dev_priv->opregion.vbt = NULL;
  481. }
  482. if (bdb == NULL) {
  483. bios = pci_map_rom(pdev, &size);
  484. if (!bios)
  485. return -1;
  486. /* Scour memory looking for the VBT signature */
  487. for (i = 0; i + 4 < size; i++) {
  488. if (!memcmp(bios + i, "$VBT", 4)) {
  489. vbt = (struct vbt_header *)(bios + i);
  490. break;
  491. }
  492. }
  493. if (!vbt) {
  494. dev_err(dev->dev, "VBT signature missing\n");
  495. pci_unmap_rom(pdev, bios);
  496. return -1;
  497. }
  498. bdb = (struct bdb_header *)(bios + i + vbt->bdb_offset);
  499. }
  500. /* Grab useful general dxefinitions */
  501. parse_general_features(dev_priv, bdb);
  502. parse_driver_features(dev_priv, bdb);
  503. parse_lfp_panel_data(dev_priv, bdb);
  504. parse_sdvo_panel_data(dev_priv, bdb);
  505. parse_sdvo_device_mapping(dev_priv, bdb);
  506. parse_device_mapping(dev_priv, bdb);
  507. parse_backlight_data(dev_priv, bdb);
  508. parse_edp(dev_priv, bdb);
  509. if (bios)
  510. pci_unmap_rom(pdev, bios);
  511. return 0;
  512. }
  513. /**
  514. * Destroy and free VBT data
  515. */
  516. void psb_intel_destroy_bios(struct drm_device *dev)
  517. {
  518. struct drm_psb_private *dev_priv = dev->dev_private;
  519. kfree(dev_priv->sdvo_lvds_vbt_mode);
  520. kfree(dev_priv->lfp_lvds_vbt_mode);
  521. kfree(dev_priv->lvds_bl);
  522. }