From: Ryosuke Yasuoka <ryasuoka@redhat.com>
To: Ian Forbes <ian.forbes@broadcom.com>
Cc: zack.rusin@broadcom.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
simona@ffwll.ch, jfalempe@redhat.com,
bcm-kernel-feedback-list@broadcom.com,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH drm-misc-next v2 1/1] drm/vmwgfx: add drm_panic support for stdu
Date: Wed, 10 Sep 2025 20:17:56 +0900 [thread overview]
Message-ID: <aMFeZG9_CvWX9vz-@zeus> (raw)
In-Reply-To: <CAO6MGtiOuQhGcHUjDjcYwnDrcZOWy9yM_kFwhxcTfbB-_OHQvA@mail.gmail.com>
On Tue, Sep 09, 2025 at 03:48:01PM -0500, Ian Forbes wrote:
> On Mon, Sep 8, 2025 at 9:12 AM Ryosuke Yasuoka <ryasuoka@redhat.com> wrote:
>
> > +static int
> > +vmw_stdu_primary_plane_get_scanout_buffer(struct drm_plane *plane,
> > + struct drm_scanout_buffer *sb)
> > +{
> > + struct drm_plane_state *state = plane->state;
> > + struct drm_crtc *crtc = state->crtc;
> > + struct vmw_private *dev_priv = vmw_priv(crtc->dev);
> > +
> > + if (!plane->state || !plane->state->fb || !plane->state->visible)
> > + return -ENODEV;
> > +
> > + sb->format = plane->state->fb->format;
> > + sb->width = plane->state->fb->width;
> > + sb->height = plane->state->fb->height;
> > + sb->pitch[0] = plane->state->fb->pitches[0];
> > +
> > + u64 size = sb->height * sb->pitch[0];
> > +
> > + sb->map[0].vaddr = memremap(dev_priv->vram_start, size, MEMREMAP_WT);
> > +
> > + if (!sb->map[0].vaddr)
> > + return -ENOMEM;
> > +
> > + return 0;
> > +}
> > +
> > +static void vmw_stdu_primary_plane_panic_flush(struct drm_plane *plane)
> > +{
> > + vmw_ldu_primary_plane_panic_flush(plane);
> > +}
> > +
> > static void
> > vmw_stdu_crtc_atomic_flush(struct drm_crtc *crtc,
> > struct drm_atomic_state *state)
> > @@ -1506,6 +1538,8 @@ drm_plane_helper_funcs vmw_stdu_primary_plane_helper_funcs = {
> > .atomic_update = vmw_stdu_primary_plane_atomic_update,
> > .prepare_fb = vmw_stdu_primary_plane_prepare_fb,
> > .cleanup_fb = vmw_stdu_primary_plane_cleanup_fb,
> > + .get_scanout_buffer = vmw_stdu_primary_plane_get_scanout_buffer,
> > + .panic_flush = vmw_stdu_primary_plane_panic_flush,
> > };
> >
> > static const struct drm_crtc_helper_funcs vmw_stdu_crtc_helper_funcs = {
> > --
> > 2.51.0
> >
>
> You only need the code I've highlighted in this reply with some minor changes.
>
> 1. You can call `vmw_kms_write_svga` directly in `panic_flush`. There
> is no need to mark the buffer as dirty or send any commands.
In my test environment, it will be unstable without dirty command's
submission. In test environment, which is Virtual box, I've
observed serveral instances of the panic screen appearing.
It sometimes appears immediately as expected, and at other times,
there's a delay of about 15 to 20 seconds to appear the screen.
Another pattern, it's necessary to switch back and forth between
the Virtual Box console window and other windows.
With command submission, we can stably get a panic screen. Even if it
failed due to some reasons, we may get the panic screen ultimately. So I
think we should leave vmw_kms_ldu_panic_do_bo_dirty() to submit
commands.
What do you think?
> 2. The format should be hardcoded to RGB565 to minimize the risk of
> overrunning VRAM. Adjust the pitch accordingly to 2x width.
I see. drm panic supports multiple pitches. Checking pitch type
in get_scanout_buffer is not difficult.
> 3. The sizes should be vmw_priv->initial_width, and
> vmw_priv->initial_height. These are the safe sizes for VRAM in early
> boot and will work in panic as well.
OK. I'll try to change this.
> 4. You want to ensure `get_scanout_buffer` only succeeds once when
> using display unit 0 since all calls to this function will return the
> same VRAM.
OK. I'll add a check in get_scanout_buffer. To confirm this, Is it
sufficient to check if lds->num_active is 1, or do I need to check
other places or values?
> 5. memremap flags should be `MEMREMAP_WB | MEMREMAP_DEC`
OK. I'll chenge the flag like this.
> 6. Move the panic related functions to the vmwgfx_kms.c files since
> they work in all DU modes.
OK. I'll try to move them in vmwgfx_kms.c
Thank you for your review and detailed comment.
Ryosuke
next prev parent reply other threads:[~2025-09-10 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 14:11 [PATCH drm-misc-next v2 0/1] add drm_panic_support for vmwgfx-stdu Ryosuke Yasuoka
2025-09-08 14:11 ` [PATCH drm-misc-next v2 1/1] drm/vmwgfx: add drm_panic support for stdu Ryosuke Yasuoka
2025-09-09 20:48 ` Ian Forbes
2025-09-10 11:17 ` Ryosuke Yasuoka [this message]
2025-09-09 0:32 ` [PATCH drm-misc-next v2 0/1] add drm_panic_support for vmwgfx-stdu Ryosuke Yasuoka
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=aMFeZG9_CvWX9vz-@zeus \
--to=ryasuoka@redhat.com \
--cc=airlied@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.forbes@broadcom.com \
--cc=jfalempe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=zack.rusin@broadcom.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
all inboxes | Powered by JetHome®