diff mbox

[RFC,5/6] drm/imx: Remove local fbdev emulation Kconfig option

Message ID 1425980493-27533-6-git-send-email-architt@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Archit Taneja March 10, 2015, 9:41 a.m. UTC
DRM_IMX_FB_HELPER config is currently used to enable/disable fbdev emulation for
the imx kms driver.

Remove this local config option and use the top level DRM_FBDEV_EMULATION config
option where applicable. Using this config lets us also prevent wrapping around
drm_fb_helper_* calls with #ifdefs in certain places.

We replace the #ifdef in imx_drm_driver_load with CONFIG_DRM_FBDEV_EMULATION.
It's probably okay to get remove the #ifdef itself, but just left it here for
now to be safe. It can be removed after some testing.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/imx/Kconfig        |  9 ---------
 drivers/gpu/drm/imx/imx-drm-core.c | 10 +---------
 2 files changed, 1 insertion(+), 18 deletions(-)

Comments

Philipp Zabel March 10, 2015, 10:54 a.m. UTC | #1
Hi Archit,

thanks for the cleanup!

Am Dienstag, den 10.03.2015, 15:11 +0530 schrieb Archit Taneja:
> DRM_IMX_FB_HELPER config is currently used to enable/disable fbdev emulation for
> the imx kms driver.
> 
> Remove this local config option and use the top level DRM_FBDEV_EMULATION config
> option where applicable. Using this config lets us also prevent wrapping around
> drm_fb_helper_* calls with #ifdefs in certain places.
> 
> We replace the #ifdef in imx_drm_driver_load with CONFIG_DRM_FBDEV_EMULATION.
> It's probably okay to get remove the #ifdef itself, but just left it here for
> now to be safe. It can be removed after some testing.
> 
> Signed-off-by: Archit Taneja <architt@codeaurora.org>

Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
(Both with and without the #ifdef CONFIG_DRM_FBDEV_EMULATION removed.)

Although this is for another patch, I think the legacyfb_depth
module_param should be removed altogether if CONFIG_DRM_FBDEV_EMULATION
is disabled, so maybe that #ifdef should stay.

regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Archit Taneja March 11, 2015, 4:53 a.m. UTC | #2
On 03/10/2015 04:24 PM, Philipp Zabel wrote:
> Hi Archit,
>
> thanks for the cleanup!
>
> Am Dienstag, den 10.03.2015, 15:11 +0530 schrieb Archit Taneja:
>> DRM_IMX_FB_HELPER config is currently used to enable/disable fbdev emulation for
>> the imx kms driver.
>>
>> Remove this local config option and use the top level DRM_FBDEV_EMULATION config
>> option where applicable. Using this config lets us also prevent wrapping around
>> drm_fb_helper_* calls with #ifdefs in certain places.
>>
>> We replace the #ifdef in imx_drm_driver_load with CONFIG_DRM_FBDEV_EMULATION.
>> It's probably okay to get remove the #ifdef itself, but just left it here for
>> now to be safe. It can be removed after some testing.
>>
>> Signed-off-by: Archit Taneja <architt@codeaurora.org>
>
> Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
> (Both with and without the #ifdef CONFIG_DRM_FBDEV_EMULATION removed.)
>

Thanks for testing it out.

> Although this is for another patch, I think the legacyfb_depth
> module_param should be removed altogether if CONFIG_DRM_FBDEV_EMULATION
> is disabled, so maybe that #ifdef should stay.

I'll create a patch for that for future revs of this patch set.

Archit
diff mbox

Patch

diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig
index 33cdddf..e008960 100644
--- a/drivers/gpu/drm/imx/Kconfig
+++ b/drivers/gpu/drm/imx/Kconfig
@@ -10,15 +10,6 @@  config DRM_IMX
 	help
 	  enable i.MX graphics support
 
-config DRM_IMX_FB_HELPER
-	tristate "provide legacy framebuffer /dev/fb0"
-	select DRM_KMS_CMA_HELPER
-	depends on DRM_IMX
-	help
-	  The DRM framework can provide a legacy /dev/fb0 framebuffer
-	  for your device. This is necessary to get a framebuffer console
-	  and also for applications using the legacy framebuffer API
-
 config DRM_IMX_PARALLEL_DISPLAY
 	tristate "Support for parallel displays"
 	select DRM_PANEL
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index a002f53..5cbcb8a 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -60,26 +60,20 @@  EXPORT_SYMBOL_GPL(imx_drm_crtc_id);
 
 static void imx_drm_driver_lastclose(struct drm_device *drm)
 {
-#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
 	struct imx_drm_device *imxdrm = drm->dev_private;
 
 	if (imxdrm->fbhelper)
 		drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
-#endif
 }
 
 static int imx_drm_driver_unload(struct drm_device *drm)
 {
-#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
 	struct imx_drm_device *imxdrm = drm->dev_private;
-#endif
 
 	drm_kms_helper_poll_fini(drm);
 
-#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
 	if (imxdrm->fbhelper)
 		drm_fbdev_cma_fini(imxdrm->fbhelper);
-#endif
 
 	component_unbind_all(drm->dev, drm);
 
@@ -215,11 +209,9 @@  EXPORT_SYMBOL_GPL(imx_drm_encoder_destroy);
 
 static void imx_drm_output_poll_changed(struct drm_device *drm)
 {
-#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
 	struct imx_drm_device *imxdrm = drm->dev_private;
 
 	drm_fbdev_cma_hotplug_event(imxdrm->fbhelper);
-#endif
 }
 
 static struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
@@ -308,7 +300,7 @@  static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
 	 * The fb helper takes copies of key hardware information, so the
 	 * crtcs/connectors/encoders must not change after this point.
 	 */
-#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 	if (legacyfb_depth != 16 && legacyfb_depth != 32) {
 		dev_warn(drm->dev, "Invalid legacyfb_depth.  Defaulting to 16bpp\n");
 		legacyfb_depth = 16;