Skip to contentSkip to conversation

video: fsl_dcu_fb: refactor init functions

PATCH New Anatolij Gustschin 1 participant 2 messages Jul 25, 2019 – Jul 29, 2019 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 video: fsl_dcu_fb: refactor init functions

From: Igor Opaniuk <[email protected]>

Move dcu-related code to fsl_dcu_probe_common, keep in video_hw_init() only legacy video stack (filling GraphicPanel struct etc.).

Add wrappers for all init functions, that will let to provide struct fb_info as an additional param (needed for further moving it from the global scope to driver private data struct in DM converted driver).

---
Changes in v2:

- fix build breakage with ls1021aiot and ls1021atwr board configs

 board/freescale/ls1021aiot/dcu.c |   9 +--
 board/freescale/ls1021aqds/dcu.c |   6 +-
 board/freescale/ls1021atwr/dcu.c |   5 +-
 board/toradex/colibri_vf/dcu.c   |   6 +-
 drivers/video/fsl_dcu_fb.c       | 107 +++++++++++++++++--------------
 include/fsl_dcu_fb.h             |  12 +++-
 6 files changed, 85 insertions(+), 60 deletions(-)
board/freescale/ls1021aiot/dcu.c +5 -4
index 9aeee0eac9..77732a6ab1 100644
@@ -23,9 +23,10 @@ unsigned int dcu_set_pixel_clock(unsigned int pixclock)
 	return div;
 }
 
-int platform_dcu_init(unsigned int xres, unsigned int yres,
-		const char *port,
-		struct fb_videomode *dcu_fb_videomode)
+int platform_dcu_init(struct fb_info *fbinfo,
+		      unsigned int xres, unsigned int yres,
+		      const char *port,
+		      struct fb_videomode *dcu_fb_videomode)
 {
 	const char *name;
 	unsigned int pixel_format;
@@ -40,7 +41,7 @@ int platform_dcu_init(unsigned int xres, unsigned int yres,
 	printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres);
 
 	pixel_format = 32;
-	fsl_dcu_init(xres, yres, pixel_format);
+	fsl_dcu_init(fbinfo, xres, yres, pixel_format);
 
 	return 0;
 }
board/freescale/ls1021aqds/dcu.c +4 -2
index 14855ea1d9..c4eac5e302 100644
@@ -39,7 +39,9 @@ unsigned int dcu_set_pixel_clock(unsigned int pixclock)
 	return div;
 }
 
-int platform_dcu_init(unsigned int xres, unsigned int yres,
+int platform_dcu_init(struct fb_info *fbinfo,
+		      unsigned int xres,
+		      unsigned int yres,
 		      const char *port,
 		      struct fb_videomode *dcu_fb_videomode)
 {
@@ -85,7 +87,7 @@ int platform_dcu_init(unsigned int xres, unsigned int yres,
 	printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres);
 
 	pixel_format = 32;
-	fsl_dcu_init(xres, yres, pixel_format);
+	fsl_dcu_init(fbinfo, xres, yres, pixel_format);
 
 	return 0;
 }
board/freescale/ls1021atwr/dcu.c +3 -2
index e1191f134c..bdf7f7645c 100644
@@ -23,7 +23,8 @@ unsigned int dcu_set_pixel_clock(unsigned int pixclock)
 	return div;
 }
 
-int platform_dcu_init(unsigned int xres, unsigned int yres,
+int platform_dcu_init(struct fb_info *fbinfo,
+		      unsigned int xres, unsigned int yres,
 		      const char *port,
 		      struct fb_videomode *dcu_fb_videomode)
 {
@@ -40,7 +41,7 @@ int platform_dcu_init(unsigned int xres, unsigned int yres,
 	printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres);
 
 	pixel_format = 32;
-	fsl_dcu_init(xres, yres, pixel_format);
+	fsl_dcu_init(fbinfo, xres, yres, pixel_format);
 
 	return 0;
 }
board/toradex/colibri_vf/dcu.c +4 -2
index c36e90cd22..c688ed79ff 100644
@@ -26,11 +26,13 @@ unsigned int dcu_set_pixel_clock(unsigned int pixclock)
 	return div;
 }
 
-int platform_dcu_init(unsigned int xres, unsigned int yres,
+int platform_dcu_init(struct fb_info *fbinfo,
+		      unsigned int xres,
+		      unsigned int yres,
 		      const char *port,
 		      struct fb_videomode *dcu_fb_videomode)
 {
-	fsl_dcu_init(xres, yres, 32);
+	fsl_dcu_init(fbinfo, xres, yres, 32);
 
 	return 0;
 }
drivers/video/fsl_dcu_fb.c +60 -47

186 lines not on this page · raw message

include/fsl_dcu_fb.h +9 -3
index 2dd5f54c3e..7a5347a924 100644
@@ -6,11 +6,17 @@
  */
 #include <linux/fb.h>
 
-int fsl_dcu_init(unsigned int xres, unsigned int yres,
+int fsl_dcu_init(struct fb_info *fbinfo,
+		 unsigned int xres,
+		 unsigned int yres,
 		 unsigned int pixel_format);
+
 int fsl_dcu_fixedfb_setup(void *blob);
 
 /* Prototypes for external board-specific functions */
-int platform_dcu_init(unsigned int xres, unsigned int yres,
-		      const char *port, struct fb_videomode *dcu_fb_videomode);
+int platform_dcu_init(struct fb_info *fbinfo,
+		      unsigned int xres,
+		      unsigned int yres,
+		      const char *port,
+		      struct fb_videomode *dcu_fb_videomode);
 unsigned int dcu_set_pixel_clock(unsigned int pixclock);
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/4 video: fsl_dcu_fb: refactor init functions

On Thu, 25 Jul 2019 15:22:26 +0200
Anatolij Gustschin agust at denx.de wrote:
...

Quoted 11 lines

Changes in v2:

- fix build breakage with ls1021aiot and ls1021atwr board configs

 board/freescale/ls1021aiot/dcu.c |   9 +--
 board/freescale/ls1021aqds/dcu.c |   6 +-
 board/freescale/ls1021atwr/dcu.c |   5 +-
 board/toradex/colibri_vf/dcu.c   |   6 +-
 drivers/video/fsl_dcu_fb.c       | 107 +++++++++++++++++--------------
 include/fsl_dcu_fb.h             |  12 +++-
 6 files changed, 85 insertions(+), 60 deletions(-)

Applied to u-boot-video/master, thanks!

--
Anatolij