From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51E1F606A322 for ; Thu, 3 Dec 2026 20:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JZ/ODneL Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B221A10EB67; Thu, 3 Dec 2026 20:21:35 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 24C6510E7D1 for ; Thu, 3 Dec 2026 20:21:30 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2865F600FA; Thu, 3 Dec 2026 20:21:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A72B01F000C2; Thu, 3 Dec 2026 20:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796329288; bh=wV8a3Li0foZPmQRWWivkCfQzizkFsCalUpvVZnja0RA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=JZ/ODneLr3xpAYIKc2SLwgqzNaNEi06oDyRrR9IMLHAPJKN6zyMqE2WsnQCq/KJB+ naiivowiklqrEvAsic2lfqwKAC7cAqFmRfSm2MHP1s82ig/FCRzg1LaeGmBah00HCs EN1CLwk6nHBgoxttypt7JUUCY3Qu4peC/DKo89YfbIFTEHq5M+VDf41/byJTgpi/4b 54hfvp6arz8uSKEl4ak2Bk6NT7G3kzevW/9YLxTbVw2DbHIrzncRn4q7HSeGUJrdER gu8HnxNGrxtNnKKEjMp+U35BXI5ngha3pAwcGbhJVe/8BXJYuNWObqJhk+Q/Yqkg7j cG6Yz7NfbjUGg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 3/9] drm/meson: keep RGB scanout state per OSD To: "Guillaume La Roque" Cc: dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, neil.armstrong@linaro.org In-Reply-To: <20261203-meson-g12a-osd2-v3-3-2cf76729b5d5@baylibre.com> References: <20261203-meson-g12a-osd2-v3-0-2cf76729b5d5@baylibre.com> <20261203-meson-g12a-osd2-v3-3-2cf76729b5d5@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 20:21:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/meson: unvalidated fb->offsets[0] alignment for OSD1 canvas and GXM AFBC -- commit 3b070782f8ebee577006ed589de24b8f70f0c4cc Author: Guillaume La Roque drm/meson: keep RGB scanout state per OSD This commit groups the OSD register cache and framebuffer parameters into a per-plane struct meson_osd_state array while keeping the primary scaler and AFBC controls separate. > diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/= meson_plane.c > index 0506e29b6ef3b..1698aaecee88b 100644 > --- a/drivers/gpu/drm/meson/meson_plane.c > +++ b/drivers/gpu/drm/meson/meson_plane.c [ ... ] > @@ -368,19 +369,16 @@ static void meson_plane_atomic_update(struct drm_pl= ane *plane, > if (new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE) > dst_h /=3D 2; > =20 > - priv->viu.osd_blend_din0_scope_h =3D ((dest.x2 - 1) << 16) | dest.x1; > - priv->viu.osd_blend_din0_scope_v =3D ((dest.y2 - 1) << 16) | dest.y1; > - priv->viu.osb_blend0_size =3D dst_h << 16 | dst_w; > - priv->viu.osb_blend1_size =3D dst_h << 16 | dst_w; > + osd->blend_size =3D dst_h << 16 | dst_w; > } > =20 > /* Update Canvas with buffer address */ > gem =3D drm_fb_dma_get_gem_obj(fb, 0); > =20 > - priv->viu.osd1_addr =3D gem->dma_addr + fb->offsets[0]; > - priv->viu.osd1_stride =3D fb->pitches[0]; > - priv->viu.osd1_height =3D fb->height; > - priv->viu.osd1_width =3D fb->width; > + osd->addr =3D gem->dma_addr + fb->offsets[0]; > + osd->stride =3D fb->pitches[0]; > + osd->height =3D fb->height; > + osd->width =3D fb->width; [Severity: Medium] Does meson_plane_atomic_check() validate fb->offsets[0] alignment before osd->addr is programmed? drm_gem_fb_create() checks buffer size but not fb->offsets[0] alignment. F= or linear scanout, meson_canvas_config() rounds addr up to an 8-byte boundary via ((addr + 7) >> 3), shifting scanout and allowing canvas DMA to read up = to 8 bytes past the end of a tightly sized buffer. For GXM AFBC, meson_gxm_afbcd_setup() shifts priv->viu.osd[0].addr right by= 4 bits, silently dropping the low 4 bits of a non-16-byte-aligned address and pointing the decoder at the wrong header. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-meson-g12a= -osd2-v3-0-2cf76729b5d5@baylibre.com?part=3D3