From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: David Herrmann <dh.herrmann@googlemail.com>
Cc: linux-serial@vger.kernel.org,
Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 05/10] fblog: add framebuffer helpers
Date: Sat, 16 Jun 2012 22:33:34 +0000 [thread overview]
Message-ID: <20120617003334.765f6226@neptune.home> (raw)
In-Reply-To: <1339884266-9201-6-git-send-email-dh.herrmann@googlemail.com>
On Sun, 17 June 2012 David Herrmann <dh.herrmann@googlemail.com> wrote:
> These helpers scan the system for all available framebuffers and register
> or unregister them. This is needed during startup and stopping fblog so we
> are aware of all connected displays.
>
> The third helper handles mode changes by rescanning the mode and adjusting
> the buffer size.
>
> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
> ---
> drivers/video/console/fblog.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/video/console/fblog.c b/drivers/video/console/fblog.c
> index e790971..7d4032e 100644
> --- a/drivers/video/console/fblog.c
> +++ b/drivers/video/console/fblog.c
> @@ -399,6 +399,35 @@ static void fblog_unregister(struct fblog_fb *fb)
> kfree(fb);
> }
>
> +static void fblog_register_all(void)
> +{
> + int i;
> +
> + for (i = 0; i < FB_MAX; ++i)
> + fblog_register(registered_fb[i]);
You should take registration_lock mutex for accessing registered_fb[],
even better would be to make use of get_fb_info() and put_fb_info()
> +}
> +
> +static void fblog_unregister_all(void)
> +{
> + int i;
> +
> + for (i = 0; i < FB_MAX; ++i)
> + fblog_unregister(fblog_info2fb(registered_fb[i]));
Same here.
Though for unregistering I'm wondering why you still scan through
registered_fb[], you should just scan your fblog_fbs[] array!
But here again, make sure to have proper locking to not get races with
registration of new framebuffers or removal of existing ones via
notifications.
> +}
> +
> +static void fblog_refresh(struct fblog_fb *fb)
> +{
> + unsigned int width, height;
> +
> + if (!fb || !fb->font)
> + return;
> +
> + width = fb->info->var.xres / fb->font->width;
> + height = fb->info->var.yres / fb->font->height;
> + fblog_buf_resize(&fb->buf, width, height);
> + fblog_redraw(fb);
> +}
> +
All these new functions are still unused, for easier following of your
patch series it would be nice to have them connected when they are
introduced as otherwise on has to search all following patches for
finding possible users.
> static int __init fblog_init(void)
> {
> return 0;
Bruno
next prev parent reply other threads:[~2012-06-16 22:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-16 22:04 [RFC 00/10] fblog: framebuffer kernel log driver David Herrmann
2012-06-16 22:04 ` [PATCH 01/10] fblog: new framebuffer kernel log dummy driver David Herrmann
2012-06-16 22:04 ` [PATCH 02/10] fblog: implement buffer management David Herrmann
2012-06-16 22:04 ` [PATCH 03/10] fblog: register framebuffer objects David Herrmann
2012-06-16 22:04 ` [PATCH 04/10] fblog: implement fblog_redraw() David Herrmann
2012-06-16 22:35 ` Alan Cox
2012-06-18 18:36 ` David Herrmann
2012-06-16 22:04 ` [PATCH 05/10] fblog: add framebuffer helpers David Herrmann
2012-06-16 22:33 ` Bruno Prémont [this message]
2012-06-18 18:50 ` David Herrmann
2012-06-16 22:04 ` [PATCH 06/10] fblog: allow enabling/disabling fblog on runtime David Herrmann
2012-06-16 22:04 ` [PATCH 07/10] fblog: forward kernel log messages to all framebuffers David Herrmann
2012-06-16 22:04 ` [PATCH 08/10] fblog: react on framebuffer events David Herrmann
2012-06-16 22:04 ` [PATCH 09/10] fblog: register all handlers on module-init David Herrmann
2012-06-16 22:04 ` [PATCH 10/10] fblog: add "activate" module parameter David Herrmann
2012-06-18 19:06 ` [RFC 00/10] fblog: framebuffer kernel log driver David Herrmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120617003334.765f6226@neptune.home \
--to=bonbons@linux-vserver.org \
--cc=FlorianSchandinat@gmx.de \
--cc=dh.herrmann@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).