[Intel-gfx] [PATCH v1] drm/i915: Fix includes and local vars order

2020-05-22 Thread Stanislav Lisovskiy
Removed duplicate include and fixed comment > 80 chars.

Signed-off-by: Stanislav Lisovskiy 
---
 drivers/gpu/drm/i915/display/intel_bw.c| 43 --
 drivers/gpu/drm/i915/display/intel_bw.h|  2 +-
 drivers/gpu/drm/i915/display/intel_cdclk.c |  2 +-
 drivers/gpu/drm/i915/display/intel_cdclk.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c|  3 +-
 drivers/gpu/drm/i915/intel_pm.h|  2 +-
 6 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c 
b/drivers/gpu/drm/i915/display/intel_bw.c
index 8d2f58e39595..db9ba8f922bd 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -5,13 +5,12 @@
 
 #include 
 
+#include "intel_atomic.h"
 #include "intel_bw.h"
-#include "intel_pm.h"
+#include "intel_cdclk.h"
 #include "intel_display_types.h"
-#include "intel_sideband.h"
-#include "intel_atomic.h"
 #include "intel_pm.h"
-#include "intel_cdclk.h"
+#include "intel_sideband.h"
 
 /* Parameters for Qclk Geyserville (QGV) */
 struct intel_qgv_point {
@@ -431,13 +430,13 @@ intel_atomic_get_bw_state(struct intel_atomic_state 
*state)
 int skl_bw_calc_min_cdclk(struct intel_atomic_state *state)
 {
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
-   int i;
+   struct intel_bw_state *new_bw_state = NULL;
+   struct intel_bw_state *old_bw_state = NULL;
const struct intel_crtc_state *crtc_state;
struct intel_crtc *crtc;
int max_bw = 0;
int slice_id;
-   struct intel_bw_state *new_bw_state = NULL;
-   struct intel_bw_state *old_bw_state = NULL;
+   int i;
 
for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
enum plane_id plane_id;
@@ -463,14 +462,17 @@ int skl_bw_calc_min_cdclk(struct intel_atomic_state 
*state)
dbuf_mask |= skl_ddb_dbuf_slice_mask(dev_priv, 
uv_plane_alloc);
 
/*
-* FIXME: To calculate that more properly we probably 
need to
-* to split per plane data_rate into data_rate_y and 
data_rate_uv
-* for multiplanar formats in order not to get 
accounted those twice
-* if they happen to reside on different slices.
-* However for pre-icl this would work anyway because 
we have only single
-* slice and for icl+ uv plane has non-zero data rate.
-* So in worst case those calculation are a bit 
pessimistic, which
-* shouldn't pose any significant problem anyway.
+* FIXME: To calculate that more properly we probably
+* need to to split per plane data_rate into data_rate_y
+* and data_rate_uv for multiplanar formats in order not
+* to get accounted those twice if they happen to reside
+* on different slices.
+* However for pre-icl this would work anyway because
+* we have only single slice and for icl+ uv plane has
+* non-zero data rate.
+* So in worst case those calculation are a bit
+* pessimistic, which shouldn't pose any significant
+* problem anyway.
 */
for_each_dbuf_slice_in_mask(slice_id, dbuf_mask)
crtc_bw->used_bw[slice_id] += data_rate;
@@ -478,11 +480,12 @@ int skl_bw_calc_min_cdclk(struct intel_atomic_state 
*state)
 
for_each_dbuf_slice(slice_id) {
/*
-* Current experimental observations show that contrary 
to BSpec
-* we get underruns once we exceed 64 * CDCLK for 
slices in total.
-* As a temporary measure in order not to keep CDCLK 
bumped up all the
-* time we calculate CDCLK according to this formula 
for  overall bw
-* consumed by slices.
+* Current experimental observations show that contrary
+* to BSpec we get underruns once we exceed 64 * CDCLK
+* for slices in total.
+* As a temporary measure in order not to keep CDCLK
+* bumped up all the time we calculate CDCLK according
+* to this formula for  overall bw consumed by slices.
 */
max_bw += crtc_bw->used_bw[slice_id];
}
diff --git a/drivers/gpu/drm/i915/display/intel_bw.h 
b/drivers/gpu/drm/i915/display/intel_bw.h
index af1a981dec84..46c6eecbd917 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.h
+++ b/drivers/gpu/drm/i915/display/intel_bw.h
@@ -9,8 +9,8 @@
 #include 
 
 #in

Re: [Intel-gfx] [PATCH v1] drm/i915: Fix includes and local vars order

2020-05-22 Thread Chris Wilson
Quoting Stanislav Lisovskiy (2020-05-22 13:55:34)
> Removed duplicate include and fixed comment > 80 chars.
> 
> Signed-off-by: Stanislav Lisovskiy 
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c| 43 --
>  drivers/gpu/drm/i915/display/intel_bw.h|  2 +-
>  drivers/gpu/drm/i915/display/intel_cdclk.c |  2 +-
>  drivers/gpu/drm/i915/display/intel_cdclk.h |  1 +
>  drivers/gpu/drm/i915/intel_pm.c|  3 +-
>  drivers/gpu/drm/i915/intel_pm.h|  2 +-
>  6 files changed, 29 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c 
> b/drivers/gpu/drm/i915/display/intel_bw.c
> index 8d2f58e39595..db9ba8f922bd 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -5,13 +5,12 @@
>  
>  #include 
>  
> +#include "intel_atomic.h"
>  #include "intel_bw.h"
> -#include "intel_pm.h"
> +#include "intel_cdclk.h"
>  #include "intel_display_types.h"
> -#include "intel_sideband.h"
> -#include "intel_atomic.h"
>  #include "intel_pm.h"
> -#include "intel_cdclk.h"
> +#include "intel_sideband.h"

There was also the accidental remove of a '\n' before
intel_bw_crtc_update()

> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c 
> b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index dda9bae02a86..643701cca6ba 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -23,10 +23,10 @@
>  
>  #include 

\n between system and local includes

>  #include "intel_atomic.h"
> +#include "intel_bw.h"
>  #include "intel_cdclk.h"
>  #include "intel_display_types.h"
>  #include "intel_sideband.h"
> -#include "intel_bw.h"

2 more nits then
Reviewed-by: Chris Wilson 
s/Reviewed/Critiqued/
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v1] drm/i915: Fix includes and local vars order

2020-05-22 Thread Lisovskiy, Stanislav
On Fri, May 22, 2020 at 02:05:26PM +0100, Chris Wilson wrote:
> Quoting Stanislav Lisovskiy (2020-05-22 13:55:34)
> > Removed duplicate include and fixed comment > 80 chars.
> > 
> > Signed-off-by: Stanislav Lisovskiy 
> > ---
> >  drivers/gpu/drm/i915/display/intel_bw.c| 43 --
> >  drivers/gpu/drm/i915/display/intel_bw.h|  2 +-
> >  drivers/gpu/drm/i915/display/intel_cdclk.c |  2 +-
> >  drivers/gpu/drm/i915/display/intel_cdclk.h |  1 +
> >  drivers/gpu/drm/i915/intel_pm.c|  3 +-
> >  drivers/gpu/drm/i915/intel_pm.h|  2 +-
> >  6 files changed, 29 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_bw.c 
> > b/drivers/gpu/drm/i915/display/intel_bw.c
> > index 8d2f58e39595..db9ba8f922bd 100644
> > --- a/drivers/gpu/drm/i915/display/intel_bw.c
> > +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> > @@ -5,13 +5,12 @@
> >  
> >  #include 
> >  
> > +#include "intel_atomic.h"
> >  #include "intel_bw.h"
> > -#include "intel_pm.h"
> > +#include "intel_cdclk.h"
> >  #include "intel_display_types.h"
> > -#include "intel_sideband.h"
> > -#include "intel_atomic.h"
> >  #include "intel_pm.h"
> > -#include "intel_cdclk.h"
> > +#include "intel_sideband.h"
> 
> There was also the accidental remove of a '\n' before
> intel_bw_crtc_update()

Weird..how didn't I spot this.

> 
> > diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c 
> > b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > index dda9bae02a86..643701cca6ba 100644
> > --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> > +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > @@ -23,10 +23,10 @@
> >  
> >  #include 
> 
> \n between system and local includes
> 
> >  #include "intel_atomic.h"
> > +#include "intel_bw.h"
> >  #include "intel_cdclk.h"
> >  #include "intel_display_types.h"
> >  #include "intel_sideband.h"
> > -#include "intel_bw.h"
> 
> 2 more nits then
> Reviewed-by: Chris Wilson 
> s/Reviewed/Critiqued/
> -Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx