Subversion Repositories Kolibri OS

Rev

Rev 3746 | Rev 5060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3746 Rev 4104
Line 209... Line 209...
209
 
209
 
210
	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
210
	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
211
	if (!lvds_options)
211
	if (!lvds_options)
Line 212... Line 212...
212
		return;
212
		return;
213
 
213
 
214
	dev_priv->lvds_dither = lvds_options->pixel_dither;
214
	dev_priv->vbt.lvds_dither = lvds_options->pixel_dither;
Line 215... Line 215...
215
	if (lvds_options->panel_type == 0xff)
215
	if (lvds_options->panel_type == 0xff)
Line 223... Line 223...
223
 
223
 
224
	lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
224
	lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
225
	if (!lvds_lfp_data_ptrs)
225
	if (!lvds_lfp_data_ptrs)
Line 226... Line 226...
226
		return;
226
		return;
Line 227... Line 227...
227
 
227
 
228
	dev_priv->lvds_vbt = 1;
228
	dev_priv->vbt.lvds_vbt = 1;
229
 
229
 
Line 235... Line 235...
235
	if (!panel_fixed_mode)
235
	if (!panel_fixed_mode)
236
		return;
236
		return;
Line 237... Line 237...
237
 
237
 
Line 238... Line 238...
238
	fill_detail_timing_data(panel_fixed_mode, panel_dvo_timing);
238
	fill_detail_timing_data(panel_fixed_mode, panel_dvo_timing);
Line 239... Line 239...
239
 
239
 
240
	dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode;
240
	dev_priv->vbt.lfp_lvds_vbt_mode = panel_fixed_mode;
Line 241... Line 241...
241
 
241
 
Line 271... Line 271...
271
				       lvds_options->panel_type);
271
				       lvds_options->panel_type);
272
	if (fp_timing) {
272
	if (fp_timing) {
273
		/* check the resolution, just to be sure */
273
		/* check the resolution, just to be sure */
274
		if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
274
		if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
275
		    fp_timing->y_res == panel_fixed_mode->vdisplay) {
275
		    fp_timing->y_res == panel_fixed_mode->vdisplay) {
276
			dev_priv->bios_lvds_val = fp_timing->lvds_reg_val;
276
			dev_priv->vbt.bios_lvds_val = fp_timing->lvds_reg_val;
277
			DRM_DEBUG_KMS("VBT initial LVDS value %x\n",
277
			DRM_DEBUG_KMS("VBT initial LVDS value %x\n",
278
				      dev_priv->bios_lvds_val);
278
				      dev_priv->vbt.bios_lvds_val);
279
		}
279
		}
280
	}
280
	}
281
}
281
}
Line 282... Line 282...
282
 
282
 
Line 313... Line 313...
313
	if (!panel_fixed_mode)
313
	if (!panel_fixed_mode)
314
		return;
314
		return;
Line 315... Line 315...
315
 
315
 
Line 316... Line 316...
316
	fill_detail_timing_data(panel_fixed_mode, dvo_timing + index);
316
	fill_detail_timing_data(panel_fixed_mode, dvo_timing + index);
Line 317... Line 317...
317
 
317
 
318
	dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode;
318
	dev_priv->vbt.sdvo_lvds_vbt_mode = panel_fixed_mode;
319
 
319
 
Line 342... Line 342...
342
	struct drm_device *dev = dev_priv->dev;
342
	struct drm_device *dev = dev_priv->dev;
343
	struct bdb_general_features *general;
343
	struct bdb_general_features *general;
Line 344... Line 344...
344
 
344
 
345
	general = find_section(bdb, BDB_GENERAL_FEATURES);
345
	general = find_section(bdb, BDB_GENERAL_FEATURES);
346
	if (general) {
346
	if (general) {
347
		dev_priv->int_tv_support = general->int_tv_support;
347
		dev_priv->vbt.int_tv_support = general->int_tv_support;
348
		dev_priv->int_crt_support = general->int_crt_support;
348
		dev_priv->vbt.int_crt_support = general->int_crt_support;
349
		dev_priv->lvds_use_ssc = general->enable_ssc;
349
		dev_priv->vbt.lvds_use_ssc = general->enable_ssc;
350
		dev_priv->lvds_ssc_freq =
350
		dev_priv->vbt.lvds_ssc_freq =
351
			intel_bios_ssc_frequency(dev, general->ssc_freq);
351
			intel_bios_ssc_frequency(dev, general->ssc_freq);
352
		dev_priv->display_clock_mode = general->display_clock_mode;
352
		dev_priv->vbt.display_clock_mode = general->display_clock_mode;
353
		dev_priv->fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted;
353
		dev_priv->vbt.fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted;
354
		DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n",
354
		DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n",
355
			      dev_priv->int_tv_support,
355
			      dev_priv->vbt.int_tv_support,
356
			      dev_priv->int_crt_support,
356
			      dev_priv->vbt.int_crt_support,
357
			      dev_priv->lvds_use_ssc,
357
			      dev_priv->vbt.lvds_use_ssc,
358
			      dev_priv->lvds_ssc_freq,
358
			      dev_priv->vbt.lvds_ssc_freq,
359
			      dev_priv->display_clock_mode,
359
			      dev_priv->vbt.display_clock_mode,
360
			      dev_priv->fdi_rx_polarity_inverted);
360
			      dev_priv->vbt.fdi_rx_polarity_inverted);
361
	}
361
	}
Line 362... Line 362...
362
}
362
}
363
 
363
 
Line 372... Line 372...
372
		u16 block_size = get_blocksize(general);
372
		u16 block_size = get_blocksize(general);
373
		if (block_size >= sizeof(*general)) {
373
		if (block_size >= sizeof(*general)) {
374
			int bus_pin = general->crt_ddc_gmbus_pin;
374
			int bus_pin = general->crt_ddc_gmbus_pin;
375
			DRM_DEBUG_KMS("crt_ddc_bus_pin: %d\n", bus_pin);
375
			DRM_DEBUG_KMS("crt_ddc_bus_pin: %d\n", bus_pin);
376
			if (intel_gmbus_is_port_valid(bus_pin))
376
			if (intel_gmbus_is_port_valid(bus_pin))
377
				dev_priv->crt_ddc_pin = bus_pin;
377
				dev_priv->vbt.crt_ddc_pin = bus_pin;
378
		} else {
378
		} else {
379
			DRM_DEBUG_KMS("BDB_GD too small (%d). Invalid.\n",
379
			DRM_DEBUG_KMS("BDB_GD too small (%d). Invalid.\n",
380
				  block_size);
380
				  block_size);
381
		}
381
		}
382
	}
382
	}
Line 483... Line 483...
483
	if (!driver)
483
	if (!driver)
484
		return;
484
		return;
Line 485... Line 485...
485
 
485
 
486
	if (SUPPORTS_EDP(dev) &&
486
	if (SUPPORTS_EDP(dev) &&
487
	    driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
487
	    driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
Line 488... Line 488...
488
		dev_priv->edp.support = 1;
488
		dev_priv->vbt.edp_support = 1;
489
 
489
 
490
	if (driver->dual_frequency)
490
	if (driver->dual_frequency)
Line 498... Line 498...
498
	struct edp_power_seq *edp_pps;
498
	struct edp_power_seq *edp_pps;
499
	struct edp_link_params *edp_link_params;
499
	struct edp_link_params *edp_link_params;
Line 500... Line 500...
500
 
500
 
501
	edp = find_section(bdb, BDB_EDP);
501
	edp = find_section(bdb, BDB_EDP);
502
	if (!edp) {
502
	if (!edp) {
503
		if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support)
503
		if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->vbt.edp_support)
504
			DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported.\n");
504
			DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported.\n");
505
		return;
505
		return;
Line 506... Line 506...
506
	}
506
	}
507
 
507
 
508
	switch ((edp->color_depth >> (panel_type * 2)) & 3) {
508
	switch ((edp->color_depth >> (panel_type * 2)) & 3) {
509
	case EDP_18BPP:
509
	case EDP_18BPP:
510
		dev_priv->edp.bpp = 18;
510
		dev_priv->vbt.edp_bpp = 18;
511
		break;
511
		break;
512
	case EDP_24BPP:
512
	case EDP_24BPP:
513
		dev_priv->edp.bpp = 24;
513
		dev_priv->vbt.edp_bpp = 24;
514
		break;
514
		break;
515
	case EDP_30BPP:
515
	case EDP_30BPP:
516
		dev_priv->edp.bpp = 30;
516
		dev_priv->vbt.edp_bpp = 30;
Line 517... Line 517...
517
		break;
517
		break;
518
	}
518
	}
519
 
519
 
Line 520... Line 520...
520
	/* Get the eDP sequencing and link info */
520
	/* Get the eDP sequencing and link info */
Line 521... Line 521...
521
	edp_pps = &edp->power_seqs[panel_type];
521
	edp_pps = &edp->power_seqs[panel_type];
522
	edp_link_params = &edp->link_params[panel_type];
522
	edp_link_params = &edp->link_params[panel_type];
523
 
523
 
524
	dev_priv->edp.pps = *edp_pps;
524
	dev_priv->vbt.edp_pps = *edp_pps;
525
 
525
 
526
	dev_priv->edp.rate = edp_link_params->rate ? DP_LINK_BW_2_7 :
526
	dev_priv->vbt.edp_rate = edp_link_params->rate ? DP_LINK_BW_2_7 :
527
		DP_LINK_BW_1_62;
527
		DP_LINK_BW_1_62;
528
	switch (edp_link_params->lanes) {
528
	switch (edp_link_params->lanes) {
529
	case 0:
529
	case 0:
530
		dev_priv->edp.lanes = 1;
530
		dev_priv->vbt.edp_lanes = 1;
531
		break;
531
		break;
532
	case 1:
532
	case 1:
533
		dev_priv->edp.lanes = 2;
533
		dev_priv->vbt.edp_lanes = 2;
534
		break;
534
		break;
535
	case 3:
535
	case 3:
536
	default:
536
	default:
537
		dev_priv->edp.lanes = 4;
537
		dev_priv->vbt.edp_lanes = 4;
538
		break;
538
		break;
539
	}
539
	}
540
	switch (edp_link_params->preemphasis) {
540
	switch (edp_link_params->preemphasis) {
541
	case 0:
541
	case 0:
542
		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_0;
542
		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_0;
543
		break;
543
		break;
544
	case 1:
544
	case 1:
545
		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_3_5;
545
		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_3_5;
546
		break;
546
		break;
547
	case 2:
547
	case 2:
548
		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_6;
548
		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_6;
549
		break;
549
		break;
550
	case 3:
550
	case 3:
551
		dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPHASIS_9_5;
551
		dev_priv->vbt.edp_preemphasis = DP_TRAIN_PRE_EMPHASIS_9_5;
552
		break;
552
		break;
553
	}
553
	}
554
	switch (edp_link_params->vswing) {
554
	switch (edp_link_params->vswing) {
555
	case 0:
555
	case 0:
556
		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_400;
556
		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_400;
557
		break;
557
		break;
558
	case 1:
558
	case 1:
559
		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_600;
559
		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_600;
560
		break;
560
		break;
561
	case 2:
561
	case 2:
562
		dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_800;
562
		dev_priv->vbt.edp_vswing = DP_TRAIN_VOLTAGE_SWING_800;
563
		break;
563
		break;
Line 564... Line 564...
564
	case 3:
564
	case 3:
Line 608... Line 608...
608
	}
608
	}
609
	if (!count) {
609
	if (!count) {
610
		DRM_DEBUG_KMS("no child dev is parsed from VBT\n");
610
		DRM_DEBUG_KMS("no child dev is parsed from VBT\n");
611
		return;
611
		return;
612
	}
612
	}
613
	dev_priv->child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL);
613
	dev_priv->vbt.child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL);
614
	if (!dev_priv->child_dev) {
614
	if (!dev_priv->vbt.child_dev) {
615
		DRM_DEBUG_KMS("No memory space for child device\n");
615
		DRM_DEBUG_KMS("No memory space for child device\n");
616
		return;
616
		return;
617
	}
617
	}
Line 618... Line 618...
618
 
618
 
619
	dev_priv->child_dev_num = count;
619
	dev_priv->vbt.child_dev_num = count;
620
	count = 0;
620
	count = 0;
621
	for (i = 0; i < child_device_num; i++) {
621
	for (i = 0; i < child_device_num; i++) {
622
		p_child = &(p_defs->devices[i]);
622
		p_child = &(p_defs->devices[i]);
623
		if (!p_child->device_type) {
623
		if (!p_child->device_type) {
624
			/* skip the device block if device type is invalid */
624
			/* skip the device block if device type is invalid */
625
			continue;
625
			continue;
626
		}
626
		}
627
		child_dev_ptr = dev_priv->child_dev + count;
627
		child_dev_ptr = dev_priv->vbt.child_dev + count;
628
		count++;
628
		count++;
629
		memcpy((void *)child_dev_ptr, (void *)p_child,
629
		memcpy((void *)child_dev_ptr, (void *)p_child,
630
					sizeof(*p_child));
630
					sizeof(*p_child));
631
	}
631
	}
Line 635... Line 635...
635
static void
635
static void
636
init_vbt_defaults(struct drm_i915_private *dev_priv)
636
init_vbt_defaults(struct drm_i915_private *dev_priv)
637
{
637
{
638
	struct drm_device *dev = dev_priv->dev;
638
	struct drm_device *dev = dev_priv->dev;
Line 639... Line 639...
639
 
639
 
Line 640... Line 640...
640
	dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC;
640
	dev_priv->vbt.crt_ddc_pin = GMBUS_PORT_VGADDC;
641
 
641
 
642
	/* LFP panel data */
642
	/* LFP panel data */
Line 643... Line 643...
643
	dev_priv->lvds_dither = 1;
643
	dev_priv->vbt.lvds_dither = 1;
644
	dev_priv->lvds_vbt = 0;
644
	dev_priv->vbt.lvds_vbt = 0;
Line 645... Line 645...
645
 
645
 
646
	/* SDVO panel data */
646
	/* SDVO panel data */
647
	dev_priv->sdvo_lvds_vbt_mode = NULL;
647
	dev_priv->vbt.sdvo_lvds_vbt_mode = NULL;
Line 648... Line 648...
648
 
648
 
649
	/* general features */
649
	/* general features */
650
	dev_priv->int_tv_support = 1;
650
	dev_priv->vbt.int_tv_support = 1;
651
	dev_priv->int_crt_support = 1;
651
	dev_priv->vbt.int_crt_support = 1;
652
 
652
 
Line 653... Line 653...
653
	/* Default to using SSC */
653
	/* Default to using SSC */
654
	dev_priv->lvds_use_ssc = 1;
654
	dev_priv->vbt.lvds_use_ssc = 1;