[PATCH v2 1/4] drm/vkms: Fix inverse lut naming scheme in script

From: Robert Mader

Date: Fri Dec 04 2026 - 09:55:46 EST


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@xxxxxxxxxxxxx>
---
.../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