From: Jocelyn Falempe <jfalempe@redhat.com>
To: John Ogness <john.ogness@linutronix.de>,
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
Subject: Re: [RFC PATCH 3/3] drm/log: Introduce a new boot logger to draw the kmsg on the screen
Date: Thu, 1 Aug 2024 15:52:12 +0200 [thread overview]
Message-ID: <d4412d54-41b1-4671-9733-34ba1423404c@redhat.com> (raw)
In-Reply-To: <87o76czfb2.fsf@jogness.linutronix.de>
On 01/08/2024 12:51, John Ogness wrote:
> 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.
Thanks, so that means the circular buffer and workqueue are only
necessary until write_thread() is merged in mainline. It will be a nice
simplification.
I think I can also register one console for each drm driver, which will
simplify drm_log even further. (currently it would mean having a
circular buffer and work function for each driver which is a bit too much).
Do you know if there is a chance to have write_thread() in 6.12 or 6.13 ?
>
> John Ogness >
Best regards
--
Jocelyn
next prev parent reply other threads:[~2024-08-01 13:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 10:04 [RFC PATCH 0/3] " 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
2024-08-01 13:52 ` Jocelyn Falempe [this message]
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-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=d4412d54-41b1-4671-9733-34ba1423404c@redhat.com \
--to=jfalempe@redhat.com \
--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=john.ogness@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®