[U-Boot] [RFC PATCH 1/2] video: add a function to acquire the GraphicDevice of cfb_console

Icenowy Zheng icenowy at aosc.xyz
Tue Feb 7 12:58:11 UTC 2017


Sometimes the GraphicDevice of cfb_console is useful at other place.

Add a function to acquire it, so that the graphics hardware (especially
the framebuffer) can be reused.

Signed-off-by: Icenowy Zheng <icenowy at aosc.xyz>
---
 drivers/video/cfb_console.c | 5 +++++
 include/video_fb.h          | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index c0b1b8dc17..c80ed1646f 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -2199,3 +2199,8 @@ int video_get_screen_columns(void)
 {
 	return CONSOLE_COLS;
 }
+
+GraphicDevice *video_get_graphic_device(void)
+{
+	return pGD;
+};
diff --git a/include/video_fb.h b/include/video_fb.h
index b008853f30..29f2b24648 100644
--- a/include/video_fb.h
+++ b/include/video_fb.h
@@ -89,4 +89,6 @@ void video_set_lut (
     unsigned char b               /* blue */
     );
 
+GraphicDevice *video_get_graphic_device(void);
+
 #endif /*_VIDEO_FB_H_ */
-- 
2.11.0



More information about the U-Boot mailing list