diff mbox series

[2/2] drm/i915: Decrease number of subplatform bits

Message ID 20210121161936.746591-2-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Check for all subplatform bits | expand

Commit Message

Tvrtko Ursulin Jan. 21, 2021, 4:19 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Commit 6ce1c33d6c36 ("drm/i915: Kill INTEL_SUBPLATFORM_AML") removed the
only platform which used bit 2 so could also decrease the
INTEL_SUBPLATFORM_BITS definition.

This is not a fixes material but still lets make it precise.

v2:
 * Fix assert in intel_device_info_subplatform_init by introducing
   INTEL_SUBPLATFORM_MASK. (Chris)
 * Update intel_subplatform().

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
References: 6ce1c33d6c36 ("drm/i915: Kill INTEL_SUBPLATFORM_AML")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_drv.h          | 2 +-
 drivers/gpu/drm/i915/intel_device_info.c | 2 +-
 drivers/gpu/drm/i915/intel_device_info.h | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Chris Wilson Jan. 21, 2021, 4:21 p.m. UTC | #1
Quoting Tvrtko Ursulin (2021-01-21 16:19:36)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Commit 6ce1c33d6c36 ("drm/i915: Kill INTEL_SUBPLATFORM_AML") removed the
> only platform which used bit 2 so could also decrease the
> INTEL_SUBPLATFORM_BITS definition.
> 
> This is not a fixes material but still lets make it precise.
> 
> v2:
>  * Fix assert in intel_device_info_subplatform_init by introducing
>    INTEL_SUBPLATFORM_MASK. (Chris)
>  * Update intel_subplatform().
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> References: 6ce1c33d6c36 ("drm/i915: Kill INTEL_SUBPLATFORM_AML")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Lucas De Marchi Jan. 22, 2021, 8:19 p.m. UTC | #2
On Thu, Jan 21, 2021 at 04:19:36PM +0000, Tvrtko Ursulin wrote:
>From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
>Commit 6ce1c33d6c36 ("drm/i915: Kill INTEL_SUBPLATFORM_AML") removed the
>only platform which used bit 2 so could also decrease the
>INTEL_SUBPLATFORM_BITS definition.
>
>This is not a fixes material but still lets make it precise.
>
>v2:
> * Fix assert in intel_device_info_subplatform_init by introducing
>   INTEL_SUBPLATFORM_MASK. (Chris)
> * Update intel_subplatform().
>
>Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>References: 6ce1c33d6c36 ("drm/i915: Kill INTEL_SUBPLATFORM_AML")
>Cc: Chris Wilson <chris@chris-wilson.co.uk>
>---
> drivers/gpu/drm/i915/i915_drv.h          | 2 +-
> drivers/gpu/drm/i915/intel_device_info.c | 2 +-
> drivers/gpu/drm/i915/intel_device_info.h | 3 ++-
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>index c31d2776134a..7efb501e22d2 100644
>--- a/drivers/gpu/drm/i915/i915_drv.h
>+++ b/drivers/gpu/drm/i915/i915_drv.h
>@@ -1343,7 +1343,7 @@ intel_subplatform(const struct intel_runtime_info *info, enum intel_platform p)
> {
> 	const unsigned int pi = __platform_mask_index(info, p);
>
>-	return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1);
>+	return info->platform_mask[pi] & INTEL_SUBPLATFORM_MASK;
> }
>
> static __always_inline bool
>diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
>index 699412c14c1d..7d98a718a051 100644
>--- a/drivers/gpu/drm/i915/intel_device_info.c
>+++ b/drivers/gpu/drm/i915/intel_device_info.c
>@@ -223,7 +223,7 @@ void intel_device_info_subplatform_init(struct drm_i915_private *i915)
> 		}
> 	}
>
>-	GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_BITS);
>+	GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_MASK);
>
> 	RUNTIME_INFO(i915)->platform_mask[pi] |= mask;
> }
>diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
>index 79dab5a6f272..e6ca1023ffcf 100644
>--- a/drivers/gpu/drm/i915/intel_device_info.h
>+++ b/drivers/gpu/drm/i915/intel_device_info.h
>@@ -93,7 +93,8 @@ enum intel_platform {
>  * it is fine for the same bit to be used on multiple parent platforms.
>  */
>
>-#define INTEL_SUBPLATFORM_BITS (3)
>+#define INTEL_SUBPLATFORM_BITS (2)
>+#define INTEL_SUBPLATFORM_MASK (BIT(INTEL_SUBPLATFORM_BITS) - 1)

not sure if it's better, but: GENMASK(INTEL_SUBPLATFORM_BITS - 1, 0)

in either case:


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>
> /* HSW/BDW/SKL/KBL/CFL */
> #define INTEL_SUBPLATFORM_ULT	(0)
>-- 
>2.27.0
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c31d2776134a..7efb501e22d2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1343,7 +1343,7 @@  intel_subplatform(const struct intel_runtime_info *info, enum intel_platform p)
 {
 	const unsigned int pi = __platform_mask_index(info, p);
 
-	return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1);
+	return info->platform_mask[pi] & INTEL_SUBPLATFORM_MASK;
 }
 
 static __always_inline bool
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index 699412c14c1d..7d98a718a051 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -223,7 +223,7 @@  void intel_device_info_subplatform_init(struct drm_i915_private *i915)
 		}
 	}
 
-	GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_BITS);
+	GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_MASK);
 
 	RUNTIME_INFO(i915)->platform_mask[pi] |= mask;
 }
diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
index 79dab5a6f272..e6ca1023ffcf 100644
--- a/drivers/gpu/drm/i915/intel_device_info.h
+++ b/drivers/gpu/drm/i915/intel_device_info.h
@@ -93,7 +93,8 @@  enum intel_platform {
  * it is fine for the same bit to be used on multiple parent platforms.
  */
 
-#define INTEL_SUBPLATFORM_BITS (3)
+#define INTEL_SUBPLATFORM_BITS (2)
+#define INTEL_SUBPLATFORM_MASK (BIT(INTEL_SUBPLATFORM_BITS) - 1)
 
 /* HSW/BDW/SKL/KBL/CFL */
 #define INTEL_SUBPLATFORM_ULT	(0)