Commit 76a39dbf authored by Daniel Vetter's avatar Daniel Vetter

drm/fb-helper: don't disable everything in initial_config

This should be done in the drivers for two reasons:
- it gets in the way of fastboot efforts
- it links the fb helpers with the crtc helpers instead of going
  through the real interface vfuncs, forcing i915 to fake all the
  ->disable callbacks used by the crtc helper to avoid ugly Oopsen

v2: Resolve conflicts since drivers still call
drm_fb_helper_single_add_all_connectors.
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 203cb501
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <drm/drmP.h> #include <drm/drmP.h>
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_fb_helper.h> #include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>
#include "ast_drv.h" #include "ast_drv.h"
static void ast_dirty_update(struct ast_fbdev *afbdev, static void ast_dirty_update(struct ast_fbdev *afbdev,
...@@ -314,6 +315,10 @@ int ast_fbdev_init(struct drm_device *dev) ...@@ -314,6 +315,10 @@ int ast_fbdev_init(struct drm_device *dev)
} }
drm_fb_helper_single_add_all_connectors(&afbdev->helper); drm_fb_helper_single_add_all_connectors(&afbdev->helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
drm_fb_helper_initial_config(&afbdev->helper, 32); drm_fb_helper_initial_config(&afbdev->helper, 32);
return 0; return 0;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <drm/drmP.h> #include <drm/drmP.h>
#include <drm/drm_fb_helper.h> #include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>
#include <linux/fb.h> #include <linux/fb.h>
...@@ -291,6 +292,9 @@ int cirrus_fbdev_init(struct cirrus_device *cdev) ...@@ -291,6 +292,9 @@ int cirrus_fbdev_init(struct cirrus_device *cdev)
return ret; return ret;
} }
drm_fb_helper_single_add_all_connectors(&gfbdev->helper); drm_fb_helper_single_add_all_connectors(&gfbdev->helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(cdev->dev);
drm_fb_helper_initial_config(&gfbdev->helper, bpp_sel); drm_fb_helper_initial_config(&gfbdev->helper, bpp_sel);
return 0; return 0;
......
...@@ -333,6 +333,9 @@ struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev, ...@@ -333,6 +333,9 @@ struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
} }
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
ret = drm_fb_helper_initial_config(helper, preferred_bpp); ret = drm_fb_helper_initial_config(helper, preferred_bpp);
if (ret < 0) { if (ret < 0) {
dev_err(dev->dev, "Failed to set inital hw configuration.\n"); dev_err(dev->dev, "Failed to set inital hw configuration.\n");
......
...@@ -1360,9 +1360,6 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) ...@@ -1360,9 +1360,6 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
int count = 0; int count = 0;
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(fb_helper->dev);
drm_fb_helper_parse_command_line(fb_helper); drm_fb_helper_parse_command_line(fb_helper);
count = drm_fb_helper_probe_connector_modes(fb_helper, count = drm_fb_helper_probe_connector_modes(fb_helper,
......
...@@ -295,6 +295,9 @@ int exynos_drm_fbdev_init(struct drm_device *dev) ...@@ -295,6 +295,9 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
} }
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP); ret = drm_fb_helper_initial_config(helper, PREFERRED_BPP);
if (ret < 0) { if (ret < 0) {
DRM_ERROR("failed to set up hw configuration.\n"); DRM_ERROR("failed to set up hw configuration.\n");
......
...@@ -616,6 +616,10 @@ int psb_fbdev_init(struct drm_device *dev) ...@@ -616,6 +616,10 @@ int psb_fbdev_init(struct drm_device *dev)
INTELFB_CONN_LIMIT); INTELFB_CONN_LIMIT);
drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper); drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32); drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32);
return 0; return 0;
} }
......
...@@ -258,6 +258,9 @@ void intel_fbdev_initial_config(struct drm_device *dev) ...@@ -258,6 +258,9 @@ void intel_fbdev_initial_config(struct drm_device *dev)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
/* Due to peculiar init order wrt to hpd handling this is separate. */ /* Due to peculiar init order wrt to hpd handling this is separate. */
drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 32); drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 32);
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <drm/drmP.h> #include <drm/drmP.h>
#include <drm/drm_fb_helper.h> #include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>
#include <linux/fb.h> #include <linux/fb.h>
...@@ -278,6 +279,10 @@ int mgag200_fbdev_init(struct mga_device *mdev) ...@@ -278,6 +279,10 @@ int mgag200_fbdev_init(struct mga_device *mdev)
return ret; return ret;
} }
drm_fb_helper_single_add_all_connectors(&mfbdev->helper); drm_fb_helper_single_add_all_connectors(&mfbdev->helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(mdev->dev);
drm_fb_helper_initial_config(&mfbdev->helper, 32); drm_fb_helper_initial_config(&mfbdev->helper, 32);
return 0; return 0;
......
...@@ -491,6 +491,9 @@ nouveau_fbcon_init(struct drm_device *dev) ...@@ -491,6 +491,9 @@ nouveau_fbcon_init(struct drm_device *dev)
else else
preferred_bpp = 32; preferred_bpp = 32;
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp); drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp);
return 0; return 0;
} }
......
...@@ -379,6 +379,10 @@ int radeon_fbdev_init(struct radeon_device *rdev) ...@@ -379,6 +379,10 @@ int radeon_fbdev_init(struct radeon_device *rdev)
} }
drm_fb_helper_single_add_all_connectors(&rfbdev->helper); drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(rdev->ddev);
drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel); drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
return 0; return 0;
} }
......
...@@ -619,6 +619,10 @@ int udl_fbdev_init(struct drm_device *dev) ...@@ -619,6 +619,10 @@ int udl_fbdev_init(struct drm_device *dev)
} }
drm_fb_helper_single_add_all_connectors(&ufbdev->helper); drm_fb_helper_single_add_all_connectors(&ufbdev->helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
drm_fb_helper_initial_config(&ufbdev->helper, bpp_sel); drm_fb_helper_initial_config(&ufbdev->helper, bpp_sel);
return 0; return 0;
} }
......
...@@ -369,6 +369,10 @@ struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev) ...@@ -369,6 +369,10 @@ struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev)
} }
drm_fb_helper_single_add_all_connectors(helper); drm_fb_helper_single_add_all_connectors(helper);
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(dev);
drm_fb_helper_initial_config(helper, 32); drm_fb_helper_initial_config(helper, 32);
priv->fbdev = helper; priv->fbdev = helper;
......
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