[PATCH V9 13/43] drm/colorop: Add destroy functions for color pipeline

2025-04-29 Thread Alex Hung
The functions are to clean up color pipeline when a device driver fails to create its color pipeline. Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- v9: - Move from from latest commit to here, and drm_colorop_pipeline_destroy is called in respective commits. drivers/gpu/drm/drm_co

[PATCH V9 10/43] drm/plane: Add COLOR PIPELINE property

2025-04-29 Thread Alex Hung
From: Harry Wentland We're adding a new enum COLOR PIPELINE property. This property will have entries for each COLOR PIPELINE by referencing the DRM object ID of the first drm_colorop of the pipeline. 0 disables the entire COLOR PIPELINE. Userspace can use this to discover the available color pi

[PATCH V9 11/43] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE

2025-04-29 Thread Alex Hung
From: Harry Wentland With the introduction of the pre-blending color pipeline we can no longer have color operations that don't have a clear position in the color pipeline. We deprecate all existing plane properties. For upstream drivers those are: - COLOR_ENCODING - COLOR_RANGE Drivers are ex

[PATCH V9 12/43] Documentation/gpu: document drm_colorop

2025-04-29 Thread Alex Hung
From: Harry Wentland Add kernel doc for drm_colorop objects. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v8: - Move this after "drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE" (Simon Ser) - Update DOC overview (Si

[PATCH V9 14/43] drm/vkms: Add enumerated 1D curve colorop

2025-04-29 Thread Alex Hung
From: Harry Wentland This patch introduces a VKMS color pipeline that includes two drm_colorops for named transfer functions. For now the only ones supported are sRGB EOTF, sRGB Inverse EOTF, and a Linear TF. We will expand this in the future but I don't want to do so without accompanying IGT tes

[PATCH V9 17/43] drm/vkms: Use s32 for internal color pipeline precision

2025-04-29 Thread Alex Hung
From: Harry Wentland Certain operations require us to preserve values below 0.0 and above 1.0 (0x0 and 0x respectively in 16 bpc unorm). One such operation is a BT709 encoding operation followed by its decoding operation, or the reverse. We'll use s32 values as intermediate in and outputs of

[PATCH V9 16/43] drm/colorop: Add 3x4 CTM type

2025-04-29 Thread Alex Hung
From: Harry Wentland This type is used to support a 3x4 matrix in colorops. A 3x4 matrix uses the last column as a "bias" column. Some HW exposes support for 3x4. The calculation looks like: out matrixin |R| |0 1 2 3 | | R | |G| = |4 5 6 7 | x | G | |B| |8 9 10 11| | B

[PATCH V9 15/43] drm/vkms: Add kunit tests for linear and sRGB LUTs

2025-04-29 Thread Alex Hung
From: Harry Wentland Two tests are added to VKMS LUT handling: - linear - inv_srgb Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v7: - Fix checkpatch warnings (Louis Chauvet) - Adde a commit messages - Fix code styles by

[PATCH V9 18/43] drm/vkms: add 3x4 matrix in color pipeline

2025-04-29 Thread Alex Hung
From: Harry Wentland We add two 3x4 matrices into the VKMS color pipeline. The reason we're adding matrices is so that we can test that application of a matrix and its inverse yields an output equal to the input image. One complication with the matrix implementation has to do with the fact that

[PATCH V9 20/43] drm/vkms: Add tests for CTM handling

2025-04-29 Thread Alex Hung
From: Harry Wentland A whole slew of tests for CTM handling that greatly helped in debugging the CTM code. The extent of tests might seem a bit silly but they're fast and might someday help save someone else's day when debugging this. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-

[PATCH V9 21/43] drm/colorop: pass plane_color_pipeline client cap to atomic check

2025-04-29 Thread Alex Hung
From: Harry Wentland Drivers will need to know whether an atomic check/commit originated from a client with DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE so they can ignore deprecated properties, like COLOR_ENCODING and COLOR_RANGE. Pass the plane_color_pipeline bit to drm_atomic_state. Reviewed-by: Simo

[PATCH V9 19/43] drm/tests: Add a few tests around drm_fixed.h

2025-04-29 Thread Alex Hung
From: Harry Wentland While working on the CTM implementation of VKMS I had to ascertain myself of a few assumptions. One of those is whether drm_fixed.h treats its numbers using signed-magnitude or twos-complement. It is twos-complement. In order to make someone else's day easier I am adding the

[PATCH V9 22/43] drm/colorop: define a new macro for_each_new_colorop_in_state

2025-04-29 Thread Alex Hung
Create a new macro for_each_new_colorop_in_state to access new drm_colorop_state updated from uapi. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- include/drm/drm_atomic.h | 20 1 file changed, 20 insertions(+) diff --git a/include/drm/drm_a

[PATCH V9 24/43] drm/amd/display: Add bypass COLOR PIPELINE

2025-04-29 Thread Alex Hung
From: Harry Wentland Add the default Bypass pipeline and ensure it passes the kms_colorop test plane-XR30-XR30-bypass. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 19 +++ 1 file changed,

[PATCH V9 25/43] drm/amd/display: Skip color pipeline initialization for cursor plane

2025-04-29 Thread Alex Hung
cursor plane does not need to have color pipeline. Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- v7: - Add a commit messages drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_

[PATCH V9 23/43] drm/amd/display: Ignore deprecated props when plane_color_pipeline set

2025-04-29 Thread Alex Hung
From: Harry Wentland When the plane_color_pipeline bit is set we should ignore deprecated properties, such as COLOR_RANGE and COLOR_ENCODING. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 1 fil

[PATCH V9 26/43] drm/amd/display: Add support for sRGB EOTF in DEGAM block

2025-04-29 Thread Alex Hung
Expose one 1D curve colorop with support for DRM_COLOROP_1D_CURVE_SRGB_EOTF and program HW to perform the sRGB transform when the colorop is not in bypass. With this change the following IGT test passes: kms_colorop --run plane-XR30-XR30-srgb_eotf The color pipeline now consists of a single color

[PATCH V9 27/43] drm/amd/display: Add support for sRGB Inverse EOTF in SHAPER block

2025-04-29 Thread Alex Hung
Expose a 2nd curve colorop with support for DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF and program HW to perform the sRGB Inverse EOTF on the shaper block when the colorop is not in bypass. With this change the follow IGT tests pass: kms_colorop --run plane-XR30-XR30-srgb_inv_eotf kms_colorop --run plane-

[PATCH V9 28/43] drm/amd/display: Add support for sRGB EOTF in BLND block

2025-04-29 Thread Alex Hung
Expose a 3rd 1D curve colorop, with support for DRM_COLOROP_1D_CURVE_SRGB_EOTF and program the BLND block to perform the sRGB transform when the colorop is not in bypass With this change the following IGT test passes: kms_colorop --run plane-XR30-XR30-srgb_eotf-srgb_inv_eotf-srgb_eotf The color p

[PATCH V9 30/43] drm/amd/display: Enable support for PQ 125 EOTF and Inverse

2025-04-29 Thread Alex Hung
From: Harry Wentland This patchset enables support for the PQ_125 EOTF and its inverse on all existing plane 1D curve colorops, i.e., on DEGAM, SHAPER, and BLND blocks. With this patchset the following IGT subtests are passing: kms_colorop --run plane-XR30-XR30-pq_125_eotf kms_colorop --run plan

[PATCH V9 29/43] drm/colorop: Add PQ 125 EOTF and its inverse

2025-04-29 Thread Alex Hung
From: Harry Wentland The PQ function defines a mapping of code values to nits (cd/m^2). The max code value maps to 10,000 nits. Windows DWM's canonical composition color space (CCCS) defaults to composing SDR contents to 80 nits and uses a float value of 1.0 to represent this. For this reason A

[PATCH V9 31/43] drm/colorop: add BT2020/BT709 OETF and Inverse OETF

2025-04-29 Thread Alex Hung
From: Harry Wentland The BT.709 and BT.2020 OETFs are the same, the only difference being that the BT.2020 variant is defined with more precision for 10 and 12-bit per color encodings. Both are used as encoding functions for video content, and are therefore defined as OETF (opto-electronic trans

[PATCH V9 32/43] drm/amd/display: Add support for BT.709 and BT.2020 TFs

2025-04-29 Thread Alex Hung
From: Harry Wentland This adds support for the BT.709/BT.2020 transfer functions on all current 1D curve plane colorops, i.e., on DEGAM, SHAPER, and BLND blocks. With this change the following IGT subtests pass: kms_colorop --run plane-XR30-XR30-bt2020_inv_oetf kms_colorop --run plane-XR30-XR30-

[PATCH V9 34/43] drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT

2025-04-29 Thread Alex Hung
This patch adds colorops for custom 1D LUTs in the SHAPER and BLND HW blocks. With this change the following IGT tests pass: kms_colorop --run plane-XR30-XR30-srgb_inv_eotf_lut kms_colorop --run plane-XR30-XR30-srgb_inv_eotf_lut-srgb_eotf_lut The color pipeline now consists of the following color

[PATCH V9 33/43] drm/colorop: Add 1D Curve Custom LUT type

2025-04-29 Thread Alex Hung
We've previously introduced DRM_COLOROP_1D_CURVE for pre-defined 1D curves. But we also have HW that supports custom curves and userspace needs the ability to pass custom curves, aka LUTs. This patch introduces a new colorop type, called DRM_COLOROP_1D_LUT that provides a SIZE property which is us

[PATCH V9 36/43] drm/colorop: Add mutliplier type

2025-04-29 Thread Alex Hung
This introduces a new drm_colorop_type: DRM_COLOROP_MULTIPLIER. It's a simple multiplier to all pixel values. The value is specified via a S31.32 fixed point provided via the "MULTIPLIER" property. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Update func

[PATCH V9 37/43] drm/amd/display: add multiplier colorop

2025-04-29 Thread Alex Hung
This adds support for a multiplier. This multiplier is programmed via the HDR Multiplier in DCN. With this change the following IGT tests pass: kms_colorop --run plane-XR30-XR30-multiply_125 kms_colorop --run plane-XR30-XR30-multiply_inv_125 The color pipeline now consists of the following coloro

[PATCH V9 35/43] drm/amd/display: add 3x4 matrix colorop

2025-04-29 Thread Alex Hung
This adds support for a 3x4 color transformation matrix. With this change the following IGT tests pass: kms_colorop --run plane-XR30-XR30-ctm_3x4_50_desat kms_colorop --run plane-XR30-XR30-ctm_3x4_overdrive kms_colorop --run plane-XR30-XR30-ctm_3x4_oversaturate kms_colorop --run plane-XR30-XR30-ct

[PATCH V9 42/43] drm/amd/display: add 3D LUT colorop

2025-04-29 Thread Alex Hung
This adds support for a 3D LUT. The color pipeline now consists of the following colorops: 1. 1D curve colorop 2. Multiplier 3. 3x4 CTM 4. 1D curve colorop 5. 1D LUT 6. 3D LUT 7. 1D curve colorop 8. 1D LUT Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Return a value in __set_dm_

[PATCH V9 40/43] drm/colorop: allow non-bypass colorops

2025-04-29 Thread Alex Hung
From: Harry Wentland Not all HW will be able to do bypass on all color operations. Introduce an 32 bits 'flags' for all colorop init functions and DRM_COLOROP_FLAG_ALLOW_BYPASS for creating the BYPASS property when it's true. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by:

[PATCH V9 39/43] drm/colorop: Define LUT_1D interpolation

2025-04-29 Thread Alex Hung
From: Harry Wentland We want to make sure userspace is aware of the 1D LUT interpolation. While linear interpolation is common it might not be supported on all HW. Give driver implementers a way to specify their interpolation. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harr

[PATCH V9 41/43] drm/colorop: Add 3D LUT support to color pipeline

2025-04-29 Thread Alex Hung
It is to be used to enable HDR by allowing userpace to create and pass 3D LUTs to kernel and hardware. new drm_colorop_type: DRM_COLOROP_3D_LUT. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Update function names by _plane_ (Chaitanya Kumar Borah) v8: -

[PATCH V9 38/43] drm/amd/display: Swap matrix and multiplier

2025-04-29 Thread Alex Hung
Swap the order of matrix and multiplier as designed in hardware. Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Update function names by _plane_ (Chaitanya Kumar Borah) .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 12 ++-- .../drm/amd/display/amdgpu_dm/amdgpu_d

[PATCH V9 43/43] drm/amd/display: Add AMD color pipeline doc

2025-04-29 Thread Alex Hung
From: Harry Wentland Add kernel doc for AMD color pipeline. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 122 +++--- 1 file changed, 102 insertions(+), 20 deletions(-) diff --git a/drivers/gp

[PATCH V9 07/43] drm/colorop: Add BYPASS property

2025-04-29 Thread Alex Hung
From: Harry Wentland We want to be able to bypass each colorop at all times. Introduce a new BYPASS boolean property for this. Reviewed-by: Simon Ser Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v6: - clarify that bypass is

[PATCH V9 00/43] Color Pipeline API w/ VKMS

2025-04-29 Thread Alex Hung
This is an RFC set for a color pipeline API, along with implementations in VKMS and amdgpu. It is tested with a set of IGT tests that can be found at [1]. The IGT tests run a pixel-by-pixel comparison with an allowable delta variation as the goal for these transformations is perceptual correctness,

[PATCH V9 04/43] drm/colorop: Introduce new drm_colorop mode object

2025-04-29 Thread Alex Hung
From: Harry Wentland This patches introduces a new drm_colorop mode object. This object represents color transformations and can be used to define color pipelines. We also introduce the drm_colorop_state here, as well as various helpers and state tracking bits. Reviewed-by: Simon Ser Signed-of

[PATCH V9 03/43] drm/doc/rfc: Describe why prescriptive color pipeline is needed

2025-04-29 Thread Alex Hung
From: Harry Wentland Add documentation for color pipeline API. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Update documents according to new 3DLUT changes (Simon Ser) - Spell out the behaviours when fallback to shaders/CPU (Simon Ser) v8: - F

[PATCH V9 02/43] drm/vkms: Add kunit tests for VKMS LUT handling

2025-04-29 Thread Alex Hung
From: Harry Wentland Debugging LUT math is much easier when we can unit test it. Add kunit functionality to VKMS and add tests for - get_lut_index - lerp_u16 Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Cc: Arthur Grillo Reviewed-by: Daniel Stone --- v

[PATCH V9 05/43] drm/colorop: Add TYPE property

2025-04-29 Thread Alex Hung
From: Harry Wentland Add a read-only TYPE property. The TYPE specifies the colorop type, such as enumerated curve, 1D LUT, CTM, 3D LUT, PWL LUT, etc. For now we're only introducing an enumerated 1D LUT type to illustrate the concept. Reviewed-by: Simon Ser Reviewed-by: Louis Chauvet Signed-of

[PATCH V9 01/43] drm: Add helper for conversion from signed-magnitude

2025-04-29 Thread Alex Hung
From: Harry Wentland CTM values are defined as signed-magnitude values. Add a helper that converts from CTM signed-magnitude fixed point value to the twos-complement value used by drm_fixed. Reviewed-by: Louis Chauvet Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- include/drm/dr

[PATCH V9 06/43] drm/colorop: Add 1D Curve subtype

2025-04-29 Thread Alex Hung
From: Harry Wentland Add a new drm_colorop with DRM_COLOROP_1D_CURVE with two subtypes: DRM_COLOROP_1D_CURVE_SRGB_EOTF and DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF. Reviewed-by: Simon Ser Reviewed-by: Louis Chauvet Signed-off-by: Harry Wentland Co-developed-by: Alex Hung Signed-off-by: Alex Hung

[PATCH V9 09/43] drm/colorop: Add atomic state print for drm_colorop

2025-04-29 Thread Alex Hung
From: Harry Wentland Print atomic state for drm_colorop in debugfs Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v8: - Add switch statement to print colorop type (Simon Ser) v7: - Add a commit messages - Squash "drm/colorop: A

[PATCH V9 08/43] drm/colorop: Add NEXT property

2025-04-29 Thread Alex Hung
From: Harry Wentland We'll construct color pipelines out of drm_colorop by chaining them via the NEXT pointer. NEXT will point to the next drm_colorop in the pipeline, or by 0 if we're at the end of the pipeline. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Re

Re: [PATCH V8 40/43] drm/colorop: Add 3D LUT support to color pipeline

2025-04-29 Thread Leandro Ribeiro
On 3/26/25 20:47, Alex Hung wrote: > It is to be used to enable HDR by allowing userpace to create and pass > 3D LUTs to kernel and hardware. > > new drm_colorop_type: DRM_COLOROP_3D_LUT. > > Signed-off-by: Alex Hung > --- > v8: > - Fix typo in subject (Simon Ser) > - Update documentation f

[ANNOUNCE] Weston 12.0.5

2025-04-29 Thread Marius Vlad
Hi all, This is Weston 12.0.5 bug-fix release. Due to some tests failing (unrelated to the fixes here) I wasn't able to release Weston 12.0.5 on last Friday, and wanted to figure out what was causing them. I've traced that to a potential fix, but those changes would've been to intrusive to land i