From patchwork Tue Feb 7 14:10:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9560197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F98F6047A for ; Tue, 7 Feb 2017 14:11:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21A0B283A6 for ; Tue, 7 Feb 2017 14:11:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1695028410; Tue, 7 Feb 2017 14:11:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 603952840B for ; Tue, 7 Feb 2017 14:10:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFC056E6C3; Tue, 7 Feb 2017 14:10:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A2276E6C3 for ; Tue, 7 Feb 2017 14:10:57 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id o16so5726038wra.2 for ; Tue, 07 Feb 2017 06:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=h/m5qrs5vVF+hjYW0luRYf5YyW+68fxtLYLtpibZJdk=; b=ek0Ms6/r1A83wkZVcYWx4tzT1a2Zaeezup+APkAITQo9y+0lkil/z/pmLrmNVeSw0D u4jjSqP/Q/jzVk2OsTw1NgB/iOLiGM/KE0U9VDP2Gy7bOXJklezcoX9URdbm4mKx2GsY c4GD/EiaY2EW7Er/9RhWFVKnwgkd68owv2w2o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=h/m5qrs5vVF+hjYW0luRYf5YyW+68fxtLYLtpibZJdk=; b=M29aEWxaYFg3DAZYiuAMSDbwhySggnol/tQ2wUE46fFJtz7sEA4HS/LC6I4gzuoNT8 3Lx2VlVJpyGzIdlZJ09a8MI4mEiI/Dj5sCuUyuiKouuW1+LJFekM4eFmf0n32IKfmstH TKhbxL9SCGVLD5JkQu8fp6MSm/kKiSTAJltvqtlgqRgHLhb1m3U0rHZtG2sUItBgIW/W XXyYqdTldPKvX05eyy/W8K1uMY7efb0dOdxVt1X1wpFFBdjW5KHN1UMQrINib7Jih2ge LqwY4QjXvuI2VH9kJUJ2Ns8txLsrTIjoZtatQNV7J1Q4yUzJ9TC3GUt8eYn+ZNa/smHq jGew== X-Gm-Message-State: AIkVDXIROxxdESUJyl/AoLPd5dRjoO/S8lkSSisSh6E5t5nosBT/zYIM+/9fK1sH++dnmA== X-Received: by 10.223.134.7 with SMTP id 7mr13866532wrv.45.1486476655711; Tue, 07 Feb 2017 06:10:55 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:56c9:0:decc:6e78:7e96:b452]) by smtp.gmail.com with ESMTPSA id s17sm7607020wrc.6.2017.02.07.06.10.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 06:10:54 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/2] drm/fb-helper: Explain unload sequence a bit better Date: Tue, 7 Feb 2017 15:10:49 +0100 Message-Id: <20170207141050.1129-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 Cc: Daniel Vetter , Daniel Vetter , Intel Graphics Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP While reviewing Chris' patches to properly cancel our async workers I checked that this happens after the fbdev is already unregistered. That's the case, but I found a small gap in our docs, fill that in. Note that I don't explain what release_fbi does, because that function will disappear in the next patch ... Cc: Chris Wilson Signed-off-by: Daniel Vetter Reviewed-by: Chris Wilson --- drivers/gpu/drm/drm_fb_helper.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index c7fafa175755..5220a7b5e6ff 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -63,7 +63,8 @@ static DEFINE_MUTEX(kernel_fb_helper_lock); * drm_fb_helper_init(), drm_fb_helper_single_add_all_connectors() and * drm_fb_helper_initial_config(). Drivers with fancier requirements than the * default behaviour can override the third step with their own code. - * Teardown is done with drm_fb_helper_fini(). + * Teardown is done with drm_fb_helper_fini() after the fbdev device is + * unregisters using drm_fb_helper_unregister_fbi(). * * At runtime drivers should restore the fbdev console by calling * drm_fb_helper_restore_fbdev_mode_unlocked() from their &drm_driver.lastclose @@ -709,7 +710,7 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, EXPORT_SYMBOL(drm_fb_helper_prepare); /** - * drm_fb_helper_init - initialize a drm_fb_helper structure + * drm_fb_helper_init - initialize a &struct drm_fb_helper * @dev: drm device * @fb_helper: driver-allocated fbdev helper structure to initialize * @crtc_count: maximum number of crtcs to support in this fbdev emulation @@ -823,7 +824,8 @@ EXPORT_SYMBOL(drm_fb_helper_alloc_fbi); * @fb_helper: driver-allocated fbdev helper * * A wrapper around unregister_framebuffer, to release the fb_info - * framebuffer device + * framebuffer device. This must be called before releasing all resources for + * @fb_helper by calling drm_fb_helper_fini(). */ void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper) { @@ -855,6 +857,13 @@ void drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper) } EXPORT_SYMBOL(drm_fb_helper_release_fbi); +/** + * drm_fb_helper_fini - finialize a &struct drm_fb_helper + * @fb_helper: driver-allocated fbdev helper + * + * This cleans up all remaining resources associated with @fb_helper. Must be + * called after drm_fb_helper_unlink_fbi() was called. + */ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) { if (!drm_fbdev_emulation)