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 47B05606A32F for ; Thu, 3 Dec 2026 19:43:59 +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=XIuPjp5x Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A923810EB3D; Thu, 3 Dec 2026 19:43:53 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id D42F5112A77 for ; Thu, 3 Dec 2026 19:43:46 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id F24B0600E6; Thu, 3 Dec 2026 19:43:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 860091F000C2; Thu, 3 Dec 2026 19:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327025; bh=3tRACrRJRUvAflUniPBqo50iiA9qK4ULpl/JtZq9qiM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=XIuPjp5xlyF3o2u+hWyt8g1ne1GlqaVBBBbG8KF8NlE5uMJBTR3RrWzSmHn9v6/zc C1wLIbqFaLKH2lLpYkR+dLHILzo4Sv8kQksKS9wxZdLuSPhqw+O29oEnzn0NQBX5xm HnDlTcYNdot0h7xF+2hIil9b2oWAocLGdIr9keTz+MVHzyEzaWeUCOM9r3bkGHcPYd nWn3V+Kchzv5WvPsMkuiSFN2hI3lXeyMzyRzHF8j+PDB+g6r+CWTkFBAaUIhkghL47 R184Yb/XfXf+/LEInPI1gtGGKzUO1DlsA37aCf8ErCROAcdEoMBzEGh4U2fdppxv0v 6wRaP9y3Oycxg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 1/9] drm/meson: honor framebuffer offsets for the primary plane 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-v2-1-8a4a57d32e20@baylibre.com> References: <20261203-meson-g12a-osd2-v2-0-8a4a57d32e20@baylibre.com> <20261203-meson-g12a-osd2-v2-1-8a4a57d32e20@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 19:43:45 +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 in meson_plane_atomic_update() -- commit 8d8faaad8589d5470ee43df783af8a02a180150e Author: Guillaume La Roque drm/meson: honor framebuffer offsets for the primary plane This commit adds fb->offsets[0] to gem->dma_addr when computing priv->viu.osd1_addr in meson_plane_atomic_update(). > diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/= meson_plane.c > index 76eb8b80ad8a5..639234d2f9d42 100644 > --- a/drivers/gpu/drm/meson/meson_plane.c > +++ b/drivers/gpu/drm/meson/meson_plane.c > @@ -368,7 +368,7 @@ static void meson_plane_atomic_update(struct drm_plan= e *plane, > /* Update Canvas with buffer address */ > gem =3D drm_fb_dma_get_gem_obj(fb, 0); > =20 > - priv->viu.osd1_addr =3D gem->dma_addr; > + priv->viu.osd1_addr =3D gem->dma_addr + fb->offsets[0]; [Severity: Medium] Can an unaligned fb->offsets[0] misprogram the Canvas or AFBC scanout address here? Neither drm_gem_fb_create() nor meson_plane_atomic_check() checks fb->offsets[0] alignment. For linear scanout, meson_canvas_config() writes ((addr + 7) >> 3) to DMC_CAV_LUT_DATAL, silently rounding unaligned offsets up by up to 7 bytes and reading past a tightly sized GEM buffer. For GXM AFBC, meson_gxm_afbcd_setup() shifts osd1_addr >> 4 for OSD1_AFBCD_HDR_PTR and OSD1_AFBCD_FRAME_PTR while keeping the low bits in OSD1_AFBCD_CHROMA_PTR, truncating non-16-byte-aligned offsets. For G12A AFBC, meson_g12a_afbcd_setup() writes osd1_addr directly to VPU_MAFBC_HEADER_BUF_ADDR_LOW_S0 without checking 64-byte AFBC header alignment. Should meson_plane_atomic_check() reject framebuffers whose fb->offsets[0] violates the Canvas (8-byte) or AFBC (16/64-byte) alignment requirements? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-meson-g12a= -osd2-v2-0-8a4a57d32e20@baylibre.com?part=3D1