From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0DBF443E2F for ; Tue, 4 Aug 2026 20:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785875770; cv=none; b=KhTkpp3KGxpR5Dntj1C+I4029JGMUczJ4z6kusLtjM+X5KrftmtPUPa1AEuAwtMo1pksb2LWI3AbvGzRmADay5I3i/mADYp1836P26sAqTDSTHkLVCHUEJaCKF88I6nrdYcyEzCYk8l9pw/iZR/eSQYeztnaKgNthd/9GFk/Tss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785875770; c=relaxed/simple; bh=Y+VxpJ/tVKNDAdbF7mD8tcR0cc6wGQyOBfUCadGI1Qw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u14c3WwWtp2iDnqV2oaM3uRAb2+Z3z4C4yFlNg4NEj3o2BL0+mTg3XacFYm+nX8ZfuNctulTFnpMnGCG6wDmTzW7xXH0hib43146Menh5DcTONiHA71HlcvdYpXyWSqq6B83o9qM43bcYqMUW7KBKFbOZy6XQYO8HocdBy7k/ko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=hKBj0ztn; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hKBj0ztn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1785875766; bh=Y+VxpJ/tVKNDAdbF7mD8tcR0cc6wGQyOBfUCadGI1Qw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKBj0ztnf3IrJJVFipmj2QIrMNWESuskauBwvI4H+dcjljw+kxv8NvBXiSZbS+3vC UXRpW/wPnEuDQ/Qqmfp07gusBzpWxRvPq6LZ3lEvrckekpfnlz6z1PFxADpH3n+0DE QoXWOh107Cerby/cY6cP5QZl0ihH0PzdCvDCoBV9fja6AxNGi+pVPtKUk+vH1Efc5f td82gZNKaDOGgeIRxEwdiak+YzZqlPMpPLZHo10hABz9TNcazjQLEiGwnfSKb16b5f q11Snf2WAyOR/FVqNNDe5E1WfKGJk5yfllwhJO/qTOPqAJLrsmXDPOdiuZiPg1GImB 2AYVQ2iotm1Og== Received: from archlinux (unknown [100.64.1.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: leandrohrb) by bali.collaboradmins.com (Postfix) with ESMTPSA id 39D5317E0243; Tue, 04 Aug 2026 22:36:02 +0200 (CEST) From: Leandro Ribeiro To: louis.chauvet@bootlin.com Cc: airlied@gmail.com, alex.hung@amd.com, daniel@fooishbar.org, hamohammed.sa@gmail.com, harry.wentland@amd.com, maarten.lankhorst@linux.intel.com, melissa.srw@gmail.com, mripard@kernel.org, pekka.paalanen@collabora.com, robert.mader@collabora.com, simona@ffwll.ch, tzimmermann@suse.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/11] drm/vkms: test sRGB and inverse sRGB LUTs using more samples Date: Tue, 4 Aug 2026 17:33:49 -0300 Message-ID: <20260804203351.148521-10-leandro.ribeiro@collabora.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260804203351.148521-1-leandro.ribeiro@collabora.com> References: <20260804203351.148521-1-leandro.ribeiro@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We're currently using srgb_eotf.lut_length samples in vkms_color_srgb_inv_srgb(). This does not exercise any points that are not in the forward sRGB LUT, although it exercises points that are not in its inverse. Let's test with more samples, to also exercise points that are not in the forward sRGB LUT. We chose 4096 samples. LUT inputs are u16, so we could have up to 65536 samples. LUT sizes are usually not higher than 512, so with 4096 we have at least 8 samples between each LUT point. We can see a minor error bump with this change. In the next commits we replace such LUTs with non-uniform optimal ones to reduce the error. Signed-off-by: Leandro Ribeiro --- drivers/gpu/drm/vkms/tests/vkms_color_test.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vkms/tests/vkms_color_test.c b/drivers/gpu/drm/vkms/tests/vkms_color_test.c index 571b1b579310..78f67bba33b5 100644 --- a/drivers/gpu/drm/vkms/tests/vkms_color_test.c +++ b/drivers/gpu/drm/vkms/tests/vkms_color_test.c @@ -123,14 +123,16 @@ static void vkms_color_test_linear(struct kunit *test) static void vkms_color_srgb_inv_srgb(struct kunit *test) { u16 srgb, final; - u16 tolerance = 119; + u16 tolerance = 122; + u32 x; - for (int i = 0; i < srgb_eotf.lut_length; i++) { - srgb = apply_lut_to_channel_value(&srgb_eotf, srgb_eotf.x[i], LUT_RED); + for (u32 i = 0; i <= 4095; i++) { + x = i * U16_MAX / 4095; + srgb = apply_lut_to_channel_value(&srgb_eotf, x, LUT_RED); final = apply_lut_to_channel_value(&srgb_inv_eotf, srgb, LUT_RED); - KUNIT_EXPECT_GE(test, final, (int)srgb_eotf.x[i] - tolerance); - KUNIT_EXPECT_LE(test, final, (int)srgb_eotf.x[i] + tolerance); + KUNIT_EXPECT_GE(test, final, (int)x - tolerance); + KUNIT_EXPECT_LE(test, final, (int)x + tolerance); } } -- 2.55.0