[PATCH v2] drm: Fix drm_fixp2int_round() making it add 0.5

2024-03-16 Thread Arthur Grillo
: 8b25320887d7 ("drm: Add fixed-point helper to get rounded integer values") Suggested-by: Pekka Paalanen Reviewed-by: Harry Wentland Signed-off-by: Arthur Grillo --- Changes in v2: - Add Fixes tag (Melissa Wen) - Remove DRM_FIXED_POINT_HALF (Melissa Wen) - Link to v1: https://lore.kern

Re: [PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5

2024-03-16 Thread Arthur Grillo
On 12/03/24 15:27, Melissa Wen wrote: > On 03/06, Arthur Grillo wrote: >> As well noted by Pekka[1], the rounding of drm_fixp2int_round is wrong. >> To round a number, you need to add 0.5 to the number and floor that, >> drm_fixp2int_round() is adding 0.076. Make

Re: [PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5

2024-03-13 Thread Arthur Grillo
On 12/03/24 15:27, Melissa Wen wrote: > On 03/06, Arthur Grillo wrote: >> As well noted by Pekka[1], the rounding of drm_fixp2int_round is wrong. >> To round a number, you need to add 0.5 to the number and floor that, >> drm_fixp2int_round() is adding 0.076. Make

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

2024-03-07 Thread Arthur Grillo
On 06/03/24 21:03, Louis Chauvet wrote: > Le 06/03/24 - 17:03, Arthur Grillo a écrit : >> Signed-off-by: Arthur Grillo >> --- >> drivers/gpu/drm/vkms/tests/vkms_format_test.c | 2 +- >> drivers/gpu/drm/vkms/vkms_drv.h | 4 >> 2 files cha

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

2024-03-06 Thread Arthur Grillo
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 Pekka's >>>> comments, would you mind doing it? >>> >>> I'm already d

[PATCH 7/7] drm/vkms: Add how to run the Kunit tests

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

[PATCH 6/7] drm/vkms: Change the gray RGB representation

2024-03-06 Thread Arthur Grillo
Using the drm_fixed calls, this needs to be changed. Which in fact is more correct, colour.YCbCr_to_RGB() gives 0x8080 for same the yuv parameters. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/tests/vkms_format_test.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions

[PATCH 5/7] drm/vkms: Add comments to format tests

2024-03-06 Thread Arthur Grillo
Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/tests/vkms_format_test.c | 67 +++ 1 file changed, 67 insertions(+) diff --git a/drivers/gpu/drm/vkms/tests/vkms_format_test.c b/drivers/gpu/drm/vkms/tests/vkms_format_test.c index 3522ecee960f..66cdd83c3d25 100644

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

2024-03-06 Thread Arthur Grillo
Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/tests/vkms_format_test.c | 2 +- drivers/gpu/drm/vkms/vkms_drv.h | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/tests/vkms_format_test.c b/drivers/gpu/drm/vkms/tests

[PATCH 3/7] drm/vkmm: Use drm_fixed api

2024-03-06 Thread Arthur Grillo
With the new 32.32 values it makes more sense to use drm_fixed functions than trying to recreate the wheel. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_formats.c | 54 +++-- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/drivers

[PATCH 2/7] drm/vkms: Add comments

2024-03-06 Thread Arthur Grillo
Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_formats.c | 47 + 1 file changed, 47 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index 44d9b9b3bdc3..55ed3f598bd7 100644 --- a/drivers/gpu/drm

[PATCH 1/7] drm: Fix drm_fixp2int_round() making it add 0.5

2024-03-06 Thread Arthur Grillo
/ Suggested-by: Pekka Paalanen Signed-off-by: Arthur Grillo --- include/drm/drm_fixed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h index 0c9f917a4d4b..de3a79909ac9 100644 --- a/include/drm/drm_fixed.h +++ b/include/drm/drm_fixed.h

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

2024-03-06 Thread Arthur Grillo
zz...@bootlin.com Cc: seanp...@google.com Cc: marc...@google.com Cc: nicolejade...@google.com Signed-off-by: Arthur Grillo --- Arthur Grillo (7): drm: Fix drm_fixp2int_round() making it add 0.5 drm/vkms: Add comments drm/vkmm: Use drm_fixed api drm/vkms: Fix compilation i

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

2024-03-04 Thread Arthur Grillo
I reply to >> your series, like a did before? > > Yes, simply reply to my series, so I can rebase everything on the > line-by-line work. OK, I will do that. Best Regards, ~Arthur Grillo > Kind regards, > Louis Chauvet > >> Best Regards, >> ~Arthur Grillo >> >>> >>> Kind regards, >>> Louis Chauvet >>> >>> [...] >>> >

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

2024-03-04 Thread Arthur Grillo
On 04/03/24 12:28, Louis Chauvet wrote: > Le 29/02/24 - 14:12, Pekka Paalanen a écrit : >> On Wed, 28 Feb 2024 22:52:09 -0300 >> Arthur Grillo wrote: >> >>> On 27/02/24 17:01, Arthur Grillo wrote: >>>> >>>> >>>> On 27/02/24

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

2024-03-02 Thread Arthur Grillo
On 01/03/24 08:53, Pekka Paalanen wrote: > On Thu, 29 Feb 2024 14:57:06 -0300 > Arthur Grillo wrote: > >> On 29/02/24 09:12, Pekka Paalanen wrote: >>> On Wed, 28 Feb 2024 22:52:09 -0300 >>> Arthur Grillo wrote: >>> >>>> On 27/02/24 17

Re: [PATCH v2 0/7] Add YUV formats to VKMS

2024-02-29 Thread Arthur Grillo
On 29/02/24 14:52, Sebastian Wick wrote: > On Wed, Feb 28, 2024 at 08:42:41PM -0300, Arthur Grillo wrote: >> >> >> On 15/01/24 12:06, Sebastian Wick wrote: >>> On Wed, Jan 10, 2024 at 02:44:00PM -0300, Arthur Grillo wrote: >>>> This patchset aims to add

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

2024-02-29 Thread Arthur Grillo
On 29/02/24 09:12, Pekka Paalanen wrote: > On Wed, 28 Feb 2024 22:52:09 -0300 > Arthur Grillo wrote: > >> On 27/02/24 17:01, Arthur Grillo wrote: >>> >>> >>> On 27/02/24 12:02, Louis Chauvet wrote: >>>> Hi Pekka, >>>> >

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

2024-02-28 Thread Arthur Grillo
On 27/02/24 17:01, Arthur Grillo wrote: > > > On 27/02/24 12:02, Louis Chauvet wrote: >> Hi Pekka, >> >> For all the comment related to the conversion part, maybe Arthur have an >> opinion on it, I took his patch as a "black box" (I did not want t

Re: [PATCH v2 0/7] Add YUV formats to VKMS

2024-02-28 Thread Arthur Grillo
On 15/01/24 12:06, Sebastian Wick wrote: > On Wed, Jan 10, 2024 at 02:44:00PM -0300, Arthur Grillo wrote: >> This patchset aims to add support for additional buffer YUV formats. >> More specifically, it adds support to: >> >> Semi-planar formats: >> >&g

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

2024-02-27 Thread Arthur Grillo
nen a écrit : >> On Fri, 23 Feb 2024 12:37:26 +0100 >> Louis Chauvet wrote: >> >>> From: Arthur Grillo >>> >>> Add support to the YUV formats bellow: >>> >>> - NV12 >>> - NV16 >>> - NV24 >>> - NV21 >>&g

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

2024-02-27 Thread Arthur Grillo
On 27/02/24 12:02, Louis Chauvet wrote: > Le 26/02/24 - 10:07, Arthur Grillo a écrit : >> >> >> On 26/02/24 05:46, Louis Chauvet wrote: >>> Add some documentation on pixel conversion functions. >>> Update of outdated comments for pixel_write function

Re: [PATCH] drm/vkms: Add information on how to benchmark

2024-02-27 Thread Arthur Grillo
On 27/02/24 12:02, Louis Chauvet wrote: > Le 27/02/24 - 15:26, Pekka Paalanen a écrit : >> On Tue, 27 Feb 2024 09:29:58 -0300 >> Arthur Grillo wrote: >> >>> On 27/02/24 08:55, Pekka Paalanen wrote: >>>> On Tue, 27 Feb 2024 08:44:52 -0300 >>>&

Re: [PATCH] drm/vkms: Add information on how to benchmark

2024-02-27 Thread Arthur Grillo
On 27/02/24 08:55, Pekka Paalanen wrote: > On Tue, 27 Feb 2024 08:44:52 -0300 > Arthur Grillo wrote: > >> On 27/02/24 06:19, Pekka Paalanen wrote: >>> On Mon, 26 Feb 2024 17:42:11 -0300 >>> Arthur Grillo wrote: >>> >>>> Now that w

Re: [RFC PATCH v4 06/42] drm/vkms: Add kunit tests for VKMS LUT handling

2024-02-27 Thread Arthur Grillo
t; v3: > - Use include way of testing static functions (Arthur) > > Signed-off-by: Harry Wentland > Cc: Arthur Grillo > --- > drivers/gpu/drm/vkms/Kconfig | 5 + > drivers/gpu/drm/vkms/tests/.kunitconfig | 4 + > drivers/gpu/drm/vkms/tests/vkms_color_

Re: [PATCH] drm/vkms: Add information on how to benchmark

2024-02-27 Thread Arthur Grillo
On 27/02/24 06:19, Pekka Paalanen wrote: > On Mon, 26 Feb 2024 17:42:11 -0300 > Arthur Grillo wrote: > >> Now that we have a defined benchmark for testing the driver, add >> documentation on how to run it. >> >> Signed-off-by: Arthur Grillo >>

[PATCH] drm/vkms: Add information on how to benchmark

2024-02-26 Thread Arthur Grillo
Now that we have a defined benchmark for testing the driver, add documentation on how to run it. Signed-off-by: Arthur Grillo --- Documentation/gpu/vkms.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/gpu/vkms.rst b/Documentation/gpu/vkms.rst index ba04ac7c2167

Re: [PATCH v2 9/9] drm/vkms: Create KUnit tests for YUV conversions

2024-02-26 Thread Arthur Grillo
On 23/02/24 08:37, 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. > > Signed-off-by: Arthur Grillo > [Louis Chauvet: fix minor formati

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

2024-02-26 Thread Arthur Grillo
; > /* The active planes are composed associatively in z-order. */ > for (size_t i = 0; i < n_active_planes; i++) { > - y_pos = get_y_pos(plane[i]->frame_info, y); > + struct vkms_plane_state *current

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

2024-02-26 Thread Arthur Grillo
ood to give more context, like: "The planes are composed line-by-line, instead of pixel-by-pixel" Best Regards, ~Arthur Grillo > + */ > for (size_t y = 0; y < crtc_y_limit; y++) { > fill_background(_color, output_buffer); > > diff --git a/d

Re: [PATCH v3 4/9] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions

2024-02-26 Thread Arthur Grillo
vkms_plane_atomic_check(struct drm_plane *plane, > diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c > b/drivers/gpu/drm/vkms/vkms_writeback.c > index c8582df1f739..c92b9f06c4a4 100644 > --- a/drivers/gpu/drm/vkms/vkms_writeback.c > +++ b/drivers/gpu/drm/vkms/vkms_writeback.c > @@ -

Re: [PATCH 2/2] drm/vkms: Use a simpler composition function

2024-02-15 Thread Arthur Grillo
> > Would need to benchmark if this is significantly slower than your > suggestion for dir=RIGHT, though. If it's roughly the same, then it > would probably be worth it. > > >> This way: >> - It's simple to read for the general case (usage of drm_rect_* instead of >> manually rewriting the logic) >> - Each pixel format can be quickly implemented with "pixel-by-pixel" >> methods >> - The performances should be good if no rotation is implied for some >> formats >> >> I also created some helpers for conversions between formats to avoid code >> duplication between pixel and line algorithms (and also between argb and >> xrgb variants). >> >> The only flaw with this, is that most of the read_line functions will >> look like: >> >> void read_line(...) { >> int increment = x_start < x_stop ? 1: -1; >> while(x_start != x_stop) { >> out += 1; >> [...] /* color conversion */ >> x_start += increment; >> } >> } >> >> But as Pekka explained, it's probably the most efficient way to do it. > > Yes, I expect them to look roughly like that. It's necessary for moving > as much of the setup computations and real function calls out of the > inner-most loop as possible. The middle (over KMS planes) and outer > (over y) loops are less sensitive to wasted cycles on redundant > computations. > >> Is there a way to save the output of vkms to a folder (something like >> "one image per frame")? It's a bit complex to debug graphics without >> seeing them. >> >> I have something which (I think) should work, but some tests are failing >> and I don't find why in my code (I don't find the reason why the they are >> failing and the hexdump I added to debug seems normal). >> >> I think my issue is a simple mistake in the "translation managment" or >> maybe just a wrong offset, but I don't see my error in the code. I think a >> quick look on the final image would help me a lot. > > I don't know anything about the kernel unit testing frameworks, maybe > they could help? > > But if you drive the test through UAPI from userspace, use a writeback > connector to fetch the resulting image. I'm sure IGT has code doing > that somewhere, although many IGT tests rely on CRC instead because CRC > is more widely available in hardware. > > Arthur's new benchmark seems to be using writeback, you just need to > make it save to file: > https://lore.kernel.org/all/20240207-bench-v1-1-7135ad426...@riseup.net/ Hi, I just found that the IGT's test kms_writeback has a flag '--dump' that does that, maybe you can use it or copy the logic to the benchmark. Best Regards, ~Arthur Grillo > > > Thanks, > pq

Re: [PATCH i-g-t v3] benchmarks: Add VKMS benchmark

2024-02-13 Thread Arthur Grillo
On 13/02/24 15:06, Kamil Konieczny wrote: > Hi Arthur, > On 2024-02-09 at 16:39:09 -0300, Arthur Grillo wrote: > > I will merge this with different description: > > [PATCH i-g-t v3] benchmarks: Add KMS frambuffer stress benchmark > > Is this ok? Its ok Best

[PATCH i-g-t v3] benchmarks: Add VKMS benchmark

2024-02-09 Thread Arthur Grillo
/lore.kernel.org/all/20240202214527.1d97c881@ferris.localdomain/ Suggested-by: Pekka Paalanen Acked-by: Pekka Paalanen Acked-by: Maíra Canal Acked-by: Kamil Konieczny Signed-off-by: Arthur Grillo --- Changes in v3: - Change primary plane width to not extend outside the CRTC size - Explicitly set a

Re: [PATCH i-g-t] benchmarks: Add VKMS benchmark

2024-02-09 Thread Arthur Grillo
On 09/02/24 05:32, Pekka Paalanen wrote: > On Thu, 8 Feb 2024 16:38:31 -0300 > Arthur Grillo wrote: > >> On 08/02/24 06:50, Pekka Paalanen wrote: >>> On Wed, 07 Feb 2024 17:17:15 -0300 >>> Arthur Grillo wrote: >>> >>>> Cr

[PATCH i-g-t v2] benchmarks: Add VKMS benchmark

2024-02-08 Thread Arthur Grillo
/lore.kernel.org/all/20240202214527.1d97c881@ferris.localdomain/ Suggested-by: Pekka Paalanen Acked-by: Pekka Paalanen Signed-off-by: Arthur Grillo --- Changes in v2: - Zero initialize data - Don't wrap igt_create_* functions (Juha-Pekka Heikkila) - Add a `break;` when a pipe is found (Pekka Paa

Re: [PATCH i-g-t] benchmarks: Add VKMS benchmark

2024-02-08 Thread Arthur Grillo
On 08/02/24 06:50, Pekka Paalanen wrote: > On Wed, 07 Feb 2024 17:17:15 -0300 > Arthur Grillo wrote: > >> Create a benchmark for the VKMS driver. Use a KMS layout with deliberate >> odd sizes to try to avoid alignment accidents and run it for FRAME_COUNT >> f

Re: [PATCH 2/2] drm/vkms: Use a simpler composition function

2024-02-07 Thread Arthur Grillo
On 07/02/24 13:03, Louis Chauvet wrote: > Hello Pekka, Arthur, > > [...] > Would it be possible to have a standardised benchmark specifically for performance rather than correctness, in IGT or where-ever it would make sense? Then it would be simple to tell contributors to

[PATCH i-g-t] benchmarks: Add VKMS benchmark

2024-02-07 Thread Arthur Grillo
Signed-off-by: Arthur Grillo --- This benchmark was suggested by Pekka Paalanen on [1] to better analyse possible performance regression on the Virtual Kernel Modesetting(VKMS) driver. With this benchmark I was able to determine two performance regression: - 322d716a3e8a ("drm/vkms: is

Re: [PATCH 2/2] drm/vkms: Use a simpler composition function

2024-02-06 Thread Arthur Grillo
riting this proposal using IGT. I got pretty interesting results: The mentioned commit 8356b97906503a02125c8d03c9b88a61ea46a05a took around 13 seconds. While drm-misc/drm-misc-next took 36 seconds. I'm currently bisecting to be certain that the change to the pixel-by-pixel is the culprit, but I don

Re: [PATCH 1/2] drm/vkms: Create a type to check a function pointer validity

2024-02-02 Thread Arthur Grillo
ding, enum > drm_color_range range); > + pixel_read_t pixel_read; Hi, Please Cc me on the next versions, You added the argument 'y' to the function but did not change the calls to it, resulting in a compiler error. I think this argument addition would be better on patch #2. Best Regards, ~Art

Re: [PATCH 2/2] drm/vkms: Use a simpler composition function

2024-02-02 Thread Arthur Grillo
t; perhaps call the original read_line() implementations pixel-by-pixel or > plane-by-plane (i.e. YUV planes) per pixel. Chroma-siting complicates > things even further. That way one could compose any > rotation-format-siting combination by chaining function pointers. > > I haven't l

Re: [PATCH v2 2/7] drm/vkms: Add support for multy-planar framebuffers

2024-02-02 Thread Arthur Grillo
gt; > In the future, if performance is actally critical, the whole composition > loop will have to be specialized for each pixel formats: some can be > treated line by line (as it's done today), but with blocks or packed > pixels it's more complex. > >> +for (size_t i = 0; i < frame_format->num_planes; i++) >> +src_pixels[i] += frame_format->cpp[i]; > > This is likely working with format with block_w != 1, see explanation > above. I think you meant that is _not_ working. Yeah, as I already explained, it was never my plan to add support for packed or tiled formats. Best Regards, ~Arthur Grillo

[PATCH v2 7/7] drm/vkms: Create KUnit tests for YUV conversions

2024-01-10 Thread Arthur Grillo
Create KUnit tests to test the conversion between YUV and RGB. Test each conversion and range combination with some common colors. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/Kconfig | 15 +++ drivers/gpu/drm/vkms/Makefile | 1 + drivers/gpu/drm

[PATCH v2 6/7] drm/vkms: Drop YUV formats TODO

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

[PATCH v2 5/7] drm/vkms: Add YUV support

2024-01-10 Thread Arthur Grillo
to avoid the use of fixed point operations. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_formats.c | 147 drivers/gpu/drm/vkms/vkms_formats.h | 4 + drivers/gpu/drm/vkms/vkms_plane.c | 14 +++- 3 files changed, 164 insertions(+), 1 deletion

[PATCH v2 4/7] drm/vkms: Add chroma subsampling

2024-01-10 Thread Arthur Grillo
Add support to chroma subsampling. This should be noop, as all supported formats do not have chroma subsampling. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_formats.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vkms

[PATCH v2 3/7] drm/vkms: Add range and encoding properties to pixel_read function

2024-01-10 Thread Arthur Grillo
Create range and encoding properties. This should be noop, as none of the conversion functions need those properties. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_drv.h | 3 ++- drivers/gpu/drm/vkms/vkms_formats.c | 20 ++-- drivers/gpu/drm/vkms/vkms_plane.c

[PATCH v2 2/7] drm/vkms: Add support for multy-planar framebuffers

2024-01-10 Thread Arthur Grillo
Add support to multy-planar formats by adding an index argument to the framebuffer data access functions. Also, give all the planes to the conversion functions. This, for now, should be noop, as all the supported formats have only one plane. Signed-off-by: Arthur Grillo --- drivers/gpu/drm

[PATCH v2 1/7] drm/vkms: Use drm_frame directly

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

[PATCH v2 0/7] Add YUV formats to VKMS

2024-01-10 Thread Arthur Grillo
/20230414135151.75975-2-mca...@igalia.com/ Signed-off-by: Arthur Grillo --- Changes in v2: - Use EXPORT_SYMBOL_IF_KUNIT instead of including the .c test file (Maxime) - Link to v1: https://lore.kernel.org/r/20240105-vkms-yuv-v1-0-34c4cd345...@riseup.net --- Arthur Grillo (7): drm/vkms: Use

Re: [PATCH 7/7] drm/vkms: Create KUnit tests for YUV conversions

2024-01-08 Thread Arthur Grillo
On 08/01/24 07:15, Maxime Ripard wrote: > Hi Arthur, > > On Fri, Jan 05, 2024 at 01:35:08PM -0300, Arthur Grillo wrote: >> diff --git a/drivers/gpu/drm/vkms/vkms_formats.c >> b/drivers/gpu/drm/vkms/vkms_formats.c >> index b654b6661a20..11df990a0fa9 100644 &g

[PATCH 4/7] drm/vkms: Add chroma subsampling

2024-01-05 Thread Arthur Grillo
Add support to chroma subsampling. This should be noop, as all supported formats do not have chroma subsampling. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_formats.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vkms

[PATCH 0/7] Add YUV formats to VKMS

2024-01-05 Thread Arthur Grillo
/20230414135151.75975-2-mca...@igalia.com/ Signed-off-by: Arthur Grillo --- Arthur Grillo (7): drm/vkms: Use drm_frame directly drm/vkms: Add support for multy-planar framebuffers drm/vkms: Add range and encoding properties to pixel_read function drm/vkms: Add chroma subsampling

[PATCH 7/7] drm/vkms: Create KUnit tests for YUV conversions

2024-01-05 Thread Arthur Grillo
Create KUnit tests to test the conversion between YUV and RGB. Test each conversion and range combination with some common colors. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/Kconfig | 15 +++ drivers/gpu/drm/vkms/tests/.kunitconfig | 4 + drivers/gpu/drm

[PATCH 3/7] drm/vkms: Add range and encoding properties to pixel_read function

2024-01-05 Thread Arthur Grillo
Create range and encoding properties. This should be noop, as none of the conversion functions need those properties. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_drv.h | 3 ++- drivers/gpu/drm/vkms/vkms_formats.c | 20 ++-- drivers/gpu/drm/vkms/vkms_plane.c

[PATCH 2/7] drm/vkms: Add support for multy-planar framebuffers

2024-01-05 Thread Arthur Grillo
Add support to multy-planar formats by adding an index argument to the framebuffer data access functions. Also, give all the planes to the conversion functions. This, for now, should be noop, as all the supported formats have only one plane. Signed-off-by: Arthur Grillo --- drivers/gpu/drm

[PATCH 6/7] drm/vkms: Drop YUV formats TODO

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

[PATCH 1/7] drm/vkms: Use drm_frame directly

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

[PATCH 5/7] drm/vkms: Add YUV support

2024-01-05 Thread Arthur Grillo
to avoid the use of fixed point operations. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/vkms/vkms_formats.c | 151 drivers/gpu/drm/vkms/vkms_plane.c | 14 +++- 2 files changed, 164 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms

Re: [RFC PATCH v3 04/23] drm/vkms: Add kunit tests for VKMS LUT handling

2023-11-10 Thread Arthur Grillo
On 09/11/23 19:05, Arthur Grillo wrote: > > > On 08/11/23 13:36, Harry Wentland wrote: >> 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 >> >>

Re: [RFC PATCH v3 05/23] drm/vkms: Avoid reading beyond LUT array

2023-11-10 Thread Arthur Grillo
gt; - Drop bits from commit description that didn't contribute >anything of value > > Signed-off-by: Harry Wentland > Cc: Arthur Grillo LGTM Reviewed-by: Arthur Grillo Best Regards, ~Arthur Grillo > --- > drivers/gpu/drm/vkms/vkms_composer.c | 14 ++ > 1 f

Re: [RFC PATCH v3 04/23] drm/vkms: Add kunit tests for VKMS LUT handling

2023-11-09 Thread Arthur Grillo
ff-by: Harry Wentland > Cc: Arthur Grillo > --- > drivers/gpu/drm/vkms/Kconfig | 5 ++ > drivers/gpu/drm/vkms/tests/.kunitconfig | 4 ++ > drivers/gpu/drm/vkms/tests/vkms_color_tests.c | 62 +++ > drivers/gpu/drm/vkms/vkms_compos

Re: [RFC PATCH v2 04/17] drm/vkms: Add kunit tests for VKMS LUT handling

2023-10-23 Thread Arthur Grillo
> Cc: Uma Shankar > Cc: Naseer Ahmed > Cc: Christopher Braga > Cc: Abhinav Kumar > Cc: Arthur Grillo > Cc: Hector Martin > Cc: Liviu Dudau > Cc: Sasha McIntosh > --- > drivers/gpu/drm/vkms/Kconfig | 5 ++ > drivers/gpu/drm/vkms/Makefile

Re: [PATCH 1/3] drm/tests: Fix kunit_release_action ctx argument

2023-09-27 Thread Arthur Grillo
On 27/09/23 19:47, Maira Canal wrote: > Hi Arthur, > > On 9/20/23 03:11, Arthur Grillo wrote: >> The kunit_action_platform_driver_unregister is added with >> _platform_driver as ctx, but the kunit_release_action is called >> pdev as ctx. Fix that by replaci

Re: [PATCH 3/3] drm/tests: Fix a use-after-free bug in __drm_kunit_helper_alloc_drm_device()

2023-09-20 Thread Arthur Grillo
On 20/09/23 03:40, Maxime Ripard wrote: > Hi, > > On Wed, Sep 20, 2023 at 03:11:38AM -0300, Arthur Grillo wrote: >> In __drm_kunit_helper_alloc_drm_device_with_driver(), a drm_driver is >> allocated with kunit_kzalloc. If the dev argument was allocated by >> drm_kun

[PATCH 3/3] drm/tests: Fix a use-after-free bug in __drm_kunit_helper_alloc_drm_device()

2023-09-20 Thread Arthur Grillo
000122 raw: 80080008 0001 page dumped because: kasan: bad access detected Memory state around the buggy address: 63194d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc 63194d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >0

[PATCH 2/3] kunit: Add kunit_move_action_to_top_or_reset() to reorder actions

2023-09-20 Thread Arthur Grillo
) || free(A) | +-++-+ | ... | -> | free(B) | +-++-+ | free(A) || ... | +-++-+ Signed-off-by: Arthur Grillo --- include/kunit/resource.h | 17 + lib/kunit/resourc

[PATCH 1/3] drm/tests: Fix kunit_release_action ctx argument

2023-09-20 Thread Arthur Grillo
The kunit_action_platform_driver_unregister is added with _platform_driver as ctx, but the kunit_release_action is called pdev as ctx. Fix that by replacing it with _platform_driver. Fixes: 4f2b0b583baa ("drm/tests: helpers: Switch to kunit actions") Signed-off-by: Arthur Grillo --- d

[PATCH 0/3] Fix a couble of bugs in drm_kunit_helpers.c

2023-09-20 Thread Arthur Grillo
that. Patches #2 and #3 solve the use-after-free bug. This error was a bit trickier to find. Basically, the usual order in which the kunit_actions run is the culprit, so #2 creates a helper function to reorder actions, and #3 uses that helper. Signed-off-by: Arthur Grillo --- Arthur Grillo (3

[PATCH RESEND v3 2/2] drm/tests: Add new format conversion tests to better cover drm_fb_blit()

2023-09-18 Thread Arthur Grillo
To fully cover drm_fb_blit(), add format conversion tests that are only supported through drm_fb_blit(). Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 142 + 1 file changed, 142 insertions(+) diff --git

[PATCH RESEND v3 1/2] drm/tests: Add calls to drm_fb_blit() on supported format conversion tests

2023-09-18 Thread Arthur Grillo
Add a call to drm_fb_blit() on existing format conversion tests that has support. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 143 + 1 file changed, 143 insertions(+) diff --git a/drivers/gpu/drm/tests

[PATCH RESEND v3 0/2] Add KUnit tests for drm_fb_blit()

2023-09-18 Thread Arthur Grillo
by drm_fb_blit(). The second patch adds those format conversion tests. Signed-off-by: Arthur Grillo --- Changes in v3: - Fix memset sizes to avoid out-of-bound access - Link to v2: https://lore.kernel.org/r/20230905-final-gsoc-v2-0-b52e8cb06...@riseup.net Changes in v2: - Split the patch into two (Maíra

Re: [PATCH v3 0/2] Add KUnit tests for drm_fb_blit()

2023-09-18 Thread Arthur Grillo
On 18/09/23 19:57, Arthur Grillo wrote: > This patchset tests the drm_fb_blit() function. > > As this function can be used with already tested formats, the first > patch adds calls to drm_fb_blit() on the tests of supported formats. > > Some supported formats we

[PATCH v3 1/2] drm/tests: Add calls to drm_fb_blit() on supported format conversion tests

2023-09-18 Thread Arthur Grillo
Add a call to drm_fb_blit() on existing format conversion tests that has support. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 143 + 1 file changed, 143 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b

[PATCH v3 0/2] Add KUnit tests for drm_fb_blit()

2023-09-18 Thread Arthur Grillo
by drm_fb_blit(). The second patch adds those format conversion tests. Signed-off-by: Arthur Grillo --- Changes in v3: - Fix memset sizes to avoid out-of-bound access - Link to v2: https://lore.kernel.org/r/20230905-final-gsoc-v2-0-b52e8cb06...@riseup.net Changes in v2: - Split the patch into two (Maíra

[PATCH v2 2/2] drm/tests: Add new format conversion tests to better cover drm_fb_blit()

2023-09-05 Thread Arthur Grillo
To fully cover drm_fb_blit(), add format conversion tests that are only supported through drm_fb_blit(). Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 142 + 1 file changed, 142 insertions(+) diff --git a/drivers/gpu/drm/tests

[PATCH v2 1/2] drm/tests: Add calls to drm_fb_blit() on supported format conversion tests

2023-09-05 Thread Arthur Grillo
Add a call to drm_fb_blit() on existing format conversion tests that has support. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 142 + 1 file changed, 142 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b

[PATCH v2 0/2] Add KUnit tests for drm_fb_blit()

2023-09-05 Thread Arthur Grillo
by drm_fb_blit(). The second patch adds those format conversion tests. Signed-off-by: Arthur Grillo --- Changes in v2: - Split the patch into two (Maíra Canal) - Link to v1: https://lore.kernel.org/r/20230901-final-gsoc-v1-1-e310c7685...@riseup.net --- Arthur Grillo (2): drm/tests: Add calls

[PATCH] drm/tests: Zero initialize fourccs_out

2023-09-01 Thread Arthur Grillo
tests for drm_fb_build_fourcc_list()") Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c index 79

[PATCH] drm/debugfs: Add inline to drm_debugfs_dev_init() to suppres -Wunused-function

2023-09-01 Thread Arthur Grillo
.feakbzej-...@intel.com/ Signed-off-by: Arthur Grillo --- include/drm/drm_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 9850fe73b739..e2640dc64e08 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -584,7

[PATCH] drm/tests: Add KUnit tests for drm_fb_blit()

2023-09-01 Thread Arthur Grillo
Insert parameterized test for the drm_fb_blit() to ensure correctness and prevent future regressions. The test is done by adding a call to drm_fb_blit() on every format that has support. Also, to fully test the function, add new format conversion tests. Signed-off-by: Arthur Grillo --- drivers

[PATCH v3 6/6] drm/tests: Add KUnit tests for drm_fb_memcpy()

2023-08-14 Thread Arthur Grillo
Insert parameterized test for the drm_fb_memcpy() to ensure correctness and prevent future regressions. The test case can accept different formats. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 362 + 1 file changed, 362 insertions

[PATCH v3 5/6] drm/tests: Add multi-plane support to conversion_buf_size()

2023-08-14 Thread Arthur Grillo
The drm_fb_memcpy() supports multi-plane formats. To fully test it in the future, add multi-plane support to the conversion_buf_size() helper. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 28 +- 1 file

[PATCH v3 4/6] drm/tests: Add KUnit tests for drm_fb_build_fourcc_list()

2023-08-14 Thread Arthur Grillo
Insert parameterized test for the drm_fb_build_fourcc_list() to ensure correctness and prevent future regressions. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 144 + 1 file changed, 144 insertions(+) diff --git a/drivers/gpu/drm

[PATCH v3 3/6] drm/tests: Add KUnit tests for drm_fb_clip_offset()

2023-08-14 Thread Arthur Grillo
Insert parameterized test for the drm_fb_clip_offset() to ensure correctness and prevent future regressions. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 91 ++ 1 file changed, 91 insertions(+) diff --git

[PATCH v3 2/6] drm/tests: Add KUnit tests for drm_fb_swab()

2023-08-14 Thread Arthur Grillo
Insert parameterized test for the drm_fb_swab() to ensure correctness and prevent future regressions. Each expected color has it bytes reversed in order, so xrgb would be bgrx. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 66

[PATCH v3 1/6] drm/tests: Test default pitch fallback

2023-08-14 Thread Arthur Grillo
Test the default pitch fallback when NULL is passed as the dst_pitch on the conversion procedures. Reviewed-by: Maíra Canal Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 126 - 1 file changed, 81 insertions(+), 45 deletions(-) diff

[PATCH v3 0/6] Increase code coverage on drm_format_helper.c

2023-08-14 Thread Arthur Grillo
://grillo-0.github.io/coverage-reports/gsoc-drm-format-test/drivers/gpu/drm/drm_format_helper.c.gcov.html Signed-off-by: Arthur Grillo --- v1->v2: https://lore.kernel.org/r/20230721182316.560649-1-arthurgri...@riseup.net - Change patch prefix to "drm/tests" (Maíra Canal) - Simp

Re: [PATCH v2 6/6] drm/tests: Add KUnit tests for drm_fb_memcpy()

2023-08-14 Thread Arthur Grillo
On 13/08/23 10:30, Maira Canal wrote: > Hi Arthur, > > On 8/11/23 15:17, Arthur Grillo wrote: >> Insert parameterized test for the drm_fb_memcpy() to ensure correctness >> and prevent future regressions. The test case can accept different >> formats. >>

[PATCH v2 6/6] drm/tests: Add KUnit tests for drm_fb_memcpy()

2023-08-11 Thread Arthur Grillo
Insert parameterized test for the drm_fb_memcpy() to ensure correctness and prevent future regressions. The test case can accept different formats. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 391 + 1 file changed, 391 insertions

[PATCH v2 5/6] drm/tests: Add multi-plane support to conversion_buf_size()

2023-08-11 Thread Arthur Grillo
The drm_fb_memcpy() supports multi-plane formats. To fully test it in the future, add multi-plane support to the conversion_buf_size() helper. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 28 +- 1 file

[PATCH v2 2/6] drm/tests: Add KUnit tests for drm_fb_swab()

2023-08-11 Thread Arthur Grillo
Insert parameterized test for the drm_fb_swab() to ensure correctness and prevent future regressions. Each expected color has it bytes reversed in order, so xrgb would be bgrx. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 66

[PATCH v2 3/6] drm/tests: Add KUnit tests for drm_fb_clip_offset()

2023-08-11 Thread Arthur Grillo
Insert parameterized test for the drm_fb_clip_offset() to ensure correctness and prevent future regressions. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal --- drivers/gpu/drm/tests/drm_format_helper_test.c | 91 ++ 1 file changed, 91 insertions(+) diff --git

[PATCH v2 4/6] drm/tests: Add KUnit tests for drm_fb_build_fourcc_list()

2023-08-11 Thread Arthur Grillo
Insert parameterized test for the drm_fb_build_fourcc_list() to ensure correctness and prevent future regressions. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 148 + 1 file changed, 148 insertions(+) diff --git a/drivers/gpu/drm

[PATCH v2 1/6] drm/tests: Test default pitch fallback

2023-08-11 Thread Arthur Grillo
Test the default pitch fallback when NULL is passed as the dst_pitch on the conversion procedures. Signed-off-by: Arthur Grillo --- drivers/gpu/drm/tests/drm_format_helper_test.c | 126 - 1 file changed, 81 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 0/6] Increase code coverage on drm_format_helper.c

2023-08-11 Thread Arthur Grillo
://grillo-0.github.io/coverage-reports/gsoc-drm-format-test/drivers/gpu/drm/drm_format_helper.c.gcov.html Signed-off-by: Arthur Grillo --- v1->v2: https://lore.kernel.org/r/20230721182316.560649-1-arthurgri...@riseup.net - Change patch prefix to "drm/tests" (Maíra Canal) - Simp

Re: [PATCH 6/6] drm/format-helper: Add KUnit tests for drm_fb_memcpy()

2023-08-09 Thread Arthur Grillo
On 05/08/23 10:26, Maira Canal wrote: > On 7/21/23 15:23, Arthur Grillo wrote: >> Insert parameterized test for the drm_fb_memcpy() to ensure correctness >> and prevent future regressions. The test case can accept different >> formats. >> >> Signed-off-by: Arthu

Re: [PATCH -next 6/7] drm/format-helper: Remove unnecessary NULL values

2023-08-09 Thread Arthur Grillo
ff-by: Ruan Jinjie > --- > .../gpu/drm/tests/drm_format_helper_test.c| 28 +-- > 1 file changed, 14 insertions(+), 14 deletions(-) Reviewed-by: Arthur Grillo Best Regards, ~Arthur Grillo > > diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c > b/drivers/gp

Re: [PATCH] drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION

2023-08-04 Thread Arthur Grillo
> and FB=n now has FB_CORE=y and FRAMEBUFFER_CONSOLE=y. > > This leads to unmet direct dependencies detected for FRAMEBUFFER_CONSOLE > as reported by Arthur Grillo, e.g: > > WARNING: unmet direct dependencies detected for FRAMEBUFFER_CONSOLE > Depends on [n]: VT [=n] &&a

  1   2   >