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 2FD6A606A33A for ; Fri, 4 Dec 2026 14:35:53 +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=k6N6Lpi6 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9583410E845; Fri, 4 Dec 2026 14:35:47 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id C9B7F10E845 for ; Fri, 4 Dec 2026 14:35:41 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 7ECFD45C82; Fri, 4 Dec 2026 14:35:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F35A1F000C2; Fri, 4 Dec 2026 14:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796394941; bh=BlRqQ7MdFd776Fi8rM8SGLJchzwBQ5IJr72xrYjV1uQ=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=k6N6Lpi6t57j47cjCOiirQ2kgFyFAiXgvK65jRYnuJHm5yvrdNbdBn8CZpXUZk2JR ehusVCNYw88/2ZL4DOBsRP+7y7GooAqQZS9G/+yhlogOHqK8GVOMW8oKWPwo5gEdDa fM7AaBq/YLf57XId8CKjarJyvmZFuPrDCwIa/YGcLiuimt99NCcSYUppM5nbPaZg2C NZ7+KBgb9Fo2AfuQ5CgZzLzHMP6WvyBIfoUAbhl9Q7XcPSZrb0uHcJNSs0edb+ohzI KLdEnezN0o7j2rMZ4RRJB9EKD8rQglH8hoNf9MExBInCFvXnIJssYgEWA95UujKxkC LnvdTOSHFM1cw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v1 4/4] drm/vkms: Add support for DRM_COLOROP_1D_CURVE_GAMMA24 To: "Robert Mader" , dri-devel@lists.freedesktop.org In-Reply-To: <20261204135131.195561-5-robert.mader@collabora.com> References: <20261204135131.195561-1-robert.mader@collabora.com> <20261204135131.195561-5-robert.mader@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 14:35:40 +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=-11.2 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 4 potential issues to consider: - [High] drm/vkms: undeclared DRM_COLOROP_1D_CURVE_GAMMA24 constants break build - [Medium] drm/vkms: u16 sum overflow in vkms_color_test_inv_lut() - [Low] drm/vkms: commit message references pow22 instead of pow24 - [Low] drm/vkms: unconditional EXPORT_SYMBOL() for test-only Gamma 2.4 LUTs -- commit 4fadd67a1786c5a41648858b25f1d109b7e89b77 Author: Robert Mader drm/vkms: Add support for DRM_COLOROP_1D_CURVE_GAMMA24 This commit adds Gamma 2.4 and inverse Gamma 2.4 LUTs, wires them into VKMS 1D curve colorops, updates the LUT generation script, and adds a KUnit round-trip test. > And its inverse, using the pow22 function from the script. [Severity: Low] Should this say pow24 instead of pow22? The patch adds pow24 and pow24_inv to color-curve-lut.py and uses them to generate the Gamma 2.4 LUTs. [ ... ] > diff --git a/drivers/gpu/drm/vkms/tests/vkms_color_test.c b/drivers/gpu/d= rm/vkms/tests/vkms_color_test.c > index 8a1cc8e3f774e..ee0a5599a1ada 100644 > --- a/drivers/gpu/drm/vkms/tests/vkms_color_test.c > +++ b/drivers/gpu/drm/vkms/tests/vkms_color_test.c > @@ -156,6 +156,11 @@ static void vkms_color_gamma22_inv_gamma22(struct ku= nit *test) > vkms_color_test_inv_lut(test, &gamma22_eotf, &gamma22_inv_eotf, 304, 2); > } > =20 > +static void vkms_color_gamma24_inv_gamma24(struct kunit *test) > +{ > + vkms_color_test_inv_lut(test, &gamma24_eotf, &gamma24_inv_eotf, 389, 3); > +} [Severity: Medium] Can the u16 sum accumulator in vkms_color_test_inv_lut() overflow here? drivers/gpu/drm/vkms/tests/vkms_color_test.c:vkms_color_test_inv_lut() { u16 sum =3D 0; ... for (u32 i =3D 0; i <=3D 4095; i++) { ... sum +=3D abs((int)x - final); count++; } KUNIT_EXPECT_LE(test, sum / count, tolerance_avg); } With 4096 samples and tolerance_max set to 389, sum wraps modulo 65536 as soon as the mean error reaches 16. A regressed LUT with a mean error between 16 and 19 wraps sum / count back to 0..3 and silently passes the tolerance_avg check. Changing sum to u32 avoids the wraparound. [ ... ] > diff --git a/drivers/gpu/drm/vkms/vkms_colorop.c b/drivers/gpu/drm/vkms/v= kms_colorop.c > index 625a590c6a2fe..db16d7e2a42fe 100644 > --- a/drivers/gpu/drm/vkms/vkms_colorop.c > +++ b/drivers/gpu/drm/vkms/vkms_colorop.c > @@ -12,7 +12,9 @@ static const u64 supported_tfs =3D > BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) | > BIT(DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) | > BIT(DRM_COLOROP_1D_CURVE_GAMMA22) | > - BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV); > + BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV) | > + BIT(DRM_COLOROP_1D_CURVE_GAMMA24) | > + BIT(DRM_COLOROP_1D_CURVE_GAMMA24_INV); [Severity: High] Are DRM_COLOROP_1D_CURVE_GAMMA24 and DRM_COLOROP_1D_CURVE_GAMMA24_INV declared anywhere in the tree? enum drm_colorop_curve_1d_type in include/drm/drm_colorop.h and colorop_curve_1d_type_names[] in drivers/gpu/drm/drm_colorop.c both stop at DRM_COLOROP_1D_CURVE_GAMMA22_INV, so this and the matching switch cases in apply_colorop() fail to compile when CONFIG_DRM_VKMS is enabled. A prerequisite DRM core patch defining both enum values and their property name strings is needed first. [ ... ] > diff --git a/drivers/gpu/drm/vkms/vkms_luts.c b/drivers/gpu/drm/vkms/vkms= _luts.c > index dcdeae68536f4..fb7d56c062187 100644 > --- a/drivers/gpu/drm/vkms/vkms_luts.c > +++ b/drivers/gpu/drm/vkms/vkms_luts.c > @@ -5650,3 +5650,857 @@ const struct vkms_color_lut gamma22_inv_eotf =3D { [ ... ] > +const struct vkms_color_lut gamma24_eotf =3D { > + .x =3D pow24_x, > + .y =3D pow24_y, > + .lut_length =3D ARRAY_SIZE(pow24_y) > +}; > +EXPORT_SYMBOL(gamma24_eotf); [ ... ] > +const struct vkms_color_lut gamma24_inv_eotf =3D { > + .x =3D pow24_inv_x, > + .y =3D pow24_inv_y, > + .lut_length =3D ARRAY_SIZE(pow24_inv_y) > +}; > +EXPORT_SYMBOL(gamma24_inv_eotf); [Severity: Low] Should gamma24_eotf and gamma24_inv_eotf use EXPORT_SYMBOL_IF_KUNIT() instead of EXPORT_SYMBOL()? Their only external user is vkms_color_test.c, which already imports the EXPORTED_FOR_KUNIT_TESTING namespace. Unconditionally exporting generic, unprefixed names into the global kernel symbol table risks symbol collisions across modules when KUnit is disabled. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204135131.1955= 61-1-robert.mader@collabora.com?part=3D4