[PATCH v2] drm/vkms: Add documentation

2024-08-26 Thread Louis Chauvet
Add documentation around vkms_output and its initialization. Signed-off-by: Louis Chauvet --- This series does not introduce functionnal changes, only some documentation and renaming to clarify the code. --- Changes in v2: - Dropped already applied patches - Dropped useless patch as its content

Re: [PATCH 2/3] drm/vkms: Rename index to possible_crtc

2024-08-26 Thread Louis Chauvet
Le 15/08/24 - 11:07, Maíra Canal a écrit : > On 8/14/24 05:46, Louis Chauvet wrote: > > The meaning of index was not clear. Replace them with crtc_index to > > clearly indicate its usage. > > > > Signed-off-by: Louis Chauvet > > IMHO no need for this patch, es

Re: [PATCH RFC 3/4] drm/vkms: Switch to managed for crtc

2024-08-26 Thread Louis Chauvet
o use drm and device managed helpers. > > > > Signed-off-by: Louis Chauvet > > I think that this patch is doing different things that we could split in > simpler > diffs. > > Moving the code from vkms_output.c to vkms_drv.c be its own patch. I agree, but for the v2

Re: [PATCH RFC 1/4] drm/vkms: Switch to managed for connector

2024-08-26 Thread Louis Chauvet
gt; is not an issue yet, but in order to support multiple devices easily, > > convert this code to use drm and device managed helpers. > > > > Signed-off-by: Louis Chauvet > > Reviewed-by: José Expósito Thanks! I will test my v2 and send it tomorrow! > >

Re: [PATCH RFC 2/4] drm/vkms: Switch to managed for encoder

2024-08-26 Thread Louis Chauvet
elpers. > > > > Signed-off-by: Louis Chauvet > > Reviewed-by: José Expósito Thanks! > > --- > > drivers/gpu/drm/vkms/vkms_drv.h| 1 - > > drivers/gpu/drm/vkms/vkms_output.c | 21 + > > 2 files changed, 9 insertions(+),

[PATCH v2 0/6] drm/vkms: Switch all vkms object to DRM managed objects

2024-08-27 Thread Louis Chauvet
r the vkms_output/vkms_crtc structure. when one of those series is merged, I will rebase the other. [1]: https://lore.kernel.org/all/20240826-google-clarifications-v2-1-2574655b0...@bootlin.com/ Signed-off-by: Louis Chauvet --- Changes in v2: - Applied comments from José - Extract the rename vkms_o

[PATCH v2 1/6] drm/vkms: Switch to managed for connector

2024-08-27 Thread Louis Chauvet
The current VKMS driver uses non-managed function to create connectors. It is not an issue yet, but in order to support multiple devices easily, convert this code to use drm and device managed helpers. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.h| 1 - drivers/gpu/drm

[PATCH v2 4/6] drm/vkms: rename to_vkms_crtc_state to drm_crtc_state_to_vkms_crtc_state to avoid confusion

2024-08-27 Thread Louis Chauvet
To avoid confusion in macro, rename to_vkms_crtc_state to a more explicit name drm_crtc_state_to_vkms_crtc_state Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_crtc.c | 6 +++--- drivers/gpu/drm/vkms/vkms_drv.c | 2 +- drivers/gpu/drm/vkms/vkms_drv.h | 2 +- 3 files changed, 5

[PATCH v2 3/6] drm/vkms: Rename vkms_output to vkms_crtc

2024-08-27 Thread Louis Chauvet
The current vkms_output structure only contains crtc-related members. In preparation of the migration to drmm for crtc and to avoid confusion, rename this structure and all its usage to vkms_crtc. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 30

[PATCH v2 6/6] drm/vkms: Add missing check for CRTC initialization

2024-08-27 Thread Louis Chauvet
CRTC initialization call drm_mode_crtc_set_gamma_size without the proper checks, introduce this check. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm

[PATCH v2 2/6] drm/vkms: Switch to managed for encoder

2024-08-27 Thread Louis Chauvet
The current VKMS driver uses non-managed function to create encoders. It is not an issue yet, but in order to support multiple devices easily, convert this code to use drm and device managed helpers. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.h| 1 - drivers/gpu/drm

[PATCH v2 5/6] drm/vkms: Switch to managed for CRTC

2024-08-27 Thread Louis Chauvet
The current VKMS driver uses non-managed function to create CRTCs. It is not an issue yet, but in order to support multiple devices easily, convert this code to use drm and device managed helpers. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_crtc.c | 40

Re: [PATCH v2 1/6] drm/vkms: Switch to managed for connector

2024-08-27 Thread Louis Chauvet
Le 27/08/24 - 15:15, Maxime Ripard a écrit : > Hi, > > On Tue, Aug 27, 2024 at 11:57:36AM GMT, Louis Chauvet wrote: > > The current VKMS driver uses non-managed function to create connectors. It > > is not an issue yet, but in order to support multiple devices easily, > &g

Re: [PATCH v2 1/6] drm/vkms: Switch to managed for connector

2024-08-27 Thread Louis Chauvet
Le 27/08/24 - 16:39, Maxime Ripard a écrit : > On Tue, Aug 27, 2024 at 03:24:10PM GMT, Louis Chauvet wrote: > > Le 27/08/24 - 15:15, Maxime Ripard a écrit : > > > Hi, > > > > > > On Tue, Aug 27, 2024 at 11:57:36AM GMT, Louis Chauvet wrote: > > > > T

Re: [PATCH RFC 11/15] drm: writeback: Add drm_writeback_connector cleanup

2024-08-27 Thread Louis Chauvet
Le 27/08/24 - 16:33, Maxime Ripard a écrit : > Hi, > > On Wed, Aug 14, 2024 at 04:36:33PM GMT, Louis Chauvet wrote: > > Currently drm_writeback_connector are created by > > drm_writeback_connector_init or drm_writeback_connector_init_with_encoder. > > Both of the funct

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

2024-08-27 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 02/44] drm/vkms: Round fixp2int conversion in lerp_u16

2024-08-27 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 18/44] drm/vkms: Use s32 for internal color pipeline precision

2024-08-27 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 14/44] drm/vkms: Add enumerated 1D curve colorop

2024-08-27 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 41/44] drm/colorop: allow non-bypass colorops

2024-08-27 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-27 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 v5 05/44] drm/colorop: Introduce new drm_colorop mode object

2024-08-27 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 03/44] drm/vkms: Add kunit tests for VKMS LUT handling

2024-08-27 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 RFC 11/15] drm: writeback: Add drm_writeback_connector cleanup

2024-08-28 Thread Louis Chauvet
Le 28/08/24 - 11:35, Jani Nikula a écrit : > On Tue, 27 Aug 2024, Louis Chauvet wrote: > > Le 27/08/24 - 16:33, Maxime Ripard a écrit : > >> Hi, > >> > >> On Wed, Aug 14, 2024 at 04:36:33PM GMT, Louis Chauvet wrote: > >> >

Re: [PATCH 3/3] drm/vkms: Add documentation

2024-08-29 Thread Louis Chauvet
Le 19/08/24 - 17:07, José Expósito a écrit : > Hi Louis, > > Thanks for this patch, adding some minor review comments: > > > Add documentation around vkms_output and its initialization. > > > > Signed-off-by: Louis Chauvet > > --- > >

Re: [PATCH v2] drm/vkms: Add documentation

2024-08-29 Thread Louis Chauvet
Le 27/08/24 - 19:49, José Expósito a écrit : > Hi Louis, > > > Add documentation around vkms_output and its initialization. > > > > Signed-off-by: Louis Chauvet > > --- > > This series does not introduce functionnal changes, only some > > docu

[PATCH v3] drm/vkms: Add documentation

2024-08-29 Thread Louis Chauvet
Add documentation around vkms_output and its initialization. Add some documentation on pixel conversion functions. Update of outdated comments for pixel_write functions. Signed-off-by: Louis Chauvet --- This series does not introduce functionnal changes, only some documentation and renaming to

Re: [PATCH v3] drm/vkms: Add documentation

2024-09-05 Thread Louis Chauvet
; Add some documentation on pixel conversion functions. > > Update of outdated comments for pixel_write functions. > > > > Signed-off-by: Louis Chauvet > > With the suggested changes, feel free to add: > Reviewed-by: José Expósito Thanks, the v4 is in your inbox! &g

[PATCH v4] drm/vkms: Add documentation

2024-09-05 Thread Louis Chauvet
Add documentation around vkms_output and its initialization. Add some documentation on pixel conversion functions. Update of outdated comments for pixel_write functions. Reviewed-by: José Expósito Signed-off-by: Louis Chauvet --- This series does not introduce functionnal changes, only some

[PATCH] drm/vkms: Add missing check for CRTC initialization

2024-09-06 Thread Louis Chauvet
CRTC initialization call drm_mode_crtc_set_gamma_size without the proper checks, introduce this check to avoid issues. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b

[PATCH] drm/vkms: Remove index parameter from init_vkms_output

2024-09-06 Thread Louis Chauvet
turns BIT(0), and the VKMS CRTC always have this id. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.c| 2 +- drivers/gpu/drm/vkms/vkms_drv.h| 4 ++-- drivers/gpu/drm/vkms/vkms_output.c | 42 +- drivers/gpu/drm/vkms/vkms_plane.c

[PATCH] drm: writeback: Introduce drm managed helpers

2024-09-06 Thread Louis Chauvet
ensure that the writeback connector is properly cleaned. This patch introduce drmm_writeback_connector_init, an helper to initialize a writeback connector using drm managed helpers. This function allows the caller to use its own encoder. Signed-off-by: Louis Chauvet --- Hi Maxime, Jani, I tried

Re: [PATCH v2 3/9] drm/vkms: write/update the documentation for pixel conversion and pixel write functions

2024-03-06 Thread Louis Chauvet
n works for non-1x1 blocks until you > have code handling at least one such format. > > All of the YUV formats that patch 6 adds support for use 1x1 blocks all > all their planes. Yes, none of the supported format have block_h != block_w != 1, so there is no need to drm_format_info_block*() helpers. I wrote the code for DRM_FORMAT_R*. They are packed, with block_w != 1. I will add this patch in the next revision. I also wrote the IGT test for DRM_FORMAT_R1 [1]. Everything will be in the v5 (I will send it when you have the time to review the v4). For information, I also have a series ready for adding more RGB variants (I introduced a macro to make it easier and avoid copy/pasting the same loop). I don't send them yet, because I realy want this series merged first. I also have the work for the writeback "line-by-line" algorithm ready (I just need to rebase it, but it will be fast). [1]: https://lore.kernel.org/igt-dev/20240306-b4-kms_tests-v1-0-8fe451efd...@bootlin.com Kind regards, Louis Chauvet [...] -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v2 5/9] drm/vkms: Re-introduce line-per-line composition algorithm

2024-03-06 Thread Louis Chauvet
Le 05/03/24 - 12:10, Pekka Paalanen a écrit : > On Mon, 4 Mar 2024 16:28:33 +0100 > Louis Chauvet wrote: > > > Le 29/02/24 - 12:21, Pekka Paalanen a écrit : > > > On Tue, 27 Feb 2024 16:02:09 +0100 > > > Louis Chauvet wrote: > > > > &g

Re: [PATCH v2 6/9] drm/vkms: Add YUV support

2024-03-06 Thread Louis Chauvet
Le 06/03/24 - 17:09, Arthur Grillo a écrit : > > > On 04/03/24 13:51, Arthur Grillo wrote: > > > > > > On 04/03/24 12:48, Louis Chauvet wrote: > [...] > >>> > >>>> Regarding the YUV part, I don't feel confortable adressing Pekk

Re: [PATCH 4/7] drm/vkms: Fix compilation issues

2024-03-06 Thread Louis Chauvet
of format we have to create a new structure". > + > struct line_buffer { > size_t n_pixels; > struct pixel_argb_u16 *pixels; > > -- > 2.43.0 > -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH 0/7] Additions to "Reimplement line-per-line pixel conversion for plane reading" series

2024-03-09 Thread Louis Chauvet
part, it was easier for Arthur to send a "real" series over [1]. I've already merged everything, and it'll all be in v5 (probably Monday or Tuesday). Kind regards, Louis Chauvet > I don't see a reason to submit fixes to a series that it is still > on review. >

[PATCH v5 01/16] drm/vkms: Code formatting

2024-03-13 Thread Louis Chauvet
Few no-op changes to remove double spaces and fix wrong alignments. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 10 +- drivers/gpu/drm/vkms/vkms_crtc.c | 6 ++ drivers/gpu/drm/vkms/vkms_drv.c | 3 +-- drivers/gpu/drm/vkms/vkms_plane.c| 8

[PATCH v5 02/16] drm/vkms: Use drm_frame directly

2024-03-13 Thread Louis Chauvet
From: Arthur Grillo Remove intermidiary variables and access the variables directly from drm_frame. These changes should be noop. Signed-off-by: Arthur Grillo Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.h | 3 --- drivers/gpu/drm/vkms/vkms_formats.c | 12

[PATCH v5 05/16] drm/vkms: Add dummy pixel_read/pixel_write callbacks to avoid NULL pointers

2024-03-13 Thread Louis Chauvet
-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_formats.c | 43 +++-- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index 55a4365d21a4..b57d85b8b935 100644 --- a/drivers

[PATCH v5 00/16] drm/vkms: Reimplement line-per-line pixel conversion for plane reading

2024-03-13 Thread Louis Chauvet
eremie.dautheri...@bootlin.com Cc: miquel.ray...@bootlin.com Cc: thomas.petazz...@bootlin.com Cc: seanp...@google.com Cc: marc...@google.com Cc: nicolejade...@google.com Signed-off-by: Louis Chauvet Note: after my changes, those tests seems to pass, so [7] may need updating (I did not check, it was maybe a

[PATCH v5 06/16] drm/vkms: Use const for input pointers in pixel_read an pixel_write functions

2024-03-13 Thread Louis Chauvet
As the pixel_read and pixel_write function should never modify the input buffer, mark those pointers const. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.h | 4 ++-- drivers/gpu/drm/vkms/vkms_formats.c | 24 2 files changed, 14 insertions(+), 14

[PATCH v5 04/16] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-03-13 Thread Louis Chauvet
between read_line and write_line. A warn has been added in get_pixel_*_function to alert when an unsupported pixel format is requested. As those formats are checked before atomic_update callbacks, it should never append. Document for those typedefs. Signed-off-by: Louis Chauvet --- drivers/gpu/drm

[PATCH v5 03/16] drm/vkms: write/update the documentation for pixel conversion and pixel write functions

2024-03-13 Thread Louis Chauvet
Add some documentation on pixel conversion functions. Update of outdated comments for pixel_write functions. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 7 drivers/gpu/drm/vkms/vkms_drv.h | 13 drivers/gpu/drm/vkms/vkms_formats.c | 62

[PATCH v5 08/16] drm/vkms: Avoid computing blending limits inside pre_mul_alpha_blend

2024-03-13 Thread Louis Chauvet
same place: the loop in `blend`. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 40 +--- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index

[PATCH v5 11/16] drm/vkms: Add YUV support

2024-03-13 Thread Louis Chauvet
formats is the order of field, a simple swap in conversion matrix columns allows using the same function. Signed-off-by: Arthur Grillo [Louis Chauvet: - Adapted Arthur's work - Implemented the read_line_t callbacks for yuv - add struct conversion_matrix - remove struct pixel_yuv_u8 - updat

[PATCH v5 10/16] drm/vkms: Re-introduce line-per-line composition algorithm

2024-03-13 Thread Louis Chauvet
functionality") https://lore.kernel.org/all/20230418130525.128733-2-mca...@igalia.com/ [3]: Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 167 +++-- drivers/gpu/drm/vkms/vkms_drv.h | 27 ++-- drivers/gpu/drm/vkms/v

[PATCH v5 12/16] drm/vkms: Add range and encoding properties to the plane

2024-03-13 Thread Louis Chauvet
From: Arthur Grillo Now that the driver internally handles these quantization ranges and YUV encoding matrices, expose the UAPI for setting them. Signed-off-by: Arthur Grillo [Louis Chauvet: retained only relevant parts, updated the commit message] Signed-off-by: Louis Chauvet --- drivers

[PATCH v5 07/16] drm/vkms: Update pixels accessor to support packed and multi-plane formats.

2024-03-13 Thread Louis Chauvet
`cpp`. Introduce the plane_index parameter to get an offset/pointer on a different plane. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_formats.c | 76 + 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/vkms

[PATCH v5 13/16] drm/vkms: Drop YUV formats TODO

2024-03-13 Thread Louis Chauvet
From: Arthur Grillo VKMS has support for YUV formats now. Remove the task from the TODO list. Signed-off-by: Arthur Grillo Signed-off-by: Louis Chauvet --- Documentation/gpu/vkms.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/gpu/vkms.rst b

[PATCH v5 14/16] drm/vkms: Create KUnit tests for YUV conversions

2024-03-13 Thread Louis Chauvet
From: Arthur Grillo Create KUnit tests to test the conversion between YUV and RGB. Test each conversion and range combination with some common colors. The code used to compute the expected result can be found in comment. Signed-off-by: Arthur Grillo [Louis Chauvet: - fix minor formating

[PATCH v5 16/16] drm/vkms: Add support for DRM_FORMAT_R*

2024-03-13 Thread Louis Chauvet
This add the support for: - R1/R2/R4/R8 R1 format was tested with [1] and [2]. [1]: https://lore.kernel.org/r/20240313-new_rotation-v2-0-6230fd5ca...@bootlin.com [2]: https://lore.kernel.org/igt-dev/20240306-b4-kms_tests-v1-0-8fe451efd...@bootlin.com/ Signed-off-by: Louis Chauvet

[PATCH v5 15/16] drm/vkms: Add how to run the Kunit tests

2024-03-13 Thread Louis Chauvet
From: Arthur Grillo Now that we have KUnit tests, add instructions on how to run them. Signed-off-by: Arthur Grillo Signed-off-by: Louis Chauvet --- Documentation/gpu/vkms.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/gpu/vkms.rst b/Documentation/gpu

[PATCH v5 09/16] drm/vkms: Introduce pixel_read_direction enum

2024-03-13 Thread Louis Chauvet
, and one to compute the step, in byte, between two successive pixel in a specific direction. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 36 drivers/gpu/drm/vkms/vkms_drv.h | 11 +++ drivers/gpu/drm/vkms/vkms_formats.c

Re: [PATCH v5 11/16] drm/vkms: Add YUV support

2024-03-14 Thread Louis Chauvet
Le 13/03/24 - 12:20, Randy Dunlap a écrit : > Hi, > > On 3/13/24 10:45, Louis Chauvet wrote: > > From: Arthur Grillo > > > > > > > Signed-off-by: Arthur Grillo > > [Louis Chauvet: > > - Adapted Arthur's work > > - Imp

Re: [PATCH v5 02/16] drm/vkms: Use drm_frame directly

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 10:20, Maíra Canal a écrit : > On 3/13/24 14:44, Louis Chauvet wrote: > > From: Arthur Grillo > > > > Remove intermidiary variables and access the variables directly from > > drm_frame. These changes should be noop. > > > > Signed-off-by:

Re: [PATCH v5 04/16] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 10:56, Maíra Canal a écrit : > On 3/13/24 14:44, Louis Chauvet wrote: > > Introduce two typedefs: pixel_read_t and pixel_write_t. It allows the > > compiler to check if the passed functions take the correct arguments. > > Such typedefs will help ensuring consis

Re: [PATCH v5 10/16] drm/vkms: Re-introduce line-per-line composition algorithm

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 11:15, Maíra Canal a écrit : > On 3/13/24 14:45, Louis Chauvet wrote: > > Re-introduce a line-by-line composition algorithm for each pixel format. > > This allows more performance by not requiring an indirection per pixel > > read. This patch is focused on re

Re: [PATCH v5 05/16] drm/vkms: Add dummy pixel_read/pixel_write callbacks to avoid NULL pointers

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 14:05, Pekka Paalanen a écrit : > On Wed, 13 Mar 2024 18:44:59 +0100 > Louis Chauvet wrote: > > > Introduce two callbacks which does nothing. They are used in replacement > > of NULL and it avoid kernel OOPS if this NULL is called. > > > > If those

Re: [PATCH v5 08/16] drm/vkms: Avoid computing blending limits inside pre_mul_alpha_blend

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 14:41, Pekka Paalanen a écrit : > On Wed, 13 Mar 2024 18:45:02 +0100 > Louis Chauvet wrote: > > > The pre_mul_alpha_blend is dedicated to blending, so to avoid mixing > > different concepts (coordinate calculation and color management), extract > > the x_

Re: [PATCH v5 09/16] drm/vkms: Introduce pixel_read_direction enum

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 15:11, Pekka Paalanen a écrit : > On Wed, 13 Mar 2024 18:45:03 +0100 > Louis Chauvet wrote: > > > The pixel_read_direction enum is useful to describe the reading direction > > in a plane. It avoids using the rotation property of DRM, which not > > practic

Re: [PATCH v5 05/16] drm/vkms: Add dummy pixel_read/pixel_write callbacks to avoid NULL pointers

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 10:59, Maíra Canal a écrit : > On 3/13/24 14:44, Louis Chauvet wrote: > > Introduce two callbacks which does nothing. They are used in replacement > > of NULL and it avoid kernel OOPS if this NULL is called. > > > > If those callback are used, it mea

Re: [PATCH v5 03/16] drm/vkms: write/update the documentation for pixel conversion and pixel write functions

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 10:32, Maíra Canal a écrit : > On 3/13/24 14:44, Louis Chauvet wrote: > > Add some documentation on pixel conversion functions. > > Update of outdated comments for pixel_write functions. > > > > Signed-off-by: Louis Chauvet > > --- > > dr

Re: [PATCH v5 10/16] drm/vkms: Re-introduce line-per-line composition algorithm

2024-03-26 Thread Louis Chauvet
pixels; > > > > + *out_pixel = argb_u16_from_RGB565(px); > > + out_pixel += 1; > > + src_pixels += step; > > } > > } > > > > @@ -343,25 +399,25 @@ void vkms_writeback_row(struct vkms_writeback_job *wb, > > } > > > > /** > > - * Retrieve the correct read_pixel function for a specific format. > > + * Retrieve the correct read_line function for a specific format. > > * If the format is not supported by VKMS a warn is emitted and a dummy > > "always read black" > > * function is returned. > > * > > * @format: DRM_FORMAT_* value for which to obtain a conversion function > > (see [drm_fourcc.h]) > > */ > > -pixel_read_t get_pixel_read_function(u32 format) > > +pixel_read_line_t get_pixel_read_line_function(u32 format) > > { > > switch (format) { > > case DRM_FORMAT_ARGB: > > - return &ARGB_to_argb_u16; > > + return &ARGB_read_line; > > case DRM_FORMAT_XRGB: > > - return &XRGB_to_argb_u16; > > + return &XRGB_read_line; > > case DRM_FORMAT_ARGB16161616: > > - return &ARGB16161616_to_argb_u16; > > + return &ARGB16161616_read_line; > > case DRM_FORMAT_XRGB16161616: > > - return &XRGB16161616_to_argb_u16; > > + return &XRGB16161616_read_line; > > case DRM_FORMAT_RGB565: > > - return &RGB565_to_argb_u16; > > + return &RGB565_read_line; > > default: > > /* > > * This is a bug in vkms_plane_atomic_check. All the supported > > diff --git a/drivers/gpu/drm/vkms/vkms_formats.h > > b/drivers/gpu/drm/vkms/vkms_formats.h > > index 3ecea4563254..8d2bef95ff79 100644 > > --- a/drivers/gpu/drm/vkms/vkms_formats.h > > +++ b/drivers/gpu/drm/vkms/vkms_formats.h > > @@ -5,7 +5,7 @@ > > > > #include "vkms_drv.h" > > > > -pixel_read_t get_pixel_read_function(u32 format); > > +pixel_read_line_t get_pixel_read_line_function(u32 format); > > > > pixel_write_t get_pixel_write_function(u32 format); > > > > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c > > b/drivers/gpu/drm/vkms/vkms_plane.c > > index 10e9b23dab28..8875bed76410 100644 > > --- a/drivers/gpu/drm/vkms/vkms_plane.c > > +++ b/drivers/gpu/drm/vkms/vkms_plane.c > > @@ -112,7 +112,6 @@ static void vkms_plane_atomic_update(struct drm_plane > > *plane, > > frame_info = vkms_plane_state->frame_info; > > memcpy(&frame_info->src, &new_state->src, sizeof(struct drm_rect)); > > memcpy(&frame_info->dst, &new_state->dst, sizeof(struct drm_rect)); > > - memcpy(&frame_info->rotated, &new_state->dst, sizeof(struct drm_rect)); > > frame_info->fb = fb; > > memcpy(&frame_info->map, &shadow_plane_state->data, > > sizeof(frame_info->map)); > > drm_framebuffer_get(frame_info->fb); > > @@ -122,10 +121,8 @@ static void vkms_plane_atomic_update(struct drm_plane > > *plane, > > > > DRM_MODE_REFLECT_X | > > > > DRM_MODE_REFLECT_Y); > > > > - drm_rect_rotate(&frame_info->rotated, > > drm_rect_width(&frame_info->rotated), > > - drm_rect_height(&frame_info->rotated), > > frame_info->rotation); > > > > - vkms_plane_state->pixel_read = get_pixel_read_function(fmt); > > + vkms_plane_state->pixel_read_line = get_pixel_read_line_function(fmt); > > } > > > > static int vkms_plane_atomic_check(struct drm_plane *plane, > > > > This is looking good enough that I can give an Thanks for all your feedback ! > Acked-by: Pekka Paalanen As I changed the code, I will not keep it in the commit. Thanks, Louis Chauvet > Thanks, > pq -- Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v5 07/16] drm/vkms: Update pixels accessor to support packed and multi-plane formats.

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 14:40, Pekka Paalanen a écrit : > On Wed, 13 Mar 2024 18:45:01 +0100 > Louis Chauvet wrote: > > > Introduce the usage of block_h/block_w to compute the offset and the > > pointer of a pixel. The previous implementation was specialized for > > planes with

Re: [PATCH v5 14/16] drm/vkms: Create KUnit tests for YUV conversions

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 11:34, Maíra Canal a écrit : > On 3/13/24 14:45, Louis Chauvet wrote: > > From: Arthur Grillo > > > > Create KUnit tests to test the conversion between YUV and RGB. Test each > > conversion and range combination with some common colors. > >

Re: [PATCH v5 09/16] drm/vkms: Introduce pixel_read_direction enum

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 11:07, Maíra Canal a écrit : > On 3/13/24 14:45, Louis Chauvet wrote: > > The pixel_read_direction enum is useful to describe the reading direction > > in a plane. It avoids using the rotation property of DRM, which not > > practical to know the direction of re

Re: [PATCH v5 04/16] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 14:04, Pekka Paalanen a écrit : > On Wed, 13 Mar 2024 18:44:58 +0100 > Louis Chauvet wrote: > > > Introduce two typedefs: pixel_read_t and pixel_write_t. It allows the > > compiler to check if the passed functions take the correct arguments. > > Such

Re: [PATCH v5 11/16] drm/vkms: Add YUV support

2024-03-26 Thread Louis Chauvet
Le 25/03/24 - 11:26, Maíra Canal a écrit : > On 3/13/24 14:45, Louis Chauvet wrote: > > From: Arthur Grillo > > > > Add support to the YUV formats bellow: > > > > - NV12/NV16/NV24 > > - NV21/NV61/NV42 > > - YUV420/YUV422/YUV444 > > - YVU420/YV

Re: [PATCH] drm/vkms: Remove event from vkms_output

2024-07-04 Thread Louis Chauvet
lore.kernel.org/all/5d9ca7b3884c1995bd4a983b1d2ff1b840eb7f1a.1531402095.git.rodrigosiqueiram...@gmail.com/ Reviewed-By: Louis Chauvet Tested-By: Louis Chauvet > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/vkms/vkms_drv.h | 1 - > 1 file changed, 1 deletion(-) > > diff -

Re: [PATCH v8 04/17] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-07-15 Thread Louis Chauvet
Le 13/07/24 - 11:38, Maíra Canal a écrit : > On 5/16/24 10:04, Louis Chauvet wrote: > > Introduce two typedefs: pixel_read_t and pixel_write_t. It allows the > > compiler to check if the passed functions take the correct arguments. > > Such typedefs will help ensuring consis

Re: [PATCH v8 03/17] drm/vkms: write/update the documentation for pixel conversion and pixel write functions

2024-07-15 Thread Louis Chauvet
Le 13/07/24 - 11:35, Maíra Canal a écrit : > On 5/16/24 10:04, Louis Chauvet wrote: > > Add some documentation on pixel conversion functions. > > Update of outdated comments for pixel_write functions. > > > > Signed-off-by: Louis Chauvet > > Acked-by: Pekka Pa

Re: [PATCH v2] drm/vkms: Fix cpu_to_le16()/le16_to_cpu() warnings

2024-07-16 Thread Louis Chauvet
-188,9 +188,9 @@ static void argb_u16_to_ARGB16161616(u8 *dst_pixels, > struct pixel_argb_u16 *in_p > > static void argb_u16_to_XRGB16161616(u8 *dst_pixels, struct pixel_argb_u16 > *in_pixel) > { > - u16 *pixels = (u16 *)dst_pixels; > + __le16 *pixels = (__force __le16

[PATCH v9 00/17] drm/vkms: Reimplement line-per-line pixel conversion for plane reading

2024-08-02 Thread Louis Chauvet
el.org Cc: jeremie.dautheri...@bootlin.com Cc: miquel.ray...@bootlin.com Cc: thomas.petazz...@bootlin.com Cc: seanp...@google.com Cc: marc...@google.com Cc: nicolejade...@google.com Signed-off-by: Louis Chauvet Note: after my changes, those tests seems to pass, so [7] may need updating (I

[PATCH v9 01/17] drm/vkms: Code formatting

2024-08-02 Thread Louis Chauvet
Few no-op changes to remove double spaces and fix wrong alignments. Reviewed-by: Pekka Paalanen Reviewed-by: Maíra Canal Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 10 +- drivers/gpu/drm/vkms/vkms_crtc.c | 6 ++ drivers/gpu/drm/vkms/vkms_drv.c

[PATCH v9 03/17] drm/vkms: write/update the documentation for pixel conversion and pixel write functions

2024-08-02 Thread Louis Chauvet
Add some documentation on pixel conversion functions. Update of outdated comments for pixel_write functions. Signed-off-by: Louis Chauvet Acked-by: Pekka Paalanen --- drivers/gpu/drm/vkms/vkms_composer.c | 7 drivers/gpu/drm/vkms/vkms_drv.h | 15 - drivers/gpu/drm/vkms

[PATCH v9 04/17] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-08-02 Thread Louis Chauvet
between read_line and write_line. A warn has been added in get_pixel_*_function to alert when an unsupported pixel format is requested. As those formats are checked before atomic_update callbacks, it should never happen. Document for those typedefs. Reviewed-by: Pekka Paalanen Signed-off-by: Louis

[PATCH v9 02/17] drm/vkms: Use drm_frame directly

2024-08-02 Thread Louis Chauvet
From: Arthur Grillo Remove intermidiary variables and access the variables directly from drm_frame. These changes should be noop. Signed-off-by: Arthur Grillo Acked-by: Pekka Paalanen Reviewed-by: Maíra Canal Reviewed-by: Louis Chauvet [Louis Chauvet: Applied review from Maíra] Signed-off

[PATCH v9 05/17] drm/vkms: Add dummy pixel_read/pixel_write callbacks to avoid NULL pointers

2024-08-02 Thread Louis Chauvet
-by: Pekka Paalanen Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_formats.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index 5ebc691656bc..ecbe79f8dfdc 100644 --- a/drivers

[PATCH v9 07/17] drm/vkms: Update pixels accessor to support packed and multi-plane formats.

2024-08-02 Thread Louis Chauvet
`cpp`. Introduce the plane_index parameter to get an offset/pointer on a different plane. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_formats.c | 112 1 file changed, 89 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/vkms

[PATCH v9 06/17] drm/vkms: Use const for input pointers in pixel_read an pixel_write functions

2024-08-02 Thread Louis Chauvet
As the pixel_read and pixel_write function should never modify the input buffer, mark those pointers const. Reviewed-by: Pekka Paalanen Reviewed-by: Maíra Canal Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.h | 4 ++-- drivers/gpu/drm/vkms/vkms_formats.c | 20

[PATCH v9 08/17] drm/vkms: Avoid computing blending limits inside pre_mul_alpha_blend

2024-08-02 Thread Louis Chauvet
same place: the loop in `blend`. Reviewed-by: Pekka Paalanen Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 40 +--- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm

[PATCH v9 09/17] drm/vkms: Introduce pixel_read_direction enum

2024-08-02 Thread Louis Chauvet
, and one to compute the step, in byte, between two successive pixel in a specific direction. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 46 drivers/gpu/drm/vkms/vkms_drv.h | 11 + drivers/gpu/drm/vkms/vkms_formats.c

[PATCH v9 10/17] drm/vkms: Re-introduce line-per-line composition algorithm

2024-08-02 Thread Louis Chauvet
/lore.kernel.org/all/20240422-kms_fb_stress-dev-v5-0-0c577163d...@riseup.net/ Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 235 --- drivers/gpu/drm/vkms/vkms_drv.h | 28 +++-- drivers/gpu/drm/vkms/v

[PATCH v9 11/17] drm/vkms: Remove useless drm_rotation_simplify

2024-08-02 Thread Louis Chauvet
As all the rotation are now supported by VKMS, this simplification does not make sense anymore, so remove it. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_plane.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers

[PATCH v9 12/17] drm/vkms: Add YUV support

2024-08-02 Thread Louis Chauvet
category of formats is the order of field, a simple swap in conversion matrix columns allows using the same function. Signed-off-by: Arthur Grillo [Louis Chauvet: - Adapted Arthur's work - Implemented the read_line_t callbacks for yuv - add struct conversion_matrix - store the

[PATCH v9 13/17] drm/vkms: Add range and encoding properties to the plane

2024-08-02 Thread Louis Chauvet
From: Arthur Grillo Now that the driver internally handles these quantization ranges and YUV encoding matrices, expose the UAPI for setting them. Signed-off-by: Arthur Grillo [Louis Chauvet: retained only relevant parts, updated the commit message] Acked-by: Pekka Paalanen Signed-off-by

[PATCH v9 14/17] drm/vkms: Drop YUV formats TODO

2024-08-02 Thread Louis Chauvet
From: Arthur Grillo VKMS has support for YUV formats now. Remove the task from the TODO list. Signed-off-by: Arthur Grillo Signed-off-by: Louis Chauvet --- Documentation/gpu/vkms.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/gpu/vkms.rst b

[PATCH v9 16/17] drm/vkms: Add how to run the Kunit tests

2024-08-02 Thread Louis Chauvet
From: Arthur Grillo Now that we have KUnit tests, add instructions on how to run them. Signed-off-by: Arthur Grillo Signed-off-by: Louis Chauvet --- Documentation/gpu/vkms.rst | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/gpu/vkms.rst b/Documentation/gpu

[PATCH v9 15/17] drm/vkms: Create KUnit tests for YUV conversions

2024-08-02 Thread Louis Chauvet
From: Arthur Grillo Create KUnit tests to test the conversion between YUV and RGB. Test each conversion and range combination with some common colors. The code used to compute the expected result can be found in comment. [Louis Chauvet: - fix minor formating issues (whitespace, double line

[PATCH v9 17/17] drm/vkms: Add support for DRM_FORMAT_R*

2024-08-02 Thread Louis Chauvet
-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_formats.c | 110 +++- drivers/gpu/drm/vkms/vkms_plane.c | 4 ++ 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index

[PATCH v10 00/16] drm/vkms: Reimplement line-per-line pixel conversion for plane reading

2024-08-09 Thread Louis Chauvet
el.org Cc: jeremie.dautheri...@bootlin.com Cc: miquel.ray...@bootlin.com Cc: thomas.petazz...@bootlin.com Cc: seanp...@google.com Cc: marc...@google.com Cc: nicolejade...@google.com Signed-off-by: Louis Chauvet Note: after my changes, those tests seems to pass, so [7] may need updating (I

[PATCH v10 01/16] drm/vkms: Code formatting

2024-08-09 Thread Louis Chauvet
Few no-op changes to remove double spaces and fix wrong alignments. Reviewed-by: Pekka Paalanen Reviewed-by: Maíra Canal Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 10 +- drivers/gpu/drm/vkms/vkms_crtc.c | 6 ++ drivers/gpu/drm/vkms/vkms_drv.c

[PATCH v10 03/16] drm/vkms: write/update the documentation for pixel conversion and pixel write functions

2024-08-09 Thread Louis Chauvet
Add some documentation on pixel conversion functions. Update of outdated comments for pixel_write functions. Signed-off-by: Louis Chauvet Acked-by: Pekka Paalanen --- drivers/gpu/drm/vkms/vkms_composer.c | 7 drivers/gpu/drm/vkms/vkms_drv.h | 15 - drivers/gpu/drm/vkms

[PATCH v10 02/16] drm/vkms: Use drm_frame directly

2024-08-09 Thread Louis Chauvet
From: Arthur Grillo Remove intermidiary variables and access the variables directly from drm_frame. These changes should be noop. Signed-off-by: Arthur Grillo Acked-by: Pekka Paalanen Reviewed-by: Maíra Canal Reviewed-by: Louis Chauvet [Louis Chauvet: Applied review from Maíra] Signed-off

[PATCH v10 04/16] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-08-09 Thread Louis Chauvet
between read_line and write_line. A warn has been added in get_pixel_*_function to alert when an unsupported pixel format is requested. As those formats are checked before atomic_update callbacks, it should never happen. Document for those typedefs. Reviewed-by: Pekka Paalanen Signed-off-by: Louis

[PATCH v10 06/16] drm/vkms: Update pixels accessor to support packed and multi-plane formats.

2024-08-09 Thread Louis Chauvet
`cpp`. Introduce the plane_index parameter to get an offset/pointer on a different plane. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_formats.c | 112 1 file changed, 89 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/vkms

[PATCH v10 05/16] drm/vkms: Use const for input pointers in pixel_read an pixel_write functions

2024-08-09 Thread Louis Chauvet
As the pixel_read and pixel_write function should never modify the input buffer, mark those pointers const. Reviewed-by: Pekka Paalanen Reviewed-by: Maíra Canal Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_drv.h | 4 ++-- drivers/gpu/drm/vkms/vkms_formats.c | 20

[PATCH v10 07/16] drm/vkms: Avoid computing blending limits inside pre_mul_alpha_blend

2024-08-09 Thread Louis Chauvet
same place: the loop in `blend`. Reviewed-by: Pekka Paalanen Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_composer.c | 40 +--- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm

[PATCH v10 10/16] drm/vkms: Remove useless drm_rotation_simplify

2024-08-09 Thread Louis Chauvet
As all the rotation are now supported by VKMS, this simplification does not make sense anymore, so remove it. Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_plane.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers

  1   2   3   4   >