diff mbox series

[1/1] drm/i915: Check for all subplatform bits

Message ID 20210120012111.44184-2-umesh.nerlige.ramappa@intel.com (mailing list archive)
State New, archived
Headers show
Series Fix subplatform check!! | expand

Commit Message

Umesh Nerlige Ramappa Jan. 20, 2021, 1:21 a.m. UTC
Current code is checking only 2 bits in the subplatform, but actually 3
bits are allocated for the field. Check all 3 bits.

Fixes: 805446c8347c9 (drm/i915: Introduce concept of a sub-platform)
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tvrtko Ursulin Jan. 20, 2021, 8:13 a.m. UTC | #1
On 20/01/2021 01:21, Umesh Nerlige Ramappa wrote:
> Current code is checking only 2 bits in the subplatform, but actually 3
> bits are allocated for the field. Check all 3 bits.
> 
> Fixes: 805446c8347c9 (drm/i915: Introduce concept of a sub-platform)
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_drv.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 8376cff5ba86..38eca00c6f09 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] & INTEL_SUBPLATFORM_BITS;
> +	return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1);
>   }
>   
>   static __always_inline bool
> 

Yep. Luckily it affected only printout in the welcome message and error 
capture metadata.

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

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8376cff5ba86..38eca00c6f09 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] & INTEL_SUBPLATFORM_BITS;
+	return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1);
 }
 
 static __always_inline bool