Re: [PATCH v2 4/4] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565()

2022-08-13 Thread José Expósito
On Wed, Aug 10, 2022 at 09:41:18AM -0700, Daniel Latypov wrote:
> On Sun, Jul 17, 2022 at 10:01 AM José Expósito
>  wrote:
> >
> > José Expósito  wrote:
> > > I already fixed the warning and added the reviewed by tags, however, I
> > > noticed that rebasing the series on the latest drm-misc-next show this
> > > error:
> > > [...]
> >
> > Sorry for the extra email. I forgot to mention that the error is only
> > present in UML. Running in other architectures works as expected.
> > Tested on x86_64 and PowerPC.
> 
> Can you take a look at the raw output?
> 
> It would be .kunit/test.log (or replace .kunit with w/e --build_dir
> you're using).
> You could also run the test with --raw_output to have kunit.py print
> that out instead.
> We might want to compare the output on UML vs x86 and see what looks 
> suspicious.
> 
> These errors
>   [ERROR] Test: xrgb_to_rgb332_test: missing subtest result line!
> means that kunit.py can't parse the KTAP output.
> 
> It could be that the output is mangled for some reason.
> I recall running into a UML-specific issue with output mangling on an
> old kernel fork. I doubt it's related to this one, but it shows that
> it's possible there could be something going on.
> 
> -Daniel

Hi!

Sorry for not clarifying the error in this thread.
I fixed it in v3 (already merged).

The issue was in my implementation. I was overwriting a few bytes of
memory due to an out of bounds bug. Thanks to the crash I mentioned,
I detected it before the code got merged.

Thanks a lot for the pointers Daniel, the next time I'll check
.kunit/test.log for usefull information.

Jose


Re: [PATCH v2 4/4] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565()

2022-08-10 Thread Daniel Vetter
On Sun, Jul 17, 2022 at 07:00:54PM +0200, José Expósito wrote:
> José Expósito  wrote:
> > I already fixed the warning and added the reviewed by tags, however, I
> > noticed that rebasing the series on the latest drm-misc-next show this
> > error:
> > [...]
> 
> Sorry for the extra email. I forgot to mention that the error is only
> present in UML. Running in other architectures works as expected.
> Tested on x86_64 and PowerPC.

Maybe a regression in the kunit infrastructure? Just guessing here ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


Re: [PATCH v2 4/4] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565()

2022-07-17 Thread José Expósito
José Expósito  wrote:
> I already fixed the warning and added the reviewed by tags, however, I
> noticed that rebasing the series on the latest drm-misc-next show this
> error:
> [...]

Sorry for the extra email. I forgot to mention that the error is only
present in UML. Running in other architectures works as expected.
Tested on x86_64 and PowerPC.

Jose


Re: [PATCH v2 4/4] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565()

2022-07-17 Thread José Expósito
Hi David,

On Sat, Jul 16, 2022 at 05:32:51PM +0800, David Gow wrote:
> On Sat, Jul 9, 2022 at 7:58 PM José Expósito  
> wrote:
> >
> > Extend the existing test cases to test the conversion from XRGB to
> > RGB565.
> >
> > The documentation and the color picker available on [1] are useful
> > resources to understand this patch and validate the values returned by
> > the conversion function.
> >
> > Tested-by: Tales L. Aparecida 
> > Acked-by: Thomas Zimmermann 
> > Signed-off-by: José Expósito 
> > Link: http://www.barth-dev.de/online/rgb565-color-picker/ # [1]
> > ---
> 
> Looks good and passes here.
> 
> Reviewed-by: David Gow 
> 
> Thanks,
> -- David

Thanks a lot for reviewing the series and for pointing out the Sparse
warning. 

I already fixed the warning and added the reviewed by tags, however, I
noticed that rebasing the series on the latest drm-misc-next show this
error:

[18:49:32] 
[18:49:33] === drm_format_helper_test (2 subtests) 
[18:49:33] = xrgb_to_rgb332_test ==
[18:49:33] [ERROR] Test: xrgb_to_rgb332_test: missing subtest result 
line!
[18:49:33] [ERROR] Test: xrgb_to_rgb332_test: 0 tests run!
[18:49:33] == [NO TESTS RUN] xrgb_to_rgb332_test ==
[18:49:33] [ERROR] Test: drm_format_helper_test: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: drm_format_helper_test: missing subtest result 
line!
[18:49:33] # Subtest: drm_format_helper_test
[18:49:33] 1..2
[18:49:33] = [CRASHED] drm_format_helper_test =
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] [ERROR] Test: main: missing expected subtest!
[18:49:33] [CRASHED] 
[18:49:33] 
[18:49:33] Testing complete. Ran 10 tests: crashed: 10, errors: 13

I bisected drm-misc-next to find out that the first bad commit is:
e23a5e14aa278858c2e3d81ec34e83aa9a4177c5

Not very usefull, because that commit merges v5.19-rc6 into misc.

I tested on the latest kselftest-master branch and the error is not
present.

Are you aware of any change that could cause this issue?

Jose

 
> >  .../gpu/drm/tests/drm_format_helper_test.c| 76 ++-
> >  1 file changed, 75 insertions(+), 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 0a490ad4fd32..c0592c1235cf 100644
> > --- a/drivers/gpu/drm/tests/drm_format_helper_test.c
> > +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
> > @@ -21,12 +21,19 @@ struct convert_to_rgb332_result {
> > const u8 expected[TEST_BUF_SIZE];
> >  };
> >
> > +struct convert_to_rgb565_result {
> > +   unsigned int dst_pitch;
> > +   const u16 expected[TEST_BUF_SIZE];
> > +   const u16 expected_swab[TEST_BUF_SIZE];
> > +};
> > +
> >  struct convert_xrgb_case {
> > const char *name;
> > unsigned int pitch;
> > struct drm_rect clip;
> > const u32 xrgb[TEST_BUF_SIZE];
> > struct convert_to_rgb332_result rgb332_result;
> > +   struct convert_to_rgb565_result rgb565_result;
> >  };
> >
> >  static struct convert_xrgb_case convert_xrgb_cases[] = {
> > @@ -39,6 +46,11 @@ static struct convert_xrgb_case 
> > convert_xrgb_cases[] = {
> > .dst_pitch = 0,
> > .expected = { 0xE0 },
> > },
> > +   .rgb565_result = {
> > +   .dst_pitch = 0,
> > +   .expected = { 0xF800 },
> > +   .expected_swab = { 0x00F8 },
> > +   },
> > },
> > {
> > .name = "single_pixel_clip_rectangle",
> > @@ -52,6 +64,11 @@ static struct convert_xrgb_case 
> > convert_xrgb_cases[] = {
> > .dst_pitch = 0,
> > .expected = { 0xE0 },
> > },
> > +   .rgb565_result = {
> > +   .dst_pitch = 0,
> > +   .expected = { 0xF800 },
> > +   .expected_swab = { 0x00F8 },
> > +   },
> > },
> > {
>