hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/drm/drm_edid.c
....@@ -27,16 +27,19 @@
2727 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2828 * DEALINGS IN THE SOFTWARE.
2929 */
30
-#include <linux/kernel.h>
31
-#include <linux/slab.h>
30
+
3231 #include <linux/hdmi.h>
3332 #include <linux/i2c.h>
33
+#include <linux/kernel.h>
3434 #include <linux/module.h>
35
+#include <linux/slab.h>
3536 #include <linux/vga_switcheroo.h>
36
-#include <drm/drmP.h>
37
+
38
+#include <drm/drm_displayid.h>
39
+#include <drm/drm_drv.h>
3740 #include <drm/drm_edid.h>
3841 #include <drm/drm_encoder.h>
39
-#include <drm/drm_displayid.h>
42
+#include <drm/drm_print.h>
4043 #include <drm/drm_scdc_helper.h>
4144
4245 #include "drm_crtc_internal.h"
....@@ -68,8 +71,6 @@
6871 * maximum size and use that.
6972 */
7073 #define EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE (1 << 4)
71
-/* Monitor forgot to set the first detailed is preferred bit. */
72
-#define EDID_QUIRK_FIRST_DETAILED_PREFERRED (1 << 5)
7374 /* use +hsync +vsync for detailed mode */
7475 #define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6)
7576 /* Force reduced-blanking timings for detailed modes */
....@@ -98,14 +99,6 @@
9899 #define LEVEL_GTF2 2
99100 #define LEVEL_CVT 3
100101
101
-/*Enum storing luminance types for HDR blocks in EDID*/
102
-enum luminance_value {
103
- NO_LUMINANCE_DATA = 3,
104
- MAXIMUM_LUMINANCE = 4,
105
- FRAME_AVERAGE_LUMINANCE = 5,
106
- MINIMUM_LUMINANCE = 6
107
-};
108
-
109102 static const struct edid_quirk {
110103 char vendor[4];
111104 int product_id;
....@@ -115,8 +108,6 @@
115108 { "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 },
116109 /* Acer F51 */
117110 { "API", 0x7602, EDID_QUIRK_PREFER_LARGE_60 },
118
- /* Unknown Acer */
119
- { "ACR", 2423, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
120111
121112 /* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
122113 { "AEO", 0, EDID_QUIRK_FORCE_6BPC },
....@@ -152,12 +143,6 @@
152143 /* LG Philips LCD LP154W01-A5 */
153144 { "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
154145 { "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
155
-
156
- /* Philips 107p5 CRT */
157
- { "PHL", 57364, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
158
-
159
- /* Proview AY765C */
160
- { "PTS", 765, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
161146
162147 /* Samsung SyncMaster 205BW. Note: irony */
163148 { "SAM", 541, EDID_QUIRK_DETAILED_SYNC_PP },
....@@ -730,669 +715,667 @@
730715 *
731716 * Do not access directly, instead always use cea_mode_for_vic().
732717 */
733
-static const struct drm_display_mode edid_cea_modes_0[] = {
734
- /* 0 - dummy, VICs start at 1 */
735
- { },
718
+static const struct drm_display_mode edid_cea_modes_1[] = {
736719 /* 1 - 640x480@60Hz 4:3 */
737720 { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25175, 640, 656,
738721 752, 800, 0, 480, 490, 492, 525, 0,
739722 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
740
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
723
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
741724 /* 2 - 720x480@60Hz 4:3 */
742725 { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 27000, 720, 736,
743726 798, 858, 0, 480, 489, 495, 525, 0,
744727 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
745
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
728
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
746729 /* 3 - 720x480@60Hz 16:9 */
747730 { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 27000, 720, 736,
748731 798, 858, 0, 480, 489, 495, 525, 0,
749732 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
750
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
733
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
751734 /* 4 - 1280x720@60Hz 16:9 */
752735 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
753736 1430, 1650, 0, 720, 725, 730, 750, 0,
754737 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
755
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
738
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
756739 /* 5 - 1920x1080i@60Hz 16:9 */
757740 { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
758741 2052, 2200, 0, 1080, 1084, 1094, 1125, 0,
759742 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
760743 DRM_MODE_FLAG_INTERLACE),
761
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
744
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
762745 /* 6 - 720(1440)x480i@60Hz 4:3 */
763746 { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 13500, 720, 739,
764747 801, 858, 0, 480, 488, 494, 525, 0,
765748 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
766749 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
767
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
750
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
768751 /* 7 - 720(1440)x480i@60Hz 16:9 */
769752 { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 13500, 720, 739,
770753 801, 858, 0, 480, 488, 494, 525, 0,
771754 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
772755 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
773
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
756
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
774757 /* 8 - 720(1440)x240@60Hz 4:3 */
775758 { DRM_MODE("720x240", DRM_MODE_TYPE_DRIVER, 13500, 720, 739,
776759 801, 858, 0, 240, 244, 247, 262, 0,
777760 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
778761 DRM_MODE_FLAG_DBLCLK),
779
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
762
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
780763 /* 9 - 720(1440)x240@60Hz 16:9 */
781764 { DRM_MODE("720x240", DRM_MODE_TYPE_DRIVER, 13500, 720, 739,
782765 801, 858, 0, 240, 244, 247, 262, 0,
783766 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
784767 DRM_MODE_FLAG_DBLCLK),
785
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
768
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
786769 /* 10 - 2880x480i@60Hz 4:3 */
787770 { DRM_MODE("2880x480i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
788771 3204, 3432, 0, 480, 488, 494, 525, 0,
789772 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
790773 DRM_MODE_FLAG_INTERLACE),
791
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
774
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
792775 /* 11 - 2880x480i@60Hz 16:9 */
793776 { DRM_MODE("2880x480i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
794777 3204, 3432, 0, 480, 488, 494, 525, 0,
795778 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
796779 DRM_MODE_FLAG_INTERLACE),
797
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
780
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
798781 /* 12 - 2880x240@60Hz 4:3 */
799782 { DRM_MODE("2880x240", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
800783 3204, 3432, 0, 240, 244, 247, 262, 0,
801784 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
802
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
785
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
803786 /* 13 - 2880x240@60Hz 16:9 */
804787 { DRM_MODE("2880x240", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2956,
805788 3204, 3432, 0, 240, 244, 247, 262, 0,
806789 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
807
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
790
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
808791 /* 14 - 1440x480@60Hz 4:3 */
809792 { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1472,
810793 1596, 1716, 0, 480, 489, 495, 525, 0,
811794 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
812
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
795
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
813796 /* 15 - 1440x480@60Hz 16:9 */
814797 { DRM_MODE("1440x480", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1472,
815798 1596, 1716, 0, 480, 489, 495, 525, 0,
816799 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
817
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
800
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
818801 /* 16 - 1920x1080@60Hz 16:9 */
819802 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
820803 2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
821804 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
822
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
805
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
823806 /* 17 - 720x576@50Hz 4:3 */
824807 { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
825808 796, 864, 0, 576, 581, 586, 625, 0,
826809 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
827
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
810
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
828811 /* 18 - 720x576@50Hz 16:9 */
829812 { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
830813 796, 864, 0, 576, 581, 586, 625, 0,
831814 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
832
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
815
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
833816 /* 19 - 1280x720@50Hz 16:9 */
834817 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
835818 1760, 1980, 0, 720, 725, 730, 750, 0,
836819 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
837
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
820
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
838821 /* 20 - 1920x1080i@50Hz 16:9 */
839822 { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
840823 2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
841824 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
842825 DRM_MODE_FLAG_INTERLACE),
843
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
826
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
844827 /* 21 - 720(1440)x576i@50Hz 4:3 */
845828 { DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 13500, 720, 732,
846829 795, 864, 0, 576, 580, 586, 625, 0,
847830 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
848831 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
849
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
832
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
850833 /* 22 - 720(1440)x576i@50Hz 16:9 */
851834 { DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 13500, 720, 732,
852835 795, 864, 0, 576, 580, 586, 625, 0,
853836 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
854837 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
855
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
838
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
856839 /* 23 - 720(1440)x288@50Hz 4:3 */
857840 { DRM_MODE("720x288", DRM_MODE_TYPE_DRIVER, 13500, 720, 732,
858841 795, 864, 0, 288, 290, 293, 312, 0,
859842 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
860843 DRM_MODE_FLAG_DBLCLK),
861
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
844
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
862845 /* 24 - 720(1440)x288@50Hz 16:9 */
863846 { DRM_MODE("720x288", DRM_MODE_TYPE_DRIVER, 13500, 720, 732,
864847 795, 864, 0, 288, 290, 293, 312, 0,
865848 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
866849 DRM_MODE_FLAG_DBLCLK),
867
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
850
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
868851 /* 25 - 2880x576i@50Hz 4:3 */
869852 { DRM_MODE("2880x576i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
870853 3180, 3456, 0, 576, 580, 586, 625, 0,
871854 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
872855 DRM_MODE_FLAG_INTERLACE),
873
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
856
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
874857 /* 26 - 2880x576i@50Hz 16:9 */
875858 { DRM_MODE("2880x576i", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
876859 3180, 3456, 0, 576, 580, 586, 625, 0,
877860 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
878861 DRM_MODE_FLAG_INTERLACE),
879
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
862
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
880863 /* 27 - 2880x288@50Hz 4:3 */
881864 { DRM_MODE("2880x288", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
882865 3180, 3456, 0, 288, 290, 293, 312, 0,
883866 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
884
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
867
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
885868 /* 28 - 2880x288@50Hz 16:9 */
886869 { DRM_MODE("2880x288", DRM_MODE_TYPE_DRIVER, 54000, 2880, 2928,
887870 3180, 3456, 0, 288, 290, 293, 312, 0,
888871 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
889
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
872
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
890873 /* 29 - 1440x576@50Hz 4:3 */
891874 { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1464,
892875 1592, 1728, 0, 576, 581, 586, 625, 0,
893876 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
894
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
877
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
895878 /* 30 - 1440x576@50Hz 16:9 */
896879 { DRM_MODE("1440x576", DRM_MODE_TYPE_DRIVER, 54000, 1440, 1464,
897880 1592, 1728, 0, 576, 581, 586, 625, 0,
898881 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
899
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
882
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
900883 /* 31 - 1920x1080@50Hz 16:9 */
901884 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
902885 2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
903886 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
904
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
887
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
905888 /* 32 - 1920x1080@24Hz 16:9 */
906889 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
907890 2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
908891 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
909
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
892
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
910893 /* 33 - 1920x1080@25Hz 16:9 */
911894 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
912895 2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
913896 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
914
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
897
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
915898 /* 34 - 1920x1080@30Hz 16:9 */
916899 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
917900 2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
918901 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
919
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
902
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
920903 /* 35 - 2880x480@60Hz 4:3 */
921904 { DRM_MODE("2880x480", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2944,
922905 3192, 3432, 0, 480, 489, 495, 525, 0,
923906 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
924
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
907
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
925908 /* 36 - 2880x480@60Hz 16:9 */
926909 { DRM_MODE("2880x480", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2944,
927910 3192, 3432, 0, 480, 489, 495, 525, 0,
928911 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
929
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
912
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
930913 /* 37 - 2880x576@50Hz 4:3 */
931914 { DRM_MODE("2880x576", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2928,
932915 3184, 3456, 0, 576, 581, 586, 625, 0,
933916 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
934
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
917
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
935918 /* 38 - 2880x576@50Hz 16:9 */
936919 { DRM_MODE("2880x576", DRM_MODE_TYPE_DRIVER, 108000, 2880, 2928,
937920 3184, 3456, 0, 576, 581, 586, 625, 0,
938921 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
939
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
922
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
940923 /* 39 - 1920x1080i@50Hz 16:9 */
941924 { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 72000, 1920, 1952,
942925 2120, 2304, 0, 1080, 1126, 1136, 1250, 0,
943926 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC |
944927 DRM_MODE_FLAG_INTERLACE),
945
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
928
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
946929 /* 40 - 1920x1080i@100Hz 16:9 */
947930 { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
948931 2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
949932 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
950933 DRM_MODE_FLAG_INTERLACE),
951
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
934
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
952935 /* 41 - 1280x720@100Hz 16:9 */
953936 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
954937 1760, 1980, 0, 720, 725, 730, 750, 0,
955938 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
956
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
939
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
957940 /* 42 - 720x576@100Hz 4:3 */
958941 { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 54000, 720, 732,
959942 796, 864, 0, 576, 581, 586, 625, 0,
960943 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
961
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
944
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
962945 /* 43 - 720x576@100Hz 16:9 */
963946 { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 54000, 720, 732,
964947 796, 864, 0, 576, 581, 586, 625, 0,
965948 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
966
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
949
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
967950 /* 44 - 720(1440)x576i@100Hz 4:3 */
968951 { DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
969952 795, 864, 0, 576, 580, 586, 625, 0,
970953 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
971954 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
972
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
955
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
973956 /* 45 - 720(1440)x576i@100Hz 16:9 */
974957 { DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 27000, 720, 732,
975958 795, 864, 0, 576, 580, 586, 625, 0,
976959 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
977960 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
978
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
961
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
979962 /* 46 - 1920x1080i@120Hz 16:9 */
980963 { DRM_MODE("1920x1080i", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
981964 2052, 2200, 0, 1080, 1084, 1094, 1125, 0,
982965 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
983966 DRM_MODE_FLAG_INTERLACE),
984
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
967
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
985968 /* 47 - 1280x720@120Hz 16:9 */
986969 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
987970 1430, 1650, 0, 720, 725, 730, 750, 0,
988971 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
989
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
972
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
990973 /* 48 - 720x480@120Hz 4:3 */
991974 { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 54000, 720, 736,
992975 798, 858, 0, 480, 489, 495, 525, 0,
993976 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
994
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
977
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
995978 /* 49 - 720x480@120Hz 16:9 */
996979 { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 54000, 720, 736,
997980 798, 858, 0, 480, 489, 495, 525, 0,
998981 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
999
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
982
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1000983 /* 50 - 720(1440)x480i@120Hz 4:3 */
1001984 { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 27000, 720, 739,
1002985 801, 858, 0, 480, 488, 494, 525, 0,
1003986 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
1004987 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
1005
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
988
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
1006989 /* 51 - 720(1440)x480i@120Hz 16:9 */
1007990 { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 27000, 720, 739,
1008991 801, 858, 0, 480, 488, 494, 525, 0,
1009992 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
1010993 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
1011
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
994
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1012995 /* 52 - 720x576@200Hz 4:3 */
1013996 { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 108000, 720, 732,
1014997 796, 864, 0, 576, 581, 586, 625, 0,
1015998 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
1016
- .vrefresh = 200, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
999
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
10171000 /* 53 - 720x576@200Hz 16:9 */
10181001 { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 108000, 720, 732,
10191002 796, 864, 0, 576, 581, 586, 625, 0,
10201003 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
1021
- .vrefresh = 200, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1004
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10221005 /* 54 - 720(1440)x576i@200Hz 4:3 */
10231006 { DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 54000, 720, 732,
10241007 795, 864, 0, 576, 580, 586, 625, 0,
10251008 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
10261009 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
1027
- .vrefresh = 200, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
1010
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
10281011 /* 55 - 720(1440)x576i@200Hz 16:9 */
10291012 { DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 54000, 720, 732,
10301013 795, 864, 0, 576, 580, 586, 625, 0,
10311014 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
10321015 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
1033
- .vrefresh = 200, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1016
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10341017 /* 56 - 720x480@240Hz 4:3 */
10351018 { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 108000, 720, 736,
10361019 798, 858, 0, 480, 489, 495, 525, 0,
10371020 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
1038
- .vrefresh = 240, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
1021
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
10391022 /* 57 - 720x480@240Hz 16:9 */
10401023 { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 108000, 720, 736,
10411024 798, 858, 0, 480, 489, 495, 525, 0,
10421025 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
1043
- .vrefresh = 240, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1026
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10441027 /* 58 - 720(1440)x480i@240Hz 4:3 */
10451028 { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 54000, 720, 739,
10461029 801, 858, 0, 480, 488, 494, 525, 0,
10471030 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
10481031 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
1049
- .vrefresh = 240, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
1032
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_4_3, },
10501033 /* 59 - 720(1440)x480i@240Hz 16:9 */
10511034 { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 54000, 720, 739,
10521035 801, 858, 0, 480, 488, 494, 525, 0,
10531036 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC |
10541037 DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK),
1055
- .vrefresh = 240, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1038
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10561039 /* 60 - 1280x720@24Hz 16:9 */
10571040 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
10581041 3080, 3300, 0, 720, 725, 730, 750, 0,
10591042 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1060
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1043
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10611044 /* 61 - 1280x720@25Hz 16:9 */
10621045 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
10631046 3740, 3960, 0, 720, 725, 730, 750, 0,
10641047 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1065
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1048
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10661049 /* 62 - 1280x720@30Hz 16:9 */
10671050 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
10681051 3080, 3300, 0, 720, 725, 730, 750, 0,
10691052 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1070
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1053
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10711054 /* 63 - 1920x1080@120Hz 16:9 */
10721055 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
10731056 2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
10741057 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1075
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1058
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10761059 /* 64 - 1920x1080@100Hz 16:9 */
10771060 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
10781061 2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
10791062 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1080
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1063
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
10811064 /* 65 - 1280x720@24Hz 64:27 */
10821065 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
10831066 3080, 3300, 0, 720, 725, 730, 750, 0,
10841067 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1085
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1068
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
10861069 /* 66 - 1280x720@25Hz 64:27 */
10871070 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
10881071 3740, 3960, 0, 720, 725, 730, 750, 0,
10891072 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1090
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1073
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
10911074 /* 67 - 1280x720@30Hz 64:27 */
10921075 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
10931076 3080, 3300, 0, 720, 725, 730, 750, 0,
10941077 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1095
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1078
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
10961079 /* 68 - 1280x720@50Hz 64:27 */
10971080 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
10981081 1760, 1980, 0, 720, 725, 730, 750, 0,
10991082 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1100
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1083
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11011084 /* 69 - 1280x720@60Hz 64:27 */
11021085 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
11031086 1430, 1650, 0, 720, 725, 730, 750, 0,
11041087 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1105
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1088
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11061089 /* 70 - 1280x720@100Hz 64:27 */
11071090 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
11081091 1760, 1980, 0, 720, 725, 730, 750, 0,
11091092 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1110
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1093
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11111094 /* 71 - 1280x720@120Hz 64:27 */
11121095 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
11131096 1430, 1650, 0, 720, 725, 730, 750, 0,
11141097 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1115
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1098
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11161099 /* 72 - 1920x1080@24Hz 64:27 */
11171100 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
11181101 2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
11191102 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1120
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1103
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11211104 /* 73 - 1920x1080@25Hz 64:27 */
11221105 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
11231106 2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
11241107 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1125
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1108
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11261109 /* 74 - 1920x1080@30Hz 64:27 */
11271110 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
11281111 2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
11291112 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1130
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1113
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11311114 /* 75 - 1920x1080@50Hz 64:27 */
11321115 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
11331116 2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
11341117 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1135
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1118
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11361119 /* 76 - 1920x1080@60Hz 64:27 */
11371120 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
11381121 2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
11391122 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1140
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1123
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11411124 /* 77 - 1920x1080@100Hz 64:27 */
11421125 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
11431126 2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
11441127 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1145
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1128
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11461129 /* 78 - 1920x1080@120Hz 64:27 */
11471130 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
11481131 2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
11491132 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1150
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1133
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11511134 /* 79 - 1680x720@24Hz 64:27 */
11521135 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
11531136 3080, 3300, 0, 720, 725, 730, 750, 0,
11541137 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1155
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1138
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11561139 /* 80 - 1680x720@25Hz 64:27 */
11571140 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
11581141 2948, 3168, 0, 720, 725, 730, 750, 0,
11591142 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1160
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1143
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11611144 /* 81 - 1680x720@30Hz 64:27 */
11621145 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
11631146 2420, 2640, 0, 720, 725, 730, 750, 0,
11641147 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1165
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1148
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11661149 /* 82 - 1680x720@50Hz 64:27 */
11671150 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
11681151 1980, 2200, 0, 720, 725, 730, 750, 0,
11691152 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1170
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1153
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11711154 /* 83 - 1680x720@60Hz 64:27 */
11721155 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
11731156 1980, 2200, 0, 720, 725, 730, 750, 0,
11741157 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1175
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1158
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11761159 /* 84 - 1680x720@100Hz 64:27 */
11771160 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
11781161 1780, 2000, 0, 720, 725, 730, 825, 0,
11791162 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1180
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1163
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11811164 /* 85 - 1680x720@120Hz 64:27 */
11821165 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
11831166 1780, 2000, 0, 720, 725, 730, 825, 0,
11841167 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1185
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1168
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11861169 /* 86 - 2560x1080@24Hz 64:27 */
11871170 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
11881171 3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
11891172 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1190
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1173
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11911174 /* 87 - 2560x1080@25Hz 64:27 */
11921175 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
11931176 3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
11941177 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1195
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1178
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
11961179 /* 88 - 2560x1080@30Hz 64:27 */
11971180 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
11981181 3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
11991182 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1200
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1183
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12011184 /* 89 - 2560x1080@50Hz 64:27 */
12021185 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
12031186 3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
12041187 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1205
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1188
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12061189 /* 90 - 2560x1080@60Hz 64:27 */
12071190 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
12081191 2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
12091192 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1210
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1193
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12111194 /* 91 - 2560x1080@100Hz 64:27 */
12121195 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
12131196 2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
12141197 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1215
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1198
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12161199 /* 92 - 2560x1080@120Hz 64:27 */
12171200 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
12181201 3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
12191202 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1220
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1203
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12211204 /* 93 - 3840x2160@24Hz 16:9 */
12221205 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
12231206 5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
12241207 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1225
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1208
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
12261209 /* 94 - 3840x2160@25Hz 16:9 */
12271210 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
12281211 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
12291212 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1230
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1213
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
12311214 /* 95 - 3840x2160@30Hz 16:9 */
12321215 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
12331216 4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
12341217 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1235
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1218
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
12361219 /* 96 - 3840x2160@50Hz 16:9 */
12371220 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
12381221 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
12391222 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1240
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1223
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
12411224 /* 97 - 3840x2160@60Hz 16:9 */
12421225 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
12431226 4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
12441227 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1245
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1228
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
12461229 /* 98 - 4096x2160@24Hz 256:135 */
12471230 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
12481231 5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
12491232 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1250
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1233
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
12511234 /* 99 - 4096x2160@25Hz 256:135 */
12521235 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
12531236 5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
12541237 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1255
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1238
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
12561239 /* 100 - 4096x2160@30Hz 256:135 */
12571240 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
12581241 4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
12591242 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1260
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1243
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
12611244 /* 101 - 4096x2160@50Hz 256:135 */
12621245 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
12631246 5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
12641247 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1265
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1248
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
12661249 /* 102 - 4096x2160@60Hz 256:135 */
12671250 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
12681251 4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
12691252 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1270
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1253
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
12711254 /* 103 - 3840x2160@24Hz 64:27 */
12721255 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
12731256 5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
12741257 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1275
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1258
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12761259 /* 104 - 3840x2160@25Hz 64:27 */
12771260 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
12781261 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
12791262 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1280
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1263
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12811264 /* 105 - 3840x2160@30Hz 64:27 */
12821265 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
12831266 4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
12841267 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1285
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1268
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12861269 /* 106 - 3840x2160@50Hz 64:27 */
12871270 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
12881271 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
12891272 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1290
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1273
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12911274 /* 107 - 3840x2160@60Hz 64:27 */
12921275 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
12931276 4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
12941277 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1295
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1278
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
12961279 /* 108 - 1280x720@48Hz 16:9 */
12971280 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 90000, 1280, 2240,
12981281 2280, 2500, 0, 720, 725, 730, 750, 0,
12991282 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1300
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1283
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
13011284 /* 109 - 1280x720@48Hz 64:27 */
13021285 { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 90000, 1280, 2240,
13031286 2280, 2500, 0, 720, 725, 730, 750, 0,
13041287 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1305
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1288
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13061289 /* 110 - 1680x720@48Hz 64:27 */
13071290 { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 2490,
13081291 2530, 2750, 0, 720, 725, 730, 750, 0,
13091292 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1310
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1293
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13111294 /* 111 - 1920x1080@48Hz 16:9 */
13121295 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2558,
13131296 2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
13141297 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1315
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1298
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
13161299 /* 112 - 1920x1080@48Hz 64:27 */
13171300 { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2558,
13181301 2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
13191302 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1320
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1303
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13211304 /* 113 - 2560x1080@48Hz 64:27 */
13221305 { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 3558,
13231306 3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
13241307 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1325
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1308
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13261309 /* 114 - 3840x2160@48Hz 16:9 */
13271310 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 5116,
13281311 5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
13291312 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1330
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1313
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
13311314 /* 115 - 4096x2160@48Hz 256:135 */
13321315 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5116,
13331316 5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
13341317 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1335
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1318
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
13361319 /* 116 - 3840x2160@48Hz 64:27 */
13371320 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 5116,
13381321 5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
13391322 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1340
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1323
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13411324 /* 117 - 3840x2160@100Hz 16:9 */
13421325 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 1188000, 3840, 4896,
13431326 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
13441327 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1345
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1328
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
13461329 /* 118 - 3840x2160@120Hz 16:9 */
13471330 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 1188000, 3840, 4016,
13481331 4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
13491332 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1350
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1333
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
13511334 /* 119 - 3840x2160@100Hz 64:27 */
13521335 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 1188000, 3840, 4896,
13531336 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
13541337 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1355
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1338
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13561339 /* 120 - 3840x2160@120Hz 64:27 */
13571340 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 1188000, 3840, 4016,
13581341 4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
13591342 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1360
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1343
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13611344 /* 121 - 5120x2160@24Hz 64:27 */
13621345 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 396000, 5120, 7116,
13631346 7204, 7500, 0, 2160, 2168, 2178, 2200, 0,
13641347 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1365
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1348
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13661349 /* 122 - 5120x2160@25Hz 64:27 */
13671350 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 396000, 5120, 6816,
13681351 6904, 7200, 0, 2160, 2168, 2178, 2200, 0,
13691352 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1370
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1353
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13711354 /* 123 - 5120x2160@30Hz 64:27 */
13721355 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 396000, 5120, 5784,
13731356 5872, 6000, 0, 2160, 2168, 2178, 2200, 0,
13741357 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1375
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1358
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13761359 /* 124 - 5120x2160@48Hz 64:27 */
13771360 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 742500, 5120, 5866,
13781361 5954, 6250, 0, 2160, 2168, 2178, 2475, 0,
13791362 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1380
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1363
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13811364 /* 125 - 5120x2160@50Hz 64:27 */
13821365 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 742500, 5120, 6216,
13831366 6304, 6600, 0, 2160, 2168, 2178, 2250, 0,
13841367 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1385
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1368
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13861369 /* 126 - 5120x2160@60Hz 64:27 */
13871370 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 742500, 5120, 5284,
13881371 5372, 5500, 0, 2160, 2168, 2178, 2250, 0,
13891372 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1390
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1373
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13911374 /* 127 - 5120x2160@100Hz 64:27 */
13921375 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 1485000, 5120, 6216,
13931376 6304, 6600, 0, 2160, 2168, 2178, 2250, 0,
13941377 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1395
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1378
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
13961379 };
13971380
13981381 /*
....@@ -1405,137 +1388,137 @@
14051388 { DRM_MODE("5120x2160", DRM_MODE_TYPE_DRIVER, 1485000, 5120, 5284,
14061389 5372, 5500, 0, 2160, 2168, 2178, 2250, 0,
14071390 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1408
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1391
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14091392 /* 194 - 7680x4320@24Hz 16:9 */
14101393 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 1188000, 7680, 10232,
14111394 10408, 11000, 0, 4320, 4336, 4356, 4500, 0,
14121395 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1413
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1396
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14141397 /* 195 - 7680x4320@25Hz 16:9 */
14151398 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 1188000, 7680, 10032,
14161399 10208, 10800, 0, 4320, 4336, 4356, 4400, 0,
14171400 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1418
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1401
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14191402 /* 196 - 7680x4320@30Hz 16:9 */
14201403 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 1188000, 7680, 8232,
14211404 8408, 9000, 0, 4320, 4336, 4356, 4400, 0,
14221405 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1423
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1406
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14241407 /* 197 - 7680x4320@48Hz 16:9 */
14251408 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 2376000, 7680, 10232,
14261409 10408, 11000, 0, 4320, 4336, 4356, 4500, 0,
14271410 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1428
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1411
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14291412 /* 198 - 7680x4320@50Hz 16:9 */
14301413 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 2376000, 7680, 10032,
14311414 10208, 10800, 0, 4320, 4336, 4356, 4400, 0,
14321415 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1433
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1416
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14341417 /* 199 - 7680x4320@60Hz 16:9 */
14351418 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 2376000, 7680, 8232,
14361419 8408, 9000, 0, 4320, 4336, 4356, 4400, 0,
14371420 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1438
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1421
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14391422 /* 200 - 7680x4320@100Hz 16:9 */
14401423 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 4752000, 7680, 9792,
14411424 9968, 10560, 0, 4320, 4336, 4356, 4500, 0,
14421425 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1443
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1426
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14441427 /* 201 - 7680x4320@120Hz 16:9 */
14451428 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 4752000, 7680, 8032,
14461429 8208, 8800, 0, 4320, 4336, 4356, 4500, 0,
14471430 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1448
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
1431
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
14491432 /* 202 - 7680x4320@24Hz 64:27 */
14501433 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 1188000, 7680, 10232,
14511434 10408, 11000, 0, 4320, 4336, 4356, 4500, 0,
14521435 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1453
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1436
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14541437 /* 203 - 7680x4320@25Hz 64:27 */
14551438 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 1188000, 7680, 10032,
14561439 10208, 10800, 0, 4320, 4336, 4356, 4400, 0,
14571440 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1458
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1441
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14591442 /* 204 - 7680x4320@30Hz 64:27 */
14601443 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 1188000, 7680, 8232,
14611444 8408, 9000, 0, 4320, 4336, 4356, 4400, 0,
14621445 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1463
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1446
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14641447 /* 205 - 7680x4320@48Hz 64:27 */
14651448 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 2376000, 7680, 10232,
14661449 10408, 11000, 0, 4320, 4336, 4356, 4500, 0,
14671450 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1468
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1451
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14691452 /* 206 - 7680x4320@50Hz 64:27 */
14701453 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 2376000, 7680, 10032,
14711454 10208, 10800, 0, 4320, 4336, 4356, 4400, 0,
14721455 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1473
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1456
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14741457 /* 207 - 7680x4320@60Hz 64:27 */
14751458 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 2376000, 7680, 8232,
14761459 8408, 9000, 0, 4320, 4336, 4356, 4400, 0,
14771460 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1478
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1461
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14791462 /* 208 - 7680x4320@100Hz 64:27 */
14801463 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 4752000, 7680, 9792,
14811464 9968, 10560, 0, 4320, 4336, 4356, 4500, 0,
14821465 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1483
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1466
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14841467 /* 209 - 7680x4320@120Hz 64:27 */
14851468 { DRM_MODE("7680x4320", DRM_MODE_TYPE_DRIVER, 4752000, 7680, 8032,
14861469 8208, 8800, 0, 4320, 4336, 4356, 4500, 0,
14871470 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1488
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1471
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14891472 /* 210 - 10240x4320@24Hz 64:27 */
14901473 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 1485000, 10240, 11732,
14911474 11908, 12500, 0, 4320, 4336, 4356, 4950, 0,
14921475 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1493
- .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1476
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14941477 /* 211 - 10240x4320@25Hz 64:27 */
14951478 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 1485000, 10240, 12732,
14961479 12908, 13500, 0, 4320, 4336, 4356, 4400, 0,
14971480 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1498
- .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1481
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
14991482 /* 212 - 10240x4320@30Hz 64:27 */
15001483 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 1485000, 10240, 10528,
15011484 10704, 11000, 0, 4320, 4336, 4356, 4500, 0,
15021485 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1503
- .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1486
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
15041487 /* 213 - 10240x4320@48Hz 64:27 */
15051488 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 2970000, 10240, 11732,
15061489 11908, 12500, 0, 4320, 4336, 4356, 4950, 0,
15071490 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1508
- .vrefresh = 48, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1491
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
15091492 /* 214 - 10240x4320@50Hz 64:27 */
15101493 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 2970000, 10240, 12732,
15111494 12908, 13500, 0, 4320, 4336, 4356, 4400, 0,
15121495 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1513
- .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1496
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
15141497 /* 215 - 10240x4320@60Hz 64:27 */
15151498 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 2970000, 10240, 10528,
15161499 10704, 11000, 0, 4320, 4336, 4356, 4500, 0,
15171500 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1518
- .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1501
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
15191502 /* 216 - 10240x4320@100Hz 64:27 */
15201503 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 5940000, 10240, 12432,
15211504 12608, 13200, 0, 4320, 4336, 4356, 4500, 0,
15221505 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1523
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1506
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
15241507 /* 217 - 10240x4320@120Hz 64:27 */
15251508 { DRM_MODE("10240x4320", DRM_MODE_TYPE_DRIVER, 5940000, 10240, 10528,
15261509 10704, 11000, 0, 4320, 4336, 4356, 4500, 0,
15271510 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1528
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
1511
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
15291512 /* 218 - 4096x2160@100Hz 256:135 */
15301513 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 1188000, 4096, 4896,
15311514 4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
15321515 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1533
- .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1516
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
15341517 /* 219 - 4096x2160@120Hz 256:135 */
15351518 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 1188000, 4096, 4184,
15361519 4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
15371520 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1538
- .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
1521
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
15391522 };
15401523
15411524 /*
....@@ -1549,25 +1532,25 @@
15491532 3840, 4016, 4104, 4400, 0,
15501533 2160, 2168, 2178, 2250, 0,
15511534 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1552
- .vrefresh = 30, },
1535
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
15531536 /* 2 - 3840x2160@25Hz */
15541537 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000,
15551538 3840, 4896, 4984, 5280, 0,
15561539 2160, 2168, 2178, 2250, 0,
15571540 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1558
- .vrefresh = 25, },
1541
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
15591542 /* 3 - 3840x2160@24Hz */
15601543 { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000,
15611544 3840, 5116, 5204, 5500, 0,
15621545 2160, 2168, 2178, 2250, 0,
15631546 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1564
- .vrefresh = 24, },
1547
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
15651548 /* 4 - 4096x2160@24Hz (SMPTE) */
15661549 { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000,
15671550 4096, 5116, 5204, 5500, 0,
15681551 2160, 2168, 2178, 2250, 0,
15691552 DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
1570
- .vrefresh = 24, },
1553
+ .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135, },
15711554 };
15721555
15731556 /*** DDC fetch and block validation ***/
....@@ -1601,18 +1584,27 @@
16011584 MODULE_PARM_DESC(edid_fixup,
16021585 "Minimum number of valid EDID header bytes (0-8, default 6)");
16031586
1604
-static void drm_get_displayid(struct drm_connector *connector,
1605
- struct edid *edid);
16061587 static int validate_displayid(u8 *displayid, int length, int idx);
16071588
16081589 static int drm_edid_block_checksum(const u8 *raw_edid)
16091590 {
16101591 int i;
1611
- u8 csum = 0;
1612
- for (i = 0; i < EDID_LENGTH; i++)
1592
+ u8 csum = 0, crc = 0;
1593
+
1594
+ for (i = 0; i < EDID_LENGTH - 1; i++)
16131595 csum += raw_edid[i];
16141596
1615
- return csum;
1597
+ crc = 0x100 - csum;
1598
+
1599
+ return crc;
1600
+}
1601
+
1602
+static bool drm_edid_block_checksum_diff(const u8 *raw_edid, u8 real_checksum)
1603
+{
1604
+ if (raw_edid[EDID_LENGTH - 1] != real_checksum)
1605
+ return true;
1606
+ else
1607
+ return false;
16161608 }
16171609
16181610 static bool drm_edid_is_zero(const u8 *in_edid, int length)
....@@ -1622,6 +1614,37 @@
16221614
16231615 return true;
16241616 }
1617
+
1618
+/**
1619
+ * drm_edid_are_equal - compare two edid blobs.
1620
+ * @edid1: pointer to first blob
1621
+ * @edid2: pointer to second blob
1622
+ * This helper can be used during probing to determine if
1623
+ * edid had changed.
1624
+ */
1625
+bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2)
1626
+{
1627
+ int edid1_len, edid2_len;
1628
+ bool edid1_present = edid1 != NULL;
1629
+ bool edid2_present = edid2 != NULL;
1630
+
1631
+ if (edid1_present != edid2_present)
1632
+ return false;
1633
+
1634
+ if (edid1) {
1635
+ edid1_len = EDID_LENGTH * (1 + edid1->extensions);
1636
+ edid2_len = EDID_LENGTH * (1 + edid2->extensions);
1637
+
1638
+ if (edid1_len != edid2_len)
1639
+ return false;
1640
+
1641
+ if (memcmp(edid1, edid2, edid1_len))
1642
+ return false;
1643
+ }
1644
+
1645
+ return true;
1646
+}
1647
+EXPORT_SYMBOL(drm_edid_are_equal);
16251648
16261649 /**
16271650 * drm_edid_block_valid - Sanity check the EDID block (base or extension)
....@@ -1649,6 +1672,7 @@
16491672
16501673 if (block == 0) {
16511674 int score = drm_edid_header_is_valid(raw_edid);
1675
+
16521676 if (score == 8) {
16531677 if (edid_corrupt)
16541678 *edid_corrupt = false;
....@@ -1670,7 +1694,7 @@
16701694 }
16711695
16721696 csum = drm_edid_block_checksum(raw_edid);
1673
- if (csum) {
1697
+ if (drm_edid_block_checksum_diff(raw_edid, csum)) {
16741698 if (edid_corrupt)
16751699 *edid_corrupt = true;
16761700
....@@ -1811,13 +1835,25 @@
18111835 u8 *edid, int num_blocks)
18121836 {
18131837 int i;
1838
+ u8 last_block;
18141839
1815
- if (connector->bad_edid_counter++ && !(drm_debug & DRM_UT_KMS))
1840
+ /*
1841
+ * 0x7e in the EDID is the number of extension blocks. The EDID
1842
+ * is 1 (base block) + num_ext_blocks big. That means we can think
1843
+ * of 0x7e in the EDID of the _index_ of the last block in the
1844
+ * combined chunk of memory.
1845
+ */
1846
+ last_block = edid[0x7e];
1847
+
1848
+ /* Calculate real checksum for the last edid extension block data */
1849
+ if (last_block < num_blocks)
1850
+ connector->real_edid_checksum =
1851
+ drm_edid_block_checksum(edid + last_block * EDID_LENGTH);
1852
+
1853
+ if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS))
18161854 return;
18171855
1818
- dev_warn(connector->dev->dev,
1819
- "%s: EDID is invalid:\n",
1820
- connector->name);
1856
+ drm_warn(connector->dev, "%s: EDID is invalid:\n", connector->name);
18211857 for (i = 0; i < num_blocks; i++) {
18221858 u8 *block = edid + i * EDID_LENGTH;
18231859 char prefix[20];
....@@ -1879,6 +1915,76 @@
18791915 }
18801916 EXPORT_SYMBOL(drm_add_override_edid_modes);
18811917
1918
+#ifdef CONFIG_NO_GKI
1919
+/*
1920
+ * References:
1921
+ * - CTA-861-H section 7.3.3 CTA Extension Version 3
1922
+ */
1923
+static int cea_db_collection_size(const u8 *cta)
1924
+{
1925
+ u8 d = cta[2];
1926
+
1927
+ if (d < 4 || d > 127)
1928
+ return 0;
1929
+
1930
+ return d - 4;
1931
+}
1932
+
1933
+#define CTA_EXT_DB_HF_EEODB 0x78
1934
+#define CTA_DB_EXTENDED_TAG 7
1935
+
1936
+static int cea_db_tag(const u8 *db);
1937
+static int cea_db_payload_len(const u8 *db);
1938
+static int cea_db_extended_tag(const u8 *db);
1939
+
1940
+static bool cea_db_is_extended_tag(const void *db, int tag)
1941
+{
1942
+ return cea_db_tag(db) == CTA_DB_EXTENDED_TAG &&
1943
+ cea_db_payload_len(db) >= 1 &&
1944
+ cea_db_extended_tag(db) == tag;
1945
+}
1946
+
1947
+static bool cea_db_is_hdmi_forum_eeodb(const void *db)
1948
+{
1949
+ return cea_db_is_extended_tag(db, CTA_EXT_DB_HF_EEODB) &&
1950
+ cea_db_payload_len(db) >= 2;
1951
+}
1952
+
1953
+static int edid_hfeeodb_extension_block_count(const struct edid *edid)
1954
+{
1955
+ const u8 *cta;
1956
+
1957
+ /* No extensions according to base block, no HF-EEODB. */
1958
+ if (!edid->extensions)
1959
+ return 0;
1960
+
1961
+ /* HF-EEODB is always in the first EDID extension block only */
1962
+ cta = (u8 *)edid + EDID_LENGTH * 1;
1963
+ if (cta[0] != CEA_EXT || cta[1] < 3)
1964
+ return 0;
1965
+
1966
+ /* Need to have the data block collection, and at least 3 bytes. */
1967
+ if (cea_db_collection_size(cta) < 3)
1968
+ return 0;
1969
+
1970
+ /*
1971
+ * Sinks that include the HF-EEODB in their E-EDID shall include one and
1972
+ * only one instance of the HF-EEODB in the E-EDID, occupying bytes 4
1973
+ * through 6 of Block 1 of the E-EDID.
1974
+ */
1975
+ if (!cea_db_is_hdmi_forum_eeodb(&cta[4]))
1976
+ return 0;
1977
+
1978
+ return cta[4 + 2];
1979
+}
1980
+
1981
+static int edid_hfeeodb_block_count(const struct edid *edid)
1982
+{
1983
+ int eeodb = edid_hfeeodb_extension_block_count(edid);
1984
+
1985
+ return eeodb ? eeodb + 1 : 0;
1986
+}
1987
+
18821988 /**
18831989 * drm_do_get_edid - get EDID data using a custom EDID block read function
18841990 * @connector: connector we're probing
....@@ -1899,6 +2005,120 @@
18992005 *
19002006 * Return: Pointer to valid EDID or NULL if we couldn't find any.
19012007 */
2008
+struct edid *drm_do_get_edid(struct drm_connector *connector,
2009
+ int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
2010
+ size_t len),
2011
+ void *data)
2012
+{
2013
+ int i, j = 0, valid_extensions = 0, num_blocks, invalid_blocks = 0;
2014
+ u8 *edid, *new;
2015
+ struct edid *override;
2016
+
2017
+ override = drm_get_override_edid(connector);
2018
+ if (override)
2019
+ return override;
2020
+
2021
+ edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
2022
+ if (!edid)
2023
+ return NULL;
2024
+
2025
+ /* base block fetch */
2026
+ for (i = 0; i < 4; i++) {
2027
+ if (get_edid_block(data, edid, 0, EDID_LENGTH))
2028
+ goto out;
2029
+ if (drm_edid_block_valid(edid, 0, false,
2030
+ &connector->edid_corrupt))
2031
+ break;
2032
+ if (i == 0 && drm_edid_is_zero(edid, EDID_LENGTH)) {
2033
+ connector->null_edid_counter++;
2034
+ goto out;
2035
+ }
2036
+ }
2037
+ if (i == 4)
2038
+ goto out;
2039
+
2040
+ /* if there's no extensions, we're done */
2041
+ valid_extensions = edid[0x7e];
2042
+ if (valid_extensions == 0)
2043
+ return (struct edid *)edid;
2044
+
2045
+ new = krealloc(edid, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);
2046
+ if (!new)
2047
+ goto out;
2048
+ edid = new;
2049
+
2050
+ num_blocks = edid[0x7e] + 1;
2051
+
2052
+ for (j = 1; j < num_blocks; j++) {
2053
+ u8 *block = edid + j * EDID_LENGTH;
2054
+
2055
+ for (i = 0; i < 4; i++) {
2056
+ if (get_edid_block(data, block, j, EDID_LENGTH))
2057
+ goto out;
2058
+ if (drm_edid_block_valid(block, j, false, NULL))
2059
+ break;
2060
+ }
2061
+
2062
+ if (i == 4)
2063
+ invalid_blocks++;
2064
+
2065
+ if (j == 1) {
2066
+ /*
2067
+ * If the first EDID extension is a CTA extension, and
2068
+ * the first Data Block is HF-EEODB, override the
2069
+ * extension block count.
2070
+ *
2071
+ * Note: HF-EEODB could specify a smaller extension
2072
+ * count too, but we can't risk allocating a smaller
2073
+ * amount.
2074
+ */
2075
+ int eeodb = edid_hfeeodb_block_count((const struct edid *)edid);
2076
+
2077
+ if (eeodb > num_blocks) {
2078
+ num_blocks = eeodb;
2079
+ new = krealloc(edid, num_blocks * EDID_LENGTH, GFP_KERNEL);
2080
+ if (!new)
2081
+ goto out;
2082
+ edid = new;
2083
+ }
2084
+ }
2085
+ }
2086
+
2087
+ if (invalid_blocks) {
2088
+ u8 *base;
2089
+
2090
+ connector_bad_edid(connector, edid, edid[0x7e] + 1);
2091
+
2092
+ new = kmalloc_array(valid_extensions + 1, EDID_LENGTH,
2093
+ GFP_KERNEL);
2094
+ if (!new)
2095
+ goto out;
2096
+
2097
+ base = new;
2098
+ for (i = 0; i <= edid[0x7e]; i++) {
2099
+ u8 *block = edid + i * EDID_LENGTH;
2100
+
2101
+ if (!drm_edid_block_valid(block, i, false, NULL))
2102
+ continue;
2103
+
2104
+ memcpy(base, block, EDID_LENGTH);
2105
+ base += EDID_LENGTH;
2106
+ }
2107
+
2108
+ new[EDID_LENGTH - 1] += new[0x7e] - valid_extensions;
2109
+ new[0x7e] = valid_extensions;
2110
+
2111
+ kfree(edid);
2112
+ edid = new;
2113
+ }
2114
+
2115
+ return (struct edid *)edid;
2116
+
2117
+out:
2118
+ kfree(edid);
2119
+ return NULL;
2120
+}
2121
+#else
19022122 struct edid *drm_do_get_edid(struct drm_connector *connector,
19032123 int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
19042124 size_t len),
....@@ -1959,9 +2179,6 @@
19592179
19602180 connector_bad_edid(connector, edid, edid[0x7e] + 1);
19612181
1962
- edid[EDID_LENGTH-1] += edid[0x7e] - valid_extensions;
1963
- edid[0x7e] = valid_extensions;
1964
-
19652182 new = kmalloc_array(valid_extensions + 1, EDID_LENGTH,
19662183 GFP_KERNEL);
19672184 if (!new)
....@@ -1978,6 +2195,9 @@
19782195 base += EDID_LENGTH;
19792196 }
19802197
2198
+ new[EDID_LENGTH - 1] += new[0x7e] - valid_extensions;
2199
+ new[0x7e] = valid_extensions;
2200
+
19812201 kfree(edid);
19822202 edid = new;
19832203 }
....@@ -1990,6 +2210,7 @@
19902210 kfree(edid);
19912211 return NULL;
19922212 }
2213
+#endif
19932214 EXPORT_SYMBOL_GPL(drm_do_get_edid);
19942215
19952216 /**
....@@ -2029,8 +2250,7 @@
20292250 return NULL;
20302251
20312252 edid = drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter);
2032
- if (edid)
2033
- drm_get_displayid(connector, edid);
2253
+ drm_connector_update_edid_property(connector, edid);
20342254 return edid;
20352255 }
20362256 EXPORT_SYMBOL(drm_get_edid);
....@@ -2154,10 +2374,8 @@
21542374 if (MODE_SIZE(cur_mode) > MODE_SIZE(preferred_mode))
21552375 preferred_mode = cur_mode;
21562376
2157
- cur_vrefresh = cur_mode->vrefresh ?
2158
- cur_mode->vrefresh : drm_mode_vrefresh(cur_mode);
2159
- preferred_vrefresh = preferred_mode->vrefresh ?
2160
- preferred_mode->vrefresh : drm_mode_vrefresh(preferred_mode);
2377
+ cur_vrefresh = drm_mode_vrefresh(cur_mode);
2378
+ preferred_vrefresh = drm_mode_vrefresh(preferred_mode);
21612379 /* At a given size, try to get closest to target refresh */
21622380 if ((MODE_SIZE(cur_mode) == MODE_SIZE(preferred_mode)) &&
21632381 MODE_REFRESH_DIFF(cur_vrefresh, target_refresh) <
....@@ -2198,6 +2416,7 @@
21982416
21992417 for (i = 0; i < ARRAY_SIZE(drm_dmt_modes); i++) {
22002418 const struct drm_display_mode *ptr = &drm_dmt_modes[i];
2419
+
22012420 if (hsize != ptr->hdisplay)
22022421 continue;
22032422 if (vsize != ptr->vdisplay)
....@@ -2214,14 +2433,28 @@
22142433 }
22152434 EXPORT_SYMBOL(drm_mode_find_dmt);
22162435
2436
+static bool is_display_descriptor(const u8 d[18], u8 tag)
2437
+{
2438
+ return d[0] == 0x00 && d[1] == 0x00 &&
2439
+ d[2] == 0x00 && d[3] == tag;
2440
+}
2441
+
2442
+static bool is_detailed_timing_descriptor(const u8 d[18])
2443
+{
2444
+ return d[0] != 0x00 || d[1] != 0x00;
2445
+}
2446
+
22172447 typedef void detailed_cb(struct detailed_timing *timing, void *closure);
22182448
22192449 static void
22202450 cea_for_each_detailed_block(u8 *ext, detailed_cb *cb, void *closure)
22212451 {
2222
- int i, n = 0;
2452
+ int i, n;
22232453 u8 d = ext[0x02];
22242454 u8 *det_base = ext + d;
2455
+
2456
+ if (d < 4 || d > 127)
2457
+ return;
22252458
22262459 n = (127 - d) / 18;
22272460 for (i = 0; i < n; i++)
....@@ -2255,6 +2488,7 @@
22552488
22562489 for (i = 1; i <= raw_edid[0x7e]; i++) {
22572490 u8 *ext = raw_edid + (i * EDID_LENGTH);
2491
+
22582492 switch (*ext) {
22592493 case CEA_EXT:
22602494 cea_for_each_detailed_block(ext, cb, closure);
....@@ -2272,9 +2506,12 @@
22722506 is_rb(struct detailed_timing *t, void *data)
22732507 {
22742508 u8 *r = (u8 *)t;
2275
- if (r[3] == EDID_DETAIL_MONITOR_RANGE)
2276
- if (r[15] & 0x10)
2277
- *(bool *)data = true;
2509
+
2510
+ if (!is_display_descriptor(r, EDID_DETAIL_MONITOR_RANGE))
2511
+ return;
2512
+
2513
+ if (r[15] & 0x10)
2514
+ *(bool *)data = true;
22782515 }
22792516
22802517 /* EDID 1.4 defines this explicitly. For EDID 1.3, we guess, badly. */
....@@ -2283,6 +2520,7 @@
22832520 {
22842521 if (edid->revision >= 4) {
22852522 bool ret = false;
2523
+
22862524 drm_for_each_detailed_block((u8 *)edid, is_rb, &ret);
22872525 return ret;
22882526 }
....@@ -2294,7 +2532,11 @@
22942532 find_gtf2(struct detailed_timing *t, void *data)
22952533 {
22962534 u8 *r = (u8 *)t;
2297
- if (r[3] == EDID_DETAIL_MONITOR_RANGE && r[10] == 0x02)
2535
+
2536
+ if (!is_display_descriptor(r, EDID_DETAIL_MONITOR_RANGE))
2537
+ return;
2538
+
2539
+ if (r[10] == 0x02)
22982540 *(u8 **)data = r;
22992541 }
23002542
....@@ -2303,6 +2545,7 @@
23032545 drm_gtf2_hbreak(struct edid *edid)
23042546 {
23052547 u8 *r = NULL;
2548
+
23062549 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
23072550 return r ? (r[12] * 2) : 0;
23082551 }
....@@ -2311,6 +2554,7 @@
23112554 drm_gtf2_2c(struct edid *edid)
23122555 {
23132556 u8 *r = NULL;
2557
+
23142558 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
23152559 return r ? r[13] : 0;
23162560 }
....@@ -2319,6 +2563,7 @@
23192563 drm_gtf2_m(struct edid *edid)
23202564 {
23212565 u8 *r = NULL;
2566
+
23222567 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
23232568 return r ? (r[15] << 8) + r[14] : 0;
23242569 }
....@@ -2327,6 +2572,7 @@
23272572 drm_gtf2_k(struct edid *edid)
23282573 {
23292574 u8 *r = NULL;
2575
+
23302576 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
23312577 return r ? r[16] : 0;
23322578 }
....@@ -2335,6 +2581,7 @@
23352581 drm_gtf2_2j(struct edid *edid)
23362582 {
23372583 u8 *r = NULL;
2584
+
23382585 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
23392586 return r ? r[17] : 0;
23402587 }
....@@ -2350,7 +2597,8 @@
23502597 return LEVEL_CVT;
23512598 if (drm_gtf2_hbreak(edid))
23522599 return LEVEL_GTF2;
2353
- return LEVEL_GTF;
2600
+ if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
2601
+ return LEVEL_GTF;
23542602 }
23552603 return LEVEL_DMT;
23562604 }
....@@ -2365,6 +2613,14 @@
23652613 return (a == 0x00 && b == 0x00) ||
23662614 (a == 0x01 && b == 0x01) ||
23672615 (a == 0x20 && b == 0x20);
2616
+}
2617
+
2618
+static int drm_mode_hsync(const struct drm_display_mode *mode)
2619
+{
2620
+ if (mode->htotal <= 0)
2621
+ return 0;
2622
+
2623
+ return DIV_ROUND_CLOSEST(mode->clock, mode->htotal);
23682624 }
23692625
23702626 /**
....@@ -2632,7 +2888,6 @@
26322888 }
26332889
26342890 mode->type = DRM_MODE_TYPE_DRIVER;
2635
- mode->vrefresh = drm_mode_vrefresh(mode);
26362891 drm_mode_set_name(mode);
26372892
26382893 return mode;
....@@ -2778,6 +3033,7 @@
27783033
27793034 for (i = 0; i < ARRAY_SIZE(extra_modes); i++) {
27803035 const struct minimode *m = &extra_modes[i];
3036
+
27813037 newmode = drm_gtf_mode(dev, m->w, m->h, m->r, 0, 0);
27823038 if (!newmode)
27833039 return modes;
....@@ -2807,6 +3063,7 @@
28073063
28083064 for (i = 0; i < ARRAY_SIZE(extra_modes); i++) {
28093065 const struct minimode *m = &extra_modes[i];
3066
+
28103067 newmode = drm_cvt_mode(dev, m->w, m->h, m->r, rb, 0, 0);
28113068 if (!newmode)
28123069 return modes;
....@@ -2832,13 +3089,13 @@
28323089 struct detailed_non_pixel *data = &timing->data.other_data;
28333090 struct detailed_data_monitor_range *range = &data->data.range;
28343091
2835
- if (data->type != EDID_DETAIL_MONITOR_RANGE)
3092
+ if (!is_display_descriptor((const u8 *)timing, EDID_DETAIL_MONITOR_RANGE))
28363093 return;
28373094
28383095 closure->modes += drm_dmt_modes_for_range(closure->connector,
28393096 closure->edid,
28403097 timing);
2841
-
3098
+
28423099 if (!version_greater(closure->edid, 1, 1))
28433100 return; /* GTF not defined yet */
28443101
....@@ -2911,10 +3168,11 @@
29113168 do_established_modes(struct detailed_timing *timing, void *c)
29123169 {
29133170 struct detailed_mode_closure *closure = c;
2914
- struct detailed_non_pixel *data = &timing->data.other_data;
29153171
2916
- if (data->type == EDID_DETAIL_EST_TIMINGS)
2917
- closure->modes += drm_est3_modes(closure->connector, timing);
3172
+ if (!is_display_descriptor((const u8 *)timing, EDID_DETAIL_EST_TIMINGS))
3173
+ return;
3174
+
3175
+ closure->modes += drm_est3_modes(closure->connector, timing);
29183176 }
29193177
29203178 /**
....@@ -2941,6 +3199,7 @@
29413199 for (i = 0; i <= EDID_EST_TIMINGS; i++) {
29423200 if (est_bits & (1<<i)) {
29433201 struct drm_display_mode *newmode;
3202
+
29443203 newmode = drm_mode_duplicate(dev, &edid_est_modes[i]);
29453204 if (newmode) {
29463205 drm_mode_probed_add(connector, newmode);
....@@ -2963,19 +3222,19 @@
29633222 struct detailed_non_pixel *data = &timing->data.other_data;
29643223 struct drm_connector *connector = closure->connector;
29653224 struct edid *edid = closure->edid;
3225
+ int i;
29663226
2967
- if (data->type == EDID_DETAIL_STD_MODES) {
2968
- int i;
2969
- for (i = 0; i < 6; i++) {
2970
- struct std_timing *std;
2971
- struct drm_display_mode *newmode;
3227
+ if (!is_display_descriptor((const u8 *)timing, EDID_DETAIL_STD_MODES))
3228
+ return;
29723229
2973
- std = &data->data.timings[i];
2974
- newmode = drm_mode_std(connector, edid, std);
2975
- if (newmode) {
2976
- drm_mode_probed_add(connector, newmode);
2977
- closure->modes++;
2978
- }
3230
+ for (i = 0; i < 6; i++) {
3231
+ struct std_timing *std = &data->data.timings[i];
3232
+ struct drm_display_mode *newmode;
3233
+
3234
+ newmode = drm_mode_std(connector, edid, std);
3235
+ if (newmode) {
3236
+ drm_mode_probed_add(connector, newmode);
3237
+ closure->modes++;
29793238 }
29803239 }
29813240 }
....@@ -3028,7 +3287,8 @@
30283287 const u8 empty[3] = { 0, 0, 0 };
30293288
30303289 for (i = 0; i < 4; i++) {
3031
- int uninitialized_var(width), height;
3290
+ int width, height;
3291
+
30323292 cvt = &(timing->data.other_data.data.cvt[i]);
30333293
30343294 if (!memcmp(cvt->code, empty, 3))
....@@ -3036,6 +3296,8 @@
30363296
30373297 height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
30383298 switch (cvt->code[1] & 0x0c) {
3299
+ /* default - because compiler doesn't see that we've enumerated all cases */
3300
+ default:
30393301 case 0x00:
30403302 width = height * 4 / 3;
30413303 break;
....@@ -3070,15 +3332,16 @@
30703332 do_cvt_mode(struct detailed_timing *timing, void *c)
30713333 {
30723334 struct detailed_mode_closure *closure = c;
3073
- struct detailed_non_pixel *data = &timing->data.other_data;
30743335
3075
- if (data->type == EDID_DETAIL_CVT_3BYTE)
3076
- closure->modes += drm_cvt_modes(closure->connector, timing);
3336
+ if (!is_display_descriptor((const u8 *)timing, EDID_DETAIL_CVT_3BYTE))
3337
+ return;
3338
+
3339
+ closure->modes += drm_cvt_modes(closure->connector, timing);
30773340 }
30783341
30793342 static int
30803343 add_cvt_modes(struct drm_connector *connector, struct edid *edid)
3081
-{
3344
+{
30823345 struct detailed_mode_closure closure = {
30833346 .connector = connector,
30843347 .edid = edid,
....@@ -3100,27 +3363,28 @@
31003363 struct detailed_mode_closure *closure = c;
31013364 struct drm_display_mode *newmode;
31023365
3103
- if (timing->pixel_clock) {
3104
- newmode = drm_mode_detailed(closure->connector->dev,
3105
- closure->edid, timing,
3106
- closure->quirks);
3107
- if (!newmode)
3108
- return;
3366
+ if (!is_detailed_timing_descriptor((const u8 *)timing))
3367
+ return;
31093368
3110
- if (closure->preferred)
3111
- newmode->type |= DRM_MODE_TYPE_PREFERRED;
3369
+ newmode = drm_mode_detailed(closure->connector->dev,
3370
+ closure->edid, timing,
3371
+ closure->quirks);
3372
+ if (!newmode)
3373
+ return;
31123374
3113
- /*
3114
- * Detailed modes are limited to 10kHz pixel clock resolution,
3115
- * so fix up anything that looks like CEA/HDMI mode, but the clock
3116
- * is just slightly off.
3117
- */
3118
- fixup_detailed_cea_mode_clock(newmode);
3375
+ if (closure->preferred)
3376
+ newmode->type |= DRM_MODE_TYPE_PREFERRED;
31193377
3120
- drm_mode_probed_add(closure->connector, newmode);
3121
- closure->modes++;
3122
- closure->preferred = false;
3123
- }
3378
+ /*
3379
+ * Detailed modes are limited to 10kHz pixel clock resolution,
3380
+ * so fix up anything that looks like CEA/HDMI mode, but the clock
3381
+ * is just slightly off.
3382
+ */
3383
+ fixup_detailed_cea_mode_clock(newmode);
3384
+
3385
+ drm_mode_probed_add(closure->connector, newmode);
3386
+ closure->modes++;
3387
+ closure->preferred = false;
31243388 }
31253389
31263390 /*
....@@ -3148,21 +3412,16 @@
31483412
31493413 return closure.modes;
31503414 }
3151
-#define VIDEO_CAPABILITY_EXTENDED_DATA_BLOCK 0x0
3415
+
31523416 #define AUDIO_BLOCK 0x01
31533417 #define VIDEO_BLOCK 0x02
31543418 #define VENDOR_BLOCK 0x03
31553419 #define SPEAKER_BLOCK 0x04
3156
-#define COLORIMETRY_DATA_BLOCK 0x5
3157
-#define COLORIMETRY_EXTENDED_DATA_BLOCK 0x05
31583420 #define HDR_STATIC_METADATA_BLOCK 0x6
31593421 #define USE_EXTENDED_TAG 0x07
31603422 #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
31613423 #define EXT_VIDEO_DATA_BLOCK_420 0x0E
31623424 #define EXT_VIDEO_CAP_BLOCK_Y420CMDB 0x0F
3163
-#define VENDOR_SPECIFIC_VIDEO_DATA_BLOCK 0x01
3164
-#define VSVDB_HDR10_PLUS_IEEE_CODE 0x90848b
3165
-#define VSVDB_HDR10_PLUS_APP_VER_MASK 0x3
31663425 #define EDID_BASIC_AUDIO (1 << 6)
31673426 #define EDID_CEA_YCRCB444 (1 << 5)
31683427 #define EDID_CEA_YCRCB422 (1 << 4)
....@@ -3171,7 +3430,41 @@
31713430 /*
31723431 * Search EDID for CEA extension block.
31733432 */
3174
-static u8 *drm_find_edid_extension(const struct edid *edid, int ext_id)
3433
+#ifdef CONFIG_NO_GKI
3434
+static u8 *drm_find_edid_extension(const struct edid *edid,
3435
+ int ext_id, int *ext_index)
3436
+{
3437
+ u8 *edid_ext = NULL;
3438
+ int i;
3439
+ int len;
3440
+
3441
+ /* No EDID or EDID extensions */
3442
+ if (edid == NULL || edid->extensions == 0)
3443
+ return NULL;
3444
+
3445
+ if (edid_hfeeodb_extension_block_count(edid))
3446
+ len = edid_hfeeodb_extension_block_count(edid);
3447
+ else
3448
+ len = edid->extensions;
3449
+
3450
+ /* Find CEA extension */
3451
+ for (i = *ext_index; i < len; i++) {
3452
+ edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
3453
+
3454
+ if (edid_ext[0] == ext_id)
3455
+ break;
3456
+ }
3457
+
3458
+ if (i >= len)
3459
+ return NULL;
3460
+
3461
+ *ext_index = i + 1;
3462
+
3463
+ return edid_ext;
3464
+}
3465
+#else
3466
+static u8 *drm_find_edid_extension(const struct edid *edid,
3467
+ int ext_id, int *ext_index)
31753468 {
31763469 u8 *edid_ext = NULL;
31773470 int i;
....@@ -3181,64 +3474,86 @@
31813474 return NULL;
31823475
31833476 /* Find CEA extension */
3184
- for (i = 0; i < edid->extensions; i++) {
3477
+ for (i = *ext_index; i < edid->extensions; i++) {
31853478 edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
31863479 if (edid_ext[0] == ext_id)
31873480 break;
31883481 }
31893482
3190
- if (i == edid->extensions)
3483
+ if (i >= edid->extensions)
31913484 return NULL;
3485
+
3486
+ *ext_index = i + 1;
31923487
31933488 return edid_ext;
31943489 }
3490
+#endif
31953491
3196
-
3197
-static u8 *drm_find_displayid_extension(const struct edid *edid)
3492
+static u8 *drm_find_displayid_extension(const struct edid *edid,
3493
+ int *length, int *idx,
3494
+ int *ext_index)
31983495 {
3199
- return drm_find_edid_extension(edid, DISPLAYID_EXT);
3496
+ u8 *displayid = drm_find_edid_extension(edid, DISPLAYID_EXT, ext_index);
3497
+ struct displayid_hdr *base;
3498
+ int ret;
3499
+
3500
+ if (!displayid)
3501
+ return NULL;
3502
+
3503
+ /* EDID extensions block checksum isn't for us */
3504
+ *length = EDID_LENGTH - 1;
3505
+ *idx = 1;
3506
+
3507
+ ret = validate_displayid(displayid, *length, *idx);
3508
+ if (ret)
3509
+ return NULL;
3510
+
3511
+ base = (struct displayid_hdr *)&displayid[*idx];
3512
+ *length = *idx + sizeof(*base) + base->bytes;
3513
+
3514
+ return displayid;
32003515 }
32013516
32023517 static u8 *drm_find_cea_extension(const struct edid *edid)
32033518 {
3204
- int ret;
3205
- int idx = 1;
3206
- int length = EDID_LENGTH;
3519
+ int length, idx;
32073520 struct displayid_block *block;
32083521 u8 *cea;
32093522 u8 *displayid;
3523
+ int ext_index;
32103524
32113525 /* Look for a top level CEA extension block */
3212
- cea = drm_find_edid_extension(edid, CEA_EXT);
3526
+ /* FIXME: make callers iterate through multiple CEA ext blocks? */
3527
+ ext_index = 0;
3528
+ cea = drm_find_edid_extension(edid, CEA_EXT, &ext_index);
32133529 if (cea)
32143530 return cea;
32153531
32163532 /* CEA blocks can also be found embedded in a DisplayID block */
3217
- displayid = drm_find_displayid_extension(edid);
3218
- if (!displayid)
3219
- return NULL;
3533
+ ext_index = 0;
3534
+ for (;;) {
3535
+ displayid = drm_find_displayid_extension(edid, &length, &idx,
3536
+ &ext_index);
3537
+ if (!displayid)
3538
+ return NULL;
32203539
3221
- ret = validate_displayid(displayid, length, idx);
3222
- if (ret)
3223
- return NULL;
3224
-
3225
- idx += sizeof(struct displayid_hdr);
3226
- for_each_displayid_db(displayid, block, idx, length) {
3227
- if (block->tag == DATA_BLOCK_CTA) {
3228
- cea = (u8 *)block;
3229
- break;
3540
+ idx += sizeof(struct displayid_hdr);
3541
+ for_each_displayid_db(displayid, block, idx, length) {
3542
+ if (block->tag == DATA_BLOCK_CTA)
3543
+ return (u8 *)block;
32303544 }
32313545 }
32323546
3233
- return cea;
3547
+ return NULL;
32343548 }
32353549
3236
-static const struct drm_display_mode *cea_mode_for_vic(u8 vic)
3550
+static __always_inline const struct drm_display_mode *cea_mode_for_vic(u8 vic)
32373551 {
3238
- if (!vic)
3239
- return NULL;
3240
- if (vic < ARRAY_SIZE(edid_cea_modes_0))
3241
- return &edid_cea_modes_0[vic];
3552
+ BUILD_BUG_ON(1 + ARRAY_SIZE(edid_cea_modes_1) - 1 != 127);
3553
+ BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 219);
3554
+
3555
+ if (vic >= 1 && vic < 1 + ARRAY_SIZE(edid_cea_modes_1))
3556
+ return &edid_cea_modes_1[vic - 1];
32423557 if (vic >= 193 && vic < 193 + ARRAY_SIZE(edid_cea_modes_193))
32433558 return &edid_cea_modes_193[vic - 193];
32443559 return NULL;
....@@ -3251,7 +3566,7 @@
32513566
32523567 static u8 cea_next_vic(u8 vic)
32533568 {
3254
- if (++vic == ARRAY_SIZE(edid_cea_modes_0))
3569
+ if (++vic == 1 + ARRAY_SIZE(edid_cea_modes_1))
32553570 vic = 193;
32563571 return vic;
32573572 }
....@@ -3265,7 +3580,7 @@
32653580 {
32663581 unsigned int clock = cea_mode->clock;
32673582
3268
- if (cea_mode->vrefresh % 6 != 0)
3583
+ if (drm_mode_vrefresh(cea_mode) % 6 != 0)
32693584 return clock;
32703585
32713586 /*
....@@ -3394,14 +3709,7 @@
33943709 return cea_mode_for_vic(vic) != NULL;
33953710 }
33963711
3397
-/**
3398
- * drm_get_cea_aspect_ratio - get the picture aspect ratio corresponding to
3399
- * the input VIC from the CEA mode list
3400
- * @video_code: ID given to each of the CEA modes
3401
- *
3402
- * Returns picture aspect ratio
3403
- */
3404
-enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code)
3712
+static enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code)
34053713 {
34063714 const struct drm_display_mode *mode = cea_mode_for_vic(video_code);
34073715
....@@ -3410,22 +3718,19 @@
34103718
34113719 return HDMI_PICTURE_ASPECT_NONE;
34123720 }
3413
-EXPORT_SYMBOL(drm_get_cea_aspect_ratio);
3721
+
3722
+static enum hdmi_picture_aspect drm_get_hdmi_aspect_ratio(const u8 video_code)
3723
+{
3724
+ return edid_4k_modes[video_code].picture_aspect_ratio;
3725
+}
34143726
34153727 /*
34163728 * Calculate the alternate clock for HDMI modes (those from the HDMI vendor
34173729 * specific block).
3418
- *
3419
- * It's almost like cea_mode_alternate_clock(), we just need to add an
3420
- * exception for the VIC 4 mode (4096x2160@24Hz): no alternate clock for this
3421
- * one.
34223730 */
34233731 static unsigned int
34243732 hdmi_mode_alternate_clock(const struct drm_display_mode *hdmi_mode)
34253733 {
3426
- if (hdmi_mode->vdisplay == 4096 && hdmi_mode->hdisplay == 2160)
3427
- return hdmi_mode->clock;
3428
-
34293734 return cea_mode_alternate_clock(hdmi_mode);
34303735 }
34313736
....@@ -3437,6 +3742,9 @@
34373742
34383743 if (!to_match->clock)
34393744 return 0;
3745
+
3746
+ if (to_match->picture_aspect_ratio)
3747
+ match_flags |= DRM_MODE_MATCH_ASPECT_RATIO;
34403748
34413749 for (vic = 1; vic < ARRAY_SIZE(edid_4k_modes); vic++) {
34423750 const struct drm_display_mode *hdmi_mode = &edid_4k_modes[vic];
....@@ -3472,6 +3780,9 @@
34723780
34733781 if (!to_match->clock)
34743782 return 0;
3783
+
3784
+ if (to_match->picture_aspect_ratio)
3785
+ match_flags |= DRM_MODE_MATCH_ASPECT_RATIO;
34753786
34763787 for (vic = 1; vic < ARRAY_SIZE(edid_4k_modes); vic++) {
34773788 const struct drm_display_mode *hdmi_mode = &edid_4k_modes[vic];
....@@ -3596,8 +3907,6 @@
35963907 if (!newmode)
35973908 return NULL;
35983909
3599
- newmode->vrefresh = 0;
3600
-
36013910 return newmode;
36023911 }
36033912
....@@ -3658,6 +3967,34 @@
36583967 bitmap_set(hdmi->y420_cmdb_modes, vic, 1);
36593968 }
36603969
3970
+/**
3971
+ * drm_display_mode_from_cea_vic() - return a mode for CEA VIC
3972
+ * @dev: DRM device
3973
+ * @video_code: CEA VIC of the mode
3974
+ *
3975
+ * Creates a new mode matching the specified CEA VIC.
3976
+ *
3977
+ * Returns: A new drm_display_mode on success or NULL on failure
3978
+ */
3979
+struct drm_display_mode *
3980
+drm_display_mode_from_cea_vic(struct drm_device *dev,
3981
+ u8 video_code)
3982
+{
3983
+ const struct drm_display_mode *cea_mode;
3984
+ struct drm_display_mode *newmode;
3985
+
3986
+ cea_mode = cea_mode_for_vic(video_code);
3987
+ if (!cea_mode)
3988
+ return NULL;
3989
+
3990
+ newmode = drm_mode_duplicate(dev, cea_mode);
3991
+ if (!newmode)
3992
+ return NULL;
3993
+
3994
+ return newmode;
3995
+}
3996
+EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
3997
+
36613998 static int
36623999 do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
36634000 {
....@@ -3666,6 +4003,7 @@
36664003
36674004 for (i = 0; i < len; i++) {
36684005 struct drm_display_mode *mode;
4006
+
36694007 mode = drm_display_mode_from_vic_index(connector, db, len, i);
36704008 if (mode) {
36714009 /*
....@@ -3978,6 +4316,13 @@
39784316 static int
39794317 cea_revision(const u8 *cea)
39804318 {
4319
+ /*
4320
+ * FIXME is this correct for the DispID variant?
4321
+ * The DispID spec doesn't really specify whether
4322
+ * this is the revision of the CEA extension or
4323
+ * the DispID CEA data block. And the only value
4324
+ * given as an example is 0.
4325
+ */
39814326 return cea[1];
39824327 }
39834328
....@@ -4002,6 +4347,10 @@
40024347 * no non-DTD data.
40034348 */
40044349 if (cea[0] == DATA_BLOCK_CTA) {
4350
+ /*
4351
+ * for_each_displayid_db() has already verified
4352
+ * that these stay within expected bounds.
4353
+ */
40054354 *start = 3;
40064355 *end = *start + cea[2];
40074356 } else if (cea[0] == CEA_EXT) {
....@@ -4013,7 +4362,7 @@
40134362 if (*end < 4 || *end > 127)
40144363 return -ERANGE;
40154364 } else {
4016
- return -ENOTSUPP;
4365
+ return -EOPNOTSUPP;
40174366 }
40184367
40194368 return 0;
....@@ -4047,6 +4396,20 @@
40474396 oui = db[3] << 16 | db[2] << 8 | db[1];
40484397
40494398 return oui == HDMI_FORUM_IEEE_OUI;
4399
+}
4400
+
4401
+static bool cea_db_is_vcdb(const u8 *db)
4402
+{
4403
+ if (cea_db_tag(db) != USE_EXTENDED_TAG)
4404
+ return false;
4405
+
4406
+ if (cea_db_payload_len(db) != 2)
4407
+ return false;
4408
+
4409
+ if (cea_db_extended_tag(db) != EXT_VIDEO_CAPABILITY_BLOCK)
4410
+ return false;
4411
+
4412
+ return true;
40504413 }
40514414
40524415 static bool cea_db_is_y420cmdb(const u8 *db)
....@@ -4120,6 +4483,68 @@
41204483 hdmi->y420_cmdb_map = map;
41214484 }
41224485
4486
+#ifdef CONFIG_NO_GKI
4487
+
4488
+static int
4489
+add_cea_modes(struct drm_connector *connector, struct edid *edid)
4490
+{
4491
+ const u8 *cea;
4492
+ const u8 *db, *hdmi = NULL, *video = NULL;
4493
+ u8 dbl, hdmi_len, video_len = 0;
4494
+ int i, count = 0, modes = 0;
4495
+ int ext_index = 0;
4496
+
4497
+ if (edid_hfeeodb_extension_block_count(edid))
4498
+ count = edid_hfeeodb_extension_block_count(edid);
4499
+ else
4500
+ count = edid->extensions;
4501
+
4502
+ for (i = 0; i < count; i++) {
4503
+ ext_index = i;
4504
+
4505
+ cea = drm_find_edid_extension(edid, CEA_EXT, &ext_index);
4506
+ if (cea && cea_revision(cea) >= 3) {
4507
+ int i, start, end;
4508
+
4509
+ if (cea_db_offsets(cea, &start, &end))
4510
+ return 0;
4511
+
4512
+ for_each_cea_db(cea, i, start, end) {
4513
+ db = &cea[i];
4514
+ dbl = cea_db_payload_len(db);
4515
+
4516
+ if (cea_db_tag(db) == VIDEO_BLOCK) {
4517
+ video = db + 1;
4518
+ video_len = dbl;
4519
+ modes += do_cea_modes(connector, video, dbl);
4520
+ } else if (cea_db_is_hdmi_vsdb(db)) {
4521
+ hdmi = db;
4522
+ hdmi_len = dbl;
4523
+ } else if (cea_db_is_y420vdb(db)) {
4524
+ const u8 *vdb420 = &db[2];
4525
+
4526
+ /* Add 4:2:0(only) modes present in EDID */
4527
+ modes += do_y420vdb_modes(connector,
4528
+ vdb420,
4529
+ dbl - 1);
4530
+ }
4531
+ }
4532
+ }
4533
+
4534
+ /*
4535
+ * We parse the HDMI VSDB after having added the cea modes as we will
4536
+ * be patching their flags when the sink supports stereo 3D.
4537
+ */
4538
+ if (hdmi)
4539
+ modes += do_hdmi_vsdb_modes(connector, hdmi, hdmi_len, video,
4540
+ video_len);
4541
+ }
4542
+
4543
+ return modes;
4544
+}
4545
+
4546
+#else
4547
+
41234548 static int
41244549 add_cea_modes(struct drm_connector *connector, struct edid *edid)
41254550 {
....@@ -4166,6 +4591,7 @@
41664591
41674592 return modes;
41684593 }
4594
+#endif
41694595
41704596 static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
41714597 {
....@@ -4208,28 +4634,6 @@
42084634 DRM_DEBUG("detailed mode matches %s VIC %d, adjusting clock %d -> %d\n",
42094635 type, vic, mode->clock, clock);
42104636 mode->clock = clock;
4211
-}
4212
-
4213
-static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
4214
-{
4215
- if (cea_db_tag(db) != USE_EXTENDED_TAG)
4216
- return false;
4217
-
4218
- if (db[1] != COLORIMETRY_DATA_BLOCK)
4219
- return false;
4220
-
4221
- return true;
4222
-}
4223
-
4224
-static void
4225
-drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
4226
-{
4227
- struct drm_hdmi_info *info = &connector->display_info.hdmi;
4228
- u16 len;
4229
-
4230
- len = cea_db_payload_len(db);
4231
- /* As per CEA 861-G spec */
4232
- info->colorimetry = ((db[3] & (0x1 << 7)) << 1) | db[2];
42334637 }
42344638
42354639 static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
....@@ -4312,396 +4716,13 @@
43124716 connector->audio_latency[1]);
43134717 }
43144718
4315
-/*
4316
- * drm_extract_vcdb_info - Parse the HDMI Video Capability Data Block
4317
- * @connector: connector corresponding to the HDMI sink
4318
- * @db: start of the CEA vendor specific block
4319
- *
4320
- * Parses the HDMI VCDB to extract sink info for @connector.
4321
- */
4322
-static void
4323
-drm_extract_vcdb_info(struct drm_connector *connector, const u8 *db)
4324
-{
4325
- /*
4326
- * Check if the sink specifies underscan
4327
- * support for:
4328
- * BIT 5: preferred video format
4329
- * BIT 3: IT video format
4330
- * BIT 1: CE video format
4331
- */
4332
-
4333
- connector->pt_scan_info =
4334
- (db[2] & (BIT(4) | BIT(5))) >> 4;
4335
- connector->it_scan_info =
4336
- (db[2] & (BIT(3) | BIT(2))) >> 2;
4337
- connector->ce_scan_info =
4338
- db[2] & (BIT(1) | BIT(0));
4339
-
4340
- DRM_DEBUG_KMS("Scan Info (pt|it|ce): (%d|%d|%d)",
4341
- (int) connector->pt_scan_info,
4342
- (int) connector->it_scan_info,
4343
- (int) connector->ce_scan_info);
4344
-}
4345
-
4346
-static void
4347
-drm_parse_vsvdb_hdr_plus(struct drm_connector *connector, const u8 *db)
4348
-{
4349
- connector->hdr_plus_app_ver = db[5] & VSVDB_HDR10_PLUS_APP_VER_MASK;
4350
-}
4351
-
4352
-static void
4353
-drm_extract_vsvdb_info(struct drm_connector *connector, const u8 *db)
4354
-{
4355
- u8 db_len = cea_db_payload_len(db);
4356
- u32 ieee_code = 0;
4357
-
4358
- if (db_len < 5)
4359
- return;
4360
-
4361
- /* Bytes 2-4: IEEE 24-bit code, LSB first */
4362
- ieee_code = db[2] | (db[3] << 8) | (db[4] << 16);
4363
- DRM_DEBUG_KMS("found VSVDB with IEEE code 0x%x\n", ieee_code);
4364
- if (ieee_code == VSVDB_HDR10_PLUS_IEEE_CODE)
4365
- drm_parse_vsvdb_hdr_plus(connector, db);
4366
-}
4367
-
4368
-static bool drm_edid_is_luminance_value_present(
4369
-u32 block_length, enum luminance_value value)
4370
-{
4371
- return block_length > NO_LUMINANCE_DATA && value <= block_length;
4372
-}
4373
-
4374
-/*
4375
- * drm_extract_clrmetry_db - Parse the HDMI colorimetry extended block
4376
- * @connector: connector corresponding to the HDMI sink
4377
- * @db: start of the HDMI colorimetry extended block
4378
- *
4379
- * Parses the HDMI colorimetry block to extract sink info for @connector.
4380
- */
4381
-static void
4382
-drm_extract_clrmetry_db(struct drm_connector *connector, const u8 *db)
4383
-{
4384
-
4385
- if (!db) {
4386
- DRM_ERROR("invalid db\n");
4387
- return;
4388
- }
4389
-
4390
- /* Byte 3 Bit 0: xvYCC_601 */
4391
- if (db[2] & BIT(0))
4392
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_601;
4393
- /* Byte 3 Bit 1: xvYCC_709 */
4394
- if (db[2] & BIT(1))
4395
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_709;
4396
- /* Byte 3 Bit 2: sYCC_601 */
4397
- if (db[2] & BIT(2))
4398
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_sYCC_601;
4399
- /* Byte 3 Bit 3: ADBYCC_601 */
4400
- if (db[2] & BIT(3))
4401
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_ADBYCC_601;
4402
- /* Byte 3 Bit 4: ADB_RGB */
4403
- if (db[2] & BIT(4))
4404
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_ADB_RGB;
4405
- /* Byte 3 Bit 5: BT2020_CYCC */
4406
- if (db[2] & BIT(5))
4407
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_CYCC;
4408
- /* Byte 3 Bit 6: BT2020_YCC */
4409
- if (db[2] & BIT(6))
4410
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_YCC;
4411
- /* Byte 3 Bit 7: BT2020_RGB */
4412
- if (db[2] & BIT(7))
4413
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_RGB;
4414
- /* Byte 4 Bit 7: DCI-P3 */
4415
- if (db[3] & BIT(7))
4416
- connector->color_enc_fmt |= DRM_EDID_CLRMETRY_DCI_P3;
4417
-
4418
- DRM_DEBUG_KMS("colorimetry fmts = 0x%x\n", connector->color_enc_fmt);
4419
-}
4420
-
4421
-/*
4422
- * drm_extract_hdr_db - Parse the HDMI HDR extended block
4423
- * @connector: connector corresponding to the HDMI sink
4424
- * @db: start of the HDMI HDR extended block
4425
- *
4426
- * Parses the HDMI HDR extended block to extract sink info for @connector.
4427
- */
4428
-static void
4429
-drm_extract_hdr_db(struct drm_connector *connector, const u8 *db)
4430
-{
4431
-
4432
- u8 len = 0;
4433
-
4434
- if (!db)
4435
- return;
4436
-
4437
- len = db[0] & 0x1f;
4438
- /* Byte 3: Electro-Optical Transfer Functions */
4439
- connector->hdr_eotf = db[2] & 0x3F;
4440
-
4441
- /* Byte 4: Static Metadata Descriptor Type 1 */
4442
- connector->hdr_metadata_type_one = (db[3] & BIT(0));
4443
-
4444
- /* Byte 5: Desired Content Maximum Luminance */
4445
- if (drm_edid_is_luminance_value_present(len, MAXIMUM_LUMINANCE))
4446
- connector->hdr_max_luminance =
4447
- db[MAXIMUM_LUMINANCE];
4448
-
4449
- /* Byte 6: Desired Content Max Frame-average Luminance */
4450
- if (drm_edid_is_luminance_value_present(len, FRAME_AVERAGE_LUMINANCE))
4451
- connector->hdr_avg_luminance =
4452
- db[FRAME_AVERAGE_LUMINANCE];
4453
-
4454
- /* Byte 7: Desired Content Min Luminance */
4455
- if (drm_edid_is_luminance_value_present(len, MINIMUM_LUMINANCE))
4456
- connector->hdr_min_luminance =
4457
- db[MINIMUM_LUMINANCE];
4458
-
4459
- connector->hdr_supported = true;
4460
-
4461
- DRM_DEBUG_KMS("HDR electro-optical %d\n", connector->hdr_eotf);
4462
- DRM_DEBUG_KMS("metadata desc 1 %d\n", connector->hdr_metadata_type_one);
4463
- DRM_DEBUG_KMS("max luminance %d\n", connector->hdr_max_luminance);
4464
- DRM_DEBUG_KMS("avg luminance %d\n", connector->hdr_avg_luminance);
4465
- DRM_DEBUG_KMS("min luminance %d\n", connector->hdr_min_luminance);
4466
-}
4467
-/*
4468
- * drm_hdmi_extract_extended_blk_info - Parse the HDMI extended tag blocks
4469
- * @connector: connector corresponding to the HDMI sink
4470
- * @edid: handle to the EDID structure
4471
- * Parses the all extended tag blocks extract sink info for @connector.
4472
- */
4473
-static void
4474
-drm_hdmi_extract_extended_blk_info(struct drm_connector *connector,
4475
- const struct edid *edid)
4476
-{
4477
- const u8 *cea = drm_find_cea_extension(edid);
4478
- const u8 *db = NULL;
4479
-
4480
- if (cea && cea_revision(cea) >= 3) {
4481
- int i, start, end;
4482
-
4483
- if (cea_db_offsets(cea, &start, &end))
4484
- return;
4485
-
4486
- for_each_cea_db(cea, i, start, end) {
4487
- db = &cea[i];
4488
-
4489
- if (cea_db_tag(db) == USE_EXTENDED_TAG) {
4490
- DRM_DEBUG_KMS("found extended tag block = %d\n",
4491
- db[1]);
4492
- switch (db[1]) {
4493
- case VIDEO_CAPABILITY_EXTENDED_DATA_BLOCK:
4494
- drm_extract_vcdb_info(connector, db);
4495
- break;
4496
- case VENDOR_SPECIFIC_VIDEO_DATA_BLOCK:
4497
- drm_extract_vsvdb_info(connector, db);
4498
- break;
4499
- case HDR_STATIC_METADATA_BLOCK:
4500
- drm_extract_hdr_db(connector, db);
4501
- break;
4502
- case COLORIMETRY_EXTENDED_DATA_BLOCK:
4503
- drm_extract_clrmetry_db(connector, db);
4504
- break;
4505
- default:
4506
- break;
4507
- }
4508
- }
4509
- }
4510
- }
4511
-}
4512
-
4513
-static void
4514
-parse_hdmi_hf_vsdb(struct drm_connector *connector, const u8 *db)
4515
-{
4516
- u8 len = cea_db_payload_len(db);
4517
-
4518
- if (len < 7)
4519
- return;
4520
-
4521
- if (db[4] != 1)
4522
- return; /* invalid version */
4523
-
4524
- connector->max_tmds_char = db[5] * 5;
4525
- connector->scdc_present = db[6] & (1 << 7);
4526
- connector->rr_capable = db[6] & (1 << 6);
4527
- connector->flags_3d = db[6] & 0x7;
4528
- connector->supports_scramble = connector->scdc_present &&
4529
- (db[6] & (1 << 3));
4530
-
4531
- DRM_DEBUG_KMS(
4532
- "HDMI v2: max TMDS char %d, scdc %s, rr %s,3D flags 0x%x, scramble %s\n",
4533
- connector->max_tmds_char,
4534
- connector->scdc_present ? "available" : "not available",
4535
- connector->rr_capable ? "capable" : "not capable",
4536
- connector->flags_3d,
4537
- connector->supports_scramble ? "supported" : "not supported");
4538
-}
4539
-
4540
-static void drm_parse_ycbcr420_deep_color_info(struct drm_connector *connector,
4541
- const u8 *db)
4542
-{
4543
- u8 dc_mask;
4544
- struct drm_hdmi_info *hdmi = &connector->display_info.hdmi;
4545
-
4546
- dc_mask = db[7] & DRM_EDID_YCBCR420_DC_MASK;
4547
- hdmi->y420_dc_modes = dc_mask;
4548
-}
4549
-
4550
-static
4551
-void drm_get_max_frl_rate(int max_frl_rate, u8 *max_lanes, u8 *max_rate_per_lane)
4552
-{
4553
- switch (max_frl_rate) {
4554
- case 1:
4555
- *max_lanes = 3;
4556
- *max_rate_per_lane = 3;
4557
- break;
4558
- case 2:
4559
- *max_lanes = 3;
4560
- *max_rate_per_lane = 6;
4561
- break;
4562
- case 3:
4563
- *max_lanes = 4;
4564
- *max_rate_per_lane = 6;
4565
- break;
4566
- case 4:
4567
- *max_lanes = 4;
4568
- *max_rate_per_lane = 8;
4569
- break;
4570
- case 5:
4571
- *max_lanes = 4;
4572
- *max_rate_per_lane = 10;
4573
- break;
4574
- case 6:
4575
- *max_lanes = 4;
4576
- *max_rate_per_lane = 12;
4577
- break;
4578
- case 0:
4579
- default:
4580
- *max_lanes = 0;
4581
- *max_rate_per_lane = 0;
4582
- }
4583
-}
4584
-
4585
-static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector,
4586
- const u8 *hf_vsdb)
4587
-{
4588
- struct drm_display_info *display = &connector->display_info;
4589
- struct drm_hdmi_info *hdmi = &display->hdmi;
4590
-
4591
- display->has_hdmi_infoframe = true;
4592
-
4593
- if (hf_vsdb[6] & 0x80) {
4594
- hdmi->scdc.supported = true;
4595
- if (hf_vsdb[6] & 0x40)
4596
- hdmi->scdc.read_request = true;
4597
- }
4598
-
4599
- /*
4600
- * All HDMI 2.0 monitors must support scrambling at rates > 340 MHz.
4601
- * And as per the spec, three factors confirm this:
4602
- * * Availability of a HF-VSDB block in EDID (check)
4603
- * * Non zero Max_TMDS_Char_Rate filed in HF-VSDB (let's check)
4604
- * * SCDC support available (let's check)
4605
- * Lets check it out.
4606
- */
4607
-
4608
- if (hf_vsdb[5]) {
4609
- /* max clock is 5000 KHz times block value */
4610
- u32 max_tmds_clock = hf_vsdb[5] * 5000;
4611
- struct drm_scdc *scdc = &hdmi->scdc;
4612
-
4613
- if (max_tmds_clock > 340000) {
4614
- display->max_tmds_clock = max_tmds_clock;
4615
- DRM_DEBUG_KMS("HF-VSDB: max TMDS clock %d kHz\n",
4616
- display->max_tmds_clock);
4617
- }
4618
-
4619
- if (scdc->supported) {
4620
- scdc->scrambling.supported = true;
4621
-
4622
- /* Few sinks support scrambling for cloks < 340M */
4623
- if ((hf_vsdb[6] & 0x8))
4624
- scdc->scrambling.low_rates = true;
4625
- }
4626
- }
4627
-
4628
- if (hf_vsdb[7]) {
4629
- u8 max_frl_rate;
4630
- u8 dsc_max_frl_rate;
4631
- u8 dsc_max_slices;
4632
- struct drm_hdmi_dsc_cap *hdmi_dsc = &hdmi->dsc_cap;
4633
-
4634
- DRM_DEBUG_KMS("hdmi_21 sink detected. parsing edid\n");
4635
- max_frl_rate = (hf_vsdb[7] & DRM_EDID_MAX_FRL_RATE_MASK) >> 4;
4636
- drm_get_max_frl_rate(max_frl_rate, &hdmi->max_lanes,
4637
- &hdmi->max_frl_rate_per_lane);
4638
- hdmi_dsc->v_1p2 = hf_vsdb[11] & DRM_EDID_DSC_1P2;
4639
-
4640
- if (hdmi_dsc->v_1p2) {
4641
- hdmi_dsc->native_420 = hf_vsdb[11] & DRM_EDID_DSC_NATIVE_420;
4642
- hdmi_dsc->all_bpp = hf_vsdb[11] & DRM_EDID_DSC_ALL_BPP;
4643
-
4644
- if (hf_vsdb[11] & DRM_EDID_DSC_16BPC)
4645
- hdmi_dsc->bpc_supported = 16;
4646
- else if (hf_vsdb[11] & DRM_EDID_DSC_12BPC)
4647
- hdmi_dsc->bpc_supported = 12;
4648
- else if (hf_vsdb[11] & DRM_EDID_DSC_10BPC)
4649
- hdmi_dsc->bpc_supported = 10;
4650
- else
4651
- hdmi_dsc->bpc_supported = 0;
4652
-
4653
- dsc_max_frl_rate = (hf_vsdb[12] & DRM_EDID_DSC_MAX_FRL_RATE_MASK) >> 4;
4654
- drm_get_max_frl_rate(dsc_max_frl_rate, &hdmi_dsc->max_lanes,
4655
- &hdmi_dsc->max_frl_rate_per_lane);
4656
- hdmi_dsc->total_chunk_kbytes = hf_vsdb[13] & DRM_EDID_DSC_TOTAL_CHUNK_KBYTES;
4657
-
4658
- dsc_max_slices = hf_vsdb[12] & DRM_EDID_DSC_MAX_SLICES;
4659
- switch (dsc_max_slices) {
4660
- case 1:
4661
- hdmi_dsc->max_slices = 1;
4662
- hdmi_dsc->clk_per_slice = 340;
4663
- break;
4664
- case 2:
4665
- hdmi_dsc->max_slices = 2;
4666
- hdmi_dsc->clk_per_slice = 340;
4667
- break;
4668
- case 3:
4669
- hdmi_dsc->max_slices = 4;
4670
- hdmi_dsc->clk_per_slice = 340;
4671
- break;
4672
- case 4:
4673
- hdmi_dsc->max_slices = 8;
4674
- hdmi_dsc->clk_per_slice = 340;
4675
- break;
4676
- case 5:
4677
- hdmi_dsc->max_slices = 8;
4678
- hdmi_dsc->clk_per_slice = 400;
4679
- break;
4680
- case 6:
4681
- hdmi_dsc->max_slices = 12;
4682
- hdmi_dsc->clk_per_slice = 400;
4683
- break;
4684
- case 7:
4685
- hdmi_dsc->max_slices = 16;
4686
- hdmi_dsc->clk_per_slice = 400;
4687
- break;
4688
- case 0:
4689
- default:
4690
- hdmi_dsc->max_slices = 0;
4691
- hdmi_dsc->clk_per_slice = 0;
4692
- }
4693
- }
4694
- }
4695
-
4696
- drm_parse_ycbcr420_deep_color_info(connector, hf_vsdb);
4697
- parse_hdmi_hf_vsdb(connector, hf_vsdb);
4698
-}
4699
-
47004719 static void
47014720 monitor_name(struct detailed_timing *t, void *data)
47024721 {
4703
- if (t->data.other_data.type == EDID_DETAIL_MONITOR_NAME)
4704
- *(u8 **)data = t->data.other_data.data.str.str;
4722
+ if (!is_display_descriptor((const u8 *)t, EDID_DETAIL_MONITOR_NAME))
4723
+ return;
4724
+
4725
+ *(u8 **)data = t->data.other_data.data.str.str;
47054726 }
47064727
47074728 static int get_monitor_name(struct edid *edid, char name[13])
....@@ -4734,7 +4755,7 @@
47344755 {
47354756 int name_length;
47364757 char buf[13];
4737
-
4758
+
47384759 if (bufsize <= 0)
47394760 return;
47404761
....@@ -4799,6 +4820,7 @@
47994820
48004821 if (cea_revision(cea) >= 3) {
48014822 int i, start, end;
4823
+ int sad_count;
48024824
48034825 if (cea_db_offsets(cea, &start, &end)) {
48044826 start = 0;
....@@ -4810,8 +4832,6 @@
48104832 dbl = cea_db_payload_len(db);
48114833
48124834 switch (cea_db_tag(db)) {
4813
- int sad_count;
4814
-
48154835 case AUDIO_BLOCK:
48164836 /* Audio Data Block, contains SADs */
48174837 sad_count = min(dbl / 3, 15 - total_sad_count);
....@@ -4829,10 +4849,6 @@
48294849 /* HDMI Vendor-Specific Data Block */
48304850 if (cea_db_is_hdmi_vsdb(db))
48314851 drm_parse_hdmi_vsdb_audio(connector, db);
4832
- /* HDMI Forum Vendor-Specific Data Block */
4833
- else if (cea_db_is_hdmi_forum_vsdb(db))
4834
- drm_parse_hdmi_forum_vsdb(connector,
4835
- db);
48364852 break;
48374853 default:
48384854 break;
....@@ -4874,12 +4890,12 @@
48744890 cea = drm_find_cea_extension(edid);
48754891 if (!cea) {
48764892 DRM_DEBUG_KMS("SAD: no CEA Extension found\n");
4877
- return -ENOENT;
4893
+ return 0;
48784894 }
48794895
48804896 if (cea_revision(cea) < 3) {
48814897 DRM_DEBUG_KMS("SAD: wrong CEA revision\n");
4882
- return -ENOTSUPP;
4898
+ return 0;
48834899 }
48844900
48854901 if (cea_db_offsets(cea, &start, &end)) {
....@@ -4892,6 +4908,7 @@
48924908
48934909 if (cea_db_tag(db) == AUDIO_BLOCK) {
48944910 int j;
4911
+
48954912 dbl = cea_db_payload_len(db);
48964913
48974914 count = dbl / 3; /* SAD is 3B */
....@@ -4935,12 +4952,12 @@
49354952 cea = drm_find_cea_extension(edid);
49364953 if (!cea) {
49374954 DRM_DEBUG_KMS("SAD: no CEA Extension found\n");
4938
- return -ENOENT;
4955
+ return 0;
49394956 }
49404957
49414958 if (cea_revision(cea) < 3) {
49424959 DRM_DEBUG_KMS("SAD: wrong CEA revision\n");
4943
- return -ENOTSUPP;
4960
+ return 0;
49444961 }
49454962
49464963 if (cea_db_offsets(cea, &start, &end)) {
....@@ -5016,6 +5033,9 @@
50165033 *
50175034 * Parse the CEA extension according to CEA-861-B.
50185035 *
5036
+ * Drivers that have added the modes parsed from EDID to drm_display_info
5037
+ * should use &drm_display_info.is_hdmi instead of calling this function.
5038
+ *
50195039 * Return: True if the monitor is HDMI, false if not or unknown.
50205040 */
50215041 bool drm_detect_hdmi_monitor(struct edid *edid)
....@@ -5067,7 +5087,8 @@
50675087 if (!edid_ext)
50685088 goto end;
50695089
5070
- has_audio = ((edid_ext[3] & EDID_BASIC_AUDIO) != 0);
5090
+ has_audio = (edid_ext[0] == CEA_EXT &&
5091
+ (edid_ext[3] & EDID_BASIC_AUDIO) != 0);
50715092
50725093 if (has_audio) {
50735094 DRM_DEBUG_KMS("Monitor has basic audio support\n");
....@@ -5091,41 +5112,6 @@
50915112 }
50925113 EXPORT_SYMBOL(drm_detect_monitor_audio);
50935114
5094
-/**
5095
- * drm_rgb_quant_range_selectable - is RGB quantization range selectable?
5096
- * @edid: EDID block to scan
5097
- *
5098
- * Check whether the monitor reports the RGB quantization range selection
5099
- * as supported. The AVI infoframe can then be used to inform the monitor
5100
- * which quantization range (full or limited) is used.
5101
- *
5102
- * Return: True if the RGB quantization range is selectable, false otherwise.
5103
- */
5104
-bool drm_rgb_quant_range_selectable(struct edid *edid)
5105
-{
5106
- u8 *edid_ext;
5107
- int i, start, end;
5108
-
5109
- edid_ext = drm_find_cea_extension(edid);
5110
- if (!edid_ext)
5111
- return false;
5112
-
5113
- if (cea_db_offsets(edid_ext, &start, &end))
5114
- return false;
5115
-
5116
- for_each_cea_db(edid_ext, i, start, end) {
5117
- if (cea_db_tag(&edid_ext[i]) == USE_EXTENDED_TAG &&
5118
- cea_db_payload_len(&edid_ext[i]) == 2 &&
5119
- cea_db_extended_tag(&edid_ext[i]) ==
5120
- EXT_VIDEO_CAPABILITY_BLOCK) {
5121
- DRM_DEBUG_KMS("CEA VCDB 0x%02x\n", edid_ext[i + 2]);
5122
- return edid_ext[i + 2] & EDID_CEA_VCDB_QS;
5123
- }
5124
- }
5125
-
5126
- return false;
5127
-}
5128
-EXPORT_SYMBOL(drm_rgb_quant_range_selectable);
51295115
51305116 /**
51315117 * drm_default_rgb_quant_range - default RGB quantization range
....@@ -5145,6 +5131,179 @@
51455131 HDMI_QUANTIZATION_RANGE_FULL;
51465132 }
51475133 EXPORT_SYMBOL(drm_default_rgb_quant_range);
5134
+
5135
+static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db)
5136
+{
5137
+ struct drm_display_info *info = &connector->display_info;
5138
+
5139
+ DRM_DEBUG_KMS("CEA VCDB 0x%02x\n", db[2]);
5140
+
5141
+ if (db[2] & EDID_CEA_VCDB_QS)
5142
+ info->rgb_quant_range_selectable = true;
5143
+}
5144
+
5145
+#ifdef CONFIG_NO_GKI
5146
+static
5147
+void drm_get_max_frl_rate(int max_frl_rate, u8 *max_lanes, u8 *max_rate_per_lane)
5148
+{
5149
+ switch (max_frl_rate) {
5150
+ case 1:
5151
+ *max_lanes = 3;
5152
+ *max_rate_per_lane = 3;
5153
+ break;
5154
+ case 2:
5155
+ *max_lanes = 3;
5156
+ *max_rate_per_lane = 6;
5157
+ break;
5158
+ case 3:
5159
+ *max_lanes = 4;
5160
+ *max_rate_per_lane = 6;
5161
+ break;
5162
+ case 4:
5163
+ *max_lanes = 4;
5164
+ *max_rate_per_lane = 8;
5165
+ break;
5166
+ case 5:
5167
+ *max_lanes = 4;
5168
+ *max_rate_per_lane = 10;
5169
+ break;
5170
+ case 6:
5171
+ *max_lanes = 4;
5172
+ *max_rate_per_lane = 12;
5173
+ break;
5174
+ case 0:
5175
+ default:
5176
+ *max_lanes = 0;
5177
+ *max_rate_per_lane = 0;
5178
+ }
5179
+}
5180
+#endif
5181
+
5182
+static void drm_parse_ycbcr420_deep_color_info(struct drm_connector *connector,
5183
+ const u8 *db)
5184
+{
5185
+ u8 dc_mask;
5186
+ struct drm_hdmi_info *hdmi = &connector->display_info.hdmi;
5187
+
5188
+ dc_mask = db[7] & DRM_EDID_YCBCR420_DC_MASK;
5189
+ hdmi->y420_dc_modes = dc_mask;
5190
+}
5191
+
5192
+static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector,
5193
+ const u8 *hf_vsdb)
5194
+{
5195
+ struct drm_display_info *display = &connector->display_info;
5196
+ struct drm_hdmi_info *hdmi = &display->hdmi;
5197
+
5198
+ display->has_hdmi_infoframe = true;
5199
+
5200
+ if (hf_vsdb[6] & 0x80) {
5201
+ hdmi->scdc.supported = true;
5202
+ if (hf_vsdb[6] & 0x40)
5203
+ hdmi->scdc.read_request = true;
5204
+ }
5205
+
5206
+ /*
5207
+ * All HDMI 2.0 monitors must support scrambling at rates > 340 MHz.
5208
+ * And as per the spec, three factors confirm this:
5209
+ * * Availability of a HF-VSDB block in EDID (check)
5210
+ * * Non zero Max_TMDS_Char_Rate filed in HF-VSDB (let's check)
5211
+ * * SCDC support available (let's check)
5212
+ * Lets check it out.
5213
+ */
5214
+
5215
+ if (hf_vsdb[5]) {
5216
+ /* max clock is 5000 KHz times block value */
5217
+ u32 max_tmds_clock = hf_vsdb[5] * 5000;
5218
+ struct drm_scdc *scdc = &hdmi->scdc;
5219
+
5220
+ if (max_tmds_clock > 340000) {
5221
+ display->max_tmds_clock = max_tmds_clock;
5222
+ DRM_DEBUG_KMS("HF-VSDB: max TMDS clock %d kHz\n",
5223
+ display->max_tmds_clock);
5224
+ }
5225
+
5226
+ if (scdc->supported) {
5227
+ scdc->scrambling.supported = true;
5228
+
5229
+ /* Few sinks support scrambling for clocks < 340M */
5230
+ if ((hf_vsdb[6] & 0x8))
5231
+ scdc->scrambling.low_rates = true;
5232
+ }
5233
+ }
5234
+
5235
+#ifdef CONFIG_NO_GKI
5236
+ if (hf_vsdb[7]) {
5237
+ u8 max_frl_rate;
5238
+ u8 dsc_max_frl_rate;
5239
+ u8 dsc_max_slices;
5240
+ struct drm_hdmi_dsc_cap *hdmi_dsc = &hdmi->dsc_cap;
5241
+
5242
+ DRM_DEBUG_KMS("hdmi_21 sink detected. parsing edid\n");
5243
+ max_frl_rate = (hf_vsdb[7] & DRM_EDID_MAX_FRL_RATE_MASK) >> 4;
5244
+ drm_get_max_frl_rate(max_frl_rate, &hdmi->max_lanes,
5245
+ &hdmi->max_frl_rate_per_lane);
5246
+ hdmi_dsc->v_1p2 = hf_vsdb[11] & DRM_EDID_DSC_1P2;
5247
+
5248
+ if (hdmi_dsc->v_1p2) {
5249
+ hdmi_dsc->native_420 = hf_vsdb[11] & DRM_EDID_DSC_NATIVE_420;
5250
+ hdmi_dsc->all_bpp = hf_vsdb[11] & DRM_EDID_DSC_ALL_BPP;
5251
+
5252
+ if (hf_vsdb[11] & DRM_EDID_DSC_16BPC)
5253
+ hdmi_dsc->bpc_supported = 16;
5254
+ else if (hf_vsdb[11] & DRM_EDID_DSC_12BPC)
5255
+ hdmi_dsc->bpc_supported = 12;
5256
+ else if (hf_vsdb[11] & DRM_EDID_DSC_10BPC)
5257
+ hdmi_dsc->bpc_supported = 10;
5258
+ else
5259
+ hdmi_dsc->bpc_supported = 0;
5260
+
5261
+ dsc_max_frl_rate = (hf_vsdb[12] & DRM_EDID_DSC_MAX_FRL_RATE_MASK) >> 4;
5262
+ drm_get_max_frl_rate(dsc_max_frl_rate, &hdmi_dsc->max_lanes,
5263
+ &hdmi_dsc->max_frl_rate_per_lane);
5264
+ hdmi_dsc->total_chunk_kbytes = hf_vsdb[13] & DRM_EDID_DSC_TOTAL_CHUNK_KBYTES;
5265
+
5266
+ dsc_max_slices = hf_vsdb[12] & DRM_EDID_DSC_MAX_SLICES;
5267
+ switch (dsc_max_slices) {
5268
+ case 1:
5269
+ hdmi_dsc->max_slices = 1;
5270
+ hdmi_dsc->clk_per_slice = 340;
5271
+ break;
5272
+ case 2:
5273
+ hdmi_dsc->max_slices = 2;
5274
+ hdmi_dsc->clk_per_slice = 340;
5275
+ break;
5276
+ case 3:
5277
+ hdmi_dsc->max_slices = 4;
5278
+ hdmi_dsc->clk_per_slice = 340;
5279
+ break;
5280
+ case 4:
5281
+ hdmi_dsc->max_slices = 8;
5282
+ hdmi_dsc->clk_per_slice = 340;
5283
+ break;
5284
+ case 5:
5285
+ hdmi_dsc->max_slices = 8;
5286
+ hdmi_dsc->clk_per_slice = 400;
5287
+ break;
5288
+ case 6:
5289
+ hdmi_dsc->max_slices = 12;
5290
+ hdmi_dsc->clk_per_slice = 400;
5291
+ break;
5292
+ case 7:
5293
+ hdmi_dsc->max_slices = 16;
5294
+ hdmi_dsc->clk_per_slice = 400;
5295
+ break;
5296
+ case 0:
5297
+ default:
5298
+ hdmi_dsc->max_slices = 0;
5299
+ hdmi_dsc->clk_per_slice = 0;
5300
+ }
5301
+ }
5302
+ }
5303
+#endif
5304
+
5305
+ drm_parse_ycbcr420_deep_color_info(connector, hf_vsdb);
5306
+}
51485307
51495308 static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
51505309 const u8 *hdmi)
....@@ -5191,7 +5350,6 @@
51915350
51925351 /* YCRCB444 is optional according to spec. */
51935352 if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) {
5194
- info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_Y444;
51955353 DRM_DEBUG("%s: HDMI sink does YCRCB444 in deep color.\n",
51965354 connector->name);
51975355 }
....@@ -5211,6 +5369,8 @@
52115369 {
52125370 struct drm_display_info *info = &connector->display_info;
52135371 u8 len = cea_db_payload_len(db);
5372
+
5373
+ info->is_hdmi = true;
52145374
52155375 if (len >= 6)
52165376 info->dvi_dual = db[6] & 1;
....@@ -5257,11 +5417,52 @@
52575417 drm_parse_hdmi_forum_vsdb(connector, db);
52585418 if (cea_db_is_y420cmdb(db))
52595419 drm_parse_y420cmdb_bitmap(connector, db);
5420
+ if (cea_db_is_vcdb(db))
5421
+ drm_parse_vcdb(connector, db);
52605422 if (cea_db_is_hdmi_hdr_metadata_block(db))
52615423 drm_parse_hdr_metadata_block(connector, db);
5262
- if (cea_db_is_hdmi_colorimetry_data_block(db))
5263
- drm_parse_colorimetry_data_block(connector, db);
52645424 }
5425
+}
5426
+
5427
+static
5428
+void get_monitor_range(struct detailed_timing *timing,
5429
+ void *info_monitor_range)
5430
+{
5431
+ struct drm_monitor_range_info *monitor_range = info_monitor_range;
5432
+ const struct detailed_non_pixel *data = &timing->data.other_data;
5433
+ const struct detailed_data_monitor_range *range = &data->data.range;
5434
+
5435
+ if (!is_display_descriptor((const u8 *)timing, EDID_DETAIL_MONITOR_RANGE))
5436
+ return;
5437
+
5438
+ /*
5439
+ * Check for flag range limits only. If flag == 1 then
5440
+ * no additional timing information provided.
5441
+ * Default GTF, GTF Secondary curve and CVT are not
5442
+ * supported
5443
+ */
5444
+ if (range->flags != DRM_EDID_RANGE_LIMITS_ONLY_FLAG)
5445
+ return;
5446
+
5447
+ monitor_range->min_vfreq = range->min_vfreq;
5448
+ monitor_range->max_vfreq = range->max_vfreq;
5449
+}
5450
+
5451
+static
5452
+void drm_get_monitor_range(struct drm_connector *connector,
5453
+ const struct edid *edid)
5454
+{
5455
+ struct drm_display_info *info = &connector->display_info;
5456
+
5457
+ if (!version_greater(edid, 1, 1))
5458
+ return;
5459
+
5460
+ drm_for_each_detailed_block((u8 *)edid, get_monitor_range,
5461
+ &info->monitor_range);
5462
+
5463
+ DRM_DEBUG_KMS("Supported Monitor Refresh rate range is %d Hz - %d Hz\n",
5464
+ info->monitor_range.min_vfreq,
5465
+ info->monitor_range.max_vfreq);
52655466 }
52665467
52675468 /* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
....@@ -5280,46 +5481,14 @@
52805481 info->cea_rev = 0;
52815482 info->max_tmds_clock = 0;
52825483 info->dvi_dual = false;
5283
- info->edid_hdmi_dc_modes = 0;
5484
+ info->is_hdmi = false;
52845485 info->has_hdmi_infoframe = false;
5486
+ info->rgb_quant_range_selectable = false;
52855487 memset(&info->hdmi, 0, sizeof(info->hdmi));
52865488
52875489 info->non_desktop = 0;
5490
+ memset(&info->monitor_range, 0, sizeof(info->monitor_range));
52885491 }
5289
-
5290
-static void
5291
-drm_hdmi_extract_vsdbs_info(struct drm_connector *connector,
5292
- const struct edid *edid)
5293
-{
5294
- const u8 *cea = drm_find_cea_extension(edid);
5295
- const u8 *db = NULL;
5296
-
5297
- if (cea && cea_revision(cea) >= 3) {
5298
- int i, start, end;
5299
-
5300
- if (cea_db_offsets(cea, &start, &end))
5301
- return;
5302
-
5303
- for_each_cea_db(cea, i, start, end) {
5304
- db = &cea[i];
5305
-
5306
- if (cea_db_tag(db) == VENDOR_BLOCK) {
5307
- /* HDMI Vendor-Specific Data Block */
5308
- if (cea_db_is_hdmi_vsdb(db)) {
5309
- drm_parse_hdmi_vsdb_video(
5310
- connector, db);
5311
- drm_parse_hdmi_vsdb_audio(
5312
- connector, db);
5313
- }
5314
- /* HDMI Forum Vendor-Specific Data Block */
5315
- else if (cea_db_is_hdmi_forum_vsdb(db))
5316
- drm_parse_hdmi_forum_vsdb(connector,
5317
- db);
5318
- }
5319
- }
5320
- }
5321
-}
5322
-
53235492
53245493 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
53255494 {
....@@ -5334,9 +5503,9 @@
53345503
53355504 info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
53365505
5337
- DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
5506
+ drm_get_monitor_range(connector, edid);
53385507
5339
- memset(&info->hdmi, 0, sizeof(info->hdmi));
5508
+ DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
53405509
53415510 if (edid->revision < 3)
53425511 return quirks;
....@@ -5354,17 +5523,12 @@
53545523 * tells us to assume 8 bpc color depth if the EDID doesn't have
53555524 * extensions which tell otherwise.
53565525 */
5357
- if ((info->bpc == 0) && (edid->revision < 4) &&
5358
- (edid->input & DRM_EDID_DIGITAL_TYPE_DVI)) {
5526
+ if (info->bpc == 0 && edid->revision == 3 &&
5527
+ edid->input & DRM_EDID_DIGITAL_DFP_1_X) {
53595528 info->bpc = 8;
53605529 DRM_DEBUG("%s: Assigning DFP sink color depth as %d bpc.\n",
53615530 connector->name, info->bpc);
53625531 }
5363
-
5364
- /* Extract audio and video latency fields for the sink */
5365
- drm_hdmi_extract_vsdbs_info(connector, edid);
5366
- /* Extract info from extended tag blocks */
5367
- drm_hdmi_extract_extended_blk_info(connector, edid);
53685532
53695533 /* Only defined for 1.4 with digital displays */
53705534 if (edid->revision < 4)
....@@ -5407,7 +5571,7 @@
54075571
54085572 static int validate_displayid(u8 *displayid, int length, int idx)
54095573 {
5410
- int i;
5574
+ int i, dispid_length;
54115575 u8 csum = 0;
54125576 struct displayid_hdr *base;
54135577
....@@ -5416,15 +5580,18 @@
54165580 DRM_DEBUG_KMS("base revision 0x%x, length %d, %d %d\n",
54175581 base->rev, base->bytes, base->prod_id, base->ext_count);
54185582
5419
- if (base->bytes + 5 > length - idx)
5583
+ /* +1 for DispID checksum */
5584
+ dispid_length = sizeof(*base) + base->bytes + 1;
5585
+ if (dispid_length > length - idx)
54205586 return -EINVAL;
5421
- for (i = idx; i <= base->bytes + 5; i++) {
5422
- csum += displayid[i];
5423
- }
5587
+
5588
+ for (i = 0; i < dispid_length; i++)
5589
+ csum += displayid[idx + i];
54245590 if (csum) {
54255591 DRM_NOTE("DisplayID checksum invalid, remainder is %d\n", csum);
54265592 return -EINVAL;
54275593 }
5594
+
54285595 return 0;
54295596 }
54305597
....@@ -5445,6 +5612,7 @@
54455612 unsigned vsync_width = (timings->vsw[0] | timings->vsw[1] << 8) + 1;
54465613 bool hsync_positive = (timings->hsync[1] >> 7) & 0x1;
54475614 bool vsync_positive = (timings->vsync[1] >> 7) & 0x1;
5615
+
54485616 mode = drm_mode_create(dev);
54495617 if (!mode)
54505618 return NULL;
....@@ -5467,7 +5635,6 @@
54675635
54685636 if (timings->flags & 0x80)
54695637 mode->type |= DRM_MODE_TYPE_PREFERRED;
5470
- mode->vrefresh = drm_mode_vrefresh(mode);
54715638 drm_mode_set_name(mode);
54725639
54735640 return mode;
....@@ -5503,32 +5670,27 @@
55035670 struct edid *edid)
55045671 {
55055672 u8 *displayid;
5506
- int ret;
5507
- int idx = 1;
5508
- int length = EDID_LENGTH;
5673
+ int length, idx;
55095674 struct displayid_block *block;
55105675 int num_modes = 0;
5676
+ int ext_index = 0;
55115677
5512
- displayid = drm_find_displayid_extension(edid);
5513
- if (!displayid)
5514
- return 0;
5515
-
5516
- ret = validate_displayid(displayid, length, idx);
5517
- if (ret)
5518
- return 0;
5519
-
5520
- idx += sizeof(struct displayid_hdr);
5521
- while (block = (struct displayid_block *)&displayid[idx],
5522
- idx + sizeof(struct displayid_block) <= length &&
5523
- idx + sizeof(struct displayid_block) + block->num_bytes <= length &&
5524
- block->num_bytes > 0) {
5525
- idx += block->num_bytes + sizeof(struct displayid_block);
5526
- switch (block->tag) {
5527
- case DATA_BLOCK_TYPE_1_DETAILED_TIMING:
5528
- num_modes += add_displayid_detailed_1_modes(connector, block);
5678
+ for (;;) {
5679
+ displayid = drm_find_displayid_extension(edid, &length, &idx,
5680
+ &ext_index);
5681
+ if (!displayid)
55295682 break;
5683
+
5684
+ idx += sizeof(struct displayid_hdr);
5685
+ for_each_displayid_db(displayid, block, idx, length) {
5686
+ switch (block->tag) {
5687
+ case DATA_BLOCK_TYPE_1_DETAILED_TIMING:
5688
+ num_modes += add_displayid_detailed_1_modes(connector, block);
5689
+ break;
5690
+ }
55305691 }
55315692 }
5693
+
55325694 return num_modes;
55335695 }
55345696
....@@ -5554,7 +5716,7 @@
55545716 }
55555717 if (!drm_edid_is_valid(edid)) {
55565718 clear_eld(connector);
5557
- dev_warn(connector->dev->dev, "%s: EDID invalid.\n",
5719
+ drm_warn(connector->dev, "%s: EDID invalid.\n",
55585720 connector->name);
55595721 return 0;
55605722 }
....@@ -5637,6 +5799,7 @@
56375799
56385800 for (i = 0; i < count; i++) {
56395801 const struct drm_display_mode *ptr = &drm_dmt_modes[i];
5802
+
56405803 if (hdisplay && vdisplay) {
56415804 /*
56425805 * Only when two are valid, they will be used to check
....@@ -5681,6 +5844,19 @@
56815844 }
56825845 EXPORT_SYMBOL(drm_set_preferred_mode);
56835846
5847
+static bool is_hdmi2_sink(const struct drm_connector *connector)
5848
+{
5849
+ /*
5850
+ * FIXME: sil-sii8620 doesn't have a connector around when
5851
+ * we need one, so we have to be prepared for a NULL connector.
5852
+ */
5853
+ if (!connector)
5854
+ return true;
5855
+
5856
+ return connector->display_info.hdmi.scdc.supported ||
5857
+ connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB420;
5858
+}
5859
+
56845860 static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf)
56855861 {
56865862 return sink_eotf & BIT(output_eotf);
....@@ -5690,7 +5866,7 @@
56905866 * drm_hdmi_infoframe_set_hdr_metadata() - fill an HDMI DRM infoframe with
56915867 * HDR metadata from userspace
56925868 * @frame: HDMI DRM infoframe
5693
- * @hdr_metadata: hdr_source_metadata info from userspace
5869
+ * @conn_state: Connector state containing HDR metadata
56945870 *
56955871 * Return: 0 on success or a negative error code on failure.
56965872 */
....@@ -5753,56 +5929,79 @@
57535929 }
57545930 EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata);
57555931
5756
-/**
5757
- * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
5758
- * data from a DRM display mode
5759
- * @frame: HDMI AVI infoframe
5760
- * @mode: DRM display mode
5761
- * @is_hdmi2_sink: Sink is HDMI 2.0 compliant
5762
- *
5763
- * Return: 0 on success or a negative error code on failure.
5764
- */
5765
-int
5766
-drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
5767
- const struct drm_display_mode *mode,
5768
- bool is_hdmi2_sink)
5932
+static u8 drm_mode_hdmi_vic(const struct drm_connector *connector,
5933
+ const struct drm_display_mode *mode)
57695934 {
5770
- enum hdmi_picture_aspect picture_aspect;
5771
- int err;
5935
+ bool has_hdmi_infoframe = connector ?
5936
+ connector->display_info.has_hdmi_infoframe : false;
57725937
5773
- if (!frame || !mode)
5774
- return -EINVAL;
5938
+ if (!has_hdmi_infoframe)
5939
+ return 0;
57755940
5776
- err = hdmi_avi_infoframe_init(frame);
5777
- if (err < 0)
5778
- return err;
5941
+ /* No HDMI VIC when signalling 3D video format */
5942
+ if (mode->flags & DRM_MODE_FLAG_3D_MASK)
5943
+ return 0;
57795944
5780
- if (mode->flags & DRM_MODE_FLAG_DBLCLK)
5781
- frame->pixel_repeat = 1;
5945
+ return drm_match_hdmi_mode(mode);
5946
+}
57825947
5783
- frame->video_code = drm_match_cea_mode(mode);
5784
-
5785
- /*
5786
- * HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but
5787
- * HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we
5788
- * have to make sure we dont break HDMI 1.4 sinks.
5789
- */
5790
- if (!is_hdmi2_sink && frame->video_code > 64)
5791
- frame->video_code = 0;
5792
-
5948
+static u8 drm_mode_cea_vic(const struct drm_connector *connector,
5949
+ const struct drm_display_mode *mode)
5950
+{
57935951 /*
57945952 * HDMI spec says if a mode is found in HDMI 1.4b 4K modes
57955953 * we should send its VIC in vendor infoframes, else send the
57965954 * VIC in AVI infoframes. Lets check if this mode is present in
57975955 * HDMI 1.4b 4K modes
57985956 */
5799
- if (frame->video_code) {
5800
- u8 vendor_if_vic = drm_match_hdmi_mode(mode);
5801
- bool is_s3d = mode->flags & DRM_MODE_FLAG_3D_MASK;
5957
+ if (drm_mode_hdmi_vic(connector, mode))
5958
+ return 0;
58025959
5803
- if (drm_valid_hdmi_vic(vendor_if_vic) && !is_s3d)
5804
- frame->video_code = 0;
5805
- }
5960
+ return drm_match_cea_mode(mode);
5961
+}
5962
+
5963
+/*
5964
+ * Avoid sending VICs defined in HDMI 2.0 in AVI infoframes to sinks that
5965
+ * conform to HDMI 1.4.
5966
+ *
5967
+ * HDMI 1.4 (CTA-861-D) VIC range: [1..64]
5968
+ * HDMI 2.0 (CTA-861-F) VIC range: [1..107]
5969
+ */
5970
+static u8 vic_for_avi_infoframe(const struct drm_connector *connector, u8 vic)
5971
+{
5972
+ if (!is_hdmi2_sink(connector) && vic > 64)
5973
+ return 0;
5974
+
5975
+ return vic;
5976
+}
5977
+
5978
+/**
5979
+ * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
5980
+ * data from a DRM display mode
5981
+ * @frame: HDMI AVI infoframe
5982
+ * @connector: the connector
5983
+ * @mode: DRM display mode
5984
+ *
5985
+ * Return: 0 on success or a negative error code on failure.
5986
+ */
5987
+int
5988
+drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
5989
+ const struct drm_connector *connector,
5990
+ const struct drm_display_mode *mode)
5991
+{
5992
+ enum hdmi_picture_aspect picture_aspect;
5993
+ u8 vic, hdmi_vic;
5994
+
5995
+ if (!frame || !mode)
5996
+ return -EINVAL;
5997
+
5998
+ hdmi_avi_infoframe_init(frame);
5999
+
6000
+ if (mode->flags & DRM_MODE_FLAG_DBLCLK)
6001
+ frame->pixel_repeat = 1;
6002
+
6003
+ vic = drm_mode_cea_vic(connector, mode);
6004
+ hdmi_vic = drm_mode_hdmi_vic(connector, mode);
58066005
58076006 frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
58086007
....@@ -5816,11 +6015,15 @@
58166015
58176016 /*
58186017 * Populate picture aspect ratio from either
5819
- * user input (if specified) or from the CEA mode list.
6018
+ * user input (if specified) or from the CEA/HDMI mode lists.
58206019 */
58216020 picture_aspect = mode->picture_aspect_ratio;
5822
- if (picture_aspect == HDMI_PICTURE_ASPECT_NONE)
5823
- picture_aspect = drm_get_cea_aspect_ratio(frame->video_code);
6021
+ if (picture_aspect == HDMI_PICTURE_ASPECT_NONE) {
6022
+ if (vic)
6023
+ picture_aspect = drm_get_cea_aspect_ratio(vic);
6024
+ else if (hdmi_vic)
6025
+ picture_aspect = drm_get_hdmi_aspect_ratio(hdmi_vic);
6026
+ }
58246027
58256028 /*
58266029 * The infoframe can't convey anything but none, 4:3
....@@ -5828,12 +6031,20 @@
58286031 * we can only satisfy it by specifying the right VIC.
58296032 */
58306033 if (picture_aspect > HDMI_PICTURE_ASPECT_16_9) {
5831
- if (picture_aspect !=
5832
- drm_get_cea_aspect_ratio(frame->video_code))
6034
+ if (vic) {
6035
+ if (picture_aspect != drm_get_cea_aspect_ratio(vic))
6036
+ return -EINVAL;
6037
+ } else if (hdmi_vic) {
6038
+ if (picture_aspect != drm_get_hdmi_aspect_ratio(hdmi_vic))
6039
+ return -EINVAL;
6040
+ } else {
58336041 return -EINVAL;
6042
+ }
6043
+
58346044 picture_aspect = HDMI_PICTURE_ASPECT_NONE;
58356045 }
58366046
6047
+ frame->video_code = vic_for_avi_infoframe(connector, vic);
58376048 frame->picture_aspect = picture_aspect;
58386049 frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
58396050 frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
....@@ -5842,26 +6053,92 @@
58426053 }
58436054 EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
58446055
6056
+/* HDMI Colorspace Spec Definitions */
6057
+#define FULL_COLORIMETRY_MASK 0x1FF
6058
+#define NORMAL_COLORIMETRY_MASK 0x3
6059
+#define EXTENDED_COLORIMETRY_MASK 0x7
6060
+#define EXTENDED_ACE_COLORIMETRY_MASK 0xF
6061
+
6062
+#define C(x) ((x) << 0)
6063
+#define EC(x) ((x) << 2)
6064
+#define ACE(x) ((x) << 5)
6065
+
6066
+#define HDMI_COLORIMETRY_NO_DATA 0x0
6067
+#define HDMI_COLORIMETRY_SMPTE_170M_YCC (C(1) | EC(0) | ACE(0))
6068
+#define HDMI_COLORIMETRY_BT709_YCC (C(2) | EC(0) | ACE(0))
6069
+#define HDMI_COLORIMETRY_XVYCC_601 (C(3) | EC(0) | ACE(0))
6070
+#define HDMI_COLORIMETRY_XVYCC_709 (C(3) | EC(1) | ACE(0))
6071
+#define HDMI_COLORIMETRY_SYCC_601 (C(3) | EC(2) | ACE(0))
6072
+#define HDMI_COLORIMETRY_OPYCC_601 (C(3) | EC(3) | ACE(0))
6073
+#define HDMI_COLORIMETRY_OPRGB (C(3) | EC(4) | ACE(0))
6074
+#define HDMI_COLORIMETRY_BT2020_CYCC (C(3) | EC(5) | ACE(0))
6075
+#define HDMI_COLORIMETRY_BT2020_RGB (C(3) | EC(6) | ACE(0))
6076
+#define HDMI_COLORIMETRY_BT2020_YCC (C(3) | EC(6) | ACE(0))
6077
+#define HDMI_COLORIMETRY_DCI_P3_RGB_D65 (C(3) | EC(7) | ACE(0))
6078
+#define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1))
6079
+
6080
+static const u32 hdmi_colorimetry_val[] = {
6081
+ [DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA,
6082
+ [DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC,
6083
+ [DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC,
6084
+ [DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601,
6085
+ [DRM_MODE_COLORIMETRY_XVYCC_709] = HDMI_COLORIMETRY_XVYCC_709,
6086
+ [DRM_MODE_COLORIMETRY_SYCC_601] = HDMI_COLORIMETRY_SYCC_601,
6087
+ [DRM_MODE_COLORIMETRY_OPYCC_601] = HDMI_COLORIMETRY_OPYCC_601,
6088
+ [DRM_MODE_COLORIMETRY_OPRGB] = HDMI_COLORIMETRY_OPRGB,
6089
+ [DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC,
6090
+ [DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB,
6091
+ [DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC,
6092
+};
6093
+
6094
+#undef C
6095
+#undef EC
6096
+#undef ACE
6097
+
6098
+/**
6099
+ * drm_hdmi_avi_infoframe_colorspace() - fill the HDMI AVI infoframe
6100
+ * colorspace information
6101
+ * @frame: HDMI AVI infoframe
6102
+ * @conn_state: connector state
6103
+ */
6104
+void
6105
+drm_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame,
6106
+ const struct drm_connector_state *conn_state)
6107
+{
6108
+ u32 colorimetry_val;
6109
+ u32 colorimetry_index = conn_state->colorspace & FULL_COLORIMETRY_MASK;
6110
+
6111
+ if (colorimetry_index >= ARRAY_SIZE(hdmi_colorimetry_val))
6112
+ colorimetry_val = HDMI_COLORIMETRY_NO_DATA;
6113
+ else
6114
+ colorimetry_val = hdmi_colorimetry_val[colorimetry_index];
6115
+
6116
+ frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK;
6117
+ /*
6118
+ * ToDo: Extend it for ACE formats as well. Modify the infoframe
6119
+ * structure and extend it in drivers/video/hdmi
6120
+ */
6121
+ frame->extended_colorimetry = (colorimetry_val >> 2) &
6122
+ EXTENDED_COLORIMETRY_MASK;
6123
+}
6124
+EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorspace);
6125
+
58456126 /**
58466127 * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
58476128 * quantization range information
58486129 * @frame: HDMI AVI infoframe
6130
+ * @connector: the connector
58496131 * @mode: DRM display mode
58506132 * @rgb_quant_range: RGB quantization range (Q)
5851
- * @rgb_quant_range_selectable: Sink support selectable RGB quantization range (QS)
5852
- * @is_hdmi2_sink: HDMI 2.0 sink, which has different default recommendations
5853
- *
5854
- * Note that @is_hdmi2_sink can be derived by looking at the
5855
- * &drm_scdc.supported flag stored in &drm_hdmi_info.scdc,
5856
- * &drm_display_info.hdmi, which can be found in &drm_connector.display_info.
58576133 */
58586134 void
58596135 drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame,
6136
+ const struct drm_connector *connector,
58606137 const struct drm_display_mode *mode,
5861
- enum hdmi_quantization_range rgb_quant_range,
5862
- bool rgb_quant_range_selectable,
5863
- bool is_hdmi2_sink)
6138
+ enum hdmi_quantization_range rgb_quant_range)
58646139 {
6140
+ const struct drm_display_info *info = &connector->display_info;
6141
+
58656142 /*
58666143 * CEA-861:
58676144 * "A Source shall not send a non-zero Q value that does not correspond
....@@ -5872,7 +6149,7 @@
58726149 * HDMI 2.0 recommends sending non-zero Q when it does match the
58736150 * default RGB quantization range for the mode, even when QS=0.
58746151 */
5875
- if (rgb_quant_range_selectable ||
6152
+ if (info->rgb_quant_range_selectable ||
58766153 rgb_quant_range == drm_default_rgb_quant_range(mode))
58776154 frame->quantization_range = rgb_quant_range;
58786155 else
....@@ -5891,7 +6168,7 @@
58916168 * we limit non-zero YQ to HDMI 2.0 sinks only as HDMI 2.0 is based
58926169 * on on CEA-861-F.
58936170 */
5894
- if (!is_hdmi2_sink ||
6171
+ if (!is_hdmi2_sink(connector) ||
58956172 rgb_quant_range == HDMI_QUANTIZATION_RANGE_LIMITED)
58966173 frame->ycc_quantization_range =
58976174 HDMI_YCC_QUANTIZATION_RANGE_LIMITED;
....@@ -5900,6 +6177,23 @@
59006177 HDMI_YCC_QUANTIZATION_RANGE_FULL;
59016178 }
59026179 EXPORT_SYMBOL(drm_hdmi_avi_infoframe_quant_range);
6180
+
6181
+/**
6182
+ * drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe
6183
+ * bar information
6184
+ * @frame: HDMI AVI infoframe
6185
+ * @conn_state: connector state
6186
+ */
6187
+void
6188
+drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,
6189
+ const struct drm_connector_state *conn_state)
6190
+{
6191
+ frame->right_bar = conn_state->tv.margins.right;
6192
+ frame->left_bar = conn_state->tv.margins.left;
6193
+ frame->top_bar = conn_state->tv.margins.top;
6194
+ frame->bottom_bar = conn_state->tv.margins.bottom;
6195
+}
6196
+EXPORT_SYMBOL(drm_hdmi_avi_infoframe_bars);
59036197
59046198 static enum hdmi_3d_structure
59056199 s3d_structure_from_display_mode(const struct drm_display_mode *mode)
....@@ -5943,7 +6237,7 @@
59436237 */
59446238 int
59456239 drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
5946
- struct drm_connector *connector,
6240
+ const struct drm_connector *connector,
59476241 const struct drm_display_mode *mode)
59486242 {
59496243 /*
....@@ -5953,8 +6247,6 @@
59536247 bool has_hdmi_infoframe = connector ?
59546248 connector->display_info.has_hdmi_infoframe : false;
59556249 int err;
5956
- u32 s3d_flags;
5957
- u8 vic;
59586250
59596251 if (!frame || !mode)
59606252 return -EINVAL;
....@@ -5962,8 +6254,9 @@
59626254 if (!has_hdmi_infoframe)
59636255 return -EINVAL;
59646256
5965
- vic = drm_match_hdmi_mode(mode);
5966
- s3d_flags = mode->flags & DRM_MODE_FLAG_3D_MASK;
6257
+ err = hdmi_vendor_infoframe_init(frame);
6258
+ if (err < 0)
6259
+ return err;
59676260
59686261 /*
59696262 * Even if it's not absolutely necessary to send the infoframe
....@@ -5974,25 +6267,17 @@
59746267 * mode if the source simply stops sending the infoframe when
59756268 * it wants to switch from 3D to 2D.
59766269 */
5977
-
5978
- if (vic && s3d_flags)
5979
- return -EINVAL;
5980
-
5981
- err = hdmi_vendor_infoframe_init(frame);
5982
- if (err < 0)
5983
- return err;
5984
-
5985
- frame->vic = vic;
6270
+ frame->vic = drm_mode_hdmi_vic(connector, mode);
59866271 frame->s3d_struct = s3d_structure_from_display_mode(mode);
59876272
59886273 return 0;
59896274 }
59906275 EXPORT_SYMBOL(drm_hdmi_vendor_infoframe_from_display_mode);
59916276
5992
-static int drm_parse_tiled_block(struct drm_connector *connector,
5993
- struct displayid_block *block)
6277
+static void drm_parse_tiled_block(struct drm_connector *connector,
6278
+ const struct displayid_block *block)
59946279 {
5995
- struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block;
6280
+ const struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block;
59966281 u16 w, h;
59976282 u8 tile_v_loc, tile_h_loc;
59986283 u8 num_v_tile, num_h_tile;
....@@ -6024,92 +6309,63 @@
60246309 DRM_DEBUG_KMS("vend %c%c%c\n", tile->topology_id[0], tile->topology_id[1], tile->topology_id[2]);
60256310
60266311 tg = drm_mode_get_tile_group(connector->dev, tile->topology_id);
6027
- if (!tg) {
6028
- tg = drm_mode_create_tile_group(connector->dev, tile->topology_id);
6029
- }
60306312 if (!tg)
6031
- return -ENOMEM;
6313
+ tg = drm_mode_create_tile_group(connector->dev, tile->topology_id);
6314
+ if (!tg)
6315
+ return;
60326316
60336317 if (connector->tile_group != tg) {
60346318 /* if we haven't got a pointer,
60356319 take the reference, drop ref to old tile group */
6036
- if (connector->tile_group) {
6320
+ if (connector->tile_group)
60376321 drm_mode_put_tile_group(connector->dev, connector->tile_group);
6038
- }
60396322 connector->tile_group = tg;
6040
- } else
6323
+ } else {
60416324 /* if same tile group, then release the ref we just took. */
60426325 drm_mode_put_tile_group(connector->dev, tg);
6043
- return 0;
6326
+ }
60446327 }
60456328
6046
-static int drm_parse_display_id(struct drm_connector *connector,
6047
- u8 *displayid, int length,
6048
- bool is_edid_extension)
6329
+static void drm_displayid_parse_tiled(struct drm_connector *connector,
6330
+ const u8 *displayid, int length, int idx)
60496331 {
6050
- /* if this is an EDID extension the first byte will be 0x70 */
6051
- int idx = 0;
6052
- struct displayid_block *block;
6053
- int ret;
6054
-
6055
- if (is_edid_extension)
6056
- idx = 1;
6057
-
6058
- ret = validate_displayid(displayid, length, idx);
6059
- if (ret)
6060
- return ret;
6332
+ const struct displayid_block *block;
60616333
60626334 idx += sizeof(struct displayid_hdr);
6063
- while (block = (struct displayid_block *)&displayid[idx],
6064
- idx + sizeof(struct displayid_block) <= length &&
6065
- idx + sizeof(struct displayid_block) + block->num_bytes <= length &&
6066
- block->num_bytes > 0) {
6067
- idx += block->num_bytes + sizeof(struct displayid_block);
6335
+ for_each_displayid_db(displayid, block, idx, length) {
60686336 DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n",
60696337 block->tag, block->rev, block->num_bytes);
60706338
60716339 switch (block->tag) {
60726340 case DATA_BLOCK_TILED_DISPLAY:
6073
- ret = drm_parse_tiled_block(connector, block);
6074
- if (ret)
6075
- return ret;
6076
- break;
6077
- case DATA_BLOCK_TYPE_1_DETAILED_TIMING:
6078
- /* handled in mode gathering code. */
6079
- break;
6080
- case DATA_BLOCK_CTA:
6081
- /* handled in the cea parser code. */
6341
+ drm_parse_tiled_block(connector, block);
60826342 break;
60836343 default:
60846344 DRM_DEBUG_KMS("found DisplayID tag 0x%x, unhandled\n", block->tag);
60856345 break;
60866346 }
60876347 }
6088
- return 0;
60896348 }
60906349
6091
-static void drm_get_displayid(struct drm_connector *connector,
6092
- struct edid *edid)
6350
+void drm_update_tile_info(struct drm_connector *connector,
6351
+ const struct edid *edid)
60936352 {
6094
- void *displayid = NULL;
6095
- int ret;
6353
+ const void *displayid = NULL;
6354
+ int ext_index = 0;
6355
+ int length, idx;
6356
+
60966357 connector->has_tile = false;
6097
- displayid = drm_find_displayid_extension(edid);
6098
- if (!displayid) {
6099
- /* drop reference to any tile group we had */
6100
- goto out_drop_ref;
6358
+ for (;;) {
6359
+ displayid = drm_find_displayid_extension(edid, &length, &idx,
6360
+ &ext_index);
6361
+ if (!displayid)
6362
+ break;
6363
+
6364
+ drm_displayid_parse_tiled(connector, displayid, length, idx);
61016365 }
61026366
6103
- ret = drm_parse_display_id(connector, displayid, EDID_LENGTH, true);
6104
- if (ret < 0)
6105
- goto out_drop_ref;
6106
- if (!connector->has_tile)
6107
- goto out_drop_ref;
6108
- return;
6109
-out_drop_ref:
6110
- if (connector->tile_group) {
6367
+ if (!connector->has_tile && connector->tile_group) {
61116368 drm_mode_put_tile_group(connector->dev, connector->tile_group);
61126369 connector->tile_group = NULL;
61136370 }
6114
- return;
61156371 }