diff mbox

drm/i915/guc: Use GUC prefix for CORE_FAMILY definitions

Message ID 20170404133836.125736-1-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Wajdeczko April 4, 2017, 1:38 p.m. UTC
Almost all other GuC fw definitions are using GUC|guc prefix.
While around, in get_core_family() change explicit WARN into MISSING_CASE
as it looks more appropriate, since GuC support capability we are controlling
by intel_device_info.has_guc flag.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_fwif.h   | 4 ++--
 drivers/gpu/drm/i915/intel_guc_loader.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Tvrtko Ursulin April 4, 2017, 1:52 p.m. UTC | #1
On 04/04/2017 14:38, Michal Wajdeczko wrote:
> Almost all other GuC fw definitions are using GUC|guc prefix.
> While around, in get_core_family() change explicit WARN into MISSING_CASE
> as it looks more appropriate, since GuC support capability we are controlling
> by intel_device_info.has_guc flag.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_guc_fwif.h   | 4 ++--
>  drivers/gpu/drm/i915/intel_guc_loader.c | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_guc_fwif.h b/drivers/gpu/drm/i915/intel_guc_fwif.h
> index cb36cbf..6156845 100644
> --- a/drivers/gpu/drm/i915/intel_guc_fwif.h
> +++ b/drivers/gpu/drm/i915/intel_guc_fwif.h
> @@ -23,8 +23,8 @@
>  #ifndef _INTEL_GUC_FWIF_H
>  #define _INTEL_GUC_FWIF_H
>
> -#define GFXCORE_FAMILY_GEN9		12
> -#define GFXCORE_FAMILY_UNKNOWN		0x7fffffff
> +#define GUC_CORE_FAMILY_GEN9		12
> +#define GUC_CORE_FAMILY_UNKNOWN		0x7fffffff
>
>  #define GUC_CLIENT_PRIORITY_KMD_HIGH	0
>  #define GUC_CLIENT_PRIORITY_HIGH	1
> diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
> index 8a1a023..2793c01 100644
> --- a/drivers/gpu/drm/i915/intel_guc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_guc_loader.c
> @@ -86,11 +86,11 @@ static u32 get_core_family(struct drm_i915_private *dev_priv)
>
>  	switch (gen) {
>  	case 9:
> -		return GFXCORE_FAMILY_GEN9;
> +		return GUC_CORE_FAMILY_GEN9;
>
>  	default:
> -		WARN(1, "GEN%d does not support GuC operation!\n", gen);
> -		return GFXCORE_FAMILY_UNKNOWN;
> +		MISSING_CASE(gen);
> +		return GUC_CORE_FAMILY_UNKNOWN;
>  	}
>  }
>
>

I agree that this is much more appropriate error handling for this 
layer. Prefix also makes sense.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Chris Wilson April 5, 2017, 9:08 a.m. UTC | #2
On Tue, Apr 04, 2017 at 02:52:06PM +0100, Tvrtko Ursulin wrote:
> 
> On 04/04/2017 14:38, Michal Wajdeczko wrote:
> >Almost all other GuC fw definitions are using GUC|guc prefix.
> >While around, in get_core_family() change explicit WARN into MISSING_CASE
> >as it looks more appropriate, since GuC support capability we are controlling
> >by intel_device_info.has_guc flag.
> >
> >Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> >Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

And pushed, thanks for the patch and review.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_guc_fwif.h b/drivers/gpu/drm/i915/intel_guc_fwif.h
index cb36cbf..6156845 100644
--- a/drivers/gpu/drm/i915/intel_guc_fwif.h
+++ b/drivers/gpu/drm/i915/intel_guc_fwif.h
@@ -23,8 +23,8 @@ 
 #ifndef _INTEL_GUC_FWIF_H
 #define _INTEL_GUC_FWIF_H
 
-#define GFXCORE_FAMILY_GEN9		12
-#define GFXCORE_FAMILY_UNKNOWN		0x7fffffff
+#define GUC_CORE_FAMILY_GEN9		12
+#define GUC_CORE_FAMILY_UNKNOWN		0x7fffffff
 
 #define GUC_CLIENT_PRIORITY_KMD_HIGH	0
 #define GUC_CLIENT_PRIORITY_HIGH	1
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 8a1a023..2793c01 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -86,11 +86,11 @@  static u32 get_core_family(struct drm_i915_private *dev_priv)
 
 	switch (gen) {
 	case 9:
-		return GFXCORE_FAMILY_GEN9;
+		return GUC_CORE_FAMILY_GEN9;
 
 	default:
-		WARN(1, "GEN%d does not support GuC operation!\n", gen);
-		return GFXCORE_FAMILY_UNKNOWN;
+		MISSING_CASE(gen);
+		return GUC_CORE_FAMILY_UNKNOWN;
 	}
 }