From c2d88e06bcb98540bb83fac874574eaa4f320363 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 17 Dec 2018 20:43:00 +0100 Subject: drm: Move the legacy kms disable_all helper to crtc helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not a core function, and the matching atomic functions are also not in the core. Plus the suspend/resume helper is also already there. Needs a tiny bit of open-coding, but less midlayer beats that I think. v2: Rebase onto ast (which gained a new user). Cc: Sam Bobroff Reviewed-by: Alex Deucher Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: David Airlie Cc: Ben Skeggs Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Cc: Rex Zhu Cc: Andrey Grodzovsky Cc: Huang Rui Cc: Shaoyun Liu Cc: Monk Liu Cc: nouveau@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20181217194303.14397-4-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_crtc.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'drivers/gpu/drm/drm_crtc.c') diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index f660819d406e..7dabbaf033a1 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -104,37 +104,6 @@ int drm_crtc_force_disable(struct drm_crtc *crtc) return drm_mode_set_config_internal(&set); } -/** - * drm_crtc_force_disable_all - Forcibly turn off all enabled CRTCs - * @dev: DRM device whose CRTCs to turn off - * - * Drivers may want to call this on unload to ensure that all displays are - * unlit and the GPU is in a consistent, low power state. Takes modeset locks. - * - * Note: This should only be used by non-atomic legacy drivers. For an atomic - * version look at drm_atomic_helper_shutdown(). - * - * Returns: - * Zero on success, error code on failure. - */ -int drm_crtc_force_disable_all(struct drm_device *dev) -{ - struct drm_crtc *crtc; - int ret = 0; - - drm_modeset_lock_all(dev); - drm_for_each_crtc(crtc, dev) - if (crtc->enabled) { - ret = drm_crtc_force_disable(crtc); - if (ret) - goto out; - } -out: - drm_modeset_unlock_all(dev); - return ret; -} -EXPORT_SYMBOL(drm_crtc_force_disable_all); - static unsigned int drm_num_crtcs(struct drm_device *dev) { unsigned int num = 0; -- cgit v1.2.3