Re: [RFC PATCH 3/3] drm/log: Introduce a new boot logger to draw the kmsg on the screen
From: John Ogness
Date: Fri Sep 06 2024 - 04:27:30 EST
On 2024-09-06, Jocelyn Falempe <jfalempe@xxxxxxxxxx> wrote:
>> It would be great to see a version of drm_log that only implements
>> write_thread() and does not do any of its own buffering with workqueue
>> and also does not need to track multiple graphic loggers at the same
>> time.
>
> Thanks for the head-up.
> I will rebase it on top of Linux-next, and adapt to the new
> write_thread() API, it should be much simpler.
For drm_log, your write_atomic() callback should be NULL. You only need
to implement the write_thead(), device_lock(), and device_unlock()
callbacks.
Your device_lock()/device_unlock() callbacks probably just need to
lock/unlock your mutex @drm_log_lock.
device_lock() is already called when the write_thread() callback is
called. So your write_thread callback really only needs to call your
drm_log_draw_kmsg_record(&dclient->scanout, wctxt->outbuf, wctxt->len).
Please let me know if you run into any issues. We probably should write
a document "HOWTO write an NBCON console driver".
John Ogness