diff mbox series

[2/2] drm/i915/lrc: replace include with forward declarations

Message ID 20220214173810.2108975-2-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915/lrc: move lrc_get_runtime() to intel_lrc.c | expand

Commit Message

Jani Nikula Feb. 14, 2022, 5:38 p.m. UTC
Prefer forward declarations over includes if possible.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 2 ++
 drivers/gpu/drm/i915/gt/intel_lrc.h | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Tvrtko Ursulin Feb. 15, 2022, 3:55 p.m. UTC | #1
On 14/02/2022 17:38, Jani Nikula wrote:
> Prefer forward declarations over includes if possible.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

> ---
>   drivers/gpu/drm/i915/gt/intel_lrc.c | 2 ++
>   drivers/gpu/drm/i915/gt/intel_lrc.h | 5 +++--
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 5b107b698b65..004e1216e654 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -8,6 +8,8 @@
>   #include "gen8_engine_cs.h"
>   #include "i915_drv.h"
>   #include "i915_perf.h"
> +#include "i915_reg.h"
> +#include "intel_context.h"
>   #include "intel_engine.h"
>   #include "intel_engine_regs.h"
>   #include "intel_gpu_commands.h"
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.h b/drivers/gpu/drm/i915/gt/intel_lrc.h
> index 2af85a15a370..0b76f096b559 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.h
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.h
> @@ -8,11 +8,12 @@
>   
>   #include <linux/types.h>
>   
> -#include "intel_context.h"
> -
>   struct drm_i915_gem_object;
> +struct i915_gem_ww_ctx;
> +struct intel_context;
>   struct intel_engine_cs;
>   struct intel_ring;
> +struct kref;
>   
>   /* At the start of the context image is its per-process HWS page */
>   #define LRC_PPHWSP_PN	(0)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 5b107b698b65..004e1216e654 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -8,6 +8,8 @@ 
 #include "gen8_engine_cs.h"
 #include "i915_drv.h"
 #include "i915_perf.h"
+#include "i915_reg.h"
+#include "intel_context.h"
 #include "intel_engine.h"
 #include "intel_engine_regs.h"
 #include "intel_gpu_commands.h"
diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.h b/drivers/gpu/drm/i915/gt/intel_lrc.h
index 2af85a15a370..0b76f096b559 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.h
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.h
@@ -8,11 +8,12 @@ 
 
 #include <linux/types.h>
 
-#include "intel_context.h"
-
 struct drm_i915_gem_object;
+struct i915_gem_ww_ctx;
+struct intel_context;
 struct intel_engine_cs;
 struct intel_ring;
+struct kref;
 
 /* At the start of the context image is its per-process HWS page */
 #define LRC_PPHWSP_PN	(0)