Skip to content

Test sample #1

@kdj0c

Description

@kdj0c
Owner

This is a test sample to show what kind of data can be put in a drm_panic qr code, and decoded with this web project.

dmr_panic_qr_code_demo

Activity

kdj0c

kdj0c commented on Jul 2, 2024

@kdj0c
OwnerAuthor

A new test sample with V40 QR code
DrmPanic_QR_V40

kdj0c

kdj0c commented on Jul 3, 2024

@kdj0c
OwnerAuthor

Test sample with uncompressed kmsg.

drm_panic_QR_V40_raw

qwertychouskie

qwertychouskie commented on Jul 4, 2024

@qwertychouskie

Test sample with uncompressed kmsg.

This one I can't scan with my phone.

kdj0c

kdj0c commented on Jul 4, 2024

@kdj0c
OwnerAuthor

This one I can't scan with my phone.

Sometime it also depends on the app you're using. The first app I used on my Android phone was only able to scan the first screenshot (with ascii Tux), bigger QR-code never worked. I'm now using the app from gamma play, and it scan all three.

qwertychouskie

qwertychouskie commented on Jul 4, 2024

@qwertychouskie

Some quick testing with the 2 troublesome QR codes:

  • Barcode Scanner: Did not work, occasionally "scanned" a few numbers as a "UPC code"
  • Barcode Scanner (different app, same name): Also did not work, also occasionally "scanned" a few numbers as a "UPC code"
  • Binary Eye: Worked pretty much instantly

Might be worth investigating what's different between these, maybe there's some sort of subtle bug in the QR code that makes it not work on all apps, or maybe some of these apps have some sort of bug with large codes.

OptikITLik

OptikITLik commented on Jul 4, 2024

@OptikITLik

How do you upload data if there is no internet connection?

tq-steina

tq-steina commented on Jul 4, 2024

@tq-steina

I can't scan the last one (Test sample with uncompressed kmsg) with my Android phone

NikitaBeloglazov

NikitaBeloglazov commented on Jul 4, 2024

@NikitaBeloglazov

Test sample with uncompressed kmsg scans normally with Samsung Camera

lucmann

lucmann commented on Jul 4, 2024

@lucmann

I can't scan the last one (Test sample with uncompressed kmsg) with my Android phone

I can also scan that normally with my Android phone (Redmi Note 11T Pro), using WeChat app.

microhobby

microhobby commented on Jul 19, 2024

@microhobby
Andy3153

Andy3153 commented on Jul 26, 2024

@Andy3153

Test sample with uncompressed kmsg.

It scans normally for me. I'm on LineageOS and I'm using the default camera app.

g0t4

g0t4 commented on Sep 3, 2024

@g0t4

@kdj0c what are you using to generate the QR codes above?

I've got panic screen working. And I've compiled the kernel with DRM_PANIC_SCREEN_QR_CODE=y and booted it, but I still get the panic screen w/o QR codes. Is resolution a factor? IIAC the QR codes require a rather high resolution display to fit?

kdj0c

kdj0c commented on Sep 3, 2024

@kdj0c
OwnerAuthor

@g0t4 You also need to set DRM_PANIC_SCREEN=qr_code (or at runtime, as root:)
echo -n "qr_code" > /sys/module/drm/parameters/panic_screen

g0t4

g0t4 commented on Sep 4, 2024

@g0t4

@kdj0c you just made my day (actually my weekend)! THANK YOU

g0t4

g0t4 commented on Sep 4, 2024

@g0t4

here's a blue version, triggered via DRM_PANIC_DEBUG

image

qnixsynapse

qnixsynapse commented on Oct 5, 2024

@qnixsynapse

This is not supported on i915 yet but do we really need a fully loaded driver to display a panic message? What happens when the cause of the panic is the display driver itself?

kdj0c

kdj0c commented on Oct 6, 2024

@kdj0c
OwnerAuthor

The panic code is a best effort, that means it's impossible to guarantee that you will see the panic screen.
When a panic occurs, the easiest way to display something is to re-use the current framebuffer. Otherwise you will need to allocate another framebuffer and configure all the display pipeline, which is hard to do in a safe way in a panic handler.
If the panic is caused by the graphic driver itself, there is a chance that the display pipeline is broken and that you won't see the message, but it might still work too.

qnixsynapse

qnixsynapse commented on Dec 4, 2024

@qnixsynapse

I think there are better ways to do this like handing off to simpledrm from GPU specific kmodule? Since technically, we don't need any fancy thing while showing a panic message. Just a static screen.

I think on most modern systems, efifb can be reinitialized after device specific kmodule has taken over. Windows probably follows this (although I can be wrong here).
Also, simpledrm (or efifb) does not require full GPU reinitialization and relies on the firmware’s framebuffer, which is generally simpler and less state-dependent than GPU-specific pipelines.

I have seen your patch on Intel i915. Thinking of trying it out with your permission.

kdj0c

kdj0c commented on Dec 4, 2024

@kdj0c
OwnerAuthor

@qnixsynapse, it is not that simple. For example, the efifb can be in a low resolution like 1024x768, but then you've switched to 4K. If you want to re-use the efifb framebuffer, then you also need to change the resolution of the screen, which can be quite complex with DP or HDMI.
switching back to simpledrm, means loading a kernel module during a panic, which is quite risky.
Also I've already made drm_panic works on a i.MX6 ARM board, which don't have an EFI or equivalent framebuffer.

lastly, yes you can try my patch for i915, that's free software, you don't have to ask to test it. It doesn't work for Alderlake or later, but I'm working on it.

qnixsynapse

qnixsynapse commented on Dec 4, 2024

@qnixsynapse

@kdj0c Thank you for your work!

means loading a kernel module during a panic, which is quite risky

Hmm.. This is correct. I was thinking of alternative ways which would be simple enough and independent of GPU specific kmodules, since the current implementation requires of these modules to have support in order to display it.

christian-heusel

christian-heusel commented on Feb 28, 2025

@christian-heusel
Contributor

Is there a nice tool on linux to retrieve the qr-code contents from a picture of a screen? 🤔 So far I tried zbarimg but couldn't get it to work 😅

lilydjwg

lilydjwg commented on Feb 28, 2025

@lilydjwg

My phones can only read the first QR code. The other three fails to scan. App is com.atharok.barcodescanner.

Using screenshot and zbarimg -q --raw PNG_FILE I can "scan" all of them.

christian-heusel

christian-heusel commented on Feb 28, 2025

@christian-heusel
Contributor

Yeah maybe the picture I took from my laptop screen isn't good enough for zbarimg then 😰 The ones from this issue worked fine 😊

adryzz

adryzz commented on Apr 9, 2025

@adryzz

since a lot of apps have trouble with big QR codes and stuff, i wanted to create an app to view offline both raw and encoded (old and new format) kernel panic QR codes, porting this javascript code and i think i got something usable https://github.com/adryzz/drm_panic-viewer

Screencast_20250408_171817.webm
kdj0c

kdj0c commented on Apr 9, 2025

@kdj0c
OwnerAuthor

That's awesome, thanks a lot for sharing it.
So with this app it's possible to use the compressed format without internet access, that's nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @g0t4@lilydjwg@kdj0c@microhobby@lucmann

        Issue actions