提交 3e68439b 编写于 作者: R Russell King

imx-drm: imx-drm-core: add core hotplug connector support

Add core imx-drm support for hotplug connector support.  We need to
setup the poll helper after we've setup the connectors; the helper
scans the connectors to determine their capabilities.
Acked-by: NPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: NShawn Guo <shawn.guo@linaro.org>
Reviewed-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 e7d6231e
...@@ -69,7 +69,11 @@ static int imx_drm_driver_unload(struct drm_device *drm) ...@@ -69,7 +69,11 @@ static int imx_drm_driver_unload(struct drm_device *drm)
{ {
#if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER) #if IS_ENABLED(CONFIG_DRM_IMX_FB_HELPER)
struct imx_drm_device *imxdrm = drm->dev_private; 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) if (imxdrm->fbhelper)
drm_fbdev_cma_fini(imxdrm->fbhelper); drm_fbdev_cma_fini(imxdrm->fbhelper);
#endif #endif
...@@ -77,7 +81,6 @@ static int imx_drm_driver_unload(struct drm_device *drm) ...@@ -77,7 +81,6 @@ static int imx_drm_driver_unload(struct drm_device *drm)
component_unbind_all(drm->dev, drm); component_unbind_all(drm->dev, drm);
drm_vblank_cleanup(drm); drm_vblank_cleanup(drm);
drm_kms_helper_poll_fini(drm);
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
return 0; return 0;
...@@ -213,8 +216,18 @@ void imx_drm_encoder_destroy(struct drm_encoder *encoder) ...@@ -213,8 +216,18 @@ void imx_drm_encoder_destroy(struct drm_encoder *encoder)
} }
EXPORT_SYMBOL_GPL(imx_drm_encoder_destroy); 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 = { static struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
.fb_create = drm_fb_cma_create, .fb_create = drm_fb_cma_create,
.output_poll_changed = imx_drm_output_poll_changed,
}; };
/* /*
...@@ -259,8 +272,6 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) ...@@ -259,8 +272,6 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
drm_mode_config_init(drm); drm_mode_config_init(drm);
drm_kms_helper_poll_init(drm);
ret = drm_vblank_init(drm, MAX_CRTC); ret = drm_vblank_init(drm, MAX_CRTC);
if (ret) if (ret)
goto err_kms; goto err_kms;
...@@ -313,6 +324,9 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) ...@@ -313,6 +324,9 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
goto err_unbind; goto err_unbind;
} }
#endif #endif
drm_kms_helper_poll_init(drm);
return 0; return 0;
err_unbind: err_unbind:
...@@ -320,7 +334,6 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) ...@@ -320,7 +334,6 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
err_vblank: err_vblank:
drm_vblank_cleanup(drm); drm_vblank_cleanup(drm);
err_kms: err_kms:
drm_kms_helper_poll_fini(drm);
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册