rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: Mitchell Levy <levymitchell0@gmail.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>,
	Miguel Ojeda <ojeda@kernel.org>,
	Alex Gaynor <alex.gaynor@gmail.com>,
	Wedson Almeida Filho <wedsonaf@gmail.com>,
	Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>,
	Bjorn Roy Baron <bjorn3_gh@protonmail.com>,
	Benno Lossin <benno.lossin@proton.me>,
	Andreas Hindborg <a.hindborg@samsung.com>,
	Alice Ryhl <aliceryhl@google.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	rust-for-linux@vger.kernel.org,
	Danilo Krummrich <dakr@redhat.com>
Subject: Re: [PATCH v4 0/4] drm/panic: Add a QR code panic screen
Date: Mon, 22 Jul 2024 10:53:00 +0200	[thread overview]
Message-ID: <8803e15d-3531-4384-b641-25845176ded5@redhat.com> (raw)
In-Reply-To: <0bad8507-22f3-38d2-5724-0aa6433990cc@gmail.com>

On 19/07/2024 20:50, Mitchell Levy wrote:
> I am trying to test this patchset on my setup, but I cannot get it 
> working. In case it's relevant, I'm running under HyperV. Any 
> troubleshooting steps/suggestions would definitely be appreciated.

First, make sure you have this in your .config:
CONFIG_RUST=y
CONFIG_DRM_SIMPLEDRM=y
CONFIG_SYSFB_SIMPLEFB=y
CONFIG_DRM_PANIC=y
CONFIG_DRM_PANIC_FOREGROUND_COLOR=0xffffff
CONFIG_DRM_PANIC_BACKGROUND_COLOR=0x000000
CONFIG_DRM_PANIC_DEBUG=y
CONFIG_DRM_PANIC_SCREEN="qr_code"
CONFIG_DRM_PANIC_SCREEN_QR_CODE=y

drm_panic is only supported by a few drivers. The easiest way to test, 
is to use the simpledrm driver, that should work on all EFI or BIOS 
based system.
To check the drm driver in use, run:
sudo udevadm info -a -n /dev/dri/card0 | grep DRIVER

If it's not simpledrm, you should blacklist it, and make sure you boot 
with simpledrm.

and then you can run:
echo 1 > /sys/kernel/debug/dri/0/drm_panic_plane_0

On a side note, looking at the hyperv drm driver, it should be easy to 
add drm_panic support for it. I will look into that when I get some time.

Best regards,

-- 

Jocelyn

> 
> Thanks!
> Mitchell
> 
> On 7/17/2024 7:24 AM, Jocelyn Falempe wrote:
>> This series adds a new panic screen, with the kmsg data embedded in a 
>> QR code.
>>
>> The main advantage of QR code, is that you can copy/paste the debug 
>> data to a bug report.
>>
>> The QR code encoder is written in rust, and is very specific to drm 
>> panic.
>> The reason is that it is called in a panic handler, and thus can't 
>> allocate memory, or use locking.
>> The rust code uses a few rust core API, and provides only two C entry 
>> points.
>> There is no particular reason to do it in rust, I just wanted to learn 
>> rust, and see if it can work in the kernel.
>>
>> If you want to see what it looks like, I've put a few screenshots here:
>> https://github.com/kdj0c/panic_report/issues/1
>>
>> v2:
>>   * Rewrite the rust comments with Markdown (Alice Ryhl)
>>   * Mark drm_panic_qr_generate() as unsafe (Alice Ryhl)
>>   * Use CStr directly, and remove the call to as_str_unchecked()
>>     (Alice Ryhl)
>>   * Add a check for data_len <= data_size (Greg KH)
>>
>> v3:
>>   * Fix all rust comments (typo, punctuation) (Miguel Ojeda)
>>   * Change the wording of safety comments (Alice Ryhl)
>>   * Add a link to the javascript decoder in the Kconfig (Greg KH)
>>   * Fix data_size and tmp_size check in drm_panic_qr_generate()
>>   v4:
>>   * Fix the logic to find next line and skip the '\n' (Alice Ryhl)
>>   * Remove __LOG_PREFIX as it's not used (Alice Ryhl)
>>
>> Jocelyn Falempe (4):
>>    drm/panic: Add integer scaling to blit()
>>    drm/rect: Add drm_rect_overlap()
>>    drm/panic: Simplify logo handling
>>    drm/panic: Add a QR code panic screen
>>
>>   drivers/gpu/drm/Kconfig         |   31 +
>>   drivers/gpu/drm/Makefile        |    1 +
>>   drivers/gpu/drm/drm_drv.c       |    3 +
>>   drivers/gpu/drm/drm_panic.c     |  340 +++++++++--
>>   drivers/gpu/drm/drm_panic_qr.rs | 1003 +++++++++++++++++++++++++++++++
>>   include/drm/drm_panic.h         |    4 +
>>   include/drm/drm_rect.h          |   15 +
>>   7 files changed, 1358 insertions(+), 39 deletions(-)
>>   create mode 100644 drivers/gpu/drm/drm_panic_qr.rs
>>
>>
>> base-commit: e1a261ba599eec97e1c5c7760d5c3698fc24e6a6
> 


      reply	other threads:[~2024-07-22  8:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 14:24 [PATCH v4 0/4] drm/panic: Add a QR code panic screen Jocelyn Falempe
2024-07-17 14:24 ` [PATCH v4 1/4] drm/panic: Add integer scaling to blit() Jocelyn Falempe
2024-07-17 14:24 ` [PATCH v4 2/4] drm/rect: Add drm_rect_overlap() Jocelyn Falempe
2024-07-17 14:24 ` [PATCH v4 3/4] drm/panic: Simplify logo handling Jocelyn Falempe
2024-07-17 14:24 ` [PATCH v4 4/4] drm/panic: Add a QR code panic screen Jocelyn Falempe
2024-07-22  9:02   ` Alice Ryhl
2024-07-22 23:20   ` Mitchell Levy
2024-07-23  8:09     ` Jocelyn Falempe
2024-07-19 18:50 ` [PATCH v4 0/4] " Mitchell Levy
2024-07-22  8:53   ` Jocelyn Falempe [this message]

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=8803e15d-3531-4384-b641-25845176ded5@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=a.hindborg@samsung.com \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=levymitchell0@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=wedsonaf@gmail.com \
    /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).