diff mbox series

[1/6] drm: include drm_device.h from drm_legacy.h

Message ID 76ee3effbaf37dd5c0116a9ff2f5f098f6e0d623.1545915059.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: drmP.h include removal w/ drm prep work | expand

Commit Message

Jani Nikula Dec. 27, 2018, 12:56 p.m. UTC
Make it easier to drop drmP.h includes.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 include/drm/drm_legacy.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Vetter Dec. 27, 2018, 4:04 p.m. UTC | #1
On Thu, Dec 27, 2018 at 02:56:36PM +0200, Jani Nikula wrote:
> Make it easier to drop drmP.h includes.
> 
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  include/drm/drm_legacy.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> index 8fad66f88e4f..743d7e70c896 100644
> --- a/include/drm/drm_legacy.h
> +++ b/include/drm/drm_legacy.h
> @@ -2,6 +2,7 @@
>  #define __DRM_DRM_LEGACY_H__
>  
>  #include <drm/drm_auth.h>
> +#include <drm/drm_device.h>

From a quick look, shouldn't a

struct drm_device;

forward decl be enough? You might need a pile more forward decl, but
that's all drm_device.h seems to pull in that drm_legacy.h needs.
-Daniel
>  
>  /*
>   * Legacy driver interfaces for the Direct Rendering Manager
> -- 
> 2.11.0
>
Daniel Vetter Dec. 27, 2018, 4:08 p.m. UTC | #2
On Thu, Dec 27, 2018 at 05:04:20PM +0100, Daniel Vetter wrote:
> On Thu, Dec 27, 2018 at 02:56:36PM +0200, Jani Nikula wrote:
> > Make it easier to drop drmP.h includes.
> > 
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  include/drm/drm_legacy.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> > index 8fad66f88e4f..743d7e70c896 100644
> > --- a/include/drm/drm_legacy.h
> > +++ b/include/drm/drm_legacy.h
> > @@ -2,6 +2,7 @@
> >  #define __DRM_DRM_LEGACY_H__
> >  
> >  #include <drm/drm_auth.h>
> > +#include <drm/drm_device.h>
> 
> From a quick look, shouldn't a
> 
> struct drm_device;
> 
> forward decl be enough? You might need a pile more forward decl, but
> that's all drm_device.h seems to pull in that drm_legacy.h needs.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> with the forward decl
(assuming it all works out).
-Daniel

> -Daniel
> >  
> >  /*
> >   * Legacy driver interfaces for the Direct Rendering Manager
> > -- 
> > 2.11.0
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Jani Nikula Dec. 28, 2018, 8:23 a.m. UTC | #3
On Thu, 27 Dec 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Thu, Dec 27, 2018 at 05:04:20PM +0100, Daniel Vetter wrote:
>> On Thu, Dec 27, 2018 at 02:56:36PM +0200, Jani Nikula wrote:
>> > Make it easier to drop drmP.h includes.
>> > 
>> > Cc: Sam Ravnborg <sam@ravnborg.org>
>> > Cc: Daniel Vetter <daniel@ffwll.ch>
>> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> > ---
>> >  include/drm/drm_legacy.h | 1 +
>> >  1 file changed, 1 insertion(+)
>> > 
>> > diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
>> > index 8fad66f88e4f..743d7e70c896 100644
>> > --- a/include/drm/drm_legacy.h
>> > +++ b/include/drm/drm_legacy.h
>> > @@ -2,6 +2,7 @@
>> >  #define __DRM_DRM_LEGACY_H__
>> >  
>> >  #include <drm/drm_auth.h>
>> > +#include <drm/drm_device.h>
>> 
>> From a quick look, shouldn't a
>> 
>> struct drm_device;
>> 
>> forward decl be enough? You might need a pile more forward decl, but
>> that's all drm_device.h seems to pull in that drm_legacy.h needs.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> with the forward decl
> (assuming it all works out).

The forward declaration is not enough, there's a &dev->maplist reference
in the static inline drm_legacy_findmap().

BR,
Jani.

> -Daniel
>
>> -Daniel
>> >  
>> >  /*
>> >   * Legacy driver interfaces for the Direct Rendering Manager
>> > -- 
>> > 2.11.0
>> > 
>> 
>> -- 
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> http://blog.ffwll.ch
Daniel Vetter Dec. 28, 2018, 12:10 p.m. UTC | #4
On Fri, Dec 28, 2018 at 10:23:00AM +0200, Jani Nikula wrote:
> On Thu, 27 Dec 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Thu, Dec 27, 2018 at 05:04:20PM +0100, Daniel Vetter wrote:
> >> On Thu, Dec 27, 2018 at 02:56:36PM +0200, Jani Nikula wrote:
> >> > Make it easier to drop drmP.h includes.
> >> > 
> >> > Cc: Sam Ravnborg <sam@ravnborg.org>
> >> > Cc: Daniel Vetter <daniel@ffwll.ch>
> >> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> > ---
> >> >  include/drm/drm_legacy.h | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> > 
> >> > diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> >> > index 8fad66f88e4f..743d7e70c896 100644
> >> > --- a/include/drm/drm_legacy.h
> >> > +++ b/include/drm/drm_legacy.h
> >> > @@ -2,6 +2,7 @@
> >> >  #define __DRM_DRM_LEGACY_H__
> >> >  
> >> >  #include <drm/drm_auth.h>
> >> > +#include <drm/drm_device.h>
> >> 
> >> From a quick look, shouldn't a
> >> 
> >> struct drm_device;
> >> 
> >> forward decl be enough? You might need a pile more forward decl, but
> >> that's all drm_device.h seems to pull in that drm_legacy.h needs.
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> with the forward decl
> > (assuming it all works out).
> 
> The forward declaration is not enough, there's a &dev->maplist reference
> in the static inline drm_legacy_findmap().

Missed that, despite that I tried checking for static inlines. And a
static inline for a O(n) lookup ... tempted to just deinline that.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> on either your v1 or a
patch that deinlines the offending function and just uses a forward decl.

Cheers, Daniel

> 
> BR,
> Jani.
> 
> > -Daniel
> >
> >> -Daniel
> >> >  
> >> >  /*
> >> >   * Legacy driver interfaces for the Direct Rendering Manager
> >> > -- 
> >> > 2.11.0
> >> > 
> >> 
> >> -- 
> >> Daniel Vetter
> >> Software Engineer, Intel Corporation
> >> http://blog.ffwll.ch
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center
Jani Nikula Dec. 28, 2018, 1:05 p.m. UTC | #5
On Fri, 28 Dec 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Dec 28, 2018 at 10:23:00AM +0200, Jani Nikula wrote:
>> On Thu, 27 Dec 2018, Daniel Vetter <daniel@ffwll.ch> wrote:
>> > On Thu, Dec 27, 2018 at 05:04:20PM +0100, Daniel Vetter wrote:
>> >> On Thu, Dec 27, 2018 at 02:56:36PM +0200, Jani Nikula wrote:
>> >> > Make it easier to drop drmP.h includes.
>> >> > 
>> >> > Cc: Sam Ravnborg <sam@ravnborg.org>
>> >> > Cc: Daniel Vetter <daniel@ffwll.ch>
>> >> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> >> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> >> > ---
>> >> >  include/drm/drm_legacy.h | 1 +
>> >> >  1 file changed, 1 insertion(+)
>> >> > 
>> >> > diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
>> >> > index 8fad66f88e4f..743d7e70c896 100644
>> >> > --- a/include/drm/drm_legacy.h
>> >> > +++ b/include/drm/drm_legacy.h
>> >> > @@ -2,6 +2,7 @@
>> >> >  #define __DRM_DRM_LEGACY_H__
>> >> >  
>> >> >  #include <drm/drm_auth.h>
>> >> > +#include <drm/drm_device.h>
>> >> 
>> >> From a quick look, shouldn't a
>> >> 
>> >> struct drm_device;
>> >> 
>> >> forward decl be enough? You might need a pile more forward decl, but
>> >> that's all drm_device.h seems to pull in that drm_legacy.h needs.
>> >
>> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> with the forward decl
>> > (assuming it all works out).
>> 
>> The forward declaration is not enough, there's a &dev->maplist reference
>> in the static inline drm_legacy_findmap().
>
> Missed that, despite that I tried checking for static inlines. And a
> static inline for a O(n) lookup ... tempted to just deinline that.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> on either your v1 or a
> patch that deinlines the offending function and just uses a forward decl.

It'll still require drm_hashtab.h include, but less intrusive than
drm_device.h I guess. Patch sent.

BR,
Jani.


>
> Cheers, Daniel
>
>> 
>> BR,
>> Jani.
>> 
>> > -Daniel
>> >
>> >> -Daniel
>> >> >  
>> >> >  /*
>> >> >   * Legacy driver interfaces for the Direct Rendering Manager
>> >> > -- 
>> >> > 2.11.0
>> >> > 
>> >> 
>> >> -- 
>> >> Daniel Vetter
>> >> Software Engineer, Intel Corporation
>> >> http://blog.ffwll.ch
>> 
>> -- 
>> Jani Nikula, Intel Open Source Graphics Center
diff mbox series

Patch

diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
index 8fad66f88e4f..743d7e70c896 100644
--- a/include/drm/drm_legacy.h
+++ b/include/drm/drm_legacy.h
@@ -2,6 +2,7 @@ 
 #define __DRM_DRM_LEGACY_H__
 
 #include <drm/drm_auth.h>
+#include <drm/drm_device.h>
 
 /*
  * Legacy driver interfaces for the Direct Rendering Manager