Re: [PATCH v5 02/44] drm/vkms: Round fixp2int conversion in lerp_u16

2024-08-30 Thread Louis Chauvet
u16 a, u16 b, s64 t) > > s64 delta = drm_fixp_mul(b_fp - a_fp, t); > > - return drm_fixp2int(a_fp + delta); > + return drm_fixp2int_round(a_fp + delta); > } > > static s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value) > -- > 2.46.0 > Reviewed-by: Louis Chauvet

Re: [PATCH v5 14/44] drm/vkms: Add enumerated 1D curve colorop

2024-08-30 Thread Louis Chauvet
a_blend(plane[i]->frame_info, stage_buffer, > output_buffer); > } [...] > diff --git a/drivers/gpu/drm/vkms/vkms_luts.c > b/drivers/gpu/drm/vkms/vkms_luts.c > new file mode 100644 > index ..6553d6d442b4 > --- /dev/null > +++ b/drivers/gpu/drm/vkms/vkms_luts.c > @@ -0,0 +1,802 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > + > +#include > + > +#include "vkms_drv.h" > +#include "vkms_luts.h" > + > +static struct drm_color_lut linear_array[LUT_SIZE] = { > + { 0x0, 0x0, 0x0, 0 }, > + { 0x101, 0x101, 0x101, 0 }, > + { 0x202, 0x202, 0x202, 0 }, > + { 0x303, 0x303, 0x303, 0 }, > + { 0x404, 0x404, 0x404, 0 }, For this LUT and the other, can you add a comment to explain how the values were generated/found? [...] Thanks, Louis Chauvet

Re: [PATCH v5 03/44] drm/vkms: Add kunit tests for VKMS LUT handling

2024-08-30 Thread Louis Chauvet
Le 19/08/24 - 16:56, Harry Wentland a écrit : [...] > diff --git a/drivers/gpu/drm/vkms/vkms_composer.c > b/drivers/gpu/drm/vkms/vkms_composer.c > index 3d6785d081f2..3ecda70c2b55 100644 > --- a/drivers/gpu/drm/vkms/vkms_composer.c > +++ b/drivers/gpu/drm/vkms/vkms_composer.c > @@ -435,3 +435,7

Re: [PATCH v5 05/44] drm/colorop: Introduce new drm_colorop mode object

2024-08-30 Thread Louis Chauvet
drm_colorop_state *state; > + > + /* colorop properties */ Maybe the same kind of comment here? > + /** @properties: property tracking for this colorop */ > + struct drm_object_properties properties; > + > +}; > + [...] Louis Chauvet

Re: [PATCH v5 00/44] Color Pipeline API w/ VKMS

2024-08-30 Thread Louis Chauvet
r identity, and sRGB, and replace > them with fixed-point math instead. Hi! I reviewed your VKMS patches and added a few comments in your series. This series looks very good. Thanks for this work, Louis Chauvet > There are plenty of things that I would like to see, but they could >

Re: [PATCH v5 18/44] drm/vkms: Use s32 for internal color pipeline precision

2024-08-30 Thread Louis Chauvet
Le 19/08/24 - 16:56, Harry Wentland a écrit : > 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 value

Re: [PATCH v5 41/44] drm/colorop: allow non-bypass colorops

2024-08-30 Thread Louis Chauvet
Le 19/08/24 - 16:57, Harry Wentland a écrit : > Not all HW will be able to do bypass on all color > operations. Introduce an 'allow_bypass' boolean for > all colorop init functions and only create the BYPASS > property when it's true. You did not change the documentation of struct drm_colorop_stat

Re: [PATCH v5 19/44] drm/vkms: add 3x4 matrix in color pipeline

2024-08-30 Thread Louis Chauvet
Le 19/08/24 - 16:56, Harry Wentland a écrit : > 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 implement

Re: [PATCH v6 18/44] drm/vkms: Use s32 for internal color pipeline precision

2024-10-04 Thread Louis Chauvet
Signed-off-by: Harry Wentland > --- > v6: > - use clamp_val instead of manual clamping (Louis Chauvet) Perfect! > v4: > - Clarify that we're packing 16-bit UNORM into s32, not >converting values to a different representation (Pekka) > > v3: > - Use new colorop-&g

Re: [PATCH v6 21/44] drm/vkms: Add tests for CTM handling

2024-10-04 Thread Louis Chauvet
; > Signed-off-by: Harry Wentland Reviewed-by: Louis Chauvet > --- > > v6: > - update reference values since we're now rounding > > v5: > - Make apply_3x4_matrix static > > v4: > - Comment on origin of bt709_enc matrix (Pekka) > - Use full opaque alpha (P

Re: [PATCH v6 41/44] drm/colorop: allow non-bypass colorops

2024-10-04 Thread Louis Chauvet
On 03/10/24 - 16:01, Harry Wentland wrote: > Not all HW will be able to do bypass on all color > operations. Introduce an 'allow_bypass' boolean for > all colorop init functions and only create the BYPASS > property when it's true. > > Signed-off-by: Harry Wentland > --- > .../amd/display/amdgpu

Re: [PATCH v6 03/44] drm/vkms: Add kunit tests for VKMS LUT handling

2024-10-04 Thread Louis Chauvet
minate need to include test as .c file (Louis Chauvet) Thanks for the modification! With the checkpatch warning fixed: Reviewed-by: Louis Chauvet > v5: > - Bring back static for lerp_u16 and get_lut_index (Arthur) > > v4: > - Test the critical points of the lerp function (Pe

Re: [PATCH v6 20/44] drm/tests: Add a few tests around drm_fixed.h

2024-10-04 Thread Louis Chauvet
Few checkpatch warnings: - line length of 103 exceeds 100 columns - Blank lines aren't necessary before a close brace '}' - adding a line without newline at end of file With those fixed: Reviewd-by: Louis Chauvet On 03/10/24 - 16:01, Harry Wentland wrote: > While

Re: [PATCH v6 19/44] drm/vkms: add 3x4 matrix in color pipeline

2024-10-04 Thread Louis Chauvet
mplement. > > Signed-off-by: Harry Wentland > --- > > v6: > - pre-compute colors (Louis Chauvet) > - round matrix output (Louis Chauvet) > > drivers/gpu/drm/vkms/vkms_colorop.c | 34 +++- > drivers/gpu/drm/vkms/vkms_composer.c | 32 +

Re: [PATCH v6 15/44] drm/vkms: Add kunit tests for linear and sRGB LUTs

2024-10-04 Thread Louis Chauvet
kms/vkms_composer.h > +++ b/drivers/gpu/drm/vkms/vkms_composer.h > @@ -5,9 +5,22 @@ > > #include > > +/* > + * This enum is related to the positions of the variables inside > + * `struct drm_color_lut`, so the order of both needs to be the same. > + */ > +enum lut

Re: [PATCH v6 14/44] drm/vkms: Add enumerated 1D curve colorop

2024-10-04 Thread Louis Chauvet
ely need higher precision > but I'm reluctant to make that change without 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-b

Re: [V7 07/45] drm/colorop: Add 1D Curve subtype

2025-02-28 Thread Louis Chauvet
Le 28/02/2025 à 02:07, Alex Hung a écrit : On 2/25/25 03:13, Louis Chauvet wrote: Le 20/12/2024 à 05:33, Alex Hung a écrit : 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

Re: [V7 02/45] drm/vkms: Round fixp2int conversion in lerp_u16

2025-02-25 Thread Louis Chauvet
Le 20/12/2024 à 05:33, Alex Hung a écrit : From: Harry Wentland fixp2int always rounds down, fixp2int_ceil rounds up. We need the new fixp2int_round. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Louis Chauvet Hi, Can I extract this patch from the series and

Re: [V7 03/45] drm/vkms: Add kunit tests for VKMS LUT handling

2025-02-25 Thread Louis Chauvet
Le 20/12/2024 à 05:33, Alex Hung a écrit : 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

Re: [V7 01/45] drm: Add helper for conversion from signed-magnitude

2025-02-25 Thread Louis Chauvet
Le 24/02/2025 à 19:50, Alex Hung a écrit : On 2/24/25 09:07, Louis Chauvet wrote: Le 20/12/2024 à 05:33, Alex Hung a écrit : 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

Re: [V7 05/45] drm/colorop: Introduce new drm_colorop mode object

2025-02-25 Thread Louis Chauvet
v6: - Comment that properties validity depends on type (Louis Chauvet) v5: - Add comment to drm_atomic_state.colorops - Replace a misplaced 'plane' with 'colorop' in comment - Fix colorop_list kernel doc - Add kernel doc for color_pipeline - drop unused drm_c

Re: [V7 06/45] drm/colorop: Add TYPE property

2025-02-25 Thread Louis Chauvet
d-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Louis Chauvet -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [V7 07/45] drm/colorop: Add 1D Curve subtype

2025-02-25 Thread Louis Chauvet
&val); + colorop_state->curve_1d_type = val; + } } /** @@ -114,3 +240,11 @@ const char *drm_get_colorop_type_name(enum drm_colorop_type type return colorop_type_name[type]; Probably a dumb question: can't we use drm_colorop_type_enum_list instead of colorop_type_name in the drm_get_colorop_type_name function? So we will avoid duplicating the string "1D Curve". } Thanks, Louis Chauvet [...] -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [V7 09/45] drm/colorop: Add BYPASS property

2025-02-25 Thread Louis Chauvet
Le 20/12/2024 à 05:33, Alex Hung a écrit : From: Harry Wentland We want to be able to bypass each colorop at all times. Introduce a new BYPASS boolean property for this. Signed-off-by: Alex Hung Signed-off-by: Harry Wentland Reviewed-by: Louis Chauvet -- Louis Chauvet, Bootlin

Re: [V7 10/45] drm/colorop: Add NEXT property

2025-02-25 Thread Louis Chauvet
drm_property *next_property; + }; #define obj_to_colorop(x) container_of(x, struct drm_colorop, base) + + + Strange useless lines Thanks, Louis Chauvet /** * drm_colorop_find - look up a Colorop object from its ID * @dev: DRM device @@ -268,4 +286,6

Re: [V7 06/45] drm/colorop: Add TYPE property

2025-02-24 Thread Louis Chauvet

Re: [V7 02/45] drm/vkms: Round fixp2int conversion in lerp_u16

2025-02-24 Thread Louis Chauvet

Re: [V7 05/45] drm/colorop: Introduce new drm_colorop mode object

2025-02-24 Thread Louis Chauvet

Re: [V7 03/45] drm/vkms: Add kunit tests for VKMS LUT handling

2025-02-24 Thread Louis Chauvet

Re: [V7 10/45] drm/colorop: Add NEXT property

2025-02-24 Thread Louis Chauvet

Re: [V7 01/45] drm: Add helper for conversion from signed-magnitude

2025-02-24 Thread Louis Chauvet
Le 20/12/2024 à 05:33, Alex Hung a écrit : 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. Signed-off-by: Harry Wentland Reviewed-by: Louis

Re: [V7 09/45] drm/colorop: Add BYPASS property

2025-02-24 Thread Louis Chauvet

Re: [V7 07/45] drm/colorop: Add 1D Curve subtype

2025-02-24 Thread Louis Chauvet

Re: [V7 02/45] drm/vkms: Round fixp2int conversion in lerp_u16

2025-02-25 Thread Louis Chauvet
Le 25/02/2025 à 12:28, Simon Ser a écrit : On Tuesday, February 25th, 2025 at 10:37, Louis Chauvet wrote: Can I extract this patch from the series and apply it on drm-misc-next? That sounds completely fine by me, and TBH it sounds like it could even be drm-misc-fixes material

Re: [V7 15/45] drm/vkms: Add kunit tests for linear and sRGB LUTs

2025-02-25 Thread Louis Chauvet
Le 20/12/2024 à 05:33, Alex Hung a écrit : 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 --- v7: - Fix checkpatch warnings (Louis Chauvet) - Adde a commit messages

Re: [V7 14/45] drm/vkms: Add enumerated 1D curve colorop

2025-02-25 Thread Louis Chauvet
t I'm reluctant to make that change without 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 --- v7: - Fix checkpatch warnings (Louis Chauv

Re: [V7 02/45] drm/vkms: Round fixp2int conversion in lerp_u16

2025-02-25 Thread Louis Chauvet
with drm/amd code but we can check that before merging. That sounds like the simplest solution to me :) So let's go this way! I just applied PATCH 2. I don't feel comfortable merging the whole colorop and AMD parts without broader reviews, but I can definitely apply the VKMS part.

Re: [V7 16/45] drm/colorop: Add 3x4 CTM type

2025-02-25 Thread Louis Chauvet
=%d\n", state->data ? state->data->base.id : 0); + break; + default: + break; + } + As suggested by Simon, you could add this switch in a previous patch, so you could avoid editing the same line twice. With or without this change: Reviewed

Re: [V7 18/45] drm/vkms: add 3x4 matrix in color pipeline

2025-02-25 Thread Louis Chauvet
ff-by: Alex Hung Signed-off-by: Harry Wentland --- v7: - Fix checkpatch warnings - Change kzalloc(sizeof(struct drm_colorop) ...) to kzalloc(sizeof(*ops[i]) ...) - Change i-1to i - 1 - Add a new line at EOF v6: - pre-compute colors (Louis Chauvet) - round matrix output (Louis Ch