Subversion Repositories Kolibri OS

Rev

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

Rev 1321 Rev 1404
Line 303... Line 303...
303
		misc |= ATOM_DOUBLE_CLOCK_MODE;
303
		misc |= ATOM_DOUBLE_CLOCK_MODE;
Line 304... Line 304...
304
 
304
 
305
	args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
305
	args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
Line 306... Line -...
306
	args.ucCRTC = radeon_crtc->crtc_id;
-
 
307
 
306
	args.ucCRTC = radeon_crtc->crtc_id;
308
	printk("executing set crtc dtd timing\n");
307
 
Line 309... Line 308...
309
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
308
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
310
}
309
}
Line 343... Line 342...
343
		misc |= ATOM_DOUBLE_CLOCK_MODE;
342
		misc |= ATOM_DOUBLE_CLOCK_MODE;
Line 344... Line 343...
344
 
343
 
345
	args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
344
	args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
Line 346... Line -...
346
	args.ucCRTC = radeon_crtc->crtc_id;
-
 
347
 
345
	args.ucCRTC = radeon_crtc->crtc_id;
348
	printk("executing set crtc timing\n");
346
 
Line 349... Line 347...
349
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
347
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
350
}
348
}
Line 405... Line 403...
405
		legacy_args.ucEnable = enable;
403
		legacy_args.ucEnable = enable;
406
		atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&legacy_args);
404
		atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&legacy_args);
407
	}
405
	}
408
}
406
}
Line -... Line 407...
-
 
407
 
-
 
408
union adjust_pixel_clock {
-
 
409
	ADJUST_DISPLAY_PLL_PS_ALLOCATION v1;
-
 
410
};
409
 
411
 
-
 
412
static u32 atombios_adjust_pll(struct drm_crtc *crtc,
-
 
413
			       struct drm_display_mode *mode,
410
void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
414
			       struct radeon_pll *pll)
411
{
-
 
412
	struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
415
{
413
	struct drm_device *dev = crtc->dev;
416
	struct drm_device *dev = crtc->dev;
414
	struct radeon_device *rdev = dev->dev_private;
417
	struct radeon_device *rdev = dev->dev_private;
415
	struct drm_encoder *encoder = NULL;
418
	struct drm_encoder *encoder = NULL;
416
	struct radeon_encoder *radeon_encoder = NULL;
-
 
417
	uint8_t frev, crev;
-
 
418
	int index;
-
 
419
	SET_PIXEL_CLOCK_PS_ALLOCATION args;
-
 
420
	PIXEL_CLOCK_PARAMETERS *spc1_ptr;
-
 
421
	PIXEL_CLOCK_PARAMETERS_V2 *spc2_ptr;
-
 
422
	PIXEL_CLOCK_PARAMETERS_V3 *spc3_ptr;
419
	struct radeon_encoder *radeon_encoder = NULL;
423
	uint32_t pll_clock = mode->clock;
-
 
424
	uint32_t adjusted_clock;
-
 
425
	uint32_t ref_div = 0, fb_div = 0, frac_fb_div = 0, post_div = 0;
-
 
426
	struct radeon_pll *pll;
-
 
Line 427... Line 420...
427
	int pll_flags = 0;
420
	u32 adjusted_clock = mode->clock;
-
 
421
 
Line 428... Line 422...
428
 
422
	/* reset the pll flags */
429
	memset(&args, 0, sizeof(args));
423
	pll->flags = 0;
430
 
424
 
431
	if (ASIC_IS_AVIVO(rdev)) {
425
	if (ASIC_IS_AVIVO(rdev)) {
432
		if ((rdev->family == CHIP_RS600) ||
426
		if ((rdev->family == CHIP_RS600) ||
433
		    (rdev->family == CHIP_RS690) ||
427
		    (rdev->family == CHIP_RS690) ||
Line 434... Line 428...
434
		    (rdev->family == CHIP_RS740))
428
		    (rdev->family == CHIP_RS740))
435
			pll_flags |= (RADEON_PLL_USE_FRAC_FB_DIV |
429
			pll->flags |= (RADEON_PLL_USE_FRAC_FB_DIV |
436
				      RADEON_PLL_PREFER_CLOSEST_LOWER);
430
				      RADEON_PLL_PREFER_CLOSEST_LOWER);
437
 
431
 
438
		if (ASIC_IS_DCE32(rdev) && mode->clock > 200000)	/* range limits??? */
432
		if (ASIC_IS_DCE32(rdev) && mode->clock > 200000)	/* range limits??? */
439
			pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
433
			pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
Line 440... Line 434...
440
		else
434
		else
441
			pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
435
			pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
442
	} else {
436
	} else {
443
		pll_flags |= RADEON_PLL_LEGACY;
437
		pll->flags |= RADEON_PLL_LEGACY;
Line 444... Line 438...
444
 
438
 
Line 445... Line 439...
445
		if (mode->clock > 200000)	/* range limits??? */
439
		if (mode->clock > 200000)	/* range limits??? */
446
			pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
440
			pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
447
		else
-
 
448
			pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
-
 
449
 
-
 
450
	}
-
 
451
 
-
 
452
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-
 
453
		if (encoder->crtc == crtc) {
-
 
454
			if (!ASIC_IS_AVIVO(rdev)) {
-
 
455
				if (encoder->encoder_type !=
441
		else
-
 
442
			pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
-
 
443
 
-
 
444
	}
-
 
445
 
-
 
446
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-
 
447
		if (encoder->crtc == crtc) {
-
 
448
			radeon_encoder = to_radeon_encoder(encoder);
-
 
449
			if (ASIC_IS_AVIVO(rdev)) {
-
 
450
				/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
-
 
451
				if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)
456
				    DRM_MODE_ENCODER_DAC)
452
					adjusted_clock = mode->clock * 2;
457
					pll_flags |= RADEON_PLL_NO_ODD_POST_DIV;
453
			} else {
458
				if (encoder->encoder_type ==
454
				if (encoder->encoder_type != DRM_MODE_ENCODER_DAC)
Line 459... Line 455...
459
					DRM_MODE_ENCODER_LVDS)
455
					pll->flags |= RADEON_PLL_NO_ODD_POST_DIV;
460
					pll_flags |= RADEON_PLL_USE_REF_DIV;
456
				if (encoder->encoder_type == DRM_MODE_ENCODER_LVDS)
461
			}
457
					pll->flags |= RADEON_PLL_USE_REF_DIV;
462
			radeon_encoder = to_radeon_encoder(encoder);
458
			}
463
			break;
459
			break;
464
		}
460
		}
465
	}
-
 
-
 
461
	}
466
 
462
 
467
	/* DCE3+ has an AdjustDisplayPll that will adjust the pixel clock
463
	/* DCE3+ has an AdjustDisplayPll that will adjust the pixel clock
Line 468... Line 464...
468
	 * accordingly based on the encoder/transmitter to work around
464
	 * accordingly based on the encoder/transmitter to work around
469
	 * special hw requirements.
465
	 * special hw requirements.
470
	 */
466
	 */
471
	if (ASIC_IS_DCE3(rdev)) {
-
 
Line 472... Line 467...
472
		ADJUST_DISPLAY_PLL_PS_ALLOCATION adjust_pll_args;
467
	if (ASIC_IS_DCE3(rdev)) {
-
 
468
		union adjust_pixel_clock args;
-
 
469
		struct radeon_encoder_atom_dig *dig;
-
 
470
		u8 frev, crev;
-
 
471
		int index;
-
 
472
 
-
 
473
		if (!radeon_encoder->enc_priv)
-
 
474
			return adjusted_clock;
-
 
475
		dig = radeon_encoder->enc_priv;
-
 
476
 
-
 
477
		index = GetIndexIntoMasterTable(COMMAND, AdjustDisplayPll);
-
 
478
		atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev,
-
 
479
				      &crev);
-
 
480
 
-
 
481
		memset(&args, 0, sizeof(args));
473
 
482
 
474
		if (!encoder)
483
		switch (frev) {
475
			return;
484
		case 1:
476
 
485
			switch (crev) {
-
 
486
			case 1:
477
		memset(&adjust_pll_args, 0, sizeof(adjust_pll_args));
487
			case 2:
478
		adjust_pll_args.usPixelClock = cpu_to_le16(mode->clock / 10);
488
				args.v1.usPixelClock = cpu_to_le16(mode->clock / 10);
-
 
489
				args.v1.ucTransmitterID = radeon_encoder->encoder_id;
-
 
490
				args.v1.ucEncodeMode = atombios_get_encoder_mode(encoder);
-
 
491
 
479
		adjust_pll_args.ucTransmitterID = radeon_encoder->encoder_id;
492
		atom_execute_table(rdev->mode_info.atom_context,
480
		adjust_pll_args.ucEncodeMode = atombios_get_encoder_mode(encoder);
493
						   index, (uint32_t *)&args);
481
 
494
				adjusted_clock = le16_to_cpu(args.v1.usPixelClock) * 10;
-
 
495
				break;
-
 
496
			default:
-
 
497
				DRM_ERROR("Unknown table version %d %d\n", frev, crev);
-
 
498
				return adjusted_clock;
-
 
499
			}
-
 
500
			break;
-
 
501
		default:
-
 
502
			DRM_ERROR("Unknown table version %d %d\n", frev, crev);
-
 
503
			return adjusted_clock;
-
 
504
		}
-
 
505
	}
-
 
506
	return adjusted_clock;
-
 
507
}
-
 
508
 
-
 
509
union set_pixel_clock {
-
 
510
	SET_PIXEL_CLOCK_PS_ALLOCATION base;
-
 
511
	PIXEL_CLOCK_PARAMETERS v1;
-
 
512
	PIXEL_CLOCK_PARAMETERS_V2 v2;
-
 
513
	PIXEL_CLOCK_PARAMETERS_V3 v3;
-
 
514
};
-
 
515
 
482
		index = GetIndexIntoMasterTable(COMMAND, AdjustDisplayPll);
516
void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
-
 
517
{
-
 
518
	struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
-
 
519
	struct drm_device *dev = crtc->dev;
-
 
520
	struct radeon_device *rdev = dev->dev_private;
-
 
521
	struct drm_encoder *encoder = NULL;
-
 
522
	struct radeon_encoder *radeon_encoder = NULL;
-
 
523
	u8 frev, crev;
-
 
524
	int index;
-
 
525
	union set_pixel_clock args;
-
 
526
	u32 pll_clock = mode->clock;
483
		atom_execute_table(rdev->mode_info.atom_context,
527
	u32 ref_div = 0, fb_div = 0, frac_fb_div = 0, post_div = 0;
-
 
528
	struct radeon_pll *pll;
-
 
529
	u32 adjusted_clock;
-
 
530
 
-
 
531
	memset(&args, 0, sizeof(args));
Line 484... Line 532...
484
				   index, (uint32_t *)&adjust_pll_args);
532
 
485
		adjusted_clock = le16_to_cpu(adjust_pll_args.usPixelClock) * 10;
533
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
486
	} else {
534
		if (encoder->crtc == crtc) {
487
		/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
535
			radeon_encoder = to_radeon_encoder(encoder);
Line -... Line 536...
-
 
536
			break;
-
 
537
		}
-
 
538
	}
488
		if (ASIC_IS_AVIVO(rdev) &&
539
 
489
		    (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1))
540
	if (!radeon_encoder)
490
			adjusted_clock = mode->clock * 2;
541
		return;
491
		else
542
 
492
			adjusted_clock = mode->clock;
543
	if (radeon_crtc->crtc_id == 0)
493
	}
544
		pll = &rdev->clock.p1pll;
494
 
545
	else
495
	if (radeon_crtc->crtc_id == 0)
546
		pll = &rdev->clock.p2pll;
496
		pll = &rdev->clock.p1pll;
547
 
497
	else
548
	/* adjust pixel clock as needed */
498
		pll = &rdev->clock.p2pll;
549
	adjusted_clock = atombios_adjust_pll(crtc, mode, pll);
499
 
550
 
Line 500... Line 551...
500
	if (ASIC_IS_AVIVO(rdev)) {
551
	if (ASIC_IS_AVIVO(rdev)) {
501
		if (radeon_new_pll)
552
		if (radeon_new_pll)
502
			radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock,
553
			radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock,
Line 503... Line 554...
503
						 &fb_div, &frac_fb_div,
554
						 &fb_div, &frac_fb_div,
504
						 &ref_div, &post_div, pll_flags);
555
						 &ref_div, &post_div);
505
		else
556
		else
506
			radeon_compute_pll(pll, adjusted_clock, &pll_clock,
557
			radeon_compute_pll(pll, adjusted_clock, &pll_clock,
507
					   &fb_div, &frac_fb_div,
-
 
508
					   &ref_div, &post_div, pll_flags);
558
					   &fb_div, &frac_fb_div,
509
	} else
559
					   &ref_div, &post_div);
510
	radeon_compute_pll(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
560
	} else
511
			   &ref_div, &post_div, pll_flags);
561
	radeon_compute_pll(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
512
 
562
				   &ref_div, &post_div);
513
	index = GetIndexIntoMasterTable(COMMAND, SetPixelClock);
563
 
514
	atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev,
564
	index = GetIndexIntoMasterTable(COMMAND, SetPixelClock);
515
			      &crev);
565
	atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev,
516
 
566
			      &crev);
517
	switch (frev) {
567
 
518
	case 1:
568
	switch (frev) {
519
		switch (crev) {
-
 
520
		case 1:
-
 
521
			spc1_ptr = (PIXEL_CLOCK_PARAMETERS *) & args.sPCLKInput;
569
	case 1:
522
			spc1_ptr->usPixelClock = cpu_to_le16(mode->clock / 10);
570
		switch (crev) {
523
			spc1_ptr->usRefDiv = cpu_to_le16(ref_div);
571
		case 1:
524
			spc1_ptr->usFbDiv = cpu_to_le16(fb_div);
572
			args.v1.usPixelClock = cpu_to_le16(mode->clock / 10);
525
			spc1_ptr->ucFracFbDiv = frac_fb_div;
573
			args.v1.usRefDiv = cpu_to_le16(ref_div);
526
			spc1_ptr->ucPostDiv = post_div;
574
			args.v1.usFbDiv = cpu_to_le16(fb_div);
527
			spc1_ptr->ucPpll =
575
			args.v1.ucFracFbDiv = frac_fb_div;
528
			    radeon_crtc->crtc_id ? ATOM_PPLL2 : ATOM_PPLL1;
576
			args.v1.ucPostDiv = post_div;
529
			spc1_ptr->ucCRTC = radeon_crtc->crtc_id;
577
			args.v1.ucPpll =
530
			spc1_ptr->ucRefDivSrc = 1;
578
			    radeon_crtc->crtc_id ? ATOM_PPLL2 : ATOM_PPLL1;
531
			break;
579
			args.v1.ucCRTC = radeon_crtc->crtc_id;
532
		case 2:
-
 
533
			spc2_ptr =
-
 
534
			    (PIXEL_CLOCK_PARAMETERS_V2 *) & args.sPCLKInput;
-
 
535
			spc2_ptr->usPixelClock = cpu_to_le16(mode->clock / 10);
-
 
536
			spc2_ptr->usRefDiv = cpu_to_le16(ref_div);
580
			args.v1.ucRefDivSrc = 1;
537
			spc2_ptr->usFbDiv = cpu_to_le16(fb_div);
581
			break;
538
			spc2_ptr->ucFracFbDiv = frac_fb_div;
582
		case 2:
539
			spc2_ptr->ucPostDiv = post_div;
583
			args.v2.usPixelClock = cpu_to_le16(mode->clock / 10);
540
			spc2_ptr->ucPpll =
584
			args.v2.usRefDiv = cpu_to_le16(ref_div);
541
			    radeon_crtc->crtc_id ? ATOM_PPLL2 : ATOM_PPLL1;
585
			args.v2.usFbDiv = cpu_to_le16(fb_div);
542
			spc2_ptr->ucCRTC = radeon_crtc->crtc_id;
586
			args.v2.ucFracFbDiv = frac_fb_div;
543
			spc2_ptr->ucRefDivSrc = 1;
587
			args.v2.ucPostDiv = post_div;
544
			break;
588
			args.v2.ucPpll =
545
		case 3:
589
			    radeon_crtc->crtc_id ? ATOM_PPLL2 : ATOM_PPLL1;
546
			if (!encoder)
590
			args.v2.ucCRTC = radeon_crtc->crtc_id;
547
				return;
591
			args.v2.ucRefDivSrc = 1;
548
			spc3_ptr =
592
			break;
549
			    (PIXEL_CLOCK_PARAMETERS_V3 *) & args.sPCLKInput;
593
		case 3:
550
			spc3_ptr->usPixelClock = cpu_to_le16(mode->clock / 10);
594
			args.v3.usPixelClock = cpu_to_le16(mode->clock / 10);
Line 567... Line 611...
567
	default:
611
	default:
568
		DRM_ERROR("Unknown table version %d %d\n", frev, crev);
612
		DRM_ERROR("Unknown table version %d %d\n", frev, crev);
569
		return;
613
		return;
570
	}
614
	}
Line 571... Line -...
571
 
-
 
572
	printk("executing set pll\n");
615
 
573
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
616
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
Line 574... Line 617...
574
}
617
}
575
 
618
 
576
int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
619
static int avivo_crtc_set_base(struct drm_crtc *crtc, int x, int y,
577
			   struct drm_framebuffer *old_fb)
620
			   struct drm_framebuffer *old_fb)
Line 578... Line 621...
578
{
621
{
Line 596... Line 639...
596
 
639
 
Line 597... Line 640...
597
	radeon_fb = to_radeon_framebuffer(crtc->fb);
640
	radeon_fb = to_radeon_framebuffer(crtc->fb);
598
 
641
 
599
	/* Pin framebuffer & get tilling informations */
642
	/* Pin framebuffer & get tilling informations */
-
 
643
	obj = radeon_fb->obj;
-
 
644
	rbo = obj->driver_private;
600
	obj = radeon_fb->obj;
645
	r = radeon_bo_reserve(rbo, false);
601
	obj_priv = obj->driver_private;
646
	if (unlikely(r != 0))
-
 
647
		return r;
-
 
648
	r = radeon_bo_pin(rbo, RADEON_GEM_DOMAIN_VRAM, &fb_location);
602
 
649
	if (unlikely(r != 0)) {
603
//	if (radeon_gem_object_pin(obj, RADEON_GEM_DOMAIN_VRAM, &fb_location)) {
650
		radeon_bo_unreserve(rbo);
604
//		return -EINVAL;
-
 
605
//	}
651
		return -EINVAL;
606
 
652
	}
Line 607... Line 653...
607
    fb_location = rdev->mc.vram_location;
653
	radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
608
    tiling_flags = 0;
654
	radeon_bo_unreserve(rbo);
609
 
655
 
610
	switch (crtc->fb->bits_per_pixel) {
656
	switch (crtc->fb->bits_per_pixel) {
Line 685... Line 731...
685
		WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
731
		WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
686
		       AVIVO_D1MODE_INTERLEAVE_EN);
732
		       AVIVO_D1MODE_INTERLEAVE_EN);
687
	else
733
	else
688
		WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
734
		WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, 0);
Line 689... Line 735...
689
 
735
 
690
//   if (old_fb && old_fb != crtc->fb) {
736
	if (old_fb && old_fb != crtc->fb) {
691
//       radeon_fb = to_radeon_framebuffer(old_fb);
737
		radeon_fb = to_radeon_framebuffer(old_fb);
-
 
738
		rbo = radeon_fb->obj->driver_private;
-
 
739
		r = radeon_bo_reserve(rbo, false);
-
 
740
		if (unlikely(r != 0))
-
 
741
			return r;
-
 
742
		radeon_bo_unpin(rbo);
692
//       radeon_gem_object_unpin(radeon_fb->obj);
743
		radeon_bo_unreserve(rbo);
Line 693... Line 744...
693
//   }
744
	}
694
 
745
 
Line 695... Line 746...
695
	/* Bytes per pixel may have changed */
746
	/* Bytes per pixel may have changed */
Line 696... Line 747...
696
	radeon_bandwidth_update(rdev);
747
	radeon_bandwidth_update(rdev);
697
 
748
 
Line -... Line 749...
-
 
749
    LEAVE();
-
 
750
 
-
 
751
	return 0;
-
 
752
}
-
 
753
 
-
 
754
int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
-
 
755
			   struct drm_framebuffer *old_fb)
-
 
756
{
-
 
757
	struct drm_device *dev = crtc->dev;
-
 
758
	struct radeon_device *rdev = dev->dev_private;
-
 
759
 
-
 
760
	if (ASIC_IS_AVIVO(rdev))
-
 
761
		return avivo_crtc_set_base(crtc, x, y, old_fb);
-
 
762
	else
-
 
763
		return radeon_crtc_set_base(crtc, x, y, old_fb);
-
 
764
}
-
 
765
 
-
 
766
/* properly set additional regs when using atombios */
-
 
767
static void radeon_legacy_atom_fixup(struct drm_crtc *crtc)
-
 
768
{
-
 
769
	struct drm_device *dev = crtc->dev;
-
 
770
	struct radeon_device *rdev = dev->dev_private;
-
 
771
	struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
-
 
772
	u32 disp_merge_cntl;
-
 
773
 
-
 
774
	switch (radeon_crtc->crtc_id) {
-
 
775
	case 0:
-
 
776
		disp_merge_cntl = RREG32(RADEON_DISP_MERGE_CNTL);
-
 
777
		disp_merge_cntl &= ~RADEON_DISP_RGB_OFFSET_EN;
-
 
778
		WREG32(RADEON_DISP_MERGE_CNTL, disp_merge_cntl);
-
 
779
		break;
-
 
780
	case 1:
-
 
781
		disp_merge_cntl = RREG32(RADEON_DISP2_MERGE_CNTL);
-
 
782
		disp_merge_cntl &= ~RADEON_DISP2_RGB_OFFSET_EN;
-
 
783
		WREG32(RADEON_DISP2_MERGE_CNTL, disp_merge_cntl);
-
 
784
		WREG32(RADEON_FP_H2_SYNC_STRT_WID,   RREG32(RADEON_CRTC2_H_SYNC_STRT_WID));
698
    LEAVE();
785
		WREG32(RADEON_FP_V2_SYNC_STRT_WID,   RREG32(RADEON_CRTC2_V_SYNC_STRT_WID));
699
 
786
		break;
700
	return 0;
787
	}
701
}
788
}
702
 
789
 
Line 719... Line 806...
719
	if (ASIC_IS_AVIVO(rdev))
806
	if (ASIC_IS_AVIVO(rdev))
720
		atombios_crtc_set_base(crtc, x, y, old_fb);
807
		atombios_crtc_set_base(crtc, x, y, old_fb);
721
	else {
808
	else {
722
		if (radeon_crtc->crtc_id == 0)
809
		if (radeon_crtc->crtc_id == 0)
723
			atombios_set_crtc_dtd_timing(crtc, adjusted_mode);
810
			atombios_set_crtc_dtd_timing(crtc, adjusted_mode);
724
		radeon_crtc_set_base(crtc, x, y, old_fb);
811
		atombios_crtc_set_base(crtc, x, y, old_fb);
725
		radeon_legacy_atom_set_surface(crtc);
812
		radeon_legacy_atom_fixup(crtc);
726
	}
813
	}
727
	atombios_overscan_setup(crtc, mode, adjusted_mode);
814
	atombios_overscan_setup(crtc, mode, adjusted_mode);
728
	atombios_scaler_setup(crtc);
815
	atombios_scaler_setup(crtc);
729
	return 0;
816
	return 0;
730
}
817
}
Line 738... Line 825...
738
	return true;
825
	return true;
739
}
826
}
Line 740... Line 827...
740
 
827
 
741
static void atombios_crtc_prepare(struct drm_crtc *crtc)
828
static void atombios_crtc_prepare(struct drm_crtc *crtc)
742
{
-
 
743
	atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
829
{
-
 
830
	atombios_lock_crtc(crtc, 1);
744
	atombios_lock_crtc(crtc, 1);
831
	atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
Line 745... Line 832...
745
}
832
}
746
 
833
 
747
static void atombios_crtc_commit(struct drm_crtc *crtc)
834
static void atombios_crtc_commit(struct drm_crtc *crtc)