From 094aa54f0f9e9185babebf95745d71b07a84321c Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 2 May 2019 15:56:03 +0200 Subject: drm: Some ocd in drm_file.c Move the open helper around to avoid the forward decl, and give drm_setup a drm_legacy_ prefix since it's all legacy stuff in there. v2: Move drm_legacy_setup into drm_legacy_misc.c (Chris). The counterpart in the form of drm_legacy_dev_reinit is there already too, plus it fits perfectly into Dave's work of making DRIVER_LEGACY code compile-time optional. Cc: Chris Wilson Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20190502135603.20413-1-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_legacy_misc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'drivers/gpu/drm/drm_legacy_misc.c') diff --git a/drivers/gpu/drm/drm_legacy_misc.c b/drivers/gpu/drm/drm_legacy_misc.c index 2fe786839ca8..18d05a6c12b3 100644 --- a/drivers/gpu/drm/drm_legacy_misc.c +++ b/drivers/gpu/drm/drm_legacy_misc.c @@ -51,6 +51,26 @@ void drm_legacy_destroy_members(struct drm_device *dev) mutex_destroy(&dev->ctxlist_mutex); } +int drm_legacy_setup(struct drm_device * dev) +{ + int ret; + + if (dev->driver->firstopen && + drm_core_check_feature(dev, DRIVER_LEGACY)) { + ret = dev->driver->firstopen(dev); + if (ret != 0) + return ret; + } + + ret = drm_legacy_dma_setup(dev); + if (ret < 0) + return ret; + + + DRM_DEBUG("\n"); + return 0; +} + void drm_legacy_dev_reinit(struct drm_device *dev) { if (dev->irq_enabled) -- cgit v1.2.3