lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 2 Jun 2022 10:12:59 -0700
From:   David Gow <davidgow@...gle.com>
To:     José Expósito <jose.exposito89@...il.com>
Cc:     Maxime Ripard <maxime@...no.tech>,
        KUnit Development <kunit-dev@...glegroups.com>,
        Javier Martinez Canillas <javierm@...hat.com>,
        tzimmermann@...e.de, maarten.lankhorst@...ux.intel.com,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 1/1] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb332()

On Mon, May 30, 2022 at 9:29 AM José Expósito <jose.exposito89@...il.com> wrote:
>
> Hi Maxime,
>
> On Mon, May 30, 2022 at 03:11:58PM +0200, Maxime Ripard wrote:
> >
> > Hi,
> >
> > On Mon, May 30, 2022 at 12:20:17PM +0200, José Expósito wrote:
> > > Test the conversion from XRGB8888 to RGB332.
> > >
> > > What is tested?
> > >
> > >  - Different values for the X in XRGB8888 to make sure it is ignored
> > >  - Different clip values: Single pixel and full and partial buffer
> > >  - Well know colors: White, black, red, green, blue, magenta, yellow
> > >    and cyan
> > >  - Other colors: Randomly picked
> > >  - Destination pitch
> > >
> > > Suggested-by: Javier Martinez Canillas <javierm@...hat.com>
> > > Signed-off-by: José Expósito <jose.exposito89@...il.com>
> >
> > It looks mostly good to me, but I think we should Cc
> > kunit-dev@...glegroups.com to have their feedback.
>
> Thanks a lot for the quick feedback.
>
> I just cc'ed kunit-dev@...glegroups.com. For anyone joining the
> conversation, here is the link to the patch and the cover letter with
> some questions:
>
> https://lore.kernel.org/dri-devel/20220530102017.471865-1-jose.exposito89@gmail.com/T/
>
> >
> > > ---
> > >  drivers/gpu/drm/Kconfig                  |  12 ++
> > >  drivers/gpu/drm/Makefile                 |   3 +
> > >  drivers/gpu/drm/drm_format_helper_test.c | 166 +++++++++++++++++++++++
> > >  3 files changed, 181 insertions(+)
> > >  create mode 100644 drivers/gpu/drm/drm_format_helper_test.c
> > >
> > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> > > index e88c497fa010..d92be6faef15 100644
> > > --- a/drivers/gpu/drm/Kconfig
> > > +++ b/drivers/gpu/drm/Kconfig
> > > @@ -76,6 +76,18 @@ config DRM_KMS_HELPER
> > >     help
> > >       CRTC helpers for KMS drivers.
> > >
> > > +config DRM_FORMAR_HELPER_TEST
> > > +   bool "drm_format_helper tests" if !KUNIT_ALL_TESTS
> > > +   depends on DRM && KUNIT=y
> > > +   select DRM_KMS_HELPER
> > > +   default KUNIT_ALL_TESTS
> > > +   help
> > > +     KUnit tests for the drm_format_helper APIs. This option is not
> > > +     useful for distributions or general kernels, but only for kernel
> > > +     developers working on DRM and associated drivers.
> > > +
> > > +     If in doubt, say "N".
> > > +
> >
> > AFAIK, kunit test cases are supposed to have a .kunitconfig too to
> > enable the kunit tests easily.
> >
> > Maxime
>
> A .kuniconfig example is present in the cover letter. (...)

FYI: it's also possible to run these tests under UML with the extra options:
CONFIG_VIRTIO_UML=y
CONFIG_UML_PCI_OVER_VIRTIO=y

I suspect it's probably better not to add those to your .kunitconfig,
as they're UML-specific and will therefore break other architectures,
but it does mean the tests can be run with, for example:

./tools/testing/kunit/kunit.py run --kunitconfig
drivers/gpu/drm/.kunitconfig --kconfig_add CONFIG_VIRTIO_UML=y
--kconfig_add CONFIG_UML_PCI_OVER_VIRTIO=y

Or, without the .kunitconfig:
./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_DRM=y
--kconfig_add CONFIG_DRM_FORMAR_HELPER_TEST=y --kconfig_add
CONFIG_VIRTIO_UML=y  --kconfig_add CONFIG_UML_PCI_OVER_VIRTIO=y
'drm-*'

Cheers,
-- David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ