Re: [RFC PATCH 3/3] drm/log: Introduce a new boot logger to draw the kmsg on the screen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024-08-01, Jocelyn Falempe <jfalempe@xxxxxxxxxx> 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



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux