emomaxd opened a new pull request, #19466:
URL: https://github.com/apache/nuttx/pull/19466

   Fix two EDID parsing bugs in `video/videomode/edid_parse.c`.
   
   ## Summary
   
   The parser misdecoded EDID standard timing entries and used the wrong 
chromaticity macro for `edid_chroma.ec_redy`.
   
   `include/nuttx/video/edid.h` defines the standard timing fields as:
   
   ```c
   #define EDID_STDTIMING_XRES_OFFSET        (0)       /* Byte 0: X resolution, 
divided by 8, less 31 */
   #  define EDID_STDTIMING_ASPECT_SHIFT     (6)       /* Bits 6-7: Image 
aspect ratio */
   #  define EDID_STDTIMING_VFREQ_SHIFT      (0)       /* Bits 0-5: Vertical 
frequency, less 60 */
   #define EDID_STDTIMING_INFO_OFFSET        (1)       /* Byte 1: Image Aspect 
Ratio / Vertical Frequency */
   ```
   
   and the chromaticity macros are defined separately:
   
   ```c
   #define EDID_CHROMA_RED_X(p) \
     (_CHROMA(p, EDID_CHROMA_RG_LOW_OFFSET, EDID_CHROMA_RG_LOW_RED_X_SHIFT, \
              EDID_CHROMA_REDX_OFFSET))
   #define EDID_CHROMA_RED_Y(p) \
     (_CHROMA(p, EDID_CHROMA_RG_LOW_OFFSET, EDID_CHROMA_RG_LOW_RED_Y_SHIFT, \
              EDID_CHROMA_REDY_OFFSET))
   ```
   
   The implementation was reading those fields as if they were literal values 
and used `RED_X` for `ec_redy`.
   
   ## Impact
   
   This is a correctness fix for `CONFIG_VIDEO_EDID`. It can affect mode 
selection and chromaticity data, but does not change ABI or build configuration.
   
   ## Testing
   
   Tested on a local Linux x86_64 build host in this workspace.
   
   - `sim:ostest` build with `CONFIG_VIDEO=y` and `CONFIG_VIDEO_EDID=y`
   - local regression harness against a checksum-valid EDID block
   - `checkpatch.sh -f video/videomode/edid_parse.c`
   - `git diff --check`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to