aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevarsh Thakkar <devarsht@ti.com>2023-12-05 21:25:21 +0530
committerTom Rini <trini@konsulko.com>2024-01-29 14:49:17 -0500
commitb30414f089d23942fe36a66a8de8c9c22fad91ba (patch)
treec851bf1971f5aa23953491142d083d35c33fd8dd
parenteefe23c12775184b10068fd4f71c42db335ff3e6 (diff)
downloadu-boot-b30414f089d23942fe36a66a8de8c9c22fad91ba.zip
u-boot-b30414f089d23942fe36a66a8de8c9c22fad91ba.tar.gz
u-boot-b30414f089d23942fe36a66a8de8c9c22fad91ba.tar.bz2
video: Fill video handoff in video post probe
Fill video handoff fields in video_post_probe as at this point we have full framebuffer-related information. Also fill all the fields available in video hand-off struct as those were missing earlier and U-boot framework expects them to be filled for some of the functionalities. While filling framebuffer size in video hand-off structure use the actual framebuffer region size as derived from gd->video_top and gd->video_bottom instead of directly using the size populated in video_uc_plat as it contains unaligned size. Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/video/video-uclass.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index d620a29..3571e62 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -144,16 +144,6 @@ int video_reserve(ulong *addrp)
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
gd->video_top);
- if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(VIDEO_HANDOFF)) {
- struct video_handoff *ho;
-
- ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
- if (!ho)
- return log_msg_ret("blf", -ENOENT);
- ho->fb = *addrp;
- ho->size = size;
- }
-
return 0;
}
@@ -552,6 +542,26 @@ static int video_post_probe(struct udevice *dev)
priv->fb_size = priv->line_length * priv->ysize;
+ /*
+ * Set up video handoff fields for passing video blob to next stage
+ * NOTE:
+ * This assumes that reserved video memory only uses a single framebuffer
+ */
+ if (spl_phase() == PHASE_SPL && CONFIG_IS_ENABLED(BLOBLIST)) {
+ struct video_handoff *ho;
+
+ ho = bloblist_add(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho), 0);
+ if (!ho)
+ return log_msg_ret("blf", -ENOENT);
+ ho->fb = gd->video_bottom;
+ /* Fill aligned size here as calculated in video_reserve() */
+ ho->size = gd->video_top - gd->video_bottom;
+ ho->xsize = priv->xsize;
+ ho->ysize = priv->ysize;
+ ho->line_length = priv->line_length;
+ ho->bpix = priv->bpix;
+ }
+
if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->copy_base)
priv->copy_fb = map_sysmem(plat->copy_base, plat->size);