summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-08-21 10:18:55 -0600
committerTom Rini <[email protected]>2024-08-26 14:05:37 -0600
commitb5c5923e4e4d526055c559e9bf644c2669335730 (patch)
treef71e6d31e1ebfb5002f4b3b96ecb690158f57d6c /drivers
parent26d3faae2963ec03d4cb8581d410fb5e18172f89 (diff)
video: Add a function to obtain the framebuffer address
Add a new function which returns the framebuffer address of the first video device. This will allow the global_data field top be dropped. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/video-uclass.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index a5aa8dd5295..e358a7949e0 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -152,6 +152,20 @@ int video_reserve(ulong *addrp)
return 0;
}
+ulong video_get_fb(void)
+{
+ struct udevice *dev;
+
+ uclass_find_first_device(UCLASS_VIDEO, &dev);
+ if (dev) {
+ const struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
+
+ return uc_plat->base;
+ }
+
+ return 0;
+}
+
int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend,
int yend, u32 colour)
{