Re: [PATCH V10 33/46] drm: Add Enhanced LUT precision structure

2025-07-15 Thread Alex Hung
On 7/15/25 01:44, Shankar, Uma wrote: -Original Message- From: Borah, Chaitanya Kumar Sent: Tuesday, July 15, 2025 10:08 AM To: Alex Hung ; Simon Ser ; Shankar, Uma Cc: dri-de...@lists.freedesktop.org; amd-...@lists.freedesktop.org; wayland- de...@lists.freedesktop.org

Re: [PATCH V10 33/46] drm: Add Enhanced LUT precision structure

2025-07-11 Thread Alex Hung
On 7/8/25 11:10, Simon Ser wrote: On Tuesday, June 17th, 2025 at 06:26, Alex Hung wrote: diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 651bdf48b766..21bd96f437e0 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -872,6 +872,16

Re: [PATCH V10 33/46] drm: Add Enhanced LUT precision structure

2025-07-11 Thread Alex Hung
On 7/9/25 14:49, Borah, Chaitanya Kumar wrote: Hi Alex, -Original Message- From: Alex Hung Sent: Tuesday, June 17, 2025 9:47 AM To: dri-de...@lists.freedesktop.org; amd-...@lists.freedesktop.org Cc: wayland-devel@lists.freedesktop.org; harry.wentl...@amd.com; alex.h...@amd.com; leo

[PATCH V10 08/46] drm/colorop: Add NEXT property

2025-06-16 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: Harr

[PATCH V10 17/46] drm/vkms: Use s32 for internal color pipeline precision

2025-06-16 Thread Alex Hung
er to allow for this we'll also invert the nesting of our colorop processing loops. We now use the pixel iteration loop on the outside and the colorop iteration on the inside. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone

[PATCH V10 23/46] drm/amd/display: Ignore deprecated props when plane_color_pipeline set

2025-06-16 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 Reviewed-by: Melissa Wen --- drivers/gpu/drm/amd/display/amdgpu_dm

[PATCH V10 39/46] drm/amd/display: Swap matrix and multiplier

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

[PATCH V10 40/46] drm/colorop: Define LUT_1D interpolation

2025-06-16 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

[PATCH V10 41/46] drm/colorop: allow non-bypass colorops

2025-06-16 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 Wentla

[PATCH V10 45/46] drm/amd/display: Ensure 3D LUT for color pipeline

2025-06-16 Thread Alex Hung
Check dpp.hw_3d_lut before creating shaper tf/lut and 3dlut colorops in colorpipeline and handling these colorops. Signed-off-by: Alex Hung --- V10: - Check dpp.hw_3d_lut before creating shaper tf/lut and 3dlut colorops (Melissa Wen) .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 47

[PATCH V10 13/46] drm/colorop: Add destroy functions for color pipeline

2025-06-16 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 Reviewed-by: Simon Ser Reviewed-by: Melissa Wen --- v9: - Move from from latest commit to here, and drm_colorop_pipeline_destroy is

[PATCH V10 20/46] drm/vkms: Add tests for CTM handling

2025-06-16 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 Hu

[PATCH V10 46/46] drm/amd/display: Disable CRTC degamma when color pipeline is enabled

2025-06-16 Thread Alex Hung
The degamma is to be handled by Color pipeline API. Signed-off-by: Alex Hung --- V10: - Disable CRTC degamma when color pipeline is enabled (Melissa Wen) .../drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c| 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a

[PATCH V10 44/46] drm/amd/display: Add AMD color pipeline doc

2025-06-16 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 Reviewed-by: Melissa Wen --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 122 +++--- 1 file changed, 102 insertions(+), 20 deletions

[PATCH V10 42/46] drm/colorop: Add 3D LUT support to color pipeline

2025-06-16 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 Reviewed-by: Melissa Wen --- V10: - Add missing set lut3d_interpolation

[PATCH V10 43/46] drm/amd/display: add 3D LUT colorop

2025-06-16 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 --- V10: - Support 32BIT RGB in 3D

[PATCH V10 38/46] drm/amd/display: add multiplier colorop

2025-06-16 Thread Alex Hung
colorops: 1. 1D curve colorop 2. 3x4 CTM 3. Multiplier 4. 1D curve colorop 5. 1D LUT 6. 1D curve colorop 7. 1D LUT Signed-off-by: Alex Hung Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- V10: - Remove redundant DRM_ERROR(...) V9: - Update function names by _plane_ (Chaitanya Kumar Borah

[PATCH V10 37/46] drm/colorop: Add multiplier type

2025-06-16 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 Revie

[PATCH V10 36/46] drm/amd/display: add 3x4 matrix colorop

2025-06-16 Thread Alex Hung
-ctm_3x4_bt709_enc kms_colorop --run plane-XR30-XR30-ctm_3x4_bt709_dec The color pipeline now consists of the following colorops: 1. 1D curve colorop 2. 3x4 CTM 3. 1D curve colorop 4. 1D LUT 5. 1D curve colorop 6. 1D LUT Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel

[PATCH V10 35/46] drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT

2025-06-16 Thread Alex Hung
colorops: 1. 1D curve colorop 2. 1D curve colorop 3. 1D LUT 4. 1D curve colorop 5. 1D LUT The 1D curve colorops support sRGB, BT2020, and PQ scaled to 125.0. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V10: - Support 32BIT RGB in 1D LUT with

[PATCH V10 34/46] drm/colorop: Add 1D Curve Custom LUT type

2025-06-16 Thread Alex Hung
ch is used by a driver to advertise the supported SIZE of the LUT, as well as a DATA property which userspace uses to set the LUT. DATA and size function in the same way as current drm_crtc GAMMA and DEGAMMA LUTs. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Co-developed-by: Harry Wentland S

[PATCH V10 33/46] drm: Add Enhanced LUT precision structure

2025-06-16 Thread Alex Hung
From: Uma Shankar Existing LUT precision structure drm_color_lut has only 16 bit precision. This is not enough for upcoming enhanced hardwares and advance usecases like HDR processing. Hence added a new structure with 32 bit precision values. Signed-off-by: Alex Hung Signed-off-by: Uma Shankar

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

2025-06-16 Thread Alex Hung
-bt2020_oetf Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V10: - Move amdgpu_dm_supported_*_tfs check to Patch 32 (Melissa Wen) V9: - Move DRM_COLOROP_1D_CURVE_BT2020_* from middle to end v8: - Move BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) in

[PATCH V10 31/46] drm/colorop: add BT2020/BT709 OETF and Inverse OETF

2025-06-16 Thread Alex Hung
transfer function) instead of as EOTF (electro-optical transfer function). Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Simon Ser --- V9: - Move DRM_COLOROP_1D_CURVE_BT2020_* from middle to end (Simon Ser) drivers/gpu/drm/drm_colorop.c | 2

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

2025-06-16 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 Reviewed-by: Simon Ser Reviewed-by: Melissa Wen --- V9: - Update documents according to new 3DLUT changes (Simon Ser) - Spell out the behaviours

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

2025-06-16 Thread Alex Hung
plane-XR30-XR30-pq_125_inv_eotf kms_colorop --run plane-XR30-XR30-pq_125_eotf-pq_125_inv_eotf kms_colorop --run plane-XR30-XR30-pq_125_eotf-pq_125_inv_eotf-pq_125_eotf Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V10: - Move amdgpu_dm_supported_*_tfs check

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

2025-06-16 Thread Alex Hung
-XR30-XR30-srgb_eotf-srgb_inv_eotf The color pipeline now consists of the following colorops: 1. 1D curve colorop w/ sRGB EOTF support 2. 1D curve colorop w/ sRGB Inverse EOTF support Signed-off-by: Alex Hung Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Reviewed-by: Daniel

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

2025-06-16 Thread Alex Hung
colorop: 1. 1D curve colorop w/ sRGB EOTF Signed-off-by: Alex Hung Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V10: - Replace DRM_ERROR by drm_err - Creaet color pipeline when >= DCN_VERSION_3_0 V9: - Update function names by _plane_ (Chaita

[PATCH V10 29/46] drm/colorop: Add PQ 125 EOTF and its inverse

2025-06-16 Thread Alex Hung
eason AMD HW hard-codes a PQ function that is scaled by 125, yielding 80 nit PQ values for 1.0 and 10,000 nits at 125.0. This patch introduces this scaled PQ EOTF and its inverse as 1D curve types. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel

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

2025-06-16 Thread Alex Hung
pipeline now consists of the following colorops: 1. 1D curve colorop w/ sRGB EOTF support 2. 1D curve colorop w/ sRGB Inverse EOTF support 3. 1D curve colorop w/ sRGB EOTF support Signed-off-by: Alex Hung Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone

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

2025-06-16 Thread Alex Hung
cursor plane does not need to have color pipeline. Signed-off-by: Alex Hung Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- 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

[PATCH V10 24/46] drm/amd/display: Add bypass COLOR PIPELINE

2025-06-16 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 --- v10: - guard "dm_plane_init_colorops" function when !AMD_PRIVATE_COLOR (M

[PATCH V10 21/46] drm/colorop: pass plane_color_pipeline client cap to atomic check

2025-06-16 Thread Alex Hung
: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- v5: - Fix kernel docs drivers/gpu/drm/drm_atomic_uapi.c | 1 + include/drm/drm_atomic.h | 18 ++ 2 files changed, 19 insertions(+) diff --git a

[PATCH V10 22/46] drm/colorop: define a new macro for_each_new_colorop_in_state

2025-06-16 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 Reviewed-by: Melissa Wen --- v10: - remove duplicated "is useful" in comments include/drm/drm_ato

[PATCH V10 19/46] drm/tests: Add a few tests around drm_fixed.h

2025-06-16 Thread Alex Hung
dding the drm_test_int2fixp test that validates the above assumption. I am also adding a test for the new sm2fixp function that converts from a signed-magnitude fixed point to the twos-complement fixed point. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Review

[PATCH V10 18/46] drm/vkms: add 3x4 matrix in color pipeline

2025-06-16 Thread Alex Hung
that the matrix entries are in signed-magnitude fixed point, whereas the drm_fixed.h implementation uses 2s-complement. The latter one is the one that we want for easy addition and subtraction, so we convert all entries to 2s-complement. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signe

[PATCH V10 14/46] drm/vkms: Add enumerated 1D curve colorop

2025-06-16 Thread Alex Hung
hout clear indication that we need it. We'll revisit and, if necessary, regenerate the LUTs when we have IGT tests for higher precision buffers. Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Replace cleanup code by drm_colorop_pipeline_des

[PATCH V10 16/46] drm/colorop: Add 3x4 CTM type

2025-06-16 Thread Alex Hung
We only create the DATA property for property types that need it. Reviewed-by: Simon Ser Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- v9: - Merge cleanup code for colorop->state->data in drm_c

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

2025-06-16 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 V10 12/46] Documentation/gpu: document drm_colorop

2025-06-16 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 Reviewed-by: Melissa Wen --- v8: - Move this after "drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE"

[PATCH V10 11/46] drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE

2025-06-16 Thread Alex Hung
d for userspace that sets this client cap. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- V9: - Fix typo in commit description (Shengyu Qu) v8: - Disallow setting of COLOR_RANGE and COLOR_ENCODING

[PATCH V10 10/46] drm/plane: Add COLOR PIPELINE property

2025-06-16 Thread Alex Hung
color pipelines, as well as set the desired one. The color pipelines are programmed via properties on the actual drm_colorop objects. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- V9: - Remove redundant com

[PATCH V10 09/46] drm/colorop: Add atomic state print for drm_colorop

2025-06-16 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 Reviewed-by: Melissa Wen --- v8: - Add switch statement to print colorop type (Simon Ser) v7: - Add a commit

[PATCH V10 07/46] drm/colorop: Add BYPASS property

2025-06-16 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 Reviewed-by: Melissa Wen --- v6

[PATCH V10 06/46] drm/colorop: Add 1D Curve subtype

2025-06-16 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 V10 05/46] drm/colorop: Add TYPE property

2025-06-16 Thread Alex Hung
igned-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- v6: - fix doc typo (Alex Hung) v5: - Add drm_get_colorop_type_name in header - Add kernel docs v4: - Use enum property for TYPE (Pekka) v3: - Make TYPE a range property - Move

[PATCH V10 04/46] drm/colorop: Introduce new drm_colorop mode object

2025-06-16 Thread Alex Hung
-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone Reviewed-by: Melissa Wen --- v8: - Remove drm_atomic_get_existing_colorop_state (Louis Chauvet) v7: - Fix checkpatch warnings and errors - Add a tab to for_each_oldnew_colorop_in_state definition - Change unsigned

[PATCH V10 00/46] Color Pipeline API w/ VKMS

2025-06-16 Thread Alex Hung
Cc: Harry Wentland Cc: Melissa Wen Cc: Jonas Ådahl Cc: Sebastian Wick Cc: Shashank Sharma Cc: Alexander Goins Cc: Joshua Ashton Cc: Michel Dänzer Cc: Aleix Pol Cc: Xaver Hugl Cc: Victoria Brekenfeld Cc: Sima Cc: Uma Shankar Cc: Naseer Ahmed Cc: Christopher Braga Cc: Abhinav Kumar C

[PATCH V10 02/46] drm/vkms: Add kunit tests for VKMS LUT handling

2025-06-16 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

[PATCH V10 01/46] drm: Add helper for conversion from signed-magnitude

2025-06-16 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 Reviewed-by: Meliss

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

2025-05-12 Thread Alex Hung
On 4/25/25 07:50, Leandro Ribeiro wrote: 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

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

2025-05-12 Thread Alex Hung
On 5/12/25 18:52, Melissa Wen wrote: On 04/29, Alex Hung wrote: 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

[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

[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

[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

[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 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 Wentla

[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

[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

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

2025-04-29 Thread Alex Hung
colorops: 1. 1D curve colorop 2. 3x4 CTM 3. Multiplier 4. 1D curve colorop 5. 1D LUT 6. 1D curve colorop 7. 1D LUT Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Update function names by _plane_ (Chaitanya Kumar Borah) .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 40

[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 --

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

2025-04-29 Thread Alex Hung
-ctm_3x4_bt709_enc kms_colorop --run plane-XR30-XR30-ctm_3x4_bt709_dec The color pipeline now consists of the following colorops: 1. 1D curve colorop 2. 3x4 CTM 3. 1D curve colorop 4. 1D LUT 5. 1D curve colorop 6. 1D LUT Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel

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

2025-04-29 Thread Alex Hung
colorops: 1. 1D curve colorop 2. 1D curve colorop 3. 1D LUT 4. 1D curve colorop 5. 1D LUT The 1D curve colorops support sRGB, BT2020, and PQ scaled to 125.0. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Update function names by _plane_ (Chaitanya Kumar

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

2025-04-29 Thread Alex Hung
ch is used by a driver to advertise the supported SIZE of the LUT, as well as a DATA property which userspace uses to set the LUT. DATA and size function in the same way as current drm_crtc GAMMA and DEGAMMA LUTs. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Co-developed-by: Harry Wentland S

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

2025-04-29 Thread Alex Hung
transfer function) instead of as EOTF (electro-optical transfer function). Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Move DRM_COLOROP_1D_CURVE_BT2020_* from middle to end (Simon Ser) drivers/gpu/drm/drm_colorop.c | 2 ++ include/drm/drm_colorop.h

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

2025-04-29 Thread Alex Hung
-bt2020_oetf Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Move DRM_COLOROP_1D_CURVE_BT2020_* from middle to end v8: - Move BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) in amdgpu_dm_supported_blnd_tfs to "drm/amd/display: Enable support for P

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

2025-04-29 Thread Alex Hung
plane-XR30-XR30-pq_125_inv_eotf kms_colorop --run plane-XR30-XR30-pq_125_eotf-pq_125_inv_eotf kms_colorop --run plane-XR30-XR30-pq_125_eotf-pq_125_inv_eotf-pq_125_eotf Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v8: - Move BIT

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

2025-04-29 Thread Alex Hung
eason AMD HW hard-codes a PQ function that is scaled by 125, yielding 80 nit PQ values for 1.0 and 10,000 nits at 125.0. This patch introduces this scaled PQ EOTF and its inverse as 1D curve types. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel

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

2025-04-29 Thread Alex Hung
pipeline now consists of the following colorops: 1. 1D curve colorop w/ sRGB EOTF support 2. 1D curve colorop w/ sRGB Inverse EOTF support 3. 1D curve colorop w/ sRGB EOTF support Signed-off-by: Alex Hung Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone

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

2025-04-29 Thread Alex Hung
-XR30-XR30-srgb_eotf-srgb_inv_eotf The color pipeline now consists of the following colorops: 1. 1D curve colorop w/ sRGB EOTF support 2. 1D curve colorop w/ sRGB Inverse EOTF support Signed-off-by: Alex Hung Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Reviewed-by: Daniel

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

2025-04-29 Thread Alex Hung
colorop: 1. 1D curve colorop w/ sRGB EOTF Signed-off-by: Alex Hung Co-developed-by: Harry Wentland Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Update function names by _plane_ (Chaitanya Kumar Borah) - Update replace cleanup code by drm_colorop_pipeline_destroy (Simon Ser

[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

[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

[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

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

2025-04-29 Thread Alex Hung
: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v5: - Fix kernel docs drivers/gpu/drm/drm_atomic_uapi.c | 1 + include/drm/drm_atomic.h | 18 ++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm

[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 Hu

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

2025-04-29 Thread Alex Hung
dding the drm_test_int2fixp test that validates the above assumption. I am also adding a test for the new sm2fixp function that converts from a signed-magnitude fixed point to the twos-complement fixed point. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Review

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

2025-04-29 Thread Alex Hung
that the matrix entries are in signed-magnitude fixed point, whereas the drm_fixed.h implementation uses 2s-complement. The latter one is the one that we want for easy addition and subtraction, so we convert all entries to 2s-complement. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signe

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

2025-04-29 Thread Alex Hung
er to allow for this we'll also invert the nesting of our colorop processing loops. We now use the pixel iteration loop on the outside and the colorop iteration on the inside. Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone

[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 16/43] drm/colorop: Add 3x4 CTM type

2025-04-29 Thread Alex Hung
We only create the DATA property for property types that need it. Reviewed-by: Simon Ser Reviewed-by: Louis Chauvet Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v9: - Merge cleanup code for colorop->state->data in drm_colorop_cleanup (Simon Se

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

2025-04-29 Thread Alex Hung
hout clear indication that we need it. We'll revisit and, if necessary, regenerate the LUTs when we have IGT tests for higher precision buffers. Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Reviewed-by: Daniel Stone --- V9: - Replace cleanup code by drm_colorop_pipeline_des

[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

[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 DO

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

2025-04-29 Thread Alex Hung
d for userspace that sets this client cap. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Fix typo in commit description (Shengyu Qu) v8: - Disallow setting of COLOR_RANGE and COLOR_ENCODING when DRM_CLIENT_CAP_PLANE_COLOR_PIPELI

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

2025-04-29 Thread Alex Hung
color pipelines, as well as set the desired one. The color pipelines are programmed via properties on the actual drm_colorop objects. Reviewed-by: Simon Ser Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- V9: - Remove redundant comments (Simon Ser) v8:

[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/co

[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: Harr

[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 05/43] drm/colorop: Add TYPE property

2025-04-29 Thread Alex Hung
igned-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v6: - fix doc typo (Alex Hung) v5: - Add drm_get_colorop_type_name in header - Add kernel docs v4: - Use enum property for TYPE (Pekka) v3: - Make TYPE a range property - Move enum drm_colorop_type to

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

2025-04-29 Thread Alex Hung
-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Daniel Stone --- v8: - Remove drm_atomic_get_existing_colorop_state (Louis Chauvet) v7: - Fix checkpatch warnings and errors - Add a tab to for_each_oldnew_colorop_in_state definition - Change unsigned index to unsigned int index

[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

[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

[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 00/43] Color Pipeline API w/ VKMS

2025-04-29 Thread Alex Hung
c: Pekka Paalanen Cc: Simon Ser Cc: Harry Wentland Cc: Melissa Wen Cc: Jonas Ådahl Cc: Sebastian Wick Cc: Shashank Sharma Cc: Alexander Goins Cc: Joshua Ashton Cc: Michel Dänzer Cc: Aleix Pol Cc: Xaver Hugl Cc: Victoria Brekenfeld Cc: Sima Cc: Uma Shankar Cc: Naseer Ahmed Cc: Christop

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

2025-04-05 Thread Alex Hung
-bt2020_oetf Signed-off-by: Alex Hung Signed-off-by: Harry Wentland --- v8: - Move BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) in amdgpu_dm_supported_blnd_tfs to "drm/amd/display: Enable support for PQ 125 EOTF and Inverse" (Leo Li) .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colo

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

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

Re: [PATCH V8 24/43] drm/amd/display: Skip color pipeline initialization for cursor plane

2025-04-04 Thread Alex Hung
On 3/31/25 19:04, Shengyu Qu wrote: My understanding is that currently the driver would just report no colorop support on cursor plane and actually implement the background plane's colorop on cursor? No. Again it is up to compositors or apps to determine how color pipeline and color

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

2025-04-04 Thread Alex Hung
On 3/29/25 09:26, Simon Ser wrote: I would also highlight that we need to seamlessly switch between HW fixed-function blocks and shaders/CPU with no visible difference. Depending on the content being displayed we might need to fallback to shaders/CPU at any time. (A classic example would be a

  1   2   3   >