Skip to content

video: Keep EDID modes and DP lane counts within what is reserved

Ana Bobillo u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11configs: stm32mp23/stm32mp25: Size the frame buffer for the LVDS panelconfigs/stm32mp23_defconfig configs/stm32mp25_defconfig+4 -01 reply
2/11video: Check that the mode fits in the reserved frame bufferdrivers/video/video-uclass.c test/dm/video.c+41 -00 replies
3/11edid: Leave the timing alone when no mode is validcommon/edid.c include/edid.h test/common/Makefile +1 more+97 -42 replies
4/11video: display: Skip modes which do not fit in the source frame bufferdrivers/video/display-uclass.c include/display.h+16 -01 reply
5/11video: rockchip: vop: Tell the display the frame buffer sizedrivers/video/rockchip/rk_vop.c+19 -162 replies
6/11video: sunxi: de2: Tell the display the frame buffer sizedrivers/video/sunxi/sunxi_de2.c+3 -03 replies
7/11video: tegra124: Tell the display the frame buffer sizedrivers/video/tegra/tegra124/display.c+3 -00 replies
8/11sunxi: display: Skip EDID modes larger than the frame bufferdrivers/video/sunxi/sunxi_display.c+3 -20 replies
9/11video: tegra: hdmi: Skip modes larger than the DC frame bufferdrivers/video/tegra/dc.c drivers/video/tegra/dc.h drivers/video/tegra/hdmi.c+11 -21 reply
10/11video: rockchip: edp: Limit the lane count to fourdrivers/video/rockchip/rk_edp.c+4 -00 replies
11/11video: tegra124: dp: Limit the lane count to fourdrivers/video/tegra/tegra124/dp.c+3 -01 reply

Reviews trailers per patch

4 of 11 patches have a Reviewed-by or Acked-by.

PatchSvyatoslav RyhelPatrice Chotard
1/11R-b
2/11
3/11
4/11A-b
5/11
6/11
7/11
8/11
9/11R-b
10/11
11/11R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/11] video: Keep EDID modes and DP lane counts within what is reserved

Much of what U-Boot's video drivers set up comes from the display: the mode from its EDID and, on DisplayPort, the lane count from its DPCD. Several drivers take these as they come, while the memory they use is sized in advance: the frame buffer is reserved for a maximum resolution when the device is bound, and the DP link training code keeps its per-lane state in four-entry arrays. A monitor or panel announcing a larger mode, or more than four lanes, makes U-Boot write past them.

Patch 2 makes video_post_probe() refuse a frame buffer larger than the memory reserved for it, for every video driver. Patch 1 first fixes the two STM32MP2 defconfigs whose panel is larger than the maximum they ask for, which only work thanks to the 2MB alignment of the reservation.

Patches 3 to 9 have the drivers which take the mode from the EDID skip the modes which do not fit, so that a smaller one is used rather than no display: edid_get_timing_validate() no longer hands back a timing it rejected (patch 3), the display uclass learns the size of the source's frame buffer (patch 4), which rk_vop, sunxi DE2 and Tegra124 pass to it (patches 5 to 7), and the sunxi DE1 and Tegra HDMI drivers, which read the EDID themselves, check their own limits (patches 8 and 9).

Patches 10 and 11 limit the DPCD lane count to four in the Rockchip eDP and Tegra124 DP drivers.

Tested on sandbox: the two new tests, dm_test_video_fb_size and edid_test_timing_validate, fail without the fixes (the first one crashes sandbox) and pass with them, and ut dm and ut common otherwise give the same results as on main. Built for chromebook_jerry, nyan-big, transformer_t30, Cubietruck and orangepi_pc with no new warnings.

CI: the series passes all 91 jobs of U-Boot's Azure pipeline, in build 13732 of my CI-only pull request, on main d1d45c926a5.

PR:    https://github.com/u-boot/u-boot/pull/1064
Build: https://dev.azure.com/u-boot/u-boot/_build/results?buildId=13732

Ana Bobillo (11):
configs: stm32mp23/stm32mp25: Size the frame buffer for the LVDS panel
video: Check that the mode fits in the reserved frame buffer
edid: Leave the timing alone when no mode is valid
video: display: Skip modes which do not fit in the source frame buffer
video: rockchip: vop: Tell the display the frame buffer size
video: sunxi: de2: Tell the display the frame buffer size
video: tegra124: Tell the display the frame buffer size
sunxi: display: Skip EDID modes larger than the frame buffer
video: tegra: hdmi: Skip modes larger than the DC frame buffer
video: rockchip: edp: Limit the lane count to four
video: tegra124: dp: Limit the lane count to four

 common/edid.c                          | 10 ++-
 configs/stm32mp23_defconfig            |  2 +
 configs/stm32mp25_defconfig            |  2 +
 drivers/video/display-uclass.c         | 10 +++
 drivers/video/rockchip/rk_edp.c        |  4 ++
 drivers/video/rockchip/rk_vop.c        | 35 ++++++-----
 drivers/video/sunxi/sunxi_de2.c        |  3 +
 drivers/video/sunxi/sunxi_display.c    |  5 +-
 drivers/video/tegra/dc.c               |  4 +-
 drivers/video/tegra/dc.h               |  4 ++
 drivers/video/tegra/hdmi.c             |  5 ++
 drivers/video/tegra/tegra124/display.c |  3 +
 drivers/video/tegra/tegra124/dp.c      |  3 +
 drivers/video/video-uclass.c           | 12 ++++
 include/display.h                      |  6 ++
 include/edid.h                         |  3 +-
 test/common/Makefile                   |  1 +
 test/common/edid.c                     | 87 ++++++++++++++++++++++++++
 test/dm/video.c                        | 29 +++++++++
 19 files changed, 204 insertions(+), 24 deletions(-)
 create mode 100644 test/common/edid.c

base-commit: d1d45c926a571fb6c1e6d7105c280833646915ea