[Intel-gfx] [PATCH 3/3] drm/i915: s/haswell_update_wm/ilk_update_wm/

2013-12-17 Thread Imre Deak
We use this hook starting from ILK onwards, so change the prefix
accordingly. Also rename functions/struct names used from
haswell_update_wm that are relevant to ILK already.

No functional change.

Signed-off-by: Imre Deak imre.d...@intel.com
---
 drivers/gpu/drm/i915/i915_drv.h |  4 +-
 drivers/gpu/drm/i915/intel_pm.c | 86 -
 2 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 53288f6..bce647f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1215,7 +1215,7 @@ struct intel_wm_level {
uint32_t fbc_val;
 };
 
-struct hsw_wm_values {
+struct ilk_wm_values {
uint32_t wm_pipe[3];
uint32_t wm_lp[3];
uint32_t wm_lp_spr[3];
@@ -1521,7 +1521,7 @@ typedef struct drm_i915_private {
uint16_t cur_latency[5];
 
/* current hardware state */
-   struct hsw_wm_values hw;
+   struct ilk_wm_values hw;
} wm;
 
struct i915_package_c8 pc8;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index f402c16..fccd7a8 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1716,7 +1716,7 @@ static uint32_t ilk_wm_fbc(uint32_t pri_val, uint32_t 
horiz_pixels,
return DIV_ROUND_UP(pri_val * 64, horiz_pixels * bytes_per_pixel) + 2;
 }
 
-struct hsw_pipe_wm_parameters {
+struct ilk_pipe_wm_parameters {
bool active;
uint32_t pipe_htotal;
uint32_t pixel_rate;
@@ -1725,7 +1725,7 @@ struct hsw_pipe_wm_parameters {
struct intel_plane_wm_parameters cur;
 };
 
-struct hsw_wm_maximums {
+struct ilk_wm_maximums {
uint16_t pri;
uint16_t spr;
uint16_t cur;
@@ -1743,7 +1743,7 @@ struct intel_wm_config {
  * For both WM_PIPE and WM_LP.
  * mem_value must be in 0.1us units.
  */
-static uint32_t ilk_compute_pri_wm(const struct hsw_pipe_wm_parameters *params,
+static uint32_t ilk_compute_pri_wm(const struct ilk_pipe_wm_parameters *params,
   uint32_t mem_value,
   bool is_lp)
 {
@@ -1772,7 +1772,7 @@ static uint32_t ilk_compute_pri_wm(const struct 
hsw_pipe_wm_parameters *params,
  * For both WM_PIPE and WM_LP.
  * mem_value must be in 0.1us units.
  */
-static uint32_t ilk_compute_spr_wm(const struct hsw_pipe_wm_parameters *params,
+static uint32_t ilk_compute_spr_wm(const struct ilk_pipe_wm_parameters *params,
   uint32_t mem_value)
 {
uint32_t method1, method2;
@@ -1795,7 +1795,7 @@ static uint32_t ilk_compute_spr_wm(const struct 
hsw_pipe_wm_parameters *params,
  * For both WM_PIPE and WM_LP.
  * mem_value must be in 0.1us units.
  */
-static uint32_t ilk_compute_cur_wm(const struct hsw_pipe_wm_parameters *params,
+static uint32_t ilk_compute_cur_wm(const struct ilk_pipe_wm_parameters *params,
   uint32_t mem_value)
 {
if (!params-active || !params-cur.enabled)
@@ -1809,7 +1809,7 @@ static uint32_t ilk_compute_cur_wm(const struct 
hsw_pipe_wm_parameters *params,
 }
 
 /* Only for WM_LP. */
-static uint32_t ilk_compute_fbc_wm(const struct hsw_pipe_wm_parameters *params,
+static uint32_t ilk_compute_fbc_wm(const struct ilk_pipe_wm_parameters *params,
   uint32_t pri_val)
 {
if (!params-active || !params-pri.enabled)
@@ -1914,7 +1914,7 @@ static void ilk_compute_wm_maximums(struct drm_device 
*dev,
int level,
const struct intel_wm_config *config,
enum intel_ddb_partitioning 
ddb_partitioning,
-   struct hsw_wm_maximums *max)
+   struct ilk_wm_maximums *max)
 {
max-pri = ilk_plane_wm_max(dev, level, config, ddb_partitioning, 
false);
max-spr = ilk_plane_wm_max(dev, level, config, ddb_partitioning, true);
@@ -1923,7 +1923,7 @@ static void ilk_compute_wm_maximums(struct drm_device 
*dev,
 }
 
 static bool ilk_validate_wm_level(int level,
- const struct hsw_wm_maximums *max,
+ const struct ilk_wm_maximums *max,
  struct intel_wm_level *result)
 {
bool ret;
@@ -1965,7 +1965,7 @@ static bool ilk_validate_wm_level(int level,
 
 static void ilk_compute_wm_level(struct drm_i915_private *dev_priv,
 int level,
-const struct hsw_pipe_wm_parameters *p,
+const struct ilk_pipe_wm_parameters *p,
 struct intel_wm_level *result)
 {
uint16_t pri_latency = dev_priv-wm.pri_latency[level];
@@ -2113,8 +2113,8 @@ static void intel_setup_wm_latency(struct drm_device *dev)

Re: [Intel-gfx] [PATCH 3/3] drm/i915: s/haswell_update_wm/ilk_update_wm/

2013-12-17 Thread Paulo Zanoni
2013/12/17 Imre Deak imre.d...@intel.com:
 We use this hook starting from ILK onwards, so change the prefix
 accordingly. Also rename functions/struct names used from
 haswell_update_wm that are relevant to ILK already.

 No functional change.


As I mentioned on IRC, my only worry is how many conflicts we're going
to cause with Ville's local WM patches (I don't know how many he still
has). But the 3 patches look correct, so, for all of them:
Reviewed-by: Paulo Zanoni paulo.r.zan...@intel.com


 Signed-off-by: Imre Deak imre.d...@intel.com
 ---
  drivers/gpu/drm/i915/i915_drv.h |  4 +-
  drivers/gpu/drm/i915/intel_pm.c | 86 
 -
  2 files changed, 45 insertions(+), 45 deletions(-)

 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
 index 53288f6..bce647f 100644
 --- a/drivers/gpu/drm/i915/i915_drv.h
 +++ b/drivers/gpu/drm/i915/i915_drv.h
 @@ -1215,7 +1215,7 @@ struct intel_wm_level {
 uint32_t fbc_val;
  };

 -struct hsw_wm_values {
 +struct ilk_wm_values {
 uint32_t wm_pipe[3];
 uint32_t wm_lp[3];
 uint32_t wm_lp_spr[3];
 @@ -1521,7 +1521,7 @@ typedef struct drm_i915_private {
 uint16_t cur_latency[5];

 /* current hardware state */
 -   struct hsw_wm_values hw;
 +   struct ilk_wm_values hw;
 } wm;

 struct i915_package_c8 pc8;
 diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
 index f402c16..fccd7a8 100644
 --- a/drivers/gpu/drm/i915/intel_pm.c
 +++ b/drivers/gpu/drm/i915/intel_pm.c
 @@ -1716,7 +1716,7 @@ static uint32_t ilk_wm_fbc(uint32_t pri_val, uint32_t 
 horiz_pixels,
 return DIV_ROUND_UP(pri_val * 64, horiz_pixels * bytes_per_pixel) + 2;
  }

 -struct hsw_pipe_wm_parameters {
 +struct ilk_pipe_wm_parameters {
 bool active;
 uint32_t pipe_htotal;
 uint32_t pixel_rate;
 @@ -1725,7 +1725,7 @@ struct hsw_pipe_wm_parameters {
 struct intel_plane_wm_parameters cur;
  };

 -struct hsw_wm_maximums {
 +struct ilk_wm_maximums {
 uint16_t pri;
 uint16_t spr;
 uint16_t cur;
 @@ -1743,7 +1743,7 @@ struct intel_wm_config {
   * For both WM_PIPE and WM_LP.
   * mem_value must be in 0.1us units.
   */
 -static uint32_t ilk_compute_pri_wm(const struct hsw_pipe_wm_parameters 
 *params,
 +static uint32_t ilk_compute_pri_wm(const struct ilk_pipe_wm_parameters 
 *params,
uint32_t mem_value,
bool is_lp)
  {
 @@ -1772,7 +1772,7 @@ static uint32_t ilk_compute_pri_wm(const struct 
 hsw_pipe_wm_parameters *params,
   * For both WM_PIPE and WM_LP.
   * mem_value must be in 0.1us units.
   */
 -static uint32_t ilk_compute_spr_wm(const struct hsw_pipe_wm_parameters 
 *params,
 +static uint32_t ilk_compute_spr_wm(const struct ilk_pipe_wm_parameters 
 *params,
uint32_t mem_value)
  {
 uint32_t method1, method2;
 @@ -1795,7 +1795,7 @@ static uint32_t ilk_compute_spr_wm(const struct 
 hsw_pipe_wm_parameters *params,
   * For both WM_PIPE and WM_LP.
   * mem_value must be in 0.1us units.
   */
 -static uint32_t ilk_compute_cur_wm(const struct hsw_pipe_wm_parameters 
 *params,
 +static uint32_t ilk_compute_cur_wm(const struct ilk_pipe_wm_parameters 
 *params,
uint32_t mem_value)
  {
 if (!params-active || !params-cur.enabled)
 @@ -1809,7 +1809,7 @@ static uint32_t ilk_compute_cur_wm(const struct 
 hsw_pipe_wm_parameters *params,
  }

  /* Only for WM_LP. */
 -static uint32_t ilk_compute_fbc_wm(const struct hsw_pipe_wm_parameters 
 *params,
 +static uint32_t ilk_compute_fbc_wm(const struct ilk_pipe_wm_parameters 
 *params,
uint32_t pri_val)
  {
 if (!params-active || !params-pri.enabled)
 @@ -1914,7 +1914,7 @@ static void ilk_compute_wm_maximums(struct drm_device 
 *dev,
 int level,
 const struct intel_wm_config *config,
 enum intel_ddb_partitioning 
 ddb_partitioning,
 -   struct hsw_wm_maximums *max)
 +   struct ilk_wm_maximums *max)
  {
 max-pri = ilk_plane_wm_max(dev, level, config, ddb_partitioning, 
 false);
 max-spr = ilk_plane_wm_max(dev, level, config, ddb_partitioning, 
 true);
 @@ -1923,7 +1923,7 @@ static void ilk_compute_wm_maximums(struct drm_device 
 *dev,
  }

  static bool ilk_validate_wm_level(int level,
 - const struct hsw_wm_maximums *max,
 + const struct ilk_wm_maximums *max,
   struct intel_wm_level *result)
  {
 bool ret;
 @@ -1965,7 +1965,7 @@ static bool ilk_validate_wm_level(int level,

  static void ilk_compute_wm_level(struct drm_i915_private *dev_priv,