All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Jocelyn Falempe <jfalempe@redhat.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Javier Martinez Canillas <javierm@redhat.com>,
	"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
	bluescreen_avenger@verizon.net, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Subject: Re: [RFC PATCH 3/3] drm/log: Introduce a new boot logger to draw the kmsg on the screen
Date: Thu, 01 Aug 2024 12:57:45 +0206	[thread overview]
Message-ID: <87o76czfb2.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20240801100640.462606-4-jfalempe@redhat.com>

On 2024-08-01, Jocelyn Falempe <jfalempe@redhat.com> wrote:
>  * It uses a circular buffer so the console->write() callback is very
>    quick, and will never stall.
>  * Drawing is done asynchronously using a workqueue.

For CON_NBCON, neither of the above points are necessary. You can draw
directly from the write_thread() callback. See below:

> +static bool drm_log_work_draw(void)
> +{
> +	unsigned int len;
> +	char buf[512];
> +
> +	len = drm_log_buf_read(buf, sizeof(buf));
> +	if (len)
> +		drm_log_draw_all(buf, len);
> +	return len != 0;
> +}

For CON_NBCON, this is essentially your write_thread() callback:

void drm_log_write_thread(struct console *con,
			  struct nbcon_write_context *wctxt)
{
	drm_log_draw_all(wctxt->outbuf, wctxt->len);
}

You cannot implement a write_atomic() callback because the console must
be able to print directly in NMI context and must not defer. But
write_atomic() is optional, so you should be fine there.

Disclaimer: Only in PREEMPT_RT patchset at the moment.

John Ogness

  reply	other threads:[~2024-08-01 10:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 10:04 [RFC PATCH 0/3] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-08-01 10:04 ` [RFC PATCH 1/3] [NOT FOR REVIEW] drm/panic: Squash of pending series Jocelyn Falempe
2024-08-01 10:04 ` [RFC PATCH 2/3] drm/panic: Move drawing functions to drm_draw Jocelyn Falempe
2024-08-01 10:04 ` [RFC PATCH 3/3] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-08-01 10:51   ` John Ogness [this message]
2024-08-01 13:52     ` Jocelyn Falempe
2024-08-01 14:28       ` John Ogness
2024-09-05 15:22         ` John Ogness
2024-09-06  7:53           ` Jocelyn Falempe
2024-09-06  8:27             ` John Ogness
2024-09-06  8:47               ` John Ogness
2024-09-06 16:29                 ` Jocelyn Falempe
2024-08-03 17:49   ` kernel test robot
2024-08-03 17:49   ` kernel test robot
2024-08-01 10:36 ` [RFC PATCH 0/3] " John Ogness

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=87o76czfb2.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=airlied@gmail.com \
    --cc=bluescreen_avenger@verizon.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gpiccoli@igalia.com \
    --cc=javierm@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.