From patchwork Mon May 20 08:21:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10950399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B59C1912 for ; Mon, 20 May 2019 08:23:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A66C928641 for ; Mon, 20 May 2019 08:23:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A6FE2874B; Mon, 20 May 2019 08:23:16 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 EB41C28641 for ; Mon, 20 May 2019 08:23:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5933F8929C; Mon, 20 May 2019 08:22:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3433E89268 for ; Mon, 20 May 2019 08:22:37 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id f37so22466529edb.13 for ; Mon, 20 May 2019 01:22:37 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=l0tIhN6YywxcaWi2QH0yYGfpMycfWUEO/RS9r5SAA9E=; b=GgZEmixvFM2QQkljBC0tbtsvY09M2k7CmrRSn24JI+iTxLs7XSwGi0M7dbEhrV5A12 IomJxIajSH3nXsC39Fc8M0sSmzSotJBOb/2JxQVXsdOYWNJhgi6g9bM6GqVQUJw/fTpx NUJNgRio8wJg0KOhZSk44vYLSkfRO1hSavMUSrcJo4FfWyIAIxxTwgTBhzspZS9LEcK1 B9V80Uj/r56tlcDAGY5Ayxv+0T/EzPFFJ8wDmCggiCVj4+H7VL2lKT0NQ9DNgBx0XP9r mdpgniapqqO8NL0rGp0DTCZiy1zuMWOQ4LnAvRXlUJ3wu3lmPrKc0v5UZQmPNqZiMfj2 XDRg== X-Gm-Message-State: APjAAAU69beJmrgDXdqfCNcwN0UIOr7hLe0+nfgHEkHFmNcVrpqgVTKd NO64V+UXZGEifvynyJDoxuu7a6Z7ezs= X-Google-Smtp-Source: APXvYqyjBA7PktU+J9tWW8mtYlNlPAkzMVk0guYtE003G2qGc0oE2kDGJAaVWmK69a2pyHuXZSNPvA== X-Received: by 2002:a17:906:d053:: with SMTP id bo19mr32339032ejb.86.1558340554401; Mon, 20 May 2019 01:22:34 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id t25sm3021263ejx.8.2019.05.20.01.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 01:22:33 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 10/33] fbcon: call fbcon_fb_(un)registered directly Date: Mon, 20 May 2019 10:21:53 +0200 Message-Id: <20190520082216.26273-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520082216.26273-1-daniel.vetter@ffwll.ch> References: <20190520082216.26273-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l0tIhN6YywxcaWi2QH0yYGfpMycfWUEO/RS9r5SAA9E=; b=akTeaLvBQ6wsq1iSx7uVMLfY4jeOwDxuxje6jNqnJq8nwKvXx2+BxVJnG7NALR5v9x xSRyR8+rVvptXBeUuUt41AoQ8UQveKZ6PNqC8P3dEvq5vRqOIIriOpQfAG9s7cEpouM+ G+j8lUIMNOMJMcLAw4VzWDGlVZcroZFqxJB40= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Daniel Vetter , Intel Graphics Development , LKML , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= , Yisheng Xie , Hans de Goede , Mikulas Patocka , Thomas Zimmermann , Greg Kroah-Hartman , Daniel Vetter , Peter Rosin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP With commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev we have a static dependency between fbcon and fbdev, and we can replace the indirection through the notifier chain with a function call. Signed-off-by: Daniel Vetter Cc: Bartlomiej Zolnierkiewicz Cc: Daniel Vetter Cc: Hans de Goede Cc: Greg Kroah-Hartman Cc: "Noralf Trønnes" Cc: Yisheng Xie Cc: Peter Rosin Cc: "Michał Mirosław" Cc: Thomas Zimmermann Cc: Mikulas Patocka Cc: linux-fbdev@vger.kernel.org --- drivers/video/fbdev/core/fbcon.c | 14 +++----------- drivers/video/fbdev/core/fbmem.c | 9 ++------- include/linux/fb.h | 4 ---- include/linux/fbcon.h | 4 ++++ 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index a1be589b692f..95af6bd783e8 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3115,14 +3115,14 @@ static int fbcon_fb_unbind(int idx) } /* called with console_lock held */ -static int fbcon_fb_unregistered(struct fb_info *info) +void fbcon_fb_unregistered(struct fb_info *info) { int i, idx; WARN_CONSOLE_UNLOCKED(); if (deferred_takeover) - return 0; + return; idx = info->node; for (i = first_fb_vc; i <= last_fb_vc; i++) { @@ -3151,8 +3151,6 @@ static int fbcon_fb_unregistered(struct fb_info *info) if (!num_registered_fb) do_unregister_con_driver(&fb_con); - - return 0; } /* called with console_lock held */ @@ -3211,7 +3209,7 @@ static inline void fbcon_select_primary(struct fb_info *info) #endif /* CONFIG_FRAMEBUFFER_DETECT_PRIMARY */ /* called with console_lock held */ -static int fbcon_fb_registered(struct fb_info *info) +int fbcon_fb_registered(struct fb_info *info) { int ret = 0, i, idx; @@ -3355,12 +3353,6 @@ static int fbcon_event_notify(struct notifier_block *self, idx = info->node; ret = fbcon_fb_unbind(idx); break; - case FB_EVENT_FB_REGISTERED: - ret = fbcon_fb_registered(info); - break; - case FB_EVENT_FB_UNREGISTERED: - ret = fbcon_fb_unregistered(info); - break; case FB_EVENT_SET_CONSOLE_MAP: /* called with console lock held */ con2fb = event->data; diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index fc3d34a8ea5b..ae2db31eeba7 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1660,7 +1660,6 @@ MODULE_PARM_DESC(lockless_register_fb, static int do_register_framebuffer(struct fb_info *fb_info) { int i, ret; - struct fb_event event; struct fb_videomode mode; if (fb_check_foreignness(fb_info)) @@ -1723,7 +1722,6 @@ static int do_register_framebuffer(struct fb_info *fb_info) fb_add_videomode(&mode, &fb_info->modelist); registered_fb[i] = fb_info; - event.info = fb_info; if (!lockless_register_fb) console_lock(); else @@ -1732,9 +1730,8 @@ static int do_register_framebuffer(struct fb_info *fb_info) ret = -ENODEV; goto unlock_console; } - ret = 0; - fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); + ret = fbcon_fb_registered(fb_info); unlock_fb_info(fb_info); unlock_console: if (!lockless_register_fb) @@ -1771,7 +1768,6 @@ static int __unlink_framebuffer(struct fb_info *fb_info); static int do_unregister_framebuffer(struct fb_info *fb_info) { - struct fb_event event; int ret; ret = unbind_console(fb_info); @@ -1789,9 +1785,8 @@ static int do_unregister_framebuffer(struct fb_info *fb_info) registered_fb[fb_info->node] = NULL; num_registered_fb--; fb_cleanup_device(fb_info); - event.info = fb_info; console_lock(); - fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event); + fbcon_fb_unregistered(fb_info); console_unlock(); /* this may free fb info */ diff --git a/include/linux/fb.h b/include/linux/fb.h index f52ef0ad6781..701abaf79c87 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -136,10 +136,6 @@ struct fb_cursor_user { #define FB_EVENT_RESUME 0x03 /* An entry from the modelist was removed */ #define FB_EVENT_MODE_DELETE 0x04 -/* A driver registered itself */ -#define FB_EVENT_FB_REGISTERED 0x05 -/* A driver unregistered itself */ -#define FB_EVENT_FB_UNREGISTERED 0x06 /* CONSOLE-SPECIFIC: get console to framebuffer mapping */ #define FB_EVENT_GET_CONSOLE_MAP 0x07 /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ diff --git a/include/linux/fbcon.h b/include/linux/fbcon.h index f68a7db14165..94a71e9e1257 100644 --- a/include/linux/fbcon.h +++ b/include/linux/fbcon.h @@ -4,9 +4,13 @@ #ifdef CONFIG_FRAMEBUFFER_CONSOLE void __init fb_console_init(void); void __exit fb_console_exit(void); +int fbcon_fb_registered(struct fb_info *info); +void fbcon_fb_unregistered(struct fb_info *info); #else static inline void fb_console_init(void) {} static inline void fb_console_exit(void) {} +static inline int fbcon_fb_registered(struct fb_info *info) { return 0; } +static inline void fbcon_fb_unregistered(struct fb_info *info) {} #endif #endif /* _LINUX_FBCON_H */