From: Thomas Zimmermann <tzimmermann@suse.de>
To: Maxime Ripard <mripard@kernel.org>,
Jocelyn Falempe <jfalempe@redhat.com>
Cc: bluescreen_avenger@verizon.net, javierm@redhat.com,
dri-devel@lists.freedesktop.org, gpiccoli@igalia.com,
"Noralf Trønnes" <noralf@tronnes.org>,
airlied@redhat.com
Subject: Re: [PATCH v4 2/4] drm/panic: Add a drm panic handler
Date: Tue, 10 Oct 2023 11:04:33 +0200 [thread overview]
Message-ID: <18af6c07-e2c1-4c77-8083-2e82d29f16c9@suse.de> (raw)
In-Reply-To: <pdzyzvq4bvaec5ohwoh3p2gdzul4vvqk5a3q2lkbmsx4lm4sem@uckgzhlhks53>
[-- Attachment #1.1: Type: text/plain, Size: 4133 bytes --]
Hi
Am 09.10.23 um 18:07 schrieb Maxime Ripard:
> On Mon, Oct 09, 2023 at 04:05:19PM +0200, Jocelyn Falempe wrote:
>>>> - I find it risky to completely reconfigure the hardware in a panic handler.
>>>
>>> I would expect to only change the format and base address of the
>>> framebuffer. I guess it can fail, but it doesn't seem that different to
>>> the async plane update we already have and works well.
>>>
>> In this case it can work, but by using generic drm api, it's hard to know
>> what the driver will do.
>
> We should document extensively what we expect drivers to do in those
> hooks, and possibly call cant_sleep() in the framework function to have
> some reporting at least.
>
>>>> Also how many drivers would need this ?
>>>>
>>>> Currently I was mostly considering x86 platform, so:
>>>>
>>>> simpledrm/ast/mgag200 which works well with the get_scanout_buffer().
>>>>
>>>> i915/amdgpu/nouveau, which are quite complex, and will need to do their own
>>>> thing anyway.
>>>
>>> I guess we're not entirely aligned there then. I would expect that
>>> mechanism to work with any atomic KMS driver. You are right that i915,
>>> amdgpu and nouveau are special enough that some extra internal plumbing
>>> is going to be required, but I'd expect it to be easy to support with
>>> any other driver for a memory-mapped device.
>>>
>>> I guess what I'm trying to say is, even though it's totally fine that
>>> you only support those drivers at first, supporting in vc4 for example
>>> shouldn't require to rewrite the whole thing.
>>
>> Would that work for you to put that in a drm_panic_helper.c,
>> so that drivers can opt-in ?
>>
>> So the driver can call a drm_panic_helper_prepare_commit() at
>> initialization, and then in the get_scanout_buffer() function
>
> If we have a full blown commit with a new framebuffer, why do we need
> get_scanout_buffer? It should be either the framebuffer itself, or in
> the plane state if you have a conversion.
We also have discussions about kexec/kdump support. Here we'd need to
retrieve the scanout address, forward it to the kexec kernel and put
simpledrm onto that framebuffer until the regular driver takes over. An
interface like get_scanout_buffer will be helpful for this use case. So
it makes sense to use it for the panic handler as well.
>
>> run the atomic_update() on it, and return this commit's framebuffer ?
>>
>> That way each driver have a better control on what the panic handler will
>> do.
>> It can even call directly its internal functions, to avoid the locks of the
>> drm generic functions, and make sure it will only change the format and base
>> address.
>> That's a bit more work for each driver, but should be more reliable I think.
>
> I don't think that better control there is a good idea, it's a path that
> won't get tested much so we'd be better off not allowing drivers to
> deviate too much from the "ideal" design.
>
> What I had in mind is something like:
>
> - Add a panic hook in drm_mode_config_funcs, with a
> drm_atomic_helper_panic helper;
>
> - Provide an atomic_panic hook or something in drm_plane_helper_funcs;
>
> - If they are set, we register the drm_panic handler;
>
> - The handler will call drm_mode_config_funcs.panic, which will take
> its prepared state, fill the framebuffer it allocated with the
> penguin and backtrace, call drm_plane_helper_funcs.atomic_panic().
>
> - The driver now updates the format and fb address.
>
> - Halt and catch fire
>
> Does that make sense?
Please see my other replies. I find this fragile, and unnecessary for
cases where there already is a working scanout buffer in place. It's
something a driver could implement internally to provide a scanout
buffer if none has been set up already.
Best regards
Thomas
> Maxime
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2023-10-10 9:04 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 14:22 [RFC][PATCH v4 0/4] drm/panic: Add a drm panic handler Jocelyn Falempe
2023-10-03 14:22 ` [PATCH v4 1/4] drm/format-helper: Export line conversion helper for drm_panic Jocelyn Falempe
2023-10-03 15:56 ` kernel test robot
2023-10-04 1:45 ` nerdopolis
2023-10-05 7:37 ` Jocelyn Falempe
2023-10-16 10:47 ` Thomas Zimmermann
2023-10-16 10:50 ` Thomas Zimmermann
2023-10-16 16:22 ` Jocelyn Falempe
2023-10-03 14:22 ` [PATCH v4 2/4] drm/panic: Add a drm panic handler Jocelyn Falempe
2023-10-05 3:39 ` kernel test robot
2023-10-05 8:18 ` Maxime Ripard
2023-10-05 9:16 ` Jocelyn Falempe
2023-10-06 14:35 ` Maxime Ripard
2023-10-06 16:54 ` Noralf Trønnes
2023-10-09 7:47 ` Jocelyn Falempe
2023-10-09 8:28 ` Maxime Ripard
2023-10-09 9:48 ` Jocelyn Falempe
2023-10-09 11:33 ` Maxime Ripard
2023-10-09 14:05 ` Jocelyn Falempe
2023-10-09 16:07 ` Maxime Ripard
2023-10-10 7:55 ` Jocelyn Falempe
2023-10-10 8:30 ` Maxime Ripard
2023-10-10 9:04 ` Thomas Zimmermann [this message]
2023-10-10 9:33 ` Maxime Ripard
2023-10-10 13:05 ` Thomas Zimmermann
2023-10-10 13:32 ` Jocelyn Falempe
2023-10-10 8:55 ` Thomas Zimmermann
2023-10-10 9:25 ` Maxime Ripard
2023-10-10 11:29 ` Noralf Trønnes
2023-10-10 12:15 ` Maxime Ripard
2023-10-10 12:59 ` Daniel Vetter
2023-10-10 13:24 ` Thomas Zimmermann
2023-10-10 13:24 ` Jocelyn Falempe
2023-10-07 12:38 ` Noralf Trønnes
2023-10-09 8:01 ` Jocelyn Falempe
2023-10-03 14:22 ` [PATCH v4 3/4] drm/simpledrm: Add drm_panic support Jocelyn Falempe
2023-10-03 14:22 ` [PATCH v4 4/4] drm/mgag200: " Jocelyn Falempe
2023-10-07 14:30 ` Noralf Trønnes
2023-10-09 10:01 ` Jocelyn Falempe
2023-10-10 9:23 ` Thomas Zimmermann
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=18af6c07-e2c1-4c77-8083-2e82d29f16c9@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@redhat.com \
--cc=bluescreen_avenger@verizon.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=gpiccoli@igalia.com \
--cc=javierm@redhat.com \
--cc=jfalempe@redhat.com \
--cc=mripard@kernel.org \
--cc=noralf@tronnes.org \
/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