diff mbox series

drm/i915: bump platform_mask to u64

Message ID 20190315001331.12010-1-lucas.demarchi@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: bump platform_mask to u64 | expand

Commit Message

Lucas De Marchi March 15, 2019, 12:13 a.m. UTC
With Elkhart Lake being added to the platforms we are almost on the edge
of platforms that fits on this 32 bits mask. So bump it to 64 bits to
have room for new ones.

Cc: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h          | 3 ++-
 drivers/gpu/drm/i915/intel_device_info.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Chris Wilson March 15, 2019, 12:19 a.m. UTC | #1
Quoting Lucas De Marchi (2019-03-15 00:13:31)
> With Elkhart Lake being added to the platforms we are almost on the edge
> of platforms that fits on this 32 bits mask. So bump it to 64 bits to
> have room for new ones.
> 
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Since platform_mask exists as an optimisation for code size, it'll be
useful to track the impact of changes.
-Chris
Souza, Jose March 15, 2019, 12:44 a.m. UTC | #2
On Thu, 2019-03-14 at 17:13 -0700, Lucas De Marchi wrote:
> With Elkhart Lake being added to the platforms we are almost on the
> edge
> of platforms that fits on this 32 bits mask. So bump it to 64 bits to
> have room for new ones.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
But https://patchwork.freedesktop.org/series/58030/ is more long term
solution :P

> 
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h          | 3 ++-
>  drivers/gpu/drm/i915/intel_device_info.h | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h
> b/drivers/gpu/drm/i915/i915_drv.h
> index dccb6006aabf..3105c1d1a5ab 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2281,7 +2281,8 @@ static inline unsigned int
> i915_sg_segment_size(void)
>  #define IS_REVID(p, since, until) \
>  	(INTEL_REVID(p) >= (since) && INTEL_REVID(p) <= (until))
>  
> -#define IS_PLATFORM(dev_priv, p) (INTEL_INFO(dev_priv)-
> >platform_mask & BIT(p))
> +#define IS_PLATFORM(dev_priv, p) \
> +	(INTEL_INFO(dev_priv)->platform_mask & BIT_ULL(p))
>  
>  #define IS_I830(dev_priv)	IS_PLATFORM(dev_priv, INTEL_I830)
>  #define IS_I845G(dev_priv)	IS_PLATFORM(dev_priv, INTEL_I845G)
> diff --git a/drivers/gpu/drm/i915/intel_device_info.h
> b/drivers/gpu/drm/i915/intel_device_info.h
> index 047d10bdd455..2e6f2de6c2fa 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.h
> +++ b/drivers/gpu/drm/i915/intel_device_info.h
> @@ -160,7 +160,7 @@ struct intel_device_info {
>  	intel_engine_mask_t engine_mask; /* Engines supported by the HW
> */
>  
>  	enum intel_platform platform;
> -	u32 platform_mask;
> +	u64 platform_mask;
>  
>  	enum intel_ppgtt ppgtt;
>  	unsigned int page_sizes; /* page sizes supported by the HW */
Lucas De Marchi March 15, 2019, 7:18 a.m. UTC | #3
On Thu, Mar 14, 2019 at 5:19 PM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting Lucas De Marchi (2019-03-15 00:13:31)
> > With Elkhart Lake being added to the platforms we are almost on the edge
> > of platforms that fits on this 32 bits mask. So bump it to 64 bits to
> > have room for new ones.
> >
> > Cc: José Roberto de Souza <jose.souza@intel.com>
> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Since platform_mask exists as an optimisation for code size, it'll be
> useful to track the impact of changes.

code size? Moving to u64 for this mask would make almost no
difference. Just checking here:

$ size drivers/gpu/drm/i915/i915.o*
   text       data        bss        dec        hex    filename
1836757      40454       4176    1881387     1cb52b
drivers/gpu/drm/i915/i915.o
1836533      40454       4176    1881163     1cb44b
drivers/gpu/drm/i915/i915.o.old

So... around 200 bytes.

Lucas De Marchi

> -Chris
> _______________________________________________
> 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 dccb6006aabf..3105c1d1a5ab 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2281,7 +2281,8 @@  static inline unsigned int i915_sg_segment_size(void)
 #define IS_REVID(p, since, until) \
 	(INTEL_REVID(p) >= (since) && INTEL_REVID(p) <= (until))
 
-#define IS_PLATFORM(dev_priv, p) (INTEL_INFO(dev_priv)->platform_mask & BIT(p))
+#define IS_PLATFORM(dev_priv, p) \
+	(INTEL_INFO(dev_priv)->platform_mask & BIT_ULL(p))
 
 #define IS_I830(dev_priv)	IS_PLATFORM(dev_priv, INTEL_I830)
 #define IS_I845G(dev_priv)	IS_PLATFORM(dev_priv, INTEL_I845G)
diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
index 047d10bdd455..2e6f2de6c2fa 100644
--- a/drivers/gpu/drm/i915/intel_device_info.h
+++ b/drivers/gpu/drm/i915/intel_device_info.h
@@ -160,7 +160,7 @@  struct intel_device_info {
 	intel_engine_mask_t engine_mask; /* Engines supported by the HW */
 
 	enum intel_platform platform;
-	u32 platform_mask;
+	u64 platform_mask;
 
 	enum intel_ppgtt ppgtt;
 	unsigned int page_sizes; /* page sizes supported by the HW */