mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: include linux/slab.h where needed
@ 2019-12-10 19:59 Arnd Bergmann
  2019-12-10 20:30 ` Kazlauskas, Nicholas
  2019-12-10 22:18 ` Alex Deucher
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-12-10 19:59 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Bhawanpreet Lakha, Roman Li, Eric Yang,
	Michael Strauss, amd-gfx, dri-devel, linux-kernel

Calling kzalloc() and related functions requires the
linux/slab.h header to be included:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c: In function 'dcn21_ipp_create':
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:679:3: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
   kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL);

A lot of other headers also miss a direct include in this file,
but this is the only one that causes a problem for now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
index 906c84e6b49b..af57885bbff2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
@@ -23,6 +23,8 @@
  *
  */
 
+#include <linux/slab.h>
+
 #include "dm_services.h"
 #include "dc.h"
 
-- 
2.20.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: include linux/slab.h where needed
  2019-12-10 19:59 [PATCH] drm/amd/display: include linux/slab.h where needed Arnd Bergmann
@ 2019-12-10 20:30 ` Kazlauskas, Nicholas
  2019-12-10 20:51   ` Arnd Bergmann
  2019-12-10 22:18 ` Alex Deucher
  1 sibling, 1 reply; 4+ messages in thread
From: Kazlauskas, Nicholas @ 2019-12-10 20:30 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Alex Deucher,
	Christian König, David (ChunMing) Zhou, David Airlie,
	Daniel Vetter
  Cc: Eric Yang, Roman Li, amd-gfx, linux-kernel, Michael Strauss,
	dri-devel, Bhawanpreet Lakha

On 2019-12-10 2:59 p.m., Arnd Bergmann wrote:
> Calling kzalloc() and related functions requires the
> linux/slab.h header to be included:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c: In function 'dcn21_ipp_create':
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:679:3: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
>     kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL);
> 
> A lot of other headers also miss a direct include in this file,
> but this is the only one that causes a problem for now.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

What version of the kernel are you building?

We have:

#include <linux/slab.h>

in os_types.h which gets included as part of this file:

#include <dc.h> -> #include <dc_types.h> -> #include <os_types.h>

Nicholas Kazlauskas

> ---
>   drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
> index 906c84e6b49b..af57885bbff2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
> @@ -23,6 +23,8 @@
>    *
>    */
>   
> +#include <linux/slab.h>
> +
>   #include "dm_services.h"
>   #include "dc.h"
>   
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: include linux/slab.h where needed
  2019-12-10 20:30 ` Kazlauskas, Nicholas
@ 2019-12-10 20:51   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-12-10 20:51 UTC (permalink / raw)
  To: Kazlauskas, Nicholas
  Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter, Eric Yang,
	Roman Li, amd-gfx list, linux-kernel, Michael Strauss, dri-devel,
	Bhawanpreet Lakha

On Tue, Dec 10, 2019 at 9:30 PM Kazlauskas, Nicholas
<nicholas.kazlauskas@amd.com> wrote:
>
> On 2019-12-10 2:59 p.m., Arnd Bergmann wrote:
> > Calling kzalloc() and related functions requires the
> > linux/slab.h header to be included:
> >
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c: In function 'dcn21_ipp_create':
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:679:3: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
> >     kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL);
> >
> > A lot of other headers also miss a direct include in this file,
> > but this is the only one that causes a problem for now.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> What version of the kernel are you building?

This is v5.5-rc1, plus some local patches.

> We have:
>
> #include <linux/slab.h>
>
> in os_types.h which gets included as part of this file:
>
> #include <dc.h> -> #include <dc_types.h> -> #include <os_types.h>

I don't see linux/slab.h in os_types.h. I now see that commit
4fc4dca8320e ("drm/amd: drop use of drmp.h in os_types.h")
was merged into linux-5.3, which may have caused this.

I also don't see anything in os_types.h that needs linux/slab.h.

    Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: include linux/slab.h where needed
  2019-12-10 19:59 [PATCH] drm/amd/display: include linux/slab.h where needed Arnd Bergmann
  2019-12-10 20:30 ` Kazlauskas, Nicholas
@ 2019-12-10 22:18 ` Alex Deucher
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2019-12-10 22:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter, Eric Yang,
	Roman Li, amd-gfx list, LKML, Michael Strauss,
	Maling list - DRI developers, Bhawanpreet Lakha

Applied.  Thanks!

Alex

On Tue, Dec 10, 2019 at 2:59 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> Calling kzalloc() and related functions requires the
> linux/slab.h header to be included:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c: In function 'dcn21_ipp_create':
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_resource.c:679:3: error: implicit declaration of function 'kzalloc'; did you mean 'd_alloc'? [-Werror=implicit-function-declaration]
>    kzalloc(sizeof(struct dcn10_ipp), GFP_KERNEL);
>
> A lot of other headers also miss a direct include in this file,
> but this is the only one that causes a problem for now.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
> index 906c84e6b49b..af57885bbff2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
> @@ -23,6 +23,8 @@
>   *
>   */
>
> +#include <linux/slab.h>
> +
>  #include "dm_services.h"
>  #include "dc.h"
>
> --
> 2.20.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-10 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 19:59 [PATCH] drm/amd/display: include linux/slab.h where needed Arnd Bergmann
2019-12-10 20:30 ` Kazlauskas, Nicholas
2019-12-10 20:51   ` Arnd Bergmann
2019-12-10 22:18 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®