[Intel-gfx] [CI 1/4] drm/i915: Shrink cxsr_latency_table

Jani Nikula jani.nikula at linux.intel.com
Fri Oct 14 13:31:10 UTC 2016


On Thu, 13 Oct 2016, Tvrtko Ursulin <tursulin at ursulin.net> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
> unsigned long is too wide - use smaller types in
> struct cxsr_latency to save 800-something bytes of .rodata.
>
> v2: All data even fits in u16 for even more saving. (Ville Syrjala)
> v3: Move bitfields to the end of the struct. (Joonas Lahtinen)
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Please learn how to run sparse, make it a habit to run it on your local
branches before submitting patches, and make it a rule to run it before
pushing patches. dim has helpers for this.

The following is caused by this patch, fix or revert ASAP.

BR,
Jani.


  CHECK   drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/intel_pm.c:218:39: warning: cast truncates bits from constant value (f8f becomes 1)
drivers/gpu/drm/i915/intel_pm.c:218:45: warning: cast truncates bits from constant value (84bf becomes 1)
drivers/gpu/drm/i915/intel_pm.c:219:39: warning: cast truncates bits from constant value (edf becomes 1)
drivers/gpu/drm/i915/intel_pm.c:219:45: warning: cast truncates bits from constant value (840f becomes 1)
drivers/gpu/drm/i915/intel_pm.c:220:39: warning: cast truncates bits from constant value (eb3 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:220:45: warning: cast truncates bits from constant value (83e3 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:221:39: warning: cast truncates bits from constant value (1ad9 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:221:45: warning: cast truncates bits from constant value (9009 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:222:39: warning: cast truncates bits from constant value (18ae becomes 0)
drivers/gpu/drm/i915/intel_pm.c:222:45: warning: cast truncates bits from constant value (8dde becomes 0)
drivers/gpu/drm/i915/intel_pm.c:224:39: warning: cast truncates bits from constant value (fb5 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:224:45: warning: cast truncates bits from constant value (84e5 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:225:39: warning: cast truncates bits from constant value (f05 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:225:45: warning: cast truncates bits from constant value (8435 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:226:39: warning: cast truncates bits from constant value (eee becomes 0)
drivers/gpu/drm/i915/intel_pm.c:226:45: warning: cast truncates bits from constant value (841e becomes 0)
drivers/gpu/drm/i915/intel_pm.c:227:39: warning: cast truncates bits from constant value (1aff becomes 1)
drivers/gpu/drm/i915/intel_pm.c:227:45: warning: cast truncates bits from constant value (902f becomes 1)
drivers/gpu/drm/i915/intel_pm.c:228:39: warning: cast truncates bits from constant value (18e9 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:228:45: warning: cast truncates bits from constant value (8e19 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:230:39: warning: cast truncates bits from constant value (104d becomes 1)
drivers/gpu/drm/i915/intel_pm.c:230:45: warning: cast truncates bits from constant value (857d becomes 1)
drivers/gpu/drm/i915/intel_pm.c:231:39: warning: cast truncates bits from constant value (f9c becomes 0)
drivers/gpu/drm/i915/intel_pm.c:231:45: warning: cast truncates bits from constant value (84cc becomes 0)
drivers/gpu/drm/i915/intel_pm.c:232:39: warning: cast truncates bits from constant value (f6a becomes 0)
drivers/gpu/drm/i915/intel_pm.c:232:45: warning: cast truncates bits from constant value (849a becomes 0)
drivers/gpu/drm/i915/intel_pm.c:233:39: warning: cast truncates bits from constant value (1b96 becomes 0)
drivers/gpu/drm/i915/intel_pm.c:233:45: warning: cast truncates bits from constant value (90c6 becomes 0)
drivers/gpu/drm/i915/intel_pm.c:234:39: warning: cast truncates bits from constant value (1965 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:234:45: warning: cast truncates bits from constant value (8e95 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:236:39: warning: cast truncates bits from constant value (fe1 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:236:45: warning: cast truncates bits from constant value (8511 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:237:39: warning: cast truncates bits from constant value (f31 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:237:45: warning: cast truncates bits from constant value (8461 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:238:39: warning: cast truncates bits from constant value (f05 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:238:45: warning: cast truncates bits from constant value (8435 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:239:39: warning: cast truncates bits from constant value (1b2b becomes 1)
drivers/gpu/drm/i915/intel_pm.c:239:45: warning: cast truncates bits from constant value (905b becomes 1)
drivers/gpu/drm/i915/intel_pm.c:240:39: warning: cast truncates bits from constant value (1900 becomes 0)
drivers/gpu/drm/i915/intel_pm.c:240:45: warning: cast truncates bits from constant value (8e30 becomes 0)
drivers/gpu/drm/i915/intel_pm.c:242:39: warning: cast truncates bits from constant value (1007 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:242:45: warning: cast truncates bits from constant value (853a becomes 0)
drivers/gpu/drm/i915/intel_pm.c:243:39: warning: cast truncates bits from constant value (f57 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:243:45: warning: cast truncates bits from constant value (8487 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:244:39: warning: cast truncates bits from constant value (f41 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:244:45: warning: cast truncates bits from constant value (8471 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:245:39: warning: cast truncates bits from constant value (1b51 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:245:45: warning: cast truncates bits from constant value (9081 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:246:39: warning: cast truncates bits from constant value (193c becomes 0)
drivers/gpu/drm/i915/intel_pm.c:246:45: warning: cast truncates bits from constant value (8e6c becomes 0)
drivers/gpu/drm/i915/intel_pm.c:248:39: warning: cast truncates bits from constant value (109f becomes 1)
drivers/gpu/drm/i915/intel_pm.c:248:45: warning: cast truncates bits from constant value (85cf becomes 1)
drivers/gpu/drm/i915/intel_pm.c:249:39: warning: cast truncates bits from constant value (fef becomes 1)
drivers/gpu/drm/i915/intel_pm.c:249:45: warning: cast truncates bits from constant value (851f becomes 1)
drivers/gpu/drm/i915/intel_pm.c:250:39: warning: cast truncates bits from constant value (fbd becomes 1)
drivers/gpu/drm/i915/intel_pm.c:250:45: warning: cast truncates bits from constant value (84ed becomes 1)
drivers/gpu/drm/i915/intel_pm.c:251:39: warning: cast truncates bits from constant value (1be9 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:251:45: warning: cast truncates bits from constant value (9119 becomes 1)
drivers/gpu/drm/i915/intel_pm.c:252:39: warning: cast truncates bits from constant value (19b8 becomes 0)
drivers/gpu/drm/i915/intel_pm.c:252:45: warning: cast truncates bits from constant value (8ee8 becomes 0)


> ---
>  drivers/gpu/drm/i915/intel_drv.h | 16 ++++++++--------
>  drivers/gpu/drm/i915/intel_pm.c  |  4 ++--
>  2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index f48e79ae2ac6..1663000023b9 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -807,14 +807,14 @@ struct intel_watermark_params {
>  };
>  
>  struct cxsr_latency {
> -	int is_desktop;
> -	int is_ddr3;
> -	unsigned long fsb_freq;
> -	unsigned long mem_freq;
> -	unsigned long display_sr;
> -	unsigned long display_hpll_disable;
> -	unsigned long cursor_sr;
> -	unsigned long cursor_hpll_disable;
> +	u16 fsb_freq;
> +	u16 mem_freq;
> +	u16 display_sr;
> +	u16 display_hpll_disable;
> +	u16 cursor_sr;
> +	u16 cursor_hpll_disable;
> +	bool is_desktop : 1;
> +	bool is_ddr3 : 1;
>  };
>  
>  #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base)
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index fe6c1c61c388..6d1d4022dbdb 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -252,8 +252,8 @@ static const struct cxsr_latency cxsr_latency_table[] = {
>  	{0, 1, 400, 800, 6042, 36042, 6584, 36584},    /* DDR3-800 SC */
>  };
>  
> -static const struct cxsr_latency *intel_get_cxsr_latency(int is_desktop,
> -							 int is_ddr3,
> +static const struct cxsr_latency *intel_get_cxsr_latency(bool is_desktop,
> +							 bool is_ddr3,
>  							 int fsb,
>  							 int mem)
>  {

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list