summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fb_cma_helper.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-02-15 10:21:55 +1000
committerDave Airlie <airlied@redhat.com>2013-02-15 10:22:01 +1000
commit3314fdf8b44bd4914050614fa2c56b7c587fabc2 (patch)
tree72f3d96e0042535769faee1a56e6da12d5a570a8 /drivers/gpu/drm/drm_fb_cma_helper.c
parentf934ec8c34b9dcefb5a4f35b0bda33bca289cbe6 (diff)
parenta065b46a01b25d7d364e01e75f7ec2bd9ed5d9cb (diff)
downloadlinux-3314fdf8b44bd4914050614fa2c56b7c587fabc2.tar.bz2
Merge branch 'drm-fb-helper' of git://people.freedesktop.org/~danvet/drm into drm-next
This is the drm fb helper cleanup, mostly motivated by strange things I've seen in my locking rework and the i915 modeset revamp. Compared to the original submission I've reinstated the setup flexibility you'd like to retain, kerneldoc has been reviewed by Laurent Pinchart and Rob Clark reviewed the code changes. Quick overview of the changes: - Cleaned-up library interface for drivers using the fb helper, also simplified the fb allocation callback since no driver supported reallocating the fb on-the-fly. And the fbdev/fbcon code keeps pointers to the old mapping around anyway, so reallocating backing storage will be much more work. - No longer call the crtc helper "disable everything" function at init time, but allow drivers to do so. Motivated by i915's fastboot effort and allows us to drop a bunch of noop dummy functions just to avoid calling NULL function pointers from i915.ko. - Properly clear old state when doing modeset calls, the fb helper left some old modes in there and unconditionally set an fb (even when disabling a crtc). The crtc helpers didn't care, but i915 modeset code can now drop a few special cases. - Full kerneldoc for the fb helper. Yay! - My version of the "don't sleep in panic ->unblank calls". The patch is already in -mm, I guess Andrew can drop it as soon as this pull lands in drm-next. * 'drm-fb-helper' of git://people.freedesktop.org/~danvet/drm: drm/fb-helper: remove unused members of struct drm_fb_helper drm/fb-helper: don't sleep for screen unblank when an oopps is in progress drm/fb-helper: improve kerneldoc drm/<drivers>: simplify ->fb_probe callback drm/fb-helper: streamline drm_fb_helper_single_fb_probe drm/fb-helper: directly call set_par from the hotplug handler drm/fb-helper: fixup set_config semantics drm/i915: rip out helper->disable noop functions drm/fb-helper: don't disable everything in initial_config drm/tegra: don't set up initial fbcon config twice drm/fb-helper: unexport drm_fb_helper_single_fb_probe drm/fb-helper: unexport drm_fb_helper_panic drm/fb-helper: kill drm_fb_helper_restore drm: review locking for drm_fb_helper_restore_fbdev_mode
Diffstat (limited to 'drivers/gpu/drm/drm_fb_cma_helper.c')
-rw-r--r--drivers/gpu/drm/drm_fb_cma_helper.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index 3742bc96421e..e851658f87d5 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -275,23 +275,8 @@ err_drm_gem_cma_free_object:
return ret;
}
-static int drm_fbdev_cma_probe(struct drm_fb_helper *helper,
- struct drm_fb_helper_surface_size *sizes)
-{
- int ret = 0;
-
- if (!helper->fb) {
- ret = drm_fbdev_cma_create(helper, sizes);
- if (ret < 0)
- return ret;
- ret = 1;
- }
-
- return ret;
-}
-
static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
- .fb_probe = drm_fbdev_cma_probe,
+ .fb_probe = drm_fbdev_cma_create,
};
/**
@@ -333,6 +318,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);
if (ret < 0) {
dev_err(dev->dev, "Failed to set inital hw configuration.\n");
@@ -389,8 +377,10 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_fini);
*/
void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma)
{
+ drm_modeset_lock_all(dev);
if (fbdev_cma)
drm_fb_helper_restore_fbdev_mode(&fbdev_cma->fb_helper);
+ drm_modeset_unlock_all(dev);
}
EXPORT_SYMBOL_GPL(drm_fbdev_cma_restore_mode);