Subversion Repositories Kolibri OS

Rev

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

Rev 1404 Rev 1428
Line 596... Line 596...
596
		break;
596
		break;
597
	}
597
	}
598
	return mode;
598
	return mode;
599
}
599
}
Line -... Line 600...
-
 
600
 
-
 
601
/*
-
 
602
 * EDID is delightfully ambiguous about how interlaced modes are to be
-
 
603
 * encoded.  Our internal representation is of frame height, but some
-
 
604
 * HDTV detailed timings are encoded as field height.
-
 
605
 *
-
 
606
 * The format list here is from CEA, in frame size.  Technically we
-
 
607
 * should be checking refresh rate too.  Whatever.
-
 
608
 */
-
 
609
static void
-
 
610
drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
-
 
611
			    struct detailed_pixel_timing *pt)
-
 
612
{
-
 
613
	int i;
-
 
614
	static const struct {
-
 
615
		int w, h;
-
 
616
	} cea_interlaced[] = {
-
 
617
		{ 1920, 1080 },
-
 
618
		{  720,  480 },
-
 
619
		{ 1440,  480 },
-
 
620
		{ 2880,  480 },
-
 
621
		{  720,  576 },
-
 
622
		{ 1440,  576 },
-
 
623
		{ 2880,  576 },
-
 
624
	};
-
 
625
	static const int n_sizes =
-
 
626
		sizeof(cea_interlaced)/sizeof(cea_interlaced[0]);
-
 
627
 
-
 
628
	if (!(pt->misc & DRM_EDID_PT_INTERLACED))
-
 
629
		return;
-
 
630
 
-
 
631
	for (i = 0; i < n_sizes; i++) {
-
 
632
		if ((mode->hdisplay == cea_interlaced[i].w) &&
-
 
633
		    (mode->vdisplay == cea_interlaced[i].h / 2)) {
-
 
634
			mode->vdisplay *= 2;
-
 
635
			mode->vsync_start *= 2;
-
 
636
			mode->vsync_end *= 2;
-
 
637
			mode->vtotal *= 2;
-
 
638
			mode->vtotal |= 1;
-
 
639
		}
-
 
640
	}
-
 
641
 
-
 
642
	mode->flags |= DRM_MODE_FLAG_INTERLACE;
-
 
643
}
600
 
644
 
601
/**
645
/**
602
 * drm_mode_detailed - create a new mode from an EDID detailed timing section
646
 * drm_mode_detailed - create a new mode from an EDID detailed timing section
603
 * @dev: DRM device (needed to create new mode)
647
 * @dev: DRM device (needed to create new mode)
604
 * @edid: EDID block
648
 * @edid: EDID block
Line 678... Line 722...
678
	if (mode->vsync_end > mode->vtotal)
722
	if (mode->vsync_end > mode->vtotal)
679
		mode->vtotal = mode->vsync_end + 1;
723
		mode->vtotal = mode->vsync_end + 1;
Line 680... Line 724...
680
 
724
 
Line 681... Line -...
681
	drm_mode_set_name(mode);
-
 
682
 
725
	drm_mode_set_name(mode);
Line 683... Line 726...
683
	if (pt->misc & DRM_EDID_PT_INTERLACED)
726
 
684
		mode->flags |= DRM_MODE_FLAG_INTERLACE;
727
	drm_mode_do_interlace_quirk(mode, pt);
685
 
728