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

   ## Summary
    
   This commit introduces EDID reading and parsing to the JZ4780 display 
driver, replacing hardcoded resolution limits with dynamic mode selection based 
on the connected display's capabilities.
   
   Specific changes include:
     - Implemented I2C DDC master communication for the HDMI controller to read 
EDID blocks from monitors.
     - Added dynamic mode selection to calculate bandwidth and pick the best 
supported resolution, prioritizing the EDID preferred mode.
     - Dynamically allocated framebuffer bounds (g_planeinfo and g_videoinfo) 
based on parsed EDID dimensions.
     - Configured GPIO pin multiplexing for HDMI power, DDC, and control pins 
(POWER_EN, CEC, SCL, SDA) to enable display power and communication on the CI20 
board.
   
   ## Testing
   
   Driver initialization fails if EDID parsing returns invalid values.
   
   ```
   80x768 @ 42Hz
    (8550 144 256 256 771 777 795
    +H +V)
                   
   0x768 @ 79Hz
    (10225 80 208 160 771 778 805
    -H +V)
   Preferred Mode: 
   80x768 @ 42Hz
   dwc_hdmi_phy_configure: PHY PLL not locked
   dwc_hdmi_phy_configure: PHY PLL not locked
   jzlcd_hdmi_event: hdmi error: -1
   fb_register: ERROR: up_fbinitialize() failed for display 0: -1
   jz4780_bringup: ERROR: fb_register() failed: -1
   telnetd [7:100]
   
   NuttShell (NSH) NuttX-13.0.1-RC0
   nsh> fb
   ERROR: Failed to open /dev/fb0: 2
   nsh> 
   ```
   
   Testing on CI20 board with  #19986 changes included.
   
   ```
   Manufacturer:   [VHH]
   EDID Version:   1.3
   Video Input:    81
                   Digital (DFP 1.x compatible)
   
   Max Size:      43 cm x 26 cm
   Gamma:         2.20
   Features:       0a
                   RGB
                   Preferred timing
   Ext Blocks:     1
   Product:        50
   Serial No:      16777216
   Manufactured:   Year 2011, Week 1
   Range:          Horizontal: 15 - 68 kHz
                   Vertical: 48 - 76 Hz
                   Max Dot Clock: 150 MHz
   Chroma Info:    Red X: 0.639
                   Red Y: 0.329
                   Grn X: 0.299
                   Grn Y: 0.599
                   Blu X: 0.149
                   Blu Y: 0.059
                   Wht X: 0.271
                   Wht Y: 0.277
   Video modes:    720x400 @ 70Hz (28320 738 846 900 412 414 449 -H +V)
                   640x480 @ 60Hz (25175 656 752 800 490 492 525 -H -V)
                   640x480 @ 73Hz (31500 664 704 832 489 492 520 -H -V)
                   640x480 @ 75Hz (31500 656 720 840 481 484 500 -H -V)
                   800x600 @ 56Hz (36000 824 896 1024 601 603 625 +H +V)
                   800x600 @ 60Hz (40000 840 968 1056 601 605 628 +H +V)
                   800x600 @ 75Hz (49500 816 896 1056 601 604 625 +H +V)
                   1024x768 @ 60Hz (65000 1048 1184 1344 771 777 806 -H -V)
                   1024x768 @ 70Hz (75000 1048 1184 1328 771 777 806 -H -V)
                   1024x768 @ 75Hz (78750 1040 1136 1312 769 772 800 +H +V)
                   1360x768 @ 60Hz (85500 1424 1536 1792 771 777 795 +H +V)
                   1280x768 @ 75Hz (102250 1360 1488 1696 771 778 805 -H +V)
   Preferred Mode: 1360x768 @ 60Hz
   up_fbgetvplane: vplane: 0
   jz_getvideoinfo: vtable=0x80086e30 vinfo=0x8009027c
   jz_getplaneinfo: vtable=0x80086e30 planeno=0 pinfo=0x80090208
   jz_getvideoinfo: vtable=0x80086e30 vinfo=0x80090224
   
   NuttShell (NSH) NuttX-13.0.1-RC0
   nsh> fb
   VideoInfo:
         fmt: 11
        xres: 1360
        yres: 768
     nplanes: 1
   PlaneInfo (plane 0):
       fbmem: 0xaf800000
       fblen: 2088960
      stride: 2720
     display: 0
         bpp: 16
   Mapped FB: 0xaf800000
    0: (  0,  0) (1360,768)
    1: (123, 69) (1114,630)
    2: (246,138) (868,492)
    3: (369,207) (622,354)
    4: (492,276) (376,216)
    5: (615,345) (130, 78)
   Test finished
   nsh> 
   ```
   


-- 
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