From: sashiko-bot@kernel.org
To: "Guillaume La Roque" <glaroque@baylibre.com>
Cc: dri-devel@lists.freedesktop.org,
linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v4 1/9] drm/meson: honor framebuffer offsets for the primary plane
Date: Fri, 04 Dec 2026 08:30:50 +0000 [thread overview]
Message-ID: <sashiko-outbox-249396@kernel.org> (raw)
In-Reply-To: <20261204-meson-g12a-osd2-v4-1-ad356340dbd6@baylibre.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/meson: visible check bypasses OSD1 offset alignment
validation
--
commit a206a4eb63f9b00457aac18f015af8890bc450de
Author: Guillaume La Roque <glaroque@baylibre.com>
drm/meson: honor framebuffer offsets for the primary plane
This commit adds fb->offsets[0] to the primary plane scanout address and
rejects unaligned scanout addresses in meson_plane_atomic_check().
> diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
> index c17afe6712f93..30afeadc7e010 100644
> --- a/drivers/gpu/drm/meson/meson_plane.c
> +++ b/drivers/gpu/drm/meson/meson_plane.c
[ ... ]
> @@ -92,11 +97,23 @@ static int meson_plane_atomic_check(struct drm_plane *plane,
> * - Upscaling up to 5x, vertical and horizontal
> * - Final coordinates must match crtc size
> */
> - return drm_atomic_helper_check_plane_state(new_plane_state,
> - crtc_state,
> - FRAC_16_16(1, 5),
> - DRM_PLANE_NO_SCALING,
> - false, true);
> + ret = drm_atomic_helper_check_plane_state(new_plane_state,
> + crtc_state,
> + FRAC_16_16(1, 5),
> + DRM_PLANE_NO_SCALING,
> + false, true);
> + if (ret || !new_plane_state->visible)
> + return ret;
> +
> + if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
> + alignment = meson_vpu_is_compatible(meson_plane->priv,
> + VPU_COMPATIBLE_G12A) ? 64 : 16;
> +
> + gem = drm_fb_dma_get_gem_obj(fb, 0);
> + if (!IS_ALIGNED(gem->dma_addr + fb->offsets[0], alignment))
> + return -EINVAL;
> +
> + return 0;
> }
[Severity: Medium]
Can returning early on !new_plane_state->visible bypass the alignment check
while meson_plane_atomic_update() still programs the unaligned osd1_addr?
When userspace commits an offscreen primary plane on an active CRTC with an
unaligned fb->offsets[0], drm_atomic_helper_check_plane_state() sets
visible to false and returns 0. drm_atomic_helper_commit_planes() still
calls meson_plane_atomic_update() regardless of visible.
meson_plane_atomic_update() does not check new_state->visible and still
sets priv->viu.osd1_addr and enables OSD1. meson_canvas_config() then
rounds unaligned linear addresses up, reading up to 7 bytes past a tightly
sized GEM buffer, and AFBC receives an unaligned header address.
Checking alignment whenever fb is set, or disabling OSD1 in
meson_plane_atomic_update() when !new_state->visible, would close this gap.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-meson-g12a-osd2-v4-0-ad356340dbd6@baylibre.com?part=1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Guillaume La Roque" <glaroque@baylibre.com>
Cc: dri-devel@lists.freedesktop.org,
linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v4 1/9] drm/meson: honor framebuffer offsets for the primary plane
Date: Fri, 04 Dec 2026 08:30:50 +0000 [thread overview]
Message-ID: <sashiko-outbox-249396@kernel.org> (raw)
In-Reply-To: <20261204-meson-g12a-osd2-v4-1-ad356340dbd6@baylibre.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/meson: visible check bypasses OSD1 offset alignment
validation
--
commit a206a4eb63f9b00457aac18f015af8890bc450de
Author: Guillaume La Roque <glaroque@baylibre.com>
drm/meson: honor framebuffer offsets for the primary plane
This commit adds fb->offsets[0] to the primary plane scanout address and
rejects unaligned scanout addresses in meson_plane_atomic_check().
> diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
> index c17afe6712f93..30afeadc7e010 100644
> --- a/drivers/gpu/drm/meson/meson_plane.c
> +++ b/drivers/gpu/drm/meson/meson_plane.c
[ ... ]
> @@ -92,11 +97,23 @@ static int meson_plane_atomic_check(struct drm_plane *plane,
> * - Upscaling up to 5x, vertical and horizontal
> * - Final coordinates must match crtc size
> */
> - return drm_atomic_helper_check_plane_state(new_plane_state,
> - crtc_state,
> - FRAC_16_16(1, 5),
> - DRM_PLANE_NO_SCALING,
> - false, true);
> + ret = drm_atomic_helper_check_plane_state(new_plane_state,
> + crtc_state,
> + FRAC_16_16(1, 5),
> + DRM_PLANE_NO_SCALING,
> + false, true);
> + if (ret || !new_plane_state->visible)
> + return ret;
> +
> + if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
> + alignment = meson_vpu_is_compatible(meson_plane->priv,
> + VPU_COMPATIBLE_G12A) ? 64 : 16;
> +
> + gem = drm_fb_dma_get_gem_obj(fb, 0);
> + if (!IS_ALIGNED(gem->dma_addr + fb->offsets[0], alignment))
> + return -EINVAL;
> +
> + return 0;
> }
[Severity: Medium]
Can returning early on !new_plane_state->visible bypass the alignment check
while meson_plane_atomic_update() still programs the unaligned osd1_addr?
When userspace commits an offscreen primary plane on an active CRTC with an
unaligned fb->offsets[0], drm_atomic_helper_check_plane_state() sets
visible to false and returns 0. drm_atomic_helper_commit_planes() still
calls meson_plane_atomic_update() regardless of visible.
meson_plane_atomic_update() does not check new_state->visible and still
sets priv->viu.osd1_addr and enables OSD1. meson_canvas_config() then
rounds unaligned linear addresses up, reading up to 7 bytes past a tightly
sized GEM buffer, and AFBC receives an unaligned header address.
Checking alignment whenever fb is set, or disabling OSD1 in
meson_plane_atomic_update() when !new_state->visible, would close this gap.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-meson-g12a-osd2-v4-0-ad356340dbd6@baylibre.com?part=1
next prev parent reply other threads:[~2026-12-04 8:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 8:08 [PATCH v4 0/9] drm/meson: add a second RGB plane on G12A Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:08 ` [PATCH v4 1/9] drm/meson: honor framebuffer offsets for the primary plane Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:30 ` sashiko-bot [this message]
2026-12-04 8:30 ` sashiko-bot
2026-12-04 8:08 ` [PATCH v4 2/9] drm/meson: isolate primary plane scaler setup Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:08 ` [PATCH v4 3/9] drm/meson: keep RGB scanout state per OSD Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:08 ` [PATCH v4 4/9] drm/meson: parameterize the G12A OSD color matrix setup Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:08 ` [PATCH v4 5/9] drm/meson: handle primary plane zpos allocation failure Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:08 ` [PATCH v4 6/9] drm/meson: select RGB plane registers by OSD index Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:08 ` [PATCH v4 7/9] drm/meson: serialize OSD state updates with the IRQ Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:30 ` sashiko-bot
2026-12-04 8:30 ` sashiko-bot
2026-12-04 8:08 ` [PATCH v4 8/9] drm/meson: publish pending OSD updates with the flip event Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
2026-12-04 8:41 ` sashiko-bot
2026-12-04 8:41 ` sashiko-bot
2026-12-04 8:08 ` [PATCH v4 9/9] drm/meson: add a linear RGB overlay on G12A OSD2 Guillaume La Roque
2026-12-04 8:08 ` Guillaume La Roque
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=sashiko-outbox-249396@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=glaroque@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.