drm/fsl-dcu: remove separate compilation unit for fbdev emulation
Subsystems (3)
Stefan Agner
maintainerPATCH 1/2 drm/fsl-dcu: remove separate compilation unit for fbdev emulation
The separate file fsl_dcu_drm_fbdev.c only initialized fbdev emulation which is a one-line operation. There is not much more code on sight which justifies a separate file, hence call the initialization helper directly from the drv file.
--- drivers/gpu/drm/fsl-dcu/Makefile | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c | 23 ----------------------- 4 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c
drivers/gpu/drm/fsl-dcu/Makefile +0 -1
@@ -3,6 +3,5 @@ fsl-dcu-drm-y := fsl_dcu_drm_drv.o \ fsl_dcu_drm_rgb.o \ fsl_dcu_drm_plane.o \ fsl_dcu_drm_crtc.o \ - fsl_dcu_drm_fbdev.o \ fsl_tcon.o obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu-drm.o
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
@@ -85,7 +85,7 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) goto done; dev->irq_enabled = true; -fsl_dcu_fbdev_init (dev); + fsl_dev->fbdev =drm_fbdev_cma_init (dev,24 ,1 ,1 );return 0 ; done:
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h +0 -1
@@ -197,7 +197,6 @@ struct fsl_dcu_drm_device { struct drm_atomic_state *state; }; -void fsl_dcu_fbdev_init (struct drm_device *dev);int fsl_dcu_drm_modeset_init (struct fsl_dcu_drm_device *fsl_dev);#endif /* __FSL_DCU_DRM_DRV_H__ */
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c deleted +0 -23
@@ -1,23 +0,0 @@ -/* -* Copyright 2015 Freescale Semiconductor, Inc. -* -* Freescale DCU drm device driver -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -*/ - -#include <drm/drmP.h> -#include <drm/drm_fb_cma_helper.h> - -#include "fsl_dcu_drm_drv.h" - -/* initialize fbdev helper */ -void fsl_dcu_fbdev_init (struct drm_device *dev) -{ -struct fsl_dcu_drm_device *fsl_dev =dev_get_drvdata (dev->dev); - - fsl_dev->fbdev =drm_fbdev_cma_init (dev,24 ,1 ,1 ); -}
Signature · 6 lines
2.10.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Stefan Agner
maintainerPATCH 2/2 drm/fsl-dcu: introduce kernel parameter to specify fbdev depth
Add a kernel parameter legancyfb_depth (like the i.MX drm driver) to control the legancy fbdev depth. Default to the so far hard coded depth of 24-bit. Currently changing the framebuffer depth is not possible from user space when using the fbdev emulation layer... This provides a rudimentary mechanism to change depth without having to change kernel code.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +15 -1
@@ -32,6 +32,9 @@#include "fsl_dcu_drm_drv.h" #include "fsl_tcon.h" +static int legacyfb_depth =24 ; +module_param (legacyfb_depth, int,0444 ); +static bool fsl_dcu_drm_is_volatile_reg (struct device *dev,unsigned int reg) {if (reg ==DCU_INT_STATUS || reg ==DCU_UPDATE_MODE )
@@ -85,7 +88,18 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) goto done; dev->irq_enabled = true; - fsl_dev->fbdev =drm_fbdev_cma_init (dev,24 ,1 ,1 ); +if (legacyfb_depth !=16 && legacyfb_depth !=24 && + legacyfb_depth !=32 ) { +dev_warn (dev->dev, +"Invalid legacyfb_depth. Defaulting to 24bpp\n" ); + legacyfb_depth =24 ; + } + fsl_dev->fbdev =drm_fbdev_cma_init (dev, legacyfb_depth,1 ,1 ); +if (IS_ERR (fsl_dev->fbdev)) { + ret =PTR_ERR (fsl_dev->fbdev); + fsl_dev->fbdev =NULL ; + goto done; + }return 0 ; done:
Signature · 1 line
2.10.2
Stefan Agner
maintainerQuoted 4 lines · Stefan Agner
The separate file
fsl_dcu_drm_fbdev.conly initialized fbdev emulation which is a one-line operation. There is not much more code on sight which justifies a separate file, hence call the initialization helper directly from the drv file.
Both applied to my for-next branch.
Quoted 69 lines
Signed-off-by Stefan Agner <[email protected]>--- drivers/gpu/drm/fsl-dcu/Makefile | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 1 - drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c | 23 ----------------------- 4 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.cdrivers/gpu/drm/fsl-dcu/Makefile +0
-1@@ -3,6 +3,5 @@ fsl-dcu-drm-y := fsl_dcu_drm_drv.o \ fsl_dcu_drm_rgb.o \ fsl_dcu_drm_plane.o \ fsl_dcu_drm_crtc.o \ - fsl_dcu_drm_fbdev.o \ fsl_tcon.o obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu-drm.odrivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1
-1@@ -85,7 +85,7 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) goto done; dev->irq_enabled = true; -fsl_dcu_fbdev_init (dev); + fsl_dev->fbdev =drm_fbdev_cma_init (dev,24 ,1 ,1 );return 0 ;done:
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h +0
-1@@ -197,7 +197,6 @@ struct fsl_dcu_drm_device { struct drm_atomic_state *state; }; -void fsl_dcu_fbdev_init (struct drm_device *dev);int fsl_dcu_drm_modeset_init (struct fsl_dcu_drm_device *fsl_dev);#endif /* __FSL_DCU_DRM_DRV_H__ */ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c deleted +0
-13@@ -1,23 +0,0 @@ -/* -* Copyright 2015 Freescale Semiconductor, Inc. -* -* Freescale DCU drm device driver -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -*/ - -#include <drm/drmP.h> -#include <drm/drm_fb_cma_helper.h>
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c line 23
Quoted 10 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_fbdev.c deleted +0
-10- -#include "fsl_dcu_drm_drv.h" - -/* initialize fbdev helper */ -void fsl_dcu_fbdev_init (struct drm_device *dev) -{ -struct fsl_dcu_drm_device *fsl_dev =dev_get_drvdata (dev->dev); - - fsl_dev->fbdev =drm_fbdev_cma_init (dev,24 ,1 ,1 ); -}
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel