aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/video-uclass.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-03-09 20:46:00 +0100
committerAnatolij Gustschin <agust@denx.de>2022-03-09 21:26:54 +0100
commitbd0df8236987df03e6131f923e31c3d9f943d086 (patch)
treee12bc12a96174de643ac834631904437206e5767 /drivers/video/video-uclass.c
parent515a2f7c021fbe1c3dcf897d7337800f721f87b5 (diff)
downloadu-boot-bd0df8236987df03e6131f923e31c3d9f943d086.zip
u-boot-bd0df8236987df03e6131f923e31c3d9f943d086.tar.gz
u-boot-bd0df8236987df03e6131f923e31c3d9f943d086.tar.bz2
video: Allow drivers to allocate the frame buffer themselves
When plat->base is set by driver then skip frame buffer reservation and allocation. Signed-off-by: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'drivers/video/video-uclass.c')
-rw-r--r--drivers/video/video-uclass.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 7d499bc..88797d4 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -33,7 +33,8 @@
* information represents the requires size and alignment of the frame buffer
* for the device. The values can be an over-estimate but cannot be too
* small. The actual values will be suppled (in the same manner) by the bind()
- * method after relocation.
+ * method after relocation. Additionally driver can allocate frame buffer
+ * itself by setting plat->base.
*
* This information is then picked up by video_reserve() which works out how
* much memory is needed for all devices. This is allocated between
@@ -78,6 +79,10 @@ static ulong alloc_fb(struct udevice *dev, ulong *addrp)
if (!plat->size)
return 0;
+ /* Allow drivers to allocate the frame buffer themselves */
+ if (plat->base)
+ return 0;
+
align = plat->align ? plat->align : 1 << 20;
base = *addrp - plat->size;
base &= ~(align - 1);