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

2016-10-14 Thread Jani Nikula
On Fri, 14 Oct 2016, Tvrtko Ursulin  wrote:
> On 14/10/2016 14:31, Jani Nikula wrote:
>> On Thu, 13 Oct 2016, Tvrtko Ursulin  wrote:
>>> From: Tvrtko Ursulin 
>>>
>>> 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 
>>> Reviewed-by: Joonas Lahtinen 
>> 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.
>
> Yeah I saw that you added dim sparse this week, however it only runs if 
> the dim tree is used for building it seems.
>
> I will try to figure out how to run in a separate build tree.

There was 'dim checker' before, and now also 'dim sparse'. Both do the
builds in the current directory, and do not cd to drm-intel directories,
so they can be used independent of other dim stuff.

In any case, running sparse is just a matter of having sparse in PATH,
and building using make C=1 or C=2. The former will run sparse on just
the files that need to be recompiled, the latter on everything. See also
'make help'. The helpers in dim first touch the the sources or rm the
object files, and run C=1.

>> The following is caused by this patch, fix or revert ASAP.
>
> Fix sent, you are on cc.

Thanks.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2016-10-14 Thread Chris Wilson
On Fri, Oct 14, 2016 at 03:08:29PM +0100, Tvrtko Ursulin wrote:
> 
> On 14/10/2016 14:31, Jani Nikula wrote:
> >On Thu, 13 Oct 2016, Tvrtko Ursulin  wrote:
> >>From: Tvrtko Ursulin 
> >>
> >>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 
> >>Reviewed-by: Joonas Lahtinen 
> >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.
> 
> Yeah I saw that you added dim sparse this week, however it only runs
> if the dim tree is used for building it seems.
> 
> I will try to figure out how to run in a separate build tree.

apt-get install sparse
make C=1

Start fuming.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2016-10-14 Thread Tvrtko Ursulin


On 14/10/2016 14:31, Jani Nikula wrote:

On Thu, 13 Oct 2016, Tvrtko Ursulin  wrote:

From: Tvrtko Ursulin 

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 
Reviewed-by: Joonas Lahtinen 

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.


Yeah I saw that you added dim sparse this week, however it only runs if 
the dim tree is used for building it seems.


I will try to figure out how to run in a separate build tree.


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


Fix sent, you are on cc.

Regards,

Tvrtko

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2016-10-14 Thread Jani Nikula
On Thu, 13 Oct 2016, Tvrtko Ursulin  wrote:
> From: Tvrtko Ursulin 
>
> 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 
> Reviewed-by: Joonas Lahtinen 

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: 

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

2016-10-13 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

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 
Reviewed-by: Joonas Lahtinen 
---
 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..166323b9 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)
 {
-- 
2.7.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx