diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-03-28 07:52:38 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-04-04 08:24:47 -0400 |
commit | 3eb578e2d5ab244085638c08c340e9e0084e8688 (patch) | |
tree | e2d642663c684c5ee44418915a4399fe52119bb6 /drivers/gpu/drm/exynos | |
parent | e49640da76b5e143b809720bff8f35ad5f2d8cc6 (diff) |
drm/exynos: disallow fbdev initialization if no device is connected
This patch adds explicit check if there is a connector with
connected status before fbdev initialization. It prevents creation
of default fbdev 1024x768 which is unusable on panels with bigger resolutions.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 5fa342e5f963..addbf7536da4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -237,6 +237,24 @@ static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { | |||
237 | .fb_probe = exynos_drm_fbdev_create, | 237 | .fb_probe = exynos_drm_fbdev_create, |
238 | }; | 238 | }; |
239 | 239 | ||
240 | bool exynos_drm_fbdev_is_anything_connected(struct drm_device *dev) | ||
241 | { | ||
242 | struct drm_connector *connector; | ||
243 | bool ret = false; | ||
244 | |||
245 | mutex_lock(&dev->mode_config.mutex); | ||
246 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | ||
247 | if (connector->status != connector_status_connected) | ||
248 | continue; | ||
249 | |||
250 | ret = true; | ||
251 | break; | ||
252 | } | ||
253 | mutex_unlock(&dev->mode_config.mutex); | ||
254 | |||
255 | return ret; | ||
256 | } | ||
257 | |||
240 | int exynos_drm_fbdev_init(struct drm_device *dev) | 258 | int exynos_drm_fbdev_init(struct drm_device *dev) |
241 | { | 259 | { |
242 | struct exynos_drm_fbdev *fbdev; | 260 | struct exynos_drm_fbdev *fbdev; |
@@ -248,6 +266,9 @@ int exynos_drm_fbdev_init(struct drm_device *dev) | |||
248 | if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector) | 266 | if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector) |
249 | return 0; | 267 | return 0; |
250 | 268 | ||
269 | if (!exynos_drm_fbdev_is_anything_connected(dev)) | ||
270 | return 0; | ||
271 | |||
251 | fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); | 272 | fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); |
252 | if (!fbdev) | 273 | if (!fbdev) |
253 | return -ENOMEM; | 274 | return -ENOMEM; |