All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arunpravin <arunpravin.paneerselvam@amd.com>
To: Matthew Auld <matthew.auld@intel.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, tzimmermann@suse.de, christian.koenig@amd.com
Subject: Re: [PATCH 1/7] drm/selftests: Move i915 buddy selftests into drm
Date: Wed, 23 Feb 2022 00:05:20 +0530	[thread overview]
Message-ID: <995b793c-9ed8-85d7-faf8-d57348cafc99@amd.com> (raw)
In-Reply-To: <4af33e93-12c1-a6e8-4ae6-cc6122117373@intel.com>



On 08/02/22 4:05 pm, Matthew Auld wrote:
> On 03/02/2022 13:32, Arunpravin wrote:
>> - move i915 buddy selftests into drm selftests folder
>> - add Makefile and Kconfig support
>> - add sanitycheck testcase
>>
>> Prerequisites
>> - These series of selftests patches are created on top of
>>    drm buddy series
>> - Enable kselftests for DRM as a module in .config
>>
>> Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
> 
> At some point I guess we also want some IGT that picks this up? Like we 
> do in tests/drm_mm.c? That way this can get picked up by CI?

igt-gpu-tools? we need to create tests/drm_buddy.c to pick these tests.
I will create a patch to include drm buddy selftests into igt-gpu-tools
> 
> Acked-by: Matthew Auld <matthew.auld@intel.com>
> 
>> ---
>>   drivers/gpu/drm/Kconfig                       |  1 +
>>   drivers/gpu/drm/selftests/Makefile            |  3 +-
>>   .../gpu/drm/selftests/drm_buddy_selftests.h   |  9 ++++
>>   drivers/gpu/drm/selftests/test-drm_buddy.c    | 49 +++++++++++++++++++
>>   4 files changed, 61 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/gpu/drm/selftests/drm_buddy_selftests.h
>>   create mode 100644 drivers/gpu/drm/selftests/test-drm_buddy.c
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index eb5a57ae3c5c..ff856df3f97f 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -71,6 +71,7 @@ config DRM_DEBUG_SELFTEST
>>   	select DRM_DP_HELPER
>>   	select DRM_LIB_RANDOM
>>   	select DRM_KMS_HELPER
>> +	select DRM_BUDDY
>>   	select DRM_EXPORT_FOR_TESTS if m
>>   	default n
>>   	help
>> diff --git a/drivers/gpu/drm/selftests/Makefile b/drivers/gpu/drm/selftests/Makefile
>> index 0856e4b12f70..5ba5f9138c95 100644
>> --- a/drivers/gpu/drm/selftests/Makefile
>> +++ b/drivers/gpu/drm/selftests/Makefile
>> @@ -4,4 +4,5 @@ test-drm_modeset-y := test-drm_modeset_common.o test-drm_plane_helper.o \
>>   		      test-drm_damage_helper.o test-drm_dp_mst_helper.o \
>>   		      test-drm_rect.o
>>   
>> -obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o test-drm_cmdline_parser.o
>> +obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o test-drm_cmdline_parser.o \
>> +				    test-drm_buddy.o
>> diff --git a/drivers/gpu/drm/selftests/drm_buddy_selftests.h b/drivers/gpu/drm/selftests/drm_buddy_selftests.h
>> new file mode 100644
>> index 000000000000..a4bcf3a6dfe3
>> --- /dev/null
>> +++ b/drivers/gpu/drm/selftests/drm_buddy_selftests.h
>> @@ -0,0 +1,9 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +/* List each unit test as selftest(name, function)
>> + *
>> + * The name is used as both an enum and expanded as igt__name to create
>> + * a module parameter. It must be unique and legal for a C identifier.
>> + *
>> + * Tests are executed in order by igt/drm_buddy
>> + */
>> +selftest(sanitycheck, igt_sanitycheck) /* keep first (selfcheck for igt) */
>> diff --git a/drivers/gpu/drm/selftests/test-drm_buddy.c b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> new file mode 100644
>> index 000000000000..51e4d393d22c
>> --- /dev/null
>> +++ b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> @@ -0,0 +1,49 @@
>> +// SPDX-License-Identifier: MIT
>> +/*
>> + * Copyright © 2019 Intel Corporation
>> + */
>> +
>> +#define pr_fmt(fmt) "drm_buddy: " fmt
>> +
>> +#include <linux/module.h>
>> +
>> +#include <drm/drm_buddy.h>
>> +
>> +#include "../lib/drm_random.h"
>> +
>> +#define TESTS "drm_buddy_selftests.h"
>> +#include "drm_selftest.h"
>> +
>> +static unsigned int random_seed;
>> +
>> +static int igt_sanitycheck(void *ignored)
>> +{
>> +	pr_info("%s - ok!\n", __func__);
>> +	return 0;
>> +}
>> +
>> +#include "drm_selftest.c"
>> +
>> +static int __init test_drm_buddy_init(void)
>> +{
>> +	int err;
>> +
>> +	while (!random_seed)
>> +		random_seed = get_random_int();
>> +
>> +	pr_info("Testing DRM buddy manager (struct drm_buddy), with random_seed=0x%x\n",
>> +		random_seed);
>> +	err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
>> +
>> +	return err > 0 ? 0 : err;
>> +}
>> +
>> +static void __exit test_drm_buddy_exit(void)
>> +{
>> +}
>> +
>> +module_init(test_drm_buddy_init);
>> +module_exit(test_drm_buddy_exit);
>> +
>> +MODULE_AUTHOR("Intel Corporation");
>> +MODULE_LICENSE("GPL");

WARNING: multiple messages have this Message-ID (diff)
From: Arunpravin <arunpravin.paneerselvam@amd.com>
To: Matthew Auld <matthew.auld@intel.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, tzimmermann@suse.de, christian.koenig@amd.com
Subject: Re: [Intel-gfx] [PATCH 1/7] drm/selftests: Move i915 buddy selftests into drm
Date: Wed, 23 Feb 2022 00:05:20 +0530	[thread overview]
Message-ID: <995b793c-9ed8-85d7-faf8-d57348cafc99@amd.com> (raw)
In-Reply-To: <4af33e93-12c1-a6e8-4ae6-cc6122117373@intel.com>



On 08/02/22 4:05 pm, Matthew Auld wrote:
> On 03/02/2022 13:32, Arunpravin wrote:
>> - move i915 buddy selftests into drm selftests folder
>> - add Makefile and Kconfig support
>> - add sanitycheck testcase
>>
>> Prerequisites
>> - These series of selftests patches are created on top of
>>    drm buddy series
>> - Enable kselftests for DRM as a module in .config
>>
>> Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
> 
> At some point I guess we also want some IGT that picks this up? Like we 
> do in tests/drm_mm.c? That way this can get picked up by CI?

igt-gpu-tools? we need to create tests/drm_buddy.c to pick these tests.
I will create a patch to include drm buddy selftests into igt-gpu-tools
> 
> Acked-by: Matthew Auld <matthew.auld@intel.com>
> 
>> ---
>>   drivers/gpu/drm/Kconfig                       |  1 +
>>   drivers/gpu/drm/selftests/Makefile            |  3 +-
>>   .../gpu/drm/selftests/drm_buddy_selftests.h   |  9 ++++
>>   drivers/gpu/drm/selftests/test-drm_buddy.c    | 49 +++++++++++++++++++
>>   4 files changed, 61 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/gpu/drm/selftests/drm_buddy_selftests.h
>>   create mode 100644 drivers/gpu/drm/selftests/test-drm_buddy.c
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index eb5a57ae3c5c..ff856df3f97f 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -71,6 +71,7 @@ config DRM_DEBUG_SELFTEST
>>   	select DRM_DP_HELPER
>>   	select DRM_LIB_RANDOM
>>   	select DRM_KMS_HELPER
>> +	select DRM_BUDDY
>>   	select DRM_EXPORT_FOR_TESTS if m
>>   	default n
>>   	help
>> diff --git a/drivers/gpu/drm/selftests/Makefile b/drivers/gpu/drm/selftests/Makefile
>> index 0856e4b12f70..5ba5f9138c95 100644
>> --- a/drivers/gpu/drm/selftests/Makefile
>> +++ b/drivers/gpu/drm/selftests/Makefile
>> @@ -4,4 +4,5 @@ test-drm_modeset-y := test-drm_modeset_common.o test-drm_plane_helper.o \
>>   		      test-drm_damage_helper.o test-drm_dp_mst_helper.o \
>>   		      test-drm_rect.o
>>   
>> -obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o test-drm_cmdline_parser.o
>> +obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o test-drm_cmdline_parser.o \
>> +				    test-drm_buddy.o
>> diff --git a/drivers/gpu/drm/selftests/drm_buddy_selftests.h b/drivers/gpu/drm/selftests/drm_buddy_selftests.h
>> new file mode 100644
>> index 000000000000..a4bcf3a6dfe3
>> --- /dev/null
>> +++ b/drivers/gpu/drm/selftests/drm_buddy_selftests.h
>> @@ -0,0 +1,9 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +/* List each unit test as selftest(name, function)
>> + *
>> + * The name is used as both an enum and expanded as igt__name to create
>> + * a module parameter. It must be unique and legal for a C identifier.
>> + *
>> + * Tests are executed in order by igt/drm_buddy
>> + */
>> +selftest(sanitycheck, igt_sanitycheck) /* keep first (selfcheck for igt) */
>> diff --git a/drivers/gpu/drm/selftests/test-drm_buddy.c b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> new file mode 100644
>> index 000000000000..51e4d393d22c
>> --- /dev/null
>> +++ b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> @@ -0,0 +1,49 @@
>> +// SPDX-License-Identifier: MIT
>> +/*
>> + * Copyright © 2019 Intel Corporation
>> + */
>> +
>> +#define pr_fmt(fmt) "drm_buddy: " fmt
>> +
>> +#include <linux/module.h>
>> +
>> +#include <drm/drm_buddy.h>
>> +
>> +#include "../lib/drm_random.h"
>> +
>> +#define TESTS "drm_buddy_selftests.h"
>> +#include "drm_selftest.h"
>> +
>> +static unsigned int random_seed;
>> +
>> +static int igt_sanitycheck(void *ignored)
>> +{
>> +	pr_info("%s - ok!\n", __func__);
>> +	return 0;
>> +}
>> +
>> +#include "drm_selftest.c"
>> +
>> +static int __init test_drm_buddy_init(void)
>> +{
>> +	int err;
>> +
>> +	while (!random_seed)
>> +		random_seed = get_random_int();
>> +
>> +	pr_info("Testing DRM buddy manager (struct drm_buddy), with random_seed=0x%x\n",
>> +		random_seed);
>> +	err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
>> +
>> +	return err > 0 ? 0 : err;
>> +}
>> +
>> +static void __exit test_drm_buddy_exit(void)
>> +{
>> +}
>> +
>> +module_init(test_drm_buddy_init);
>> +module_exit(test_drm_buddy_exit);
>> +
>> +MODULE_AUTHOR("Intel Corporation");
>> +MODULE_LICENSE("GPL");

WARNING: multiple messages have this Message-ID (diff)
From: Arunpravin <arunpravin.paneerselvam@amd.com>
To: Matthew Auld <matthew.auld@intel.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, tzimmermann@suse.de,
	christian.koenig@amd.com, daniel@ffwll.ch
Subject: Re: [PATCH 1/7] drm/selftests: Move i915 buddy selftests into drm
Date: Wed, 23 Feb 2022 00:05:20 +0530	[thread overview]
Message-ID: <995b793c-9ed8-85d7-faf8-d57348cafc99@amd.com> (raw)
In-Reply-To: <4af33e93-12c1-a6e8-4ae6-cc6122117373@intel.com>



On 08/02/22 4:05 pm, Matthew Auld wrote:
> On 03/02/2022 13:32, Arunpravin wrote:
>> - move i915 buddy selftests into drm selftests folder
>> - add Makefile and Kconfig support
>> - add sanitycheck testcase
>>
>> Prerequisites
>> - These series of selftests patches are created on top of
>>    drm buddy series
>> - Enable kselftests for DRM as a module in .config
>>
>> Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
> 
> At some point I guess we also want some IGT that picks this up? Like we 
> do in tests/drm_mm.c? That way this can get picked up by CI?

igt-gpu-tools? we need to create tests/drm_buddy.c to pick these tests.
I will create a patch to include drm buddy selftests into igt-gpu-tools
> 
> Acked-by: Matthew Auld <matthew.auld@intel.com>
> 
>> ---
>>   drivers/gpu/drm/Kconfig                       |  1 +
>>   drivers/gpu/drm/selftests/Makefile            |  3 +-
>>   .../gpu/drm/selftests/drm_buddy_selftests.h   |  9 ++++
>>   drivers/gpu/drm/selftests/test-drm_buddy.c    | 49 +++++++++++++++++++
>>   4 files changed, 61 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/gpu/drm/selftests/drm_buddy_selftests.h
>>   create mode 100644 drivers/gpu/drm/selftests/test-drm_buddy.c
>>
>> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
>> index eb5a57ae3c5c..ff856df3f97f 100644
>> --- a/drivers/gpu/drm/Kconfig
>> +++ b/drivers/gpu/drm/Kconfig
>> @@ -71,6 +71,7 @@ config DRM_DEBUG_SELFTEST
>>   	select DRM_DP_HELPER
>>   	select DRM_LIB_RANDOM
>>   	select DRM_KMS_HELPER
>> +	select DRM_BUDDY
>>   	select DRM_EXPORT_FOR_TESTS if m
>>   	default n
>>   	help
>> diff --git a/drivers/gpu/drm/selftests/Makefile b/drivers/gpu/drm/selftests/Makefile
>> index 0856e4b12f70..5ba5f9138c95 100644
>> --- a/drivers/gpu/drm/selftests/Makefile
>> +++ b/drivers/gpu/drm/selftests/Makefile
>> @@ -4,4 +4,5 @@ test-drm_modeset-y := test-drm_modeset_common.o test-drm_plane_helper.o \
>>   		      test-drm_damage_helper.o test-drm_dp_mst_helper.o \
>>   		      test-drm_rect.o
>>   
>> -obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o test-drm_cmdline_parser.o
>> +obj-$(CONFIG_DRM_DEBUG_SELFTEST) += test-drm_mm.o test-drm_modeset.o test-drm_cmdline_parser.o \
>> +				    test-drm_buddy.o
>> diff --git a/drivers/gpu/drm/selftests/drm_buddy_selftests.h b/drivers/gpu/drm/selftests/drm_buddy_selftests.h
>> new file mode 100644
>> index 000000000000..a4bcf3a6dfe3
>> --- /dev/null
>> +++ b/drivers/gpu/drm/selftests/drm_buddy_selftests.h
>> @@ -0,0 +1,9 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +/* List each unit test as selftest(name, function)
>> + *
>> + * The name is used as both an enum and expanded as igt__name to create
>> + * a module parameter. It must be unique and legal for a C identifier.
>> + *
>> + * Tests are executed in order by igt/drm_buddy
>> + */
>> +selftest(sanitycheck, igt_sanitycheck) /* keep first (selfcheck for igt) */
>> diff --git a/drivers/gpu/drm/selftests/test-drm_buddy.c b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> new file mode 100644
>> index 000000000000..51e4d393d22c
>> --- /dev/null
>> +++ b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> @@ -0,0 +1,49 @@
>> +// SPDX-License-Identifier: MIT
>> +/*
>> + * Copyright © 2019 Intel Corporation
>> + */
>> +
>> +#define pr_fmt(fmt) "drm_buddy: " fmt
>> +
>> +#include <linux/module.h>
>> +
>> +#include <drm/drm_buddy.h>
>> +
>> +#include "../lib/drm_random.h"
>> +
>> +#define TESTS "drm_buddy_selftests.h"
>> +#include "drm_selftest.h"
>> +
>> +static unsigned int random_seed;
>> +
>> +static int igt_sanitycheck(void *ignored)
>> +{
>> +	pr_info("%s - ok!\n", __func__);
>> +	return 0;
>> +}
>> +
>> +#include "drm_selftest.c"
>> +
>> +static int __init test_drm_buddy_init(void)
>> +{
>> +	int err;
>> +
>> +	while (!random_seed)
>> +		random_seed = get_random_int();
>> +
>> +	pr_info("Testing DRM buddy manager (struct drm_buddy), with random_seed=0x%x\n",
>> +		random_seed);
>> +	err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
>> +
>> +	return err > 0 ? 0 : err;
>> +}
>> +
>> +static void __exit test_drm_buddy_exit(void)
>> +{
>> +}
>> +
>> +module_init(test_drm_buddy_init);
>> +module_exit(test_drm_buddy_exit);
>> +
>> +MODULE_AUTHOR("Intel Corporation");
>> +MODULE_LICENSE("GPL");

  reply	other threads:[~2022-02-22 18:24 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 13:32 [PATCH 1/7] drm/selftests: Move i915 buddy selftests into drm Arunpravin
2022-02-03 13:32 ` Arunpravin
2022-02-03 13:32 ` [Intel-gfx] " Arunpravin
2022-02-03 13:32 ` [PATCH 2/7] drm/selftests: add drm buddy alloc limit testcase Arunpravin
2022-02-03 13:32   ` Arunpravin
2022-02-03 13:32   ` [Intel-gfx] " Arunpravin
2022-02-08  9:40   ` Matthew Auld
2022-02-08  9:40     ` Matthew Auld
2022-02-08  9:40     ` [Intel-gfx] " Matthew Auld
2022-02-22 19:07     ` Arunpravin
2022-02-22 19:07       ` Arunpravin
2022-02-22 19:07       ` [Intel-gfx] " Arunpravin
2022-02-03 13:32 ` [PATCH 3/7] drm/selftests: add drm buddy alloc range testcase Arunpravin
2022-02-03 13:32   ` Arunpravin
2022-02-03 13:32   ` [Intel-gfx] " Arunpravin
2022-02-08 10:03   ` Matthew Auld
2022-02-08 10:03     ` Matthew Auld
2022-02-08 10:03     ` [Intel-gfx] " Matthew Auld
2022-02-03 13:32 ` [PATCH 4/7] drm/selftests: add drm buddy optimistic testcase Arunpravin
2022-02-03 13:32   ` Arunpravin
2022-02-03 13:32   ` [Intel-gfx] " Arunpravin
2022-02-08 10:12   ` Matthew Auld
2022-02-08 10:12     ` Matthew Auld
2022-02-08 10:12     ` [Intel-gfx] " Matthew Auld
2022-02-03 13:32 ` [PATCH 5/7] drm/selftests: add drm buddy pessimistic testcase Arunpravin
2022-02-03 13:32   ` Arunpravin
2022-02-03 13:32   ` [Intel-gfx] " Arunpravin
2022-02-08 10:17   ` Matthew Auld
2022-02-08 10:17     ` Matthew Auld
2022-02-08 10:17     ` [Intel-gfx] " Matthew Auld
2022-02-03 13:32 ` [PATCH 6/7] drm/selftests: add drm buddy smoke testcase Arunpravin
2022-02-03 13:32   ` Arunpravin
2022-02-03 13:32   ` [Intel-gfx] " Arunpravin
2022-02-08 10:22   ` Matthew Auld
2022-02-08 10:22     ` Matthew Auld
2022-02-08 10:22     ` [Intel-gfx] " Matthew Auld
2022-02-03 13:32 ` [PATCH 7/7] drm/selftests: add drm buddy pathological testcase Arunpravin
2022-02-03 13:32   ` Arunpravin
2022-02-03 13:32   ` [Intel-gfx] " Arunpravin
2022-02-08 10:26   ` Matthew Auld
2022-02-08 10:26     ` Matthew Auld
2022-02-08 10:26     ` [Intel-gfx] " Matthew Auld
2022-02-03 14:12 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/7] drm/selftests: Move i915 buddy selftests into drm Patchwork
2022-02-03 14:33 ` [PATCH 1/7] " Christian König
2022-02-03 14:33   ` Christian König
2022-02-03 14:33   ` [Intel-gfx] " Christian König
2022-02-08 10:35 ` Matthew Auld
2022-02-08 10:35   ` Matthew Auld
2022-02-08 10:35   ` [Intel-gfx] " Matthew Auld
2022-02-22 18:35   ` Arunpravin [this message]
2022-02-22 18:35     ` Arunpravin
2022-02-22 18:35     ` [Intel-gfx] " Arunpravin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=995b793c-9ed8-85d7-faf8-d57348cafc99@amd.com \
    --to=arunpravin.paneerselvam@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.