diff options
author | Vincent Abriou <vincent.abriou@st.com> | 2017-01-04 15:06:51 +0300 |
---|---|---|
committer | Vincent Abriou <vincent.abriou@st.com> | 2017-01-06 17:12:03 +0300 |
commit | 8953e9ee0ce5ff466c900ba70fd582ac0d4155cc (patch) | |
tree | aa89eb683176401163ce146d761eb91f4adaf595 /drivers/gpu/drm/sti/sti_drv.c | |
parent | a69e466b0666d611e7bacd4f2c17e10d0b8b9c47 (diff) | |
download | linux-8953e9ee0ce5ff466c900ba70fd582ac0d4155cc.tar.xz |
drm/sti: create fbdev at binding
Do not wait for a hot plug event to create fbdev.
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Diffstat (limited to 'drivers/gpu/drm/sti/sti_drv.c')
-rw-r--r-- | drivers/gpu/drm/sti/sti_drv.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index ff71e25ab5bf..c584d4d03fff 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -252,19 +252,7 @@ static void sti_output_poll_changed(struct drm_device *ddev) { struct sti_private *private = ddev->dev_private; - if (!ddev->mode_config.num_connector) - return; - - if (private->fbdev) { - drm_fbdev_cma_hotplug_event(private->fbdev); - return; - } - - private->fbdev = drm_fbdev_cma_init(ddev, 32, - ddev->mode_config.num_crtc, - ddev->mode_config.num_connector); - if (IS_ERR(private->fbdev)) - private->fbdev = NULL; + drm_fbdev_cma_hotplug_event(private->fbdev); } static const struct drm_mode_config_funcs sti_mode_config_funcs = { @@ -382,6 +370,8 @@ static void sti_cleanup(struct drm_device *ddev) static int sti_bind(struct device *dev) { struct drm_device *ddev; + struct sti_private *private; + struct drm_fbdev_cma *fbdev; int ret; ddev = drm_dev_alloc(&sti_driver, dev); @@ -404,6 +394,17 @@ static int sti_bind(struct device *dev) drm_mode_config_reset(ddev); + private = ddev->dev_private; + if (ddev->mode_config.num_connector) { + fbdev = drm_fbdev_cma_init(ddev, 32, ddev->mode_config.num_crtc, + ddev->mode_config.num_connector); + if (IS_ERR(fbdev)) { + DRM_DEBUG_DRIVER("Warning: fails to create fbdev\n"); + fbdev = NULL; + } + private->fbdev = fbdev; + } + return 0; err_register: |