Commit 8953e9ee authored by Vincent Abriou's avatar Vincent Abriou

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: default avatarVincent Abriou <vincent.abriou@st.com>
parent a69e466b
...@@ -252,19 +252,7 @@ static void sti_output_poll_changed(struct drm_device *ddev) ...@@ -252,19 +252,7 @@ static void sti_output_poll_changed(struct drm_device *ddev)
{ {
struct sti_private *private = ddev->dev_private; struct sti_private *private = ddev->dev_private;
if (!ddev->mode_config.num_connector) drm_fbdev_cma_hotplug_event(private->fbdev);
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;
} }
static const struct drm_mode_config_funcs sti_mode_config_funcs = { static const struct drm_mode_config_funcs sti_mode_config_funcs = {
...@@ -382,6 +370,8 @@ static void sti_cleanup(struct drm_device *ddev) ...@@ -382,6 +370,8 @@ static void sti_cleanup(struct drm_device *ddev)
static int sti_bind(struct device *dev) static int sti_bind(struct device *dev)
{ {
struct drm_device *ddev; struct drm_device *ddev;
struct sti_private *private;
struct drm_fbdev_cma *fbdev;
int ret; int ret;
ddev = drm_dev_alloc(&sti_driver, dev); ddev = drm_dev_alloc(&sti_driver, dev);
...@@ -404,6 +394,17 @@ static int sti_bind(struct device *dev) ...@@ -404,6 +394,17 @@ static int sti_bind(struct device *dev)
drm_mode_config_reset(ddev); 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; return 0;
err_register: err_register:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment