This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 4dfca78d41e video: fix EDID standard timing decode
4dfca78d41e is described below

commit 4dfca78d41e9bb53534c7e05783da2a658d346c3
Author: Emre Cecanpunar <[email protected]>
AuthorDate: Fri Jul 17 12:55:54 2026 +0300

    video: fix EDID standard timing decode
    
    Fix standard timing decoding and the red chromaticity Y field.
    
    Signed-off-by: Emre Cecanpunar <[email protected]>
---
 video/videomode/edid_parse.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/video/videomode/edid_parse.c b/video/videomode/edid_parse.c
index db098f83d05..b2ef10607df 100644
--- a/video/videomode/edid_parse.c
+++ b/video/videomode/edid_parse.c
@@ -125,6 +125,7 @@ static bool edid_std_timing(FAR const uint8_t *stdtim,
   unsigned x;
   unsigned y;
   unsigned f;
+  uint8_t info;
 
   if ((stdtim[0] == 1 && stdtim[1] == 1) ||
       (stdtim[0] == 0 && stdtim[1] == 0) ||
@@ -133,8 +134,9 @@ static bool edid_std_timing(FAR const uint8_t *stdtim,
       return false;
     }
 
-  x = stdtim[EDID_STDTIMING_XRES_OFFSET];
-  switch (x & EDID_STDTIMING_ASPECT_MASK)
+  x = (stdtim[EDID_STDTIMING_XRES_OFFSET] + 31) * 8;
+  info = stdtim[EDID_STDTIMING_INFO_OFFSET];
+  switch (info & EDID_STDTIMING_ASPECT_MASK)
     {
     case EDID_STDTIMING_ASPECT_16_10:
       y = x * 10 / 16;
@@ -154,7 +156,7 @@ static bool edid_std_timing(FAR const uint8_t *stdtim,
       break;
     }
 
-  f = stdtim[EDID_STDTIMING_INFO_OFFSET];
+  f = (info & ~EDID_STDTIMING_ASPECT_MASK) + 60;
 
   /* First try to lookup the mode as a DMT timing */
 
@@ -499,7 +501,7 @@ int edid_parse(FAR const uint8_t *data, FAR struct 
edid_info_s *edid)
   edid->edid_features         = data[EDID_DISPLAY_FEATURES_OFFSET];
 
   edid->edid_chroma.ec_redx   = EDID_CHROMA_RED_X(data);
-  edid->edid_chroma.ec_redy   = EDID_CHROMA_RED_X(data);
+  edid->edid_chroma.ec_redy   = EDID_CHROMA_RED_Y(data);
   edid->edid_chroma.ec_greenx = EDID_CHROMA_GREEN_X(data);
   edid->edid_chroma.ec_greeny = EDID_CHROMA_GREEN_Y(data);
   edid->edid_chroma.ec_bluex  = EDID_CHROMA_BLUE_X(data);

Reply via email to