* [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
@ 2021-11-10 10:24 Andy Shevchenko
2021-11-10 13:54 ` Thomas Zimmermann
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-11-10 10:24 UTC (permalink / raw)
To: Thomas Zimmermann, Andy Shevchenko, dri-devel, linux-kernel
Cc: Maarten Lankhorst, Maxime Ripard, David Airlie, Daniel Vetter
When kernel.h is used in the headers it adds a lot into dependency hell,
especially when there are circular dependencies are involved.
Replace kernel.h inclusion with the list of what is really being used.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/drm/drm_gem_ttm_helper.h | 2 +-
include/drm/drm_gem_vram_helper.h | 2 +-
include/drm/drm_mm.h | 4 +++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/drm/drm_gem_ttm_helper.h b/include/drm/drm_gem_ttm_helper.h
index c1aa02bd4c89..78040f6cc6f3 100644
--- a/include/drm/drm_gem_ttm_helper.h
+++ b/include/drm/drm_gem_ttm_helper.h
@@ -3,7 +3,7 @@
#ifndef DRM_GEM_TTM_HELPER_H
#define DRM_GEM_TTM_HELPER_H
-#include <linux/kernel.h>
+#include <linux/container_of.h>
#include <drm/drm_device.h>
#include <drm/drm_gem.h>
diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
index d3cf06c9af65..b4ce27a72773 100644
--- a/include/drm/drm_gem_vram_helper.h
+++ b/include/drm/drm_gem_vram_helper.h
@@ -11,8 +11,8 @@
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
+#include <linux/container_of.h>
#include <linux/dma-buf-map.h>
-#include <linux/kernel.h> /* for container_of() */
struct drm_mode_create_dumb;
struct drm_plane;
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 9b4292f229c6..ac33ba1b18bc 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -39,13 +39,15 @@
*/
#include <linux/bug.h>
#include <linux/rbtree.h>
-#include <linux/kernel.h>
+#include <linux/limits.h>
#include <linux/mm_types.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#ifdef CONFIG_DRM_DEBUG_MM
#include <linux/stackdepot.h>
#endif
+#include <linux/types.h>
+
#include <drm/drm_print.h>
#ifdef CONFIG_DRM_DEBUG_MM
--
2.33.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-11-10 10:24 [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions Andy Shevchenko
@ 2021-11-10 13:54 ` Thomas Zimmermann
2021-11-10 16:34 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2021-11-10 13:54 UTC (permalink / raw)
To: Andy Shevchenko, dri-devel, linux-kernel
Cc: Maarten Lankhorst, Maxime Ripard, David Airlie, Daniel Vetter
[-- Attachment #1.1: Type: text/plain, Size: 2397 bytes --]
Hi
Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
> When kernel.h is used in the headers it adds a lot into dependency hell,
> especially when there are circular dependencies are involved.
>
> Replace kernel.h inclusion with the list of what is really being used.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> include/drm/drm_gem_ttm_helper.h | 2 +-
> include/drm/drm_gem_vram_helper.h | 2 +-
> include/drm/drm_mm.h | 4 +++-
> 3 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/include/drm/drm_gem_ttm_helper.h b/include/drm/drm_gem_ttm_helper.h
> index c1aa02bd4c89..78040f6cc6f3 100644
> --- a/include/drm/drm_gem_ttm_helper.h
> +++ b/include/drm/drm_gem_ttm_helper.h
> @@ -3,7 +3,7 @@
> #ifndef DRM_GEM_TTM_HELPER_H
> #define DRM_GEM_TTM_HELPER_H
>
> -#include <linux/kernel.h>
> +#include <linux/container_of.h>
I built this patch on a recent drm-misc-next, but there's no
linux/container_of.h
Best regards
Thomas
>
> #include <drm/drm_device.h>
> #include <drm/drm_gem.h>
> diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
> index d3cf06c9af65..b4ce27a72773 100644
> --- a/include/drm/drm_gem_vram_helper.h
> +++ b/include/drm/drm_gem_vram_helper.h
> @@ -11,8 +11,8 @@
> #include <drm/ttm/ttm_bo_api.h>
> #include <drm/ttm/ttm_bo_driver.h>
>
> +#include <linux/container_of.h>
> #include <linux/dma-buf-map.h>
> -#include <linux/kernel.h> /* for container_of() */
>
> struct drm_mode_create_dumb;
> struct drm_plane;
> diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
> index 9b4292f229c6..ac33ba1b18bc 100644
> --- a/include/drm/drm_mm.h
> +++ b/include/drm/drm_mm.h
> @@ -39,13 +39,15 @@
> */
> #include <linux/bug.h>
> #include <linux/rbtree.h>
> -#include <linux/kernel.h>
> +#include <linux/limits.h>
> #include <linux/mm_types.h>
> #include <linux/list.h>
> #include <linux/spinlock.h>
> #ifdef CONFIG_DRM_DEBUG_MM
> #include <linux/stackdepot.h>
> #endif
> +#include <linux/types.h>
> +
> #include <drm/drm_print.h>
>
> #ifdef CONFIG_DRM_DEBUG_MM
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-11-10 13:54 ` Thomas Zimmermann
@ 2021-11-10 16:34 ` Andy Shevchenko
2021-11-10 16:39 ` Thomas Zimmermann
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-11-10 16:34 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: Andy Shevchenko, dri-devel, Linux Kernel Mailing List,
Maarten Lankhorst, Maxime Ripard, David Airlie, Daniel Vetter
On Wed, Nov 10, 2021 at 3:55 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
> > When kernel.h is used in the headers it adds a lot into dependency hell,
> > especially when there are circular dependencies are involved.
> >
> > Replace kernel.h inclusion with the list of what is really being used.
...
> > +#include <linux/container_of.h>
>
> I built this patch on a recent drm-misc-next, but there's no
> linux/container_of.h
Thank you for trying. It's in the upstream, whenever drm-misc-next
switches to newer/newest upstream it will be there. I assume it will
happen after v5.16-rc1?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-11-10 16:34 ` Andy Shevchenko
@ 2021-11-10 16:39 ` Thomas Zimmermann
2021-11-15 11:35 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2021-11-10 16:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: David Airlie, Linux Kernel Mailing List, dri-devel, Andy Shevchenko
[-- Attachment #1.1: Type: text/plain, Size: 1190 bytes --]
Hi
Am 10.11.21 um 17:34 schrieb Andy Shevchenko:
> On Wed, Nov 10, 2021 at 3:55 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
>>> When kernel.h is used in the headers it adds a lot into dependency hell,
>>> especially when there are circular dependencies are involved.
>>>
>>> Replace kernel.h inclusion with the list of what is really being used.
>
> ...
>
>>> +#include <linux/container_of.h>
>>
>> I built this patch on a recent drm-misc-next, but there's no
>> linux/container_of.h
>
> Thank you for trying. It's in the upstream, whenever drm-misc-next
> switches to newer/newest upstream it will be there. I assume it will
> happen after v5.16-rc1?
Yes, we'll certainly backmerge soon after rc1 has been released. If I
forget to add the patch then, please send a reminder.
Once the necessary headers are available, the patch is
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Best regards
Thomas
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-11-10 16:39 ` Thomas Zimmermann
@ 2021-11-15 11:35 ` Andy Shevchenko
2021-11-23 16:32 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-11-15 11:35 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: David Airlie, Linux Kernel Mailing List, dri-devel
On Wed, Nov 10, 2021 at 05:39:33PM +0100, Thomas Zimmermann wrote:
> Am 10.11.21 um 17:34 schrieb Andy Shevchenko:
> > On Wed, Nov 10, 2021 at 3:55 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> > > Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
...
> > > > +#include <linux/container_of.h>
> > >
> > > I built this patch on a recent drm-misc-next, but there's no
> > > linux/container_of.h
> >
> > Thank you for trying. It's in the upstream, whenever drm-misc-next
> > switches to newer/newest upstream it will be there. I assume it will
> > happen after v5.16-rc1?
>
> Yes, we'll certainly backmerge soon after rc1 has been released. If I forget
> to add the patch then, please send a reminder.
>
> Once the necessary headers are available,
$ git log --oneline v5.16-rc1 -- include/linux/container_of.h
e1edc277e6f6 linux/container_of.h: switch to static_assert
d2a8ebbf8192 kernel.h: split out container_of() and typeof_member() macros
> the patch is
> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-11-15 11:35 ` Andy Shevchenko
@ 2021-11-23 16:32 ` Andy Shevchenko
2021-12-09 12:24 ` Andy Shevchenko
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-11-23 16:32 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: David Airlie, Linux Kernel Mailing List, dri-devel
On Mon, Nov 15, 2021 at 01:35:47PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 10, 2021 at 05:39:33PM +0100, Thomas Zimmermann wrote:
> > Am 10.11.21 um 17:34 schrieb Andy Shevchenko:
> > > On Wed, Nov 10, 2021 at 3:55 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> > > > Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
>
> ...
>
> > > > > +#include <linux/container_of.h>
> > > >
> > > > I built this patch on a recent drm-misc-next, but there's no
> > > > linux/container_of.h
> > >
> > > Thank you for trying. It's in the upstream, whenever drm-misc-next
> > > switches to newer/newest upstream it will be there. I assume it will
> > > happen after v5.16-rc1?
> >
> > Yes, we'll certainly backmerge soon after rc1 has been released. If I forget
> > to add the patch then, please send a reminder.
> >
> > Once the necessary headers are available,
>
> $ git log --oneline v5.16-rc1 -- include/linux/container_of.h
> e1edc277e6f6 linux/container_of.h: switch to static_assert
> d2a8ebbf8192 kernel.h: split out container_of() and typeof_member() macros
>
> > the patch is
> > Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
>
> Thanks!
Maybe I misunderstood something, I thought that DRM people may apply this,
is it incorrect assumption?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-11-23 16:32 ` Andy Shevchenko
@ 2021-12-09 12:24 ` Andy Shevchenko
2021-12-09 12:53 ` Thomas Zimmermann
0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-12-09 12:24 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: David Airlie, Linux Kernel Mailing List, dri-devel
On Tue, Nov 23, 2021 at 06:32:46PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 15, 2021 at 01:35:47PM +0200, Andy Shevchenko wrote:
> > On Wed, Nov 10, 2021 at 05:39:33PM +0100, Thomas Zimmermann wrote:
> > > Am 10.11.21 um 17:34 schrieb Andy Shevchenko:
> > > > On Wed, Nov 10, 2021 at 3:55 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
> > > > > Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
> >
> > ...
> >
> > > > > > +#include <linux/container_of.h>
> > > > >
> > > > > I built this patch on a recent drm-misc-next, but there's no
> > > > > linux/container_of.h
> > > >
> > > > Thank you for trying. It's in the upstream, whenever drm-misc-next
> > > > switches to newer/newest upstream it will be there. I assume it will
> > > > happen after v5.16-rc1?
> > >
> > > Yes, we'll certainly backmerge soon after rc1 has been released. If I forget
> > > to add the patch then, please send a reminder.
> > >
> > > Once the necessary headers are available,
> >
> > $ git log --oneline v5.16-rc1 -- include/linux/container_of.h
> > e1edc277e6f6 linux/container_of.h: switch to static_assert
> > d2a8ebbf8192 kernel.h: split out container_of() and typeof_member() macros
> >
> > > the patch is
> > > Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> >
> > Thanks!
>
> Maybe I misunderstood something, I thought that DRM people may apply this,
> is it incorrect assumption?
It still does not appear in Linux Next...
What should I do to move this forward, please?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions
2021-12-09 12:24 ` Andy Shevchenko
@ 2021-12-09 12:53 ` Thomas Zimmermann
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Zimmermann @ 2021-12-09 12:53 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: David Airlie, Linux Kernel Mailing List, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 1821 bytes --]
Hi
Am 09.12.21 um 13:24 schrieb Andy Shevchenko:
> On Tue, Nov 23, 2021 at 06:32:46PM +0200, Andy Shevchenko wrote:
>> On Mon, Nov 15, 2021 at 01:35:47PM +0200, Andy Shevchenko wrote:
>>> On Wed, Nov 10, 2021 at 05:39:33PM +0100, Thomas Zimmermann wrote:
>>>> Am 10.11.21 um 17:34 schrieb Andy Shevchenko:
>>>>> On Wed, Nov 10, 2021 at 3:55 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>>>>> Am 10.11.21 um 11:24 schrieb Andy Shevchenko:
>>>
>>> ...
>>>
>>>>>>> +#include <linux/container_of.h>
>>>>>>
>>>>>> I built this patch on a recent drm-misc-next, but there's no
>>>>>> linux/container_of.h
>>>>>
>>>>> Thank you for trying. It's in the upstream, whenever drm-misc-next
>>>>> switches to newer/newest upstream it will be there. I assume it will
>>>>> happen after v5.16-rc1?
>>>>
>>>> Yes, we'll certainly backmerge soon after rc1 has been released. If I forget
>>>> to add the patch then, please send a reminder.
>>>>
>>>> Once the necessary headers are available,
>>>
>>> $ git log --oneline v5.16-rc1 -- include/linux/container_of.h
>>> e1edc277e6f6 linux/container_of.h: switch to static_assert
>>> d2a8ebbf8192 kernel.h: split out container_of() and typeof_member() macros
>>>
>>>> the patch is
>>>> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>
>>> Thanks!
>>
>> Maybe I misunderstood something, I thought that DRM people may apply this,
>> is it incorrect assumption?
>
> It still does not appear in Linux Next...
> What should I do to move this forward, please?
>
It's now in drm-misc-next. Sorry that it fell through the cracks.
Best regards
Thomas
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-12-09 12:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 10:24 [PATCH v1 1/1] drm: Replace kernel.h with the necessary inclusions Andy Shevchenko
2021-11-10 13:54 ` Thomas Zimmermann
2021-11-10 16:34 ` Andy Shevchenko
2021-11-10 16:39 ` Thomas Zimmermann
2021-11-15 11:35 ` Andy Shevchenko
2021-11-23 16:32 ` Andy Shevchenko
2021-12-09 12:24 ` Andy Shevchenko
2021-12-09 12:53 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).