diff mbox

[v9,4/7] drm/i915/guc: Add support to return CNL specific reserved GuC WOPCM size

Message ID 1518131035-24108-4-git-send-email-yaodong.li@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jackie Li Feb. 8, 2018, 11:03 p.m. UTC
CNL has its specific reserved GuC WOPCM size for RC6 and other hardware
contexts.

This patch updates the code to return CNL specific reserved GuC WOPCM size
for RC6 and other hardware contexts so that the GuC WOPCM size can be
calculated correctly for CNL.

v9:
 - Created a new patch for these changes originally made in v8 4/6 patch of
   this series (Sagar/Michal)

Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jackie Li <yaodong.li@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_wopcm.c | 3 +++
 drivers/gpu/drm/i915/intel_guc_wopcm.h | 2 ++
 2 files changed, 5 insertions(+)

Comments

Joonas Lahtinen Feb. 9, 2018, 9:37 a.m. UTC | #1
Quoting Jackie Li (2018-02-09 01:03:52)
> CNL has its specific reserved GuC WOPCM size for RC6 and other hardware
> contexts.
> 
> This patch updates the code to return CNL specific reserved GuC WOPCM size
> for RC6 and other hardware contexts so that the GuC WOPCM size can be
> calculated correctly for CNL.
> 
> v9:
>  - Created a new patch for these changes originally made in v8 4/6 patch of
>    this series (Sagar/Michal)
> 
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Jackie Li <yaodong.li@intel.com>

<SNIP>

> diff --git a/drivers/gpu/drm/i915/intel_guc_wopcm.c b/drivers/gpu/drm/i915/intel_guc_wopcm.c
> index 8b2ce49..d0185b0 100644
> --- a/drivers/gpu/drm/i915/intel_guc_wopcm.c
> +++ b/drivers/gpu/drm/i915/intel_guc_wopcm.c
> @@ -34,6 +34,9 @@ static inline u32 guc_wopcm_context_reserved_size(struct intel_guc *guc)
>         if (IS_GEN9_LP(i915))
>                 return BXT_GUC_WOPCM_RC6_CTX_RESERVED;
>  
> +       if (IS_GEN10(i915))
> +               return CNL_GUC_WOPCM_HW_CTX_RESERVED;
> +
>         return 0;
>  }
>  

This should maybe be a if-else ladder, with the last branch applying to
any Gen10+, as it's a reasonable expectation that size is what it was in
the previous platform (or is it?). So;

if (gen9_lp)
	...
else if (gen => 10)
	...

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_guc_wopcm.c b/drivers/gpu/drm/i915/intel_guc_wopcm.c
index 8b2ce49..d0185b0 100644
--- a/drivers/gpu/drm/i915/intel_guc_wopcm.c
+++ b/drivers/gpu/drm/i915/intel_guc_wopcm.c
@@ -34,6 +34,9 @@  static inline u32 guc_wopcm_context_reserved_size(struct intel_guc *guc)
 	if (IS_GEN9_LP(i915))
 		return BXT_GUC_WOPCM_RC6_CTX_RESERVED;
 
+	if (IS_GEN10(i915))
+		return CNL_GUC_WOPCM_HW_CTX_RESERVED;
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_guc_wopcm.h b/drivers/gpu/drm/i915/intel_guc_wopcm.h
index 3af7ca9..1c5ffeb 100644
--- a/drivers/gpu/drm/i915/intel_guc_wopcm.h
+++ b/drivers/gpu/drm/i915/intel_guc_wopcm.h
@@ -72,6 +72,8 @@  struct intel_guc;
 #define GUC_WOPCM_STACK_RESERVED	(8 << 10)
 /* 24KB at the end of GuC WOPCM is reserved for RC6 CTX on BXT. */
 #define BXT_GUC_WOPCM_RC6_CTX_RESERVED	(24 << 10)
+/* 36KB WOPCM reserved at the end of GuC WOPCM on CNL. */
+#define CNL_GUC_WOPCM_HW_CTX_RESERVED	(36 << 10)
 
 /*
  * GuC WOPCM starts at 144KB (GUC_WOPCM_RESERVED + 128KB reserved for GuC