Re: [PATCH] drm/tests: Alloc drm_device on drm_exec tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Jul 28, 2023 at 02:43:14PM -0300, Arthur Grillo Queiroz Cabral wrote:
> >>  drivers/gpu/drm/tests/drm_exec_test.c | 36 +++++++++++++++++++++------
> >>  1 file changed, 29 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/tests/drm_exec_test.c b/drivers/gpu/drm/tests/drm_exec_test.c
> >> index 727ac267682e..df31f89a7945 100644
> >> --- a/drivers/gpu/drm/tests/drm_exec_test.c
> >> +++ b/drivers/gpu/drm/tests/drm_exec_test.c
> >> @@ -12,11 +12,31 @@
> >>  
> >>  #include <drm/drm_exec.h>
> >>  #include <drm/drm_device.h>
> >> +#include <drm/drm_drv.h>
> >>  #include <drm/drm_gem.h>
> >> +#include <drm/drm_kunit_helpers.h>
> >>  
> >>  #include "../lib/drm_random.h"
> >>  
> >> -static struct drm_device dev;
> >> +static struct device *dev;
> >> +static struct drm_device *drm;
> >> +
> >> +static int test_init(struct kunit *test)
> >> +{
> >> +	dev = drm_kunit_helper_alloc_device(test);
> >> +	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev);
> >> +
> >> +	drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*drm), 0,
> >> +						  DRIVER_MODESET);
> >> +	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, drm);
> >> +
> >> +	return 0;
> >> +}
> >> +
> >> +static void test_exit(struct kunit *test)
> >> +{
> >> +	drm_kunit_helper_free_device(test, dev);
> >> +}

Also, I just pushed changes that make the call to
drm_kunit_helper_free_device unnecessary.

Maxime

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux