diff mbox series

[RFC,4/5] video: Skip framebuffer reservation if already reserved

Message ID 20231016160611.1353458-5-devarsht@ti.com
State RFC
Delegated to: Anatolij Gustschin
Headers show
Series Move video memory reservation for SPL at the end of RAM | expand

Commit Message

Devarsh Thakkar Oct. 16, 2023, 4:06 p.m. UTC
Skip framebufer reservation if it was already reserved
from previous stage and whose information was passed
using a bloblist.

Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
---
 drivers/video/video-uclass.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Simon Glass Oct. 19, 2023, 1:56 p.m. UTC | #1
Hi Devarsh,

On Mon, 16 Oct 2023 at 10:06, 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.
>
> Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
> ---
>  drivers/video/video-uclass.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
> index f743ed74c8..bac30187e7 100644
> --- a/drivers/video/video-uclass.c
> +++ b/drivers/video/video-uclass.c
> @@ -123,6 +123,14 @@ int video_reserve(ulong *addrp)
>         struct udevice *dev;
>         ulong size;
>
> +
> +       if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) {
> +               /* Skip allocation if already received a bloblist which
> +                * filled below fields */

Comment style

/*
 * Skip allocation ...

 */

> +               if (gd->fb_base && gd->video_top && gd->video_bottom)
> +                       return 0;
> +       }
> +
>         gd->video_top = *addrp;
>         for (uclass_find_first_device(UCLASS_VIDEO, &dev);
>              dev;
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index f743ed74c8..bac30187e7 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -123,6 +123,14 @@  int video_reserve(ulong *addrp)
 	struct udevice *dev;
 	ulong size;
 
+
+	if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) {
+		/* Skip allocation if already received a bloblist which
+		 * filled below fields */
+		if (gd->fb_base && gd->video_top && gd->video_bottom)
+			return 0;
+	}
+
 	gd->video_top = *addrp;
 	for (uclass_find_first_device(UCLASS_VIDEO, &dev);
 	     dev;