From: Robert Mader <robert.mader@collabora.com>
To: dri-devel@lists.freedesktop.org
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>,
Harry Wentland <harry.wentland@amd.com>,
Melissa Wen <mwen@igalia.com>,
Sebastian Wick <sebastian.wick@redhat.com>,
Robert Mader <robert.mader@collabora.com>,
Louis Chauvet <louis.chauvet@bootlin.com>,
Haneen Mohammed <hamohammed.sa@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Melissa Wen <melissa.srw@gmail.com>,
Oarora Etimis <oaroraetimis@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Leandro Ribeiro <leandro.ribeiro@collabora.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/4] drm/vkms: Fix inverse lut naming scheme in script
Date: Fri, 4 Dec 2026 15:53:40 +0100 [thread overview]
Message-ID: <20261204145427.221618-2-robert.mader@collabora.com> (raw)
In-Reply-To: <20261204145427.221618-1-robert.mader@collabora.com>
We went with in srgb_inv instead of inv_srgb in commit 3c7c3c12dfc7
("drm/vkms: replace uniform sRGB LUT and its inverse with optimal ones")
thus adopt the script to reflect that.
Fixes: e64f6256cd12 ("drm/vkms: add script to create optimized LUTs for color curves")
Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
.../gpu/drm/vkms/scripts/color-curve-lut.py | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/vkms/scripts/color-curve-lut.py b/drivers/gpu/drm/vkms/scripts/color-curve-lut.py
index c8f13643bdb7..6a1fa804d16f 100644
--- a/drivers/gpu/drm/vkms/scripts/color-curve-lut.py
+++ b/drivers/gpu/drm/vkms/scripts/color-curve-lut.py
@@ -371,7 +371,7 @@ class Functions:
return pow(x, 2.2)
@staticmethod
- def inv_pow22(x):
+ def pow22_inv(x):
return pow(x, 1.0 / 2.2)
@staticmethod
@@ -381,7 +381,7 @@ class Functions:
return pow(((x + 0.055) / 1.055), 2.4)
@staticmethod
- def inv_srgb(x):
+ def srgb_inv(x):
if x <= 0.0031308:
return 12.92 * x
return 1.055 * pow(x, (1.0 / 2.4)) - 0.055
@@ -397,7 +397,7 @@ class Functions:
return pow(max(aux - c1, 0.0) / (c2 - c3 * aux), m1_inv)
@staticmethod
- def inv_pq(x):
+ def pq_inv(x):
m1 = 0.1593017578125
m2 = 78.84375
c1 = 0.8359375
@@ -414,7 +414,7 @@ class Functions:
return a * (pow(x, 0.45)) - (a - 1.0)
@staticmethod
- def inv_bt2020_oetf(x):
+ def bt2020_oetf_inv(x):
a = 1.0993
if x < 0.081:
return x / 4.5
@@ -472,7 +472,7 @@ def print_help_and_quit(function_table):
print("Possible function names are:")
for func in function_table.keys():
print(f" {func}")
- print(f" inv_{func}")
+ print(f" {func}_inv")
sys.exit(1)
@@ -491,8 +491,8 @@ def parse_cli_params(args, function_table):
plot = True
func_str = args[1]
- use_inverse = func_str.startswith("inv_")
- base_func_str = func_str[4:] if use_inverse else func_str
+ use_inverse = func_str.endswith("_inv")
+ base_func_str = func_str[:-4] if use_inverse else func_str
func_pair = function_table.get(base_func_str)
if func_pair is None:
@@ -517,10 +517,10 @@ def parse_cli_params(args, function_table):
def main(args):
function_table = {
- "srgb": (Functions.srgb, Functions.inv_srgb),
- "pow22": (Functions.pow22, Functions.inv_pow22),
- "pq": (Functions.pq, Functions.inv_pq),
- "bt2020_oetf": (Functions.bt2020_oetf, Functions.inv_bt2020_oetf),
+ "srgb": (Functions.srgb, Functions.srgb_inv),
+ "pow22": (Functions.pow22, Functions.pow22_inv),
+ "pq": (Functions.pq, Functions.pq_inv),
+ "bt2020_oetf": (Functions.bt2020_oetf, Functions.bt2020_oetf_inv),
}
func_str, func_pair, lut_size, plot = parse_cli_params(args, function_table)
--
2.56.1
next prev parent reply other threads:[~2026-12-04 14:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 14:53 [PATCH v2 0/4] drm/vkms: Add gamma 2.2 and 2.4 1D curve colorops Robert Mader
2026-12-04 14:53 ` Robert Mader [this message]
2026-12-04 14:53 ` [PATCH v2 2/4] drm/vkms: Make LUT test reusable Robert Mader
2026-12-04 14:53 ` [PATCH v2 3/4] drm/vkms: Add support for DRM_COLOROP_1D_CURVE_GAMMA22 Robert Mader
2026-12-04 15:10 ` sashiko-bot
2026-12-04 14:53 ` [PATCH v2 4/4] drm/vkms: Add support for DRM_COLOROP_1D_CURVE_GAMMA24 Robert Mader
2026-12-04 15:11 ` sashiko-bot
2026-12-05 9:55 ` kernel test robot
2026-12-05 9:55 ` kernel test robot
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=20261204145427.221618-2-robert.mader@collabora.com \
--to=robert.mader@collabora.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=harry.wentland@amd.com \
--cc=leandro.ribeiro@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=melissa.srw@gmail.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=oaroraetimis@gmail.com \
--cc=pekka.paalanen@collabora.com \
--cc=sebastian.wick@redhat.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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.