diff options
| author | Devarsh Thakkar <[email protected]> | 2023-12-05 21:25:20 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-01-29 14:49:17 -0500 |
| commit | eefe23c12775184b10068fd4f71c42db335ff3e6 (patch) | |
| tree | 7a1428e4758e7cf64d60d079b693b8719618ec05 /drivers | |
| parent | 4ef9c77248c95cd2bc63697084ae82f345e5c6e7 (diff) | |
video: Skip framebuffer reservation if already reserved
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/video-uclass.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index f743ed74c81..d620a29c253 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -123,6 +123,9 @@ int video_reserve(ulong *addrp) struct udevice *dev; ulong size; + if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() == PHASE_BOARD_F) + return 0; + gd->video_top = *addrp; for (uclass_find_first_device(UCLASS_VIDEO, &dev); dev; @@ -208,11 +211,14 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, int video_reserve_from_bloblist(struct video_handoff *ho) { + if (!ho->fb || ho->size == 0) + return -ENOENT; + gd->video_bottom = ho->fb; gd->fb_base = ho->fb; gd->video_top = ho->fb + ho->size; - debug("Reserving %luk for video using blob at: %08x\n", - ((unsigned long)ho->size) >> 10, (u32)ho->fb); + debug("%s: Reserving %lx bytes at %08x as per bloblist received\n", + __func__, (unsigned long)ho->size, (u32)ho->fb); return 0; } |
