
On Sat, 25 Nov 2023 at 09:27, Devarsh Thakkar devarsht@ti.com wrote:
Skip framebufer reservation if it was already reserved from previous stage and whose information was passed using a bloblist.
Return error in case framebuffer information received from bloblist is invalid i.e NULL or empty.
While at it, improve the debug message to make it more clear that address in discussion is of framebuffer and not bloblist and also match it with printing scheme followed in video_reserve function.
Signed-off-by: Devarsh Thakkar devarsht@ti.com
V2:
- Add debug prints
- Fix commenting style
V3:
- Fix commenting style
V4:
- Remove extra checks on gd for video data in video_reserve
- Add check and return error if video handoff provided info is invalid
- Improve debug message
- Remove Reviewed-by due to additional changes per review comments
common/board_f.c | 8 ++++++-- drivers/video/video-uclass.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
with nit below
diff --git a/common/board_f.c b/common/board_f.c index acf802c9cb..442b8349d0 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -407,11 +407,15 @@ static int reserve_video_from_videoblob(void) { if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) {
This is board_f.c so the SPL phase will always be PHASE_BOARD_F so can you please drop that second condition? It will confuse people.
struct video_handoff *ho;
int ret = 0; ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho)); if (!ho)
return log_msg_ret("blf", -ENOENT);
video_reserve_from_bloblist(ho);
return log_msg_ret("Missing video bloblist", -ENOENT);
ret = video_reserve_from_bloblist(ho);
if (ret)
return log_msg_ret("Invalid Video handoff info", ret); /* Sanity check fb from blob is before current relocaddr */ if (likely(gd->relocaddr > (unsigned long)ho->fb))
[..]
Regards, Simon