Re: [PATCH 05/10] drm/tests: Add test for drm_framebuffer_cleanup()

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

 



On Fri, Sep 08, 2023 at 05:42:07PM -0300, Maira Canal wrote:
> Hi Carlos,
> 
> On 9/4/23 14:22, Carlos wrote:
> > Hi Maíra,
> > 
> > On 8/26/23 11:06, Maíra Canal wrote:
> > > Hi Carlos,
> > > 
> > > On 8/25/23 13:07, Carlos Eduardo Gallo Filho wrote:
> > > > Add a single KUnit test case for the drm_framebuffer_cleanup function.
> > > > 
> > > > Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@xxxxxxxxxxx>
> > > > ---
> > > >   drivers/gpu/drm/tests/drm_framebuffer_test.c | 49 ++++++++++++++++++++
> > > >   1 file changed, 49 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c
> > > > b/drivers/gpu/drm/tests/drm_framebuffer_test.c
> > > > index 0e0e8216bbbc..16d9cf4bed88 100644
> > > > --- a/drivers/gpu/drm/tests/drm_framebuffer_test.c
> > > > +++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c
> > > > @@ -370,6 +370,9 @@ static int drm_framebuffer_test_init(struct
> > > > kunit *test)
> > > >       KUNIT_ASSERT_NOT_ERR_OR_NULL(test, mock);
> > > >       dev = &mock->dev;
> > > >   +    mutex_init(&dev->mode_config.fb_lock);
> > > 
> > > What about drmm_mutex_init()?
> > I took a look into it and as far I understand it would be useful if
> > the drm_device was allocated with drmm_kalloc(), sure? As far we
> 
> I'm not sure if we can allocate drm_device with drmm_kzalloc(), as we
> need a DRM device for drmm_kzalloc(). drmm_kzalloc() is just a
> &drm_device managed version of kzalloc().

We should use drm_kunit_helper_alloc_drm_device_with_driver

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