From: sashiko-bot@kernel.org
To: "Leandro Ribeiro" <leandro.ribeiro@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 10/11] drm/vkms: add script to create optimized LUTs for color curves
Date: Tue, 04 Aug 2026 20:47:36 +0000 [thread overview]
Message-ID: <20260804204737.A68ED1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260804203351.148521-11-leandro.ribeiro@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unconditional GUI plot generation and matplotlib import block script execution and break in headless environments.
--
--- Patch [10]: [PATCH 10/11] drm/vkms: add script to create optimized LUTs for color curves ---
commit eeb1a305fab717b385cfb6fdf6633f43f03c3b5f
Author: Leandro Ribeiro <leandro.ribeiro@collabora.com>
drm/vkms: add script to create optimized LUTs for color curves
This commit adds a Python script to generate u16 LUTs for VKMS color transfer
functions. The script compares different LUT generation strategies and outputs
the generated LUTs as C arrays formatted for vkms_luts.c.
> diff --git a/drivers/gpu/drm/vkms/scripts/color-curve-lut.py b/drivers/gpu/drm/vkms/scripts/color-curve-lut.py
> new file mode 100644
> index 0000000000000..f80e67120f5b3
> --- /dev/null
> +++ b/drivers/gpu/drm/vkms/scripts/color-curve-lut.py
> @@ -0,0 +1,561 @@
[ ... ]
> +import sys
> +import os
> +import time
> +import bisect
> +import math
> +import numpy as np
> +import matplotlib.pyplot as plt
[Severity: Medium]
Will this unconditional import of matplotlib crash the script in headless
environments or CI pipelines that lack a configured display backend?
[ ... ]
> +def main(args):
[ ... ]
> + # Save the greedy subdivision LUT as C arrays for VKMS
> + greedy_lut = luts[2]
> + emit_c_arrays(greedy_lut, func_str)
> +
> + # Plot the LUTs... kind of useless when we have a big LUT, but still good to
> + # visualize with fewer taps.
> + fig, axes = plt.subplots(1, len(luts), figsize=(15, 6))
> + for i, lut in enumerate(luts):
> + ax = axes[i]
> + ax.set_title(f"{lut.name} - {func_str}, LUT size: {lut.lut_size}")
> + ax.set_xlabel('X')
> + ax.set_ylabel('Y')
> + ax.grid(True, linestyle='--')
> + ax.plot(lut.x, lut.y, 'o', color="blue")
> + ax.set_aspect('equal')
> + plt.tight_layout()
> + plt.show()
[Severity: Medium]
Does this plt.show() call block execution indefinitely until the GUI window is
manually closed?
If this script is run as part of an automated workflow, this could cause the
process to hang. Could the plotting functionality be made optional and put
behind a command-line flag?
> +
> +
> +if __name__ == "__main__":
> + main(sys.argv)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260804203351.148521-1-leandro.ribeiro@collabora.com?part=10
next prev parent reply other threads:[~2026-08-04 20:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 20:33 [PATCH 00/11] drm/vkms: improve color curve LUTs precision Leandro Ribeiro
2026-08-04 20:33 ` [PATCH 01/11] drm/vkms: rename VKMS_LUT_SIZE to VKMS_GAMMA_LUT_SIZE Leandro Ribeiro
2026-08-04 20:41 ` sashiko-bot
2026-08-04 20:33 ` [PATCH 02/11] drm/vkms: allow color curve LUTs to have different sizes Leandro Ribeiro
2026-08-04 20:33 ` [PATCH 03/11] drm/vkms: remove TEST_LUT_SIZE Leandro Ribeiro
2026-08-04 20:33 ` [PATCH 04/11] drm/vkms: remove linear_eotf Leandro Ribeiro
2026-08-04 20:42 ` sashiko-bot
2026-08-04 20:33 ` [PATCH 05/11] drm/vkms: improve the way in which we access LUT member Leandro Ribeiro
2026-08-04 20:33 ` [PATCH 06/11] drm/vkms: rename struct vkms_color_lut::base to y Leandro Ribeiro
2026-08-04 20:52 ` sashiko-bot
2026-08-04 20:33 ` [PATCH 07/11] drm/vkms: rename get_lut_index() to get_uniform_lut_index() Leandro Ribeiro
2026-08-04 20:47 ` sashiko-bot
2026-08-04 20:33 ` [PATCH 08/11] drm/vkms: add support to non-uniform LUT for internal color curves Leandro Ribeiro
2026-08-04 20:33 ` [PATCH 09/11] drm/vkms: test sRGB and inverse sRGB LUTs using more samples Leandro Ribeiro
2026-08-04 20:33 ` [PATCH 10/11] drm/vkms: add script to create optimized LUTs for color curves Leandro Ribeiro
2026-08-04 20:47 ` sashiko-bot [this message]
2026-08-04 20:33 ` [PATCH 11/11] drm/vkms: replace uniform sRGB LUT and its inverse with optimal ones Leandro Ribeiro
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=20260804204737.A68ED1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=leandro.ribeiro@collabora.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox