This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

VIC code mapping incorrectly in hdmi.c

The values returned for VIC code based on the Video parameters does not reflect CEA values. Some are mapped incorrectly in the table all_timings_direct in hdmi.c and don't reflect CEA values. For example the “all_timings_direct” entry that corresponds to 800x600@60 is all_timings_direct[16]: {800, 600, 40000, 128, 40, 88, 4 , 1, 23}. The corresponding entry in code_index, code_index[16], is 9.   VIC = 9 corresponds to “720(1440)x240p 59.94Hz/60Hz 16:9”.  

Another issue: the largest VIC value is 64 (“1920x1080p 100Hz 16:9”), which is 0x40.  So the values in the table  0X51, 0X52 are not valld. Also the initial value for the VIC return code is set to 16 (HDMI) - this results in a return of VIC=16 if the code is not found in the table - this is wrong - should be VIC = 0 (Video format not listed). Lastly, we have tried the following values and got these wrong results for standard CEA timing:

1. 800x600@60: /sys/devices/platform/vpss/display0/timings set to:  40000,800/40/88/128,600/1/23/4,1

Expected VIC=0 (“video format not listed”), Got VIC=9 (“720(1440)x240p 59.94Hz/60Hz 16:9”)

 2. 1024x768@60: /sys/devices/platform/vpss/display0/timings set to:  65000,1024/24/160/136,768/3/29/6,1

 Expected VIC=0 (“video format not listed”), Got VIC=16 (“1920x1080p 59.94Hz/60Hz 16:9”)

 3. 1280x1024@60: /sys/devices/platform/vpss/display0/timings set to:  108000,1280/48/248/112,1024/1/38/3,1

 Expected VIC=0 (“video format not listed”), Got VIC=35 (“2880x480p 59.94Hz/60Hz  4:3”)

 4. 1366x768@60: /sys/devices/platform/vpss/display0/timings set to:  85500,1366/70/213/143,768/3/24/3,1

 Expected VIC=0 (“video format not listed”), Got VIC=81 (“Reserved for the Future”)

 5. 480p@59.94: /sys/devices/platform/vpss/display0/timings set to:  27000,720/16/60/62,480/9/30/6,1

 Expected VIC=3 (“720x480p 59.94Hz/60Hz 16:9”), or maybe VIC=2 (“720x480p 59.94Hz/60Hz 4:3”), Got VIC=0 (“video format not listed”)

 6. 720p@23.98: /sys/devices/platform/vpss/display0/timings set to:  59281,1280/1760/220/40,720/5/20/5,1

 Expected VIC=60 (“1280x720p 23.97Hz/24Hz 16:9”), Got VIC=0 (“video format not listed”)

 7. 720p@24: /sys/devices/platform/vpss/display0/timings set to:  59400,1280/1760/220/40,720/5/20/5,1

 Expected VIC=60 (“1280x720p 23.97Hz/24Hz 16:9”), Got VIC=0 (“video format not listed”)

 8. 720p@25: /sys/devices/platform/vpss/display0/timings set to:  74250,1280/2420/220/40,720/5/20/5,1

 Expected VIC=61 (“1280x720p 25Hz 16:9”), Got VIC=0 (“video format not listed”)

 9. 720p@29.97: /sys/devices/platform/vpss/display0/timings set to:  74176,1280/1760/220/40,720/5/20/5,1

 Expected VIC=62 (“1280x720p 29.97Hz/30Hz 16:9”), Got VIC=0 (“video format not listed”)

 10. 720p@30: /sys/devices/platform/vpss/display0/timings set to:  74250,1280/1760/220/40,720/5/20/5,1

 Expected VIC=62 (“1280x720p 29.97Hz/30Hz 16:9”), Got VIC=0 (“video format not listed”)

 11. 720p@59.94: /sys/devices/platform/vpss/display0/timings set to:  74176,1280/110/220/40,720/5/20/5,1

 Expected VIC=4 (“1280x720p 59.94Hz/60Hz 16:9”), Got VIC=0 (“video format not listed”)

 12. 1080i@59.94: /sys/devices/platform/vpss/display0/timings set to:  74176,1920/88/148/44,1080/2/15/5,0

 Expected VIC=5 (“1920x1080i 59.94Hz/60Hz 16:9”), Got VIC=0 (“video format not listed”)

 13. 1080p@23.98: /sys/devices/platform/vpss/display0/timings set to:  74176,1920/638/148/44,1080/4/36/5,1

 Expected VIC=32 (“1920x1080p 23.97Hz/24Hz 16:9”), Got VIC=0 (“video format not listed”)

 14. 1080p@25: /sys/devices/platform/vpss/display0/timings set to:  74250,1920/528/148/44,1080/4/36/5,1

 Expected VIC=33 (“1920x1080p 25Hz 16:9”), Got VIC=0 (“video format not listed”)

 15. 1080p@29.97: /sys/devices/platform/vpss/display0/timings set to:  74176,1920/88/148/44,1080/4/36/5,1

 Expected VIC=34 (“1920x1080p 29.97Hz/30Hz 16:9”), Got VIC=0 (“video format not listed”)

 16. 1080p@30: /sys/devices/platform/vpss/display0/timings set to:  74250,1920/88/148/44,1080/4/36/5,1

 Expected VIC=34 (“1920x1080p 29.97Hz/30Hz 16:9”), Got VIC=0 (“video format not listed”)

 17. 1080p@59.94: /sys/devices/platform/vpss/display0/timings set to:  148352,1920/88/148/44,1080/4/36/5,1

 Expected VIC= 16 (“1920x1080p 59.94Hz/60Hz 16:9”), =Got VIC=0 (“video format not listed”)

Finally, the number of entries in the all_timings_direct[] and the corresponding code_index[] are not the same (34 in the former, 33 in the latter).

Instead of trying to accomodate some of the VESA timings (no way you could accomodate all...and VESA does not know VIC codes), can we not just make the tables map the 64 standard CEA VIC codes to the appropriate timings?