Skip to contentSkip to conversation

drm/i915: include reductions

PATCH Superseded Jani Nikula 3 participants 13 messages Dec 9, 2021 – Dec 10, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#6 lore raw

PATCH 4/7 drm/i915/fbc: avoid intel_frontbuffer.h include with declaration

In reply to Jani Nikula

Reduce include dependencies using forward declarations.

---
 drivers/gpu/drm/i915/display/intel_fbc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_fbc.h +1 -2
index b8d9cda85cfc..07ad0411fcc3 100644
@@ -8,8 +8,7 @@
 
 #include <linux/types.h>
 
-#include "intel_frontbuffer.h"
-
+enum fb_op_origin;
 struct drm_i915_private;
 struct intel_atomic_state;
 struct intel_crtc;
Signature · 1 line
2.30.2
#9 lore raw

PATCH 7/7 drm/i915/pxp: remove useless includes

In reply to Jani Nikula

Not needed.

---
 drivers/gpu/drm/i915/pxp/intel_pxp_types.h | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/pxp/intel_pxp_types.h +0 -2
index 73ef7d1754e1..7ce5f37ee12e 100644
@@ -7,9 +7,7 @@
 #define __INTEL_PXP_TYPES_H__
 
 #include <linux/completion.h>
-#include <linux/list.h>
 #include <linux/mutex.h>
-#include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/workqueue.h>
 
Signature · 1 line
2.30.2
#5 lore raw

PATCH 3/7 drm/i915/psr: avoid intel_frontbuffer.h include with declaration

In reply to Jani Nikula

Reduce include dependencies using forward declarations.

---
 drivers/gpu/drm/i915/display/intel_psr.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_psr.h +6 -5
index 3d9c0e13c329..f6526d9ccfdc 100644
@@ -6,18 +6,19 @@
 #ifndef __INTEL_PSR_H__
 #define __INTEL_PSR_H__
 
-#include "intel_frontbuffer.h"
+#include <linux/types.h>
 
+enum fb_op_origin;
 struct drm_connector;
 struct drm_connector_state;
 struct drm_i915_private;
+struct intel_atomic_state;
+struct intel_crtc;
 struct intel_crtc_state;
 struct intel_dp;
-struct intel_crtc;
-struct intel_atomic_state;
-struct intel_plane_state;
-struct intel_plane;
 struct intel_encoder;
+struct intel_plane;
+struct intel_plane_state;
 
 void intel_psr_init_dpcd(struct intel_dp *intel_dp);
 void intel_psr_pre_plane_update(struct intel_atomic_state *state,
Signature · 1 line
2.30.2
#4 lore raw

PATCH 2/7 drm/i915/active: remove useless i915_utils.h include

In reply to Jani Nikula

Not needed.

---
 drivers/gpu/drm/i915/i915_active_types.h | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/i915_active_types.h +0 -2
index c149f348a972..b02a78ac87db 100644
@@ -15,8 +15,6 @@
 #include <linux/rcupdate.h>
 #include <linux/workqueue.h>
 
-#include "i915_utils.h"
-
 struct i915_active_fence {
 	struct dma_fence __rcu *fence;
 	struct dma_fence_cb cb;
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/7 drm/i915/reset: remove useless intel_display_types.h include

In reply to Jani Nikula

Not needed.

---
 drivers/gpu/drm/i915/gt/intel_reset.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_reset.c +0 -1
index 63199f0550e6..b8ac454f2d96 100644
@@ -6,7 +6,6 @@
 #include <linux/sched/mm.h>
 #include <linux/stop_machine.h>
 
-#include "display/intel_display_types.h"
 #include "display/intel_overlay.h"
 
 #include "gem/i915_gem_context.h"
Signature · 1 line
2.30.2
#0 lore raw

cover drm/i915: include reductions

Remove some useless includes as well as ones that can be removed with trivial changes.

Jani Nikula (7):
drm/i915/reset: remove useless intel_display_types.h include drm/i915/active: remove useless i915_utils.h include drm/i915/psr: avoid intel_frontbuffer.h include with declaration drm/i915/fbc: avoid intel_frontbuffer.h include with declaration drm/i915/fb: reduce include dependencies drm/i915/pxp: un-inline intel_pxp_is_enabled() drm/i915/pxp: remove useless includes

 drivers/gpu/drm/i915/display/intel_fbc.h         |  3 +--
 drivers/gpu/drm/i915/display/intel_frontbuffer.h |  2 +-
 drivers/gpu/drm/i915/display/intel_psr.h         | 11 ++++++-----
 drivers/gpu/drm/i915/gt/intel_reset.c            |  1 -
 drivers/gpu/drm/i915/i915_active_types.h         |  2 --
 drivers/gpu/drm/i915/pxp/intel_pxp.c             |  5 +++++
 drivers/gpu/drm/i915/pxp/intel_pxp.h             | 14 ++++++++------
 drivers/gpu/drm/i915/pxp/intel_pxp_types.h       |  2 --
 8 files changed, 21 insertions(+), 19 deletions(-)
Signature · 1 line
2.30.2
#8 lore raw

PATCH 6/7 drm/i915/pxp: un-inline intel_pxp_is_enabled()

In the interest of reducing include dependencies, un-inline intel_pxp_is_enabled().

---
 drivers/gpu/drm/i915/pxp/intel_pxp.c |  5 +++++
 drivers/gpu/drm/i915/pxp/intel_pxp.h | 14 ++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/pxp/intel_pxp.c +5 -0
index e2314ad9546d..15311eaed848 100644
@@ -44,6 +44,11 @@ struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp)
 	return container_of(pxp, struct intel_gt, pxp);
 }
 
+bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
+{
+	return pxp->ce;
+}
+
 bool intel_pxp_is_active(const struct intel_pxp *pxp)
 {
 	return pxp->arb_is_valid;
drivers/gpu/drm/i915/pxp/intel_pxp.h +8 -6
index aa262258d4d4..f9999ca8a6f1 100644
@@ -6,17 +6,14 @@
 #ifndef __INTEL_PXP_H__
 #define __INTEL_PXP_H__
 
-#include "intel_pxp_types.h"
+#include <linux/types.h>
 
+struct intel_pxp;
 struct drm_i915_gem_object;
 
-static inline bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
-{
-	return pxp->ce;
-}
-
 #ifdef CONFIG_DRM_I915_PXP
 struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp);
+bool intel_pxp_is_enabled(const struct intel_pxp *pxp);
 bool intel_pxp_is_active(const struct intel_pxp *pxp);
 
 void intel_pxp_init(struct intel_pxp *pxp);
@@ -48,6 +45,11 @@ static inline int intel_pxp_start(struct intel_pxp *pxp)
 	return -ENODEV;
 }
 
+static inline bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
+{
+	return false;
+}
+
 static inline bool intel_pxp_is_active(const struct intel_pxp *pxp)
 {
 	return false;
Signature · 1 line
2.30.2
#7 lore raw

PATCH 5/7 drm/i915/fb: reduce include dependencies

In reply to Jani Nikula

We actually need i915_active_types.h, not i915_active.h.

---
 drivers/gpu/drm/i915/display/intel_frontbuffer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_frontbuffer.h +1 -1
index a88441edc8f9..ff0c37b079aa 100644
@@ -28,7 +28,7 @@
 #include <linux/kref.h>
 
 #include "gem/i915_gem_object_types.h"
-#include "i915_active.h"
+#include "i915_active_types.h"
 
 struct drm_i915_private;
 
Signature · 1 line
2.30.2
#2 lore raw

Re: [Intel-gfx] [PATCH 1/7] drm/i915/reset: remove useless intel_display_types.h include

In reply to Jani Nikula
Quoted 12 lines · Jani Nikula

Not needed.

---
 drivers/gpu/drm/i915/gt/intel_reset.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_reset.c +0 -0
index 63199f0550e6..b8ac454f2d96 100644

drivers/gpu/drm/i915/gt/intel_reset.c line 9

Quoted 4 lines
drivers/gpu/drm/i915/gt/intel_reset.c +0 -1
@@ -6,7 +6,6 @@
 #include <linux/sched/mm.h>
 #include <linux/stop_machine.h>
 
-#include "display/intel_display_types.h"

intel_display_{prepare,finish}_reset() are in intel_display.h so I'm thinking that is what we want to include here. I guess atm it gets included via some more circuitous route?

Quoted 5 lines
drivers/gpu/drm/i915/gt/intel_reset.c +0 -0
 #include "display/intel_overlay.h"
 
 #include "gem/i915_gem_context.h"
Signature · 1 line
2.30.2
Signature · 2 lines
Ville Syrjälä
Intel
Reviewed-by on the v1 series
#10 lore raw
In reply to Jani Nikula
Quoted 11 lines · Jani Nikula

Remove some useless includes as well as ones that can be removed with trivial changes.

Jani Nikula (7):
drm/i915/reset: remove useless intel_display_types.h include drm/i915/active: remove useless i915_utils.h include drm/i915/psr: avoid intel_frontbuffer.h include with declaration drm/i915/fbc: avoid intel_frontbuffer.h include with declaration drm/i915/fb: reduce include dependencies drm/i915/pxp: un-inline intel_pxp_is_enabled() drm/i915/pxp: remove useless includes

Apart from the slight display reset stuff oddness this all looks good.

Series is

Quoted 13 lines
 drivers/gpu/drm/i915/display/intel_fbc.h         |  3 +--
 drivers/gpu/drm/i915/display/intel_frontbuffer.h |  2 +-
 drivers/gpu/drm/i915/display/intel_psr.h         | 11 ++++++-----
 drivers/gpu/drm/i915/gt/intel_reset.c            |  1 -
 drivers/gpu/drm/i915/i915_active_types.h         |  2 --
 drivers/gpu/drm/i915/pxp/intel_pxp.c             |  5 +++++
 drivers/gpu/drm/i915/pxp/intel_pxp.h             | 14 ++++++++------
 drivers/gpu/drm/i915/pxp/intel_pxp_types.h       |  2 --
 8 files changed, 21 insertions(+), 19 deletions(-)
Signature · 1 line
2.30.2
Signature · 2 lines
Ville Syrjälä
Intel
#3 lore raw

Re: [Intel-gfx] [PATCH 1/7] drm/i915/reset: remove useless intel_display_types.h include

In reply to Ville Syrjälä
Quoted 16 lines · Ville Syrjälä
Quoted 15 lines · Jani Nikula

Not needed.

---
 drivers/gpu/drm/i915/gt/intel_reset.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_reset.c +0 -0
index 63199f0550e6..b8ac454f2d96 100644
@@ -6,7 +6,6 @@
 #include <linux/sched/mm.h>
 #include <linux/stop_machine.h>
 
Quoted 5 lines

drivers/gpu/drm/i915/gt/intel_reset.c line 9

Quoted 1 line
drivers/gpu/drm/i915/gt/intel_reset.c +0 -1
-#include "display/intel_display_types.h"

intel_display_{prepare,finish}_reset() are in intel_display.h so I'm thinking that is what we want to include here. I guess atm it gets included via some more circuitous route?

Mmmh, all roads lead to i915_drv.h...

We should trim the includes in i915_drv.h a *lot* too. Make it purely about defining struct drm_i915_private, not about including the world.

It's just that especially the gem/gt headers include just about everything.

BR,
Jani.

Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/gt/intel_reset.c +0 -0
 #include "display/intel_overlay.h"
 
 #include "gem/i915_gem_context.h"
Signature · 1 line
2.30.2
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#11 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: include reductions

In reply to Jani Nikula
== Series Details ==

== Series Details ==

Series: drm/i915: include reductions
URL : https://patchwork.freedesktop.org/series/97789/
State : failure

== Summary ==

CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/gem/i915_gem_create.o
In file included from drivers/gpu/drm/i915/gem/i915_gem_create.c:9:
./drivers/gpu/drm/i915/pxp/intel_pxp.h: In function ‘intel_pxp_start’:
./drivers/gpu/drm/i915/pxp/intel_pxp.h:45:10: error: ‘ENODEV’ undeclared (first use in this function)

  return -ENODEV;
          ^~~~~~
./drivers/gpu/drm/i915/pxp/intel_pxp.h:45:10: note: each undeclared identifier is reported only once for each function it appears in
./drivers/gpu/drm/i915/pxp/intel_pxp.h: In function ‘intel_pxp_key_check’:
./drivers/gpu/drm/i915/pxp/intel_pxp.h:62:10: error: ‘ENODEV’ undeclared (first use in this function)
  return -ENODEV;
          ^~~~~~

scripts/Makefile.build:287: recipe for target 'drivers/gpu/drm/i915/gem/i915_gem_create.o' failed make[4]: *** [drivers/gpu/drm/i915/gem/i915_gem_create.o] Error 1 scripts/Makefile.build:549: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:549: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:549: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1846: recipe for target 'drivers' failed
make: *** [drivers] Error 2

#12 lore raw

Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: include reductions

Quoted 23 lines · Patchwork

== Series Details ==

Series: drm/i915: include reductions
URL : https://patchwork.freedesktop.org/series/97789/
State : failure

== Summary ==

CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/gem/i915_gem_create.o
In file included from drivers/gpu/drm/i915/gem/i915_gem_create.c:9:
./drivers/gpu/drm/i915/pxp/intel_pxp.h: In function ‘intel_pxp_start’:
./drivers/gpu/drm/i915/pxp/intel_pxp.h:45:10: error: ‘ENODEV’ undeclared (first use in this function)

  return -ENODEV;
          ^~~~~~
./drivers/gpu/drm/i915/pxp/intel_pxp.h:45:10: note: each undeclared identifier is reported only once for each function it appears in
./drivers/gpu/drm/i915/pxp/intel_pxp.h: In function ‘intel_pxp_key_check’:
./drivers/gpu/drm/i915/pxp/intel_pxp.h:62:10: error: ‘ENODEV’ undeclared (first use in this function)
  return -ENODEV;
          ^~~~~~
Quoted 10 lines

scripts/Makefile.build:287: recipe for target 'drivers/gpu/drm/i915/gem/i915_gem_create.o' failed make[4]: *** [drivers/gpu/drm/i915/gem/i915_gem_create.o] Error 1 scripts/Makefile.build:549: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:549: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:549: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1846: recipe for target 'drivers' failed
make: *** [drivers] Error 2

I guess this means we have CONFIG_DRM_I915_PXP=n in CI.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center