drm/i915: Clean up the wm mem latency stuff
Subsystems (2)
cover drm/i915: Clean up the wm mem latency stuff
From: Ville Syrjälä <[email protected]>
Currently we store the watermark memory latency values in three different units (.1 usec, .5 usec, and 1 usec). Let's make things less confusing by picking .1 usec as the one true unit and unify all platforms around that. And I've included some other cleanups related to this latency stuff.
Ville Syrjälä (12):
drm/i915: Store all wm memory latency values in .1 usec units drm/i915: Use the spr/cur latencies on vlv/chv/g4x drm/i915: Eliminate skl_latency[]
drm/i915: Add dev_priv->wm.num_levels and use it everywhere drm/i915: Add DEFINE_SNPRINTF_ARRAY()
drm/i915: Make the WM memory latency print more compact drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code drm/i915: Split skl+ and ilk+ read_wm_latency() drm/i915: Sanitize wm latency values for ilk+ drm/i915: Drop the funky ilk wm setup
drm/i915: Allow LP3 watermarks on ILK
drm/i915: Remove the remnants of the ilk+ LP0 wm hack
drivers/gpu/drm/i915/i915_debugfs.c | 82 +--- drivers/gpu/drm/i915/i915_drv.h | 26 +- drivers/gpu/drm/i915/i915_utils.h | 16 + drivers/gpu/drm/i915/intel_display.c | 12 +- drivers/gpu/drm/i915/intel_dp.c | 17 +- drivers/gpu/drm/i915/intel_pm.c | 587 ++++++++++++++------------- 6 files changed, 349 insertions(+), 391 deletions(-)
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/12 drm/i915: Store all wm memory latency values in .1 usec units
From: Ville Syrjälä <[email protected]>
In order to simplify the code let's store all memory latency values in 0.1 usec units. This limits the platform specific units to the initial setup code for the most part.
--- drivers/gpu/drm/i915/i915_debugfs.c | 12 --- drivers/gpu/drm/i915/i915_drv.h | 14 +-- drivers/gpu/drm/i915/intel_pm.c | 149 ++++++++++++++++------------ 3 files changed, 87 insertions(+), 88 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +0 -12
@@ -3807,18 +3807,6 @@ static void wm_latency_show(struct seq_file *m, const uint16_t wm[8])for (level =0 ; level < num_levels; level++) {unsigned int latency = wm[level]; -/* -* - WM1+ latency values in 0.5us units -* - latencies are in us on gen9/vlv/chv -*/ -if (INTEL_GEN (dev_priv) >=9 || -IS_VALLEYVIEW (dev_priv) || -IS_CHERRYVIEW (dev_priv) || -IS_G4X (dev_priv)) - latency *=10 ; -else if (level >0 ) - latency *=5 ; -seq_printf (m,"WM%d %u (%u.%u usec)\n" , level, wm[level], latency /10 , latency %10 ); }
drivers/gpu/drm/i915/i915_drv.h +1 -13
@@ -1906,22 +1906,10 @@ struct drm_i915_private { } sagv_status;struct { -/* -* Raw watermark latency values: -* in 0.1us units for WM0, -* in 0.5us units for WM1+. -*/ -/* primary */ +/* Watermark memory latency values in 0.1 us units */ uint16_t pri_latency[5 ]; -/* sprite */ uint16_t spr_latency[5 ]; -/* cursor */ uint16_t cur_latency[5 ]; -/* -* Raw watermark memory latency values -* for SKL for all 8 levels -* in 1us units. -*/ uint16_t skl_latency[8 ];/* current hardware state */
drivers/gpu/drm/i915/intel_pm.c +86 -63
307 lines not on this page · raw message
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/12] drm/i915: Store all wm memory latency values in .1 usec units
Quoting Ville Syrjala (2018-10-10 14:04:43)
Quoted 5 lines
From: Ville Syrjälä <[email protected]>
In order to simplify the code let's store all memory latency values in 0.1 usec units. This limits the platform specific units to the initial setup code for the most part.
Asking for a friend: is it 0.1us or 128ns?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 01/12] drm/i915: Store all wm memory latency values in .1 usec units
Quoted 8 lines · Chris Wilson
Quoting Ville Syrjala (2018-10-10 14:04:43)
Quoted 5 lines
From: Ville Syrjälä <[email protected]>
In order to simplify the code let's store all memory latency values in 0.1 usec units. This limits the platform specific units to the initial setup code for the most part.
Asking for a friend: is it 0.1us or 128ns?
100ns
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/12 drm/i915: Store all wm memory latency values in .1 usec units
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
In order to simplify the code let's store all memory latency values in 0.1 usec units. This limits the platform specific units to the initial setup code for the most part.
v2: Write the constants as '<usec> * 10' for clarity
Fix up the SKL+ wm calculations to match the .1 usec latency units
--- drivers/gpu/drm/i915/i915_debugfs.c | 12 -- drivers/gpu/drm/i915/i915_drv.h | 14 +-- drivers/gpu/drm/i915/intel_pm.c | 166 ++++++++++++++++------------ 3 files changed, 95 insertions(+), 97 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +0 -12
@@ -3806,18 +3806,6 @@ static void wm_latency_show(struct seq_file *m, const uint16_t wm[8])for (level =0 ; level < num_levels; level++) {unsigned int latency = wm[level]; -/* -* - WM1+ latency values in 0.5us units -* - latencies are in us on gen9/vlv/chv -*/ -if (INTEL_GEN (dev_priv) >=9 || -IS_VALLEYVIEW (dev_priv) || -IS_CHERRYVIEW (dev_priv) || -IS_G4X (dev_priv)) - latency *=10 ; -else if (level >0 ) - latency *=5 ; -seq_printf (m,"WM%d %u (%u.%u usec)\n" , level, wm[level], latency /10 , latency %10 ); }
drivers/gpu/drm/i915/i915_drv.h +1 -13
@@ -1888,22 +1888,10 @@ struct drm_i915_private { } sagv_status;struct { -/* -* Raw watermark latency values: -* in 0.1us units for WM0, -* in 0.5us units for WM1+. -*/ -/* primary */ +/* Watermark memory latency values in 0.1 us units */ uint16_t pri_latency[5 ]; -/* sprite */ uint16_t spr_latency[5 ]; -/* cursor */ uint16_t cur_latency[5 ]; -/* -* Raw watermark memory latency values -* for SKL for all 8 levels -* in 1us units. -*/ uint16_t skl_latency[8 ];/* current hardware state */
drivers/gpu/drm/i915/intel_pm.c +94 -72
366 lines not on this page · raw message
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/12 drm/i915: Use the spr/cur latencies on vlv/chv/g4x
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Reduce the differences between the platforms by using the spr/cur watermark latency values on gmch platforms as well. We'll also print the wm latencies the same way as we do for ilk+.
--- drivers/gpu/drm/i915/i915_debugfs.c | 4 +- drivers/gpu/drm/i915/intel_pm.c | 63 ++++++++++++++++++----------- 2 files changed, 41 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +2 -2
@@ -3873,7 +3873,7 @@ static int spr_wm_latency_open(struct inode *inode, struct file *file) {struct drm_i915_private *dev_priv = inode->i_private; -if (HAS_GMCH_DISPLAY (dev_priv)) +if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv))return -ENODEV ;return single_open (file, spr_wm_latency_show, dev_priv);
@@ -3883,7 +3883,7 @@ static int cur_wm_latency_open(struct inode *inode, struct file *file) {struct drm_i915_private *dev_priv = inode->i_private; -if (HAS_GMCH_DISPLAY (dev_priv)) +if (INTEL_GEN (dev_priv) <5 && !IS_G4X (dev_priv))return -ENODEV ;return single_open (file, cur_wm_latency_show, dev_priv);
drivers/gpu/drm/i915/intel_pm.c +39 -24
93 lines not on this page · raw message
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/12 drm/i915: Eliminate skl_latency[]
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Make SKL+ less special by eliminating the separate skl_latency[] array and just using the normal pri/spr/cur latency arrays. The result is 4 bytes larger (3*5+8 vs. 3*8)
--- drivers/gpu/drm/i915/i915_debugfs.c | 42 +++++------------------------ drivers/gpu/drm/i915/i915_drv.h | 8 +++--- drivers/gpu/drm/i915/intel_pm.c | 16 ++++++----- 3 files changed, 20 insertions(+), 46 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +6 -36
@@ -3817,12 +3817,7 @@ static void wm_latency_show(struct seq_file *m, const uint16_t wm[8])static int pri_wm_latency_show (struct seq_file *m,void *data) {struct drm_i915_private *dev_priv = m->private; -const uint16_t *latencies; - -if (INTEL_GEN (dev_priv) >=9 ) - latencies = dev_priv->wm.skl_latency; -else - latencies = dev_priv->wm.pri_latency; +const u16 *latencies = dev_priv->wm.pri_latency;wm_latency_show (m, latencies);
@@ -3832,12 +3827,7 @@ static int pri_wm_latency_show(struct seq_file *m, void *data)static int spr_wm_latency_show (struct seq_file *m,void *data) {struct drm_i915_private *dev_priv = m->private; -const uint16_t *latencies; - -if (INTEL_GEN (dev_priv) >=9 ) - latencies = dev_priv->wm.skl_latency; -else - latencies = dev_priv->wm.spr_latency; +const u16 *latencies = dev_priv->wm.spr_latency;wm_latency_show (m, latencies);
@@ -3847,12 +3837,7 @@ static int spr_wm_latency_show(struct seq_file *m, void *data)static int cur_wm_latency_show (struct seq_file *m,void *data) {struct drm_i915_private *dev_priv = m->private; -const uint16_t *latencies; - -if (INTEL_GEN (dev_priv) >=9 ) - latencies = dev_priv->wm.skl_latency; -else - latencies = dev_priv->wm.cur_latency; +const u16 *latencies = dev_priv->wm.cur_latency;wm_latency_show (m, latencies);
@@ -3940,12 +3925,7 @@ static ssize_t pri_wm_latency_write(struct file *file, const char __user *ubuf, {struct seq_file *m = file->private_data;struct drm_i915_private *dev_priv = m->private; -uint16_t *latencies; - -if (INTEL_GEN (dev_priv) >=9 ) - latencies = dev_priv->wm.skl_latency; -else - latencies = dev_priv->wm.pri_latency; +u16 *latencies = dev_priv->wm.pri_latency;return wm_latency_write (file, ubuf, len, offp, latencies); }
@@ -3955,12 +3935,7 @@ static ssize_t spr_wm_latency_write(struct file *file, const char __user *ubuf, {struct seq_file *m = file->private_data;struct drm_i915_private *dev_priv = m->private; -uint16_t *latencies; - -if (INTEL_GEN (dev_priv) >=9 ) - latencies = dev_priv->wm.skl_latency; -else - latencies = dev_priv->wm.spr_latency; +u16 *latencies = dev_priv->wm.spr_latency;return wm_latency_write (file, ubuf, len, offp, latencies); }
@@ -3970,12 +3945,7 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf, {struct seq_file *m = file->private_data;struct drm_i915_private *dev_priv = m->private; -uint16_t *latencies; - -if (INTEL_GEN (dev_priv) >=9 ) - latencies = dev_priv->wm.skl_latency; -else - latencies = dev_priv->wm.cur_latency; +u16 *latencies = dev_priv->wm.cur_latency;return wm_latency_write (file, ubuf, len, offp, latencies); }
drivers/gpu/drm/i915/i915_drv.h +4 -4
@@ -1907,10 +1907,10 @@ struct drm_i915_private {struct {/* Watermark memory latency values in 0.1 us units */ -uint16_t pri_latency[5 ]; -uint16_t spr_latency[5 ]; -uint16_t cur_latency[5 ]; -uint16_t skl_latency[8 ]; +/* Watermark memory latency values in .1 us units */ +u16 pri_latency[8 ]; +u16 spr_latency[8 ]; +u16 cur_latency[8 ];/* current hardware state */ union {
drivers/gpu/drm/i915/intel_pm.c +10 -6
@@ -827,9 +827,6 @@ static int intel_plane_wm_latency(struct intel_plane *plane, {struct drm_i915_private *dev_priv =to_i915 (plane->base.dev); -if (INTEL_GEN (dev_priv) >=9 ) -return dev_priv->wm.skl_latency[level]; -switch (plane->id) {case PLANE_PRIMARY :return dev_priv->wm.pri_latency[level];
@@ -3064,11 +3061,18 @@ static void skl_fixup_wm_latency_units(struct drm_i915_private *dev_priv,static void skl_setup_wm_latency (struct drm_i915_private *dev_priv) { -intel_read_wm_latency (dev_priv, dev_priv->wm.skl_latency); +intel_read_wm_latency (dev_priv, dev_priv->wm.pri_latency); -skl_fixup_wm_latency_units (dev_priv, dev_priv->wm.skl_latency); +skl_fixup_wm_latency_units (dev_priv, dev_priv->wm.pri_latency); -intel_print_wm_latency (dev_priv,"Gen9 Plane" , dev_priv->wm.skl_latency); +memcpy (dev_priv->wm.spr_latency, dev_priv->wm.pri_latency, +sizeof (dev_priv->wm.pri_latency)); +memcpy (dev_priv->wm.cur_latency, dev_priv->wm.pri_latency, +sizeof (dev_priv->wm.pri_latency)); + +intel_print_wm_latency (dev_priv,"Primary" , dev_priv->wm.pri_latency); +intel_print_wm_latency (dev_priv,"Sprite" , dev_priv->wm.spr_latency); +intel_print_wm_latency (dev_priv,"Cursor" , dev_priv->wm.cur_latency); } static bool ilk_validate_pipe_wm(struct drm_device *dev,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/12 drm/i915: Add dev_priv->wm.num_levels and use it everywhere
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Unify our approach to figuring out how many wm levels are supported by having dev_priv->wm.num_levels. This replaces the older dev_priv->wm.max_level which was used on some of the platforms. I think num_levels is less confusing than max_level in most places. The +/-1 is now mostly isolated to the mempry latency init code.
--- drivers/gpu/drm/i915/i915_debugfs.c | 24 +---- drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/intel_display.c | 6 +- drivers/gpu/drm/i915/intel_pm.c | 132 +++++++++++++-------------- 4 files changed, 70 insertions(+), 96 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +2 -22
@@ -3790,17 +3790,7 @@ static void wm_latency_show(struct seq_file *m, const uint16_t wm[8]) {struct drm_i915_private *dev_priv = m->private;struct drm_device *dev = &dev_priv->drm; -int level; -int num_levels; - -if (IS_CHERRYVIEW (dev_priv)) - num_levels =3 ; -else if (IS_VALLEYVIEW (dev_priv)) - num_levels =1 ; -else if (IS_G4X (dev_priv)) - num_levels =3 ; -else - num_levels =ilk_wm_max_level (dev_priv) +1 ; +int level, num_levels = dev_priv->wm.num_levels;drm_modeset_lock_all (dev);
@@ -3881,20 +3871,10 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf,struct drm_i915_private *dev_priv = m->private;struct drm_device *dev = &dev_priv->drm;uint16_t new[8 ] = {0 }; -int num_levels; -int level; +int level, num_levels = dev_priv->wm.num_levels;int ret;char tmp[32 ]; -if (IS_CHERRYVIEW (dev_priv)) - num_levels =3 ; -else if (IS_VALLEYVIEW (dev_priv)) - num_levels =1 ; -else if (IS_G4X (dev_priv)) - num_levels =3 ; -else - num_levels =ilk_wm_max_level (dev_priv) +1 ; -if (len >=sizeof (tmp))return -EINVAL ;
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -1920,8 +1920,6 @@ struct drm_i915_private {struct g4x_wm_values g4x; }; -uint8_t max_level; -/* * Should be held around atomic WM register writing; also * protects * intel_crtc->wm.active and
@@ -1929,6 +1927,8 @@ struct drm_i915_private {*/ struct mutex wm_mutex; +u8 num_levels; +/* * Set during HW readout of watermarks/DDB. Some platforms * need to know when we're still using BIOS-provided values
drivers/gpu/drm/i915/intel_display.c +3 -3
@@ -11737,7 +11737,7 @@ static void verify_wm_state(struct drm_crtc *crtc,struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry;struct intel_crtc *intel_crtc =to_intel_crtc (crtc);const enum pipe pipe = intel_crtc->pipe; -int plane, level, max_level =ilk_wm_max_level (dev_priv); +int plane, level, num_levels = dev_priv->wm.num_levels;if (INTEL_GEN (dev_priv) <9 || !new_state->active)return ;
@@ -11759,7 +11759,7 @@ static void verify_wm_state(struct drm_crtc *crtc, sw_plane_wm = &sw_wm->planes[plane];/* Watermarks */ -for (level =0 ; level <= max_level; level++) { +for (level =0 ; level < num_levels; level++) {if (skl_wm_level_equals (&hw_plane_wm->wm[level], &sw_plane_wm->wm[level]))continue ;
@@ -11809,7 +11809,7 @@ static void verify_wm_state(struct drm_crtc *crtc, sw_plane_wm = &sw_wm->planes[PLANE_CURSOR ];/* Watermarks */ -for (level =0 ; level <= max_level; level++) { +for (level =0 ; level < num_levels; level++) {if (skl_wm_level_equals (&hw_plane_wm->wm[level], &sw_plane_wm->wm[level]))continue ;
drivers/gpu/drm/i915/intel_pm.c +63 -69
420 lines not on this page · raw message
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/12 drm/i915: Add dev_priv->wm.num_levels and use it everywhere
From: Ville Syrjälä <[email protected]>
Unify our approach to figuring out how many wm levels are supported by having dev_priv->wm.num_levels. This replaces the older dev_priv->wm.max_level which was used on some of the platforms. I think num_levels is less confusing than max_level in most places. The +/-1 is now mostly isolated to the mempry latency init code.
v2: Rebase
--- drivers/gpu/drm/i915/i915_debugfs.c | 24 +---- drivers/gpu/drm/i915/i915_drv.h | 4 +- drivers/gpu/drm/i915/intel_display.c | 6 +- drivers/gpu/drm/i915/intel_pm.c | 131 +++++++++++++-------------- 4 files changed, 69 insertions(+), 96 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +2 -22
@@ -3789,17 +3789,7 @@ static void wm_latency_show(struct seq_file *m, const uint16_t wm[8]) {struct drm_i915_private *dev_priv = m->private;struct drm_device *dev = &dev_priv->drm; -int level; -int num_levels; - -if (IS_CHERRYVIEW (dev_priv)) - num_levels =3 ; -else if (IS_VALLEYVIEW (dev_priv)) - num_levels =1 ; -else if (IS_G4X (dev_priv)) - num_levels =3 ; -else - num_levels =ilk_wm_max_level (dev_priv) +1 ; +int level, num_levels = dev_priv->wm.num_levels;drm_modeset_lock_all (dev);
@@ -3880,20 +3870,10 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf,struct drm_i915_private *dev_priv = m->private;struct drm_device *dev = &dev_priv->drm;uint16_t new[8 ] = {0 }; -int num_levels; -int level; +int level, num_levels = dev_priv->wm.num_levels;int ret;char tmp[32 ]; -if (IS_CHERRYVIEW (dev_priv)) - num_levels =3 ; -else if (IS_VALLEYVIEW (dev_priv)) - num_levels =1 ; -else if (IS_G4X (dev_priv)) - num_levels =3 ; -else - num_levels =ilk_wm_max_level (dev_priv) +1 ; -if (len >=sizeof (tmp))return -EINVAL ;
drivers/gpu/drm/i915/i915_drv.h +2 -2
@@ -1902,8 +1902,6 @@ struct drm_i915_private {struct g4x_wm_values g4x; }; -uint8_t max_level; -/* * Should be held around atomic WM register writing; also * protects * intel_crtc->wm.active and
@@ -1911,6 +1909,8 @@ struct drm_i915_private {*/ struct mutex wm_mutex; +u8 num_levels; +/* * Set during HW readout of watermarks/DDB. Some platforms * need to know when we're still using BIOS-provided values
drivers/gpu/drm/i915/intel_display.c +3 -3
@@ -11802,7 +11802,7 @@ static void verify_wm_state(struct drm_crtc *crtc,struct skl_ddb_entry *hw_ddb_entry, *sw_ddb_entry;struct intel_crtc *intel_crtc =to_intel_crtc (crtc);const enum pipe pipe = intel_crtc->pipe; -int plane, level, max_level =ilk_wm_max_level (dev_priv); +int plane, level, num_levels = dev_priv->wm.num_levels;if (INTEL_GEN (dev_priv) <9 || !new_state->active)return ;
@@ -11824,7 +11824,7 @@ static void verify_wm_state(struct drm_crtc *crtc, sw_plane_wm = &sw_wm->planes[plane];/* Watermarks */ -for (level =0 ; level <= max_level; level++) { +for (level =0 ; level < num_levels; level++) {if (skl_wm_level_equals (&hw_plane_wm->wm[level], &sw_plane_wm->wm[level]))continue ;
@@ -11874,7 +11874,7 @@ static void verify_wm_state(struct drm_crtc *crtc, sw_plane_wm = &sw_wm->planes[PLANE_CURSOR ];/* Watermarks */ -for (level =0 ; level <= max_level; level++) { +for (level =0 ; level < num_levels; level++) {if (skl_wm_level_equals (&hw_plane_wm->wm[level], &sw_plane_wm->wm[level]))continue ;
drivers/gpu/drm/i915/intel_pm.c +62 -69
413 lines not on this page · raw message
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/12 drm/i915: Add DEFINE_SNPRINTF_ARRAY()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Templatize snprintf_int_array() to allow us to print different kinds of arrays without having to type all the boilerplate for the snprintf() loop.
--- drivers/gpu/drm/i915/i915_utils.h | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 17 ++--------------- 2 files changed, 18 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_utils.h +16 -0
@@ -161,4 +161,20 @@ static inline const char *enableddisabled(bool v) return v ? "enabled" : "disabled"; } +#define DEFINE_SNPRINTF_ARRAY (name, type, values, index, fmt, ...) \ +void name(char *_str, size_t _len, const type *values, int _nelems) \ +{ \ + int index; \ + if (_len) \ + _str[0] = '\0'; \ + for (index = 0; index < _nelems; index++) { \ + int _r = snprintf(_str, _len, "%s" fmt, \ + index ? ", " : "", __VA_ARGS__); \ + if (_r >= _len) \ + return; \ + _str += _r; \ + _len -= _r; \ + } \ +} +#endif /* !__I915_UTILS_H */
drivers/gpu/drm/i915/intel_dp.c +2 -15
@@ -1774,21 +1774,8 @@ intel_dp_set_clock(struct intel_encoder *encoder, } } -static void snprintf_int_array (char *str,size_t len, -const int *array,int nelem) -{ -int i; - - str[0 ] ='\0' ; - -for (i =0 ; i < nelem; i++) { -int r =snprintf (str, len,"%s%d" , i ?", " :"" , array[i]); -if (r >= len) -return ; - str += r; - len -= r; - } -} +static DEFINE_SNPRINTF_ARRAY(snprintf_int_array, + int, array, i, "%d", array[i]);static void intel_dp_print_rates (struct intel_dp *intel_dp) {
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [PATCH 05/12] drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Quoted 5 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Templatize
snprintf_int_array()to allow us to print different kinds of arrays without having to type all the boilerplate for thesnprintf()loop.
I might just feel happier about duplicating the boilerplate...
BR,
Jani.
Quoted 60 lines
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_utils.h | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 17 ++--------------- 2 files changed, 18 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_utils.h +16
-0@@ -161,4 +161,20 @@ static inline const char *enableddisabled(bool v) return v ? "enabled" : "disabled"; } +#define DEFINE_SNPRINTF_ARRAY (name, type, values, index, fmt, ...) \ +void name(char *_str, size_t _len, const type *values, int _nelems) \ +{ \ + int index; \ + if (_len) \ + _str[0] = '\0'; \ + for (index = 0; index < _nelems; index++) { \ + int _r = snprintf(_str, _len, "%s" fmt, \ + index ? ", " : "", __VA_ARGS__); \ + if (_r >= _len) \ + return; \ + _str += _r; \ + _len -= _r; \ + } \ +} +#endif /* !__I915_UTILS_H */ drivers/gpu/drm/i915/intel_dp.c +2
-15@@ -1774,21 +1774,8 @@ intel_dp_set_clock(struct intel_encoder *encoder, } } -static void snprintf_int_array (char *str,size_t len, -const int *array,int nelem) -{ -int i; - - str[0 ] ='\0' ; - -for (i =0 ; i < nelem; i++) { -int r =snprintf (str, len,"%s%d" , i ?", " :"" , array[i]); -if (r >= len) -return ; - str += r; - len -= r; - } -} +static DEFINE_SNPRINTF_ARRAY(snprintf_int_array, + int, array, i, "%d", array[i]);static void intel_dp_print_rates (struct intel_dp *intel_dp) {
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 05/12] drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Quoted 8 lines · Jani Nikula
Quoted 5 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Templatize
snprintf_int_array()to allow us to print different kinds of arrays without having to type all the boilerplate for thesnprintf()loop.I might just feel happier about duplicating the boilerplate...
How about when the third user appears? :)
Not sure I have a third user for this actually. snprintf_output_types() is pretty close, and there are other bitmask I'd probably like to decode. But I couldn't immediately think of a nice way to handle bitmasks and arrays in the same function.
Quoted 69 lines
BR,
Jani.Quoted 60 lines
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_utils.h | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 17 ++--------------- 2 files changed, 18 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_utils.h +16
-0@@ -161,4 +161,20 @@ static inline const char *enableddisabled(bool v) return v ? "enabled" : "disabled"; } +#define DEFINE_SNPRINTF_ARRAY (name, type, values, index, fmt, ...) \ +void name(char *_str, size_t _len, const type *values, int _nelems) \ +{ \ + int index; \ + if (_len) \ + _str[0] = '\0'; \ + for (index = 0; index < _nelems; index++) { \ + int _r = snprintf(_str, _len, "%s" fmt, \ + index ? ", " : "", __VA_ARGS__); \ + if (_r >= _len) \ + return; \ + _str += _r; \ + _len -= _r; \ + } \ +} +#endif /* !__I915_UTILS_H */ drivers/gpu/drm/i915/intel_dp.c +2
-15@@ -1774,21 +1774,8 @@ intel_dp_set_clock(struct intel_encoder *encoder, } } -static void snprintf_int_array (char *str,size_t len, -const int *array,int nelem) -{ -int i; - - str[0 ] ='\0' ; - -for (i =0 ; i < nelem; i++) { -int r =snprintf (str, len,"%s%d" , i ?", " :"" , array[i]); -if (r >= len) -return ; - str += r; - len -= r; - } -} +static DEFINE_SNPRINTF_ARRAY(snprintf_int_array, + int, array, i, "%d", array[i]);static void intel_dp_print_rates (struct intel_dp *intel_dp) {Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerRe: [PATCH 05/12] drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Quoted 10 lines · Ville Syrjälä
Quoted 8 lines · Jani Nikula
Quoted 5 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Templatize
snprintf_int_array()to allow us to print different kinds of arrays without having to type all the boilerplate for thesnprintf()loop.I might just feel happier about duplicating the boilerplate...
Quoted 7 lines
How about when the third user appears? :)
Not sure I have a third user for this actually.
snprintf_output_types()is pretty close, and there are other bitmask I'd probably like to decode. But I couldn't immediately think of a nice way to handle bitmasks and arrays in the same function.
So here's the non-macro generic approach. It's not perfect, it just has different wrinkles:
static int snprintf_int(char *str, size_t len, const void *elem)
{
return snprintf(str, len, "%d", *((const int *)elem));
}static void snprintf_array(char *str, size_t len, const void *array, int nelem,
size_t size, const char *sep,
int (*print)(char *str, size_t len, const void *elem))
{
int i, r;
if (len)
str[0] = '\0';
for (i = 0; i < nelem; i++) {
const void *elem = array + i * size;
if (i) {
r = snprintf(str, len, "%s", sep);
if (r >= len)
return;
str += r;
len -= r;
}
r = print(str, len, elem);
if (r >= len)
return;
str += r;
len -= r;
}
}static void snprintf_int_array(char *str, size_t len, const int *array, int nelem)
{
snprintf_array(str, len, array, nelem, sizeof(array[0]), ", ",
snprintf_int);
}Of course, this doesn't help with bitmasks either. You'd first have to split the bitmask into an array.
BR,
Jani.
Quoted 70 lines
Quoted 70 lines
BR,
Jani.Quoted 60 lines
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/i915/i915_utils.h | 16 ++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 17 ++--------------- 2 files changed, 18 insertions(+), 15 deletions(-)drivers/gpu/drm/i915/i915_utils.h +16
-0@@ -161,4 +161,20 @@ static inline const char *enableddisabled(bool v) return v ? "enabled" : "disabled"; } +#define DEFINE_SNPRINTF_ARRAY (name, type, values, index, fmt, ...) \ +void name(char *_str, size_t _len, const type *values, int _nelems) \ +{ \ + int index; \ + if (_len) \ + _str[0] = '\0'; \ + for (index = 0; index < _nelems; index++) { \ + int _r = snprintf(_str, _len, "%s" fmt, \ + index ? ", " : "", __VA_ARGS__); \ + if (_r >= _len) \ + return; \ + _str += _r; \ + _len -= _r; \ + } \ +} +#endif /* !__I915_UTILS_H */ drivers/gpu/drm/i915/intel_dp.c +2
-15@@ -1774,21 +1774,8 @@ intel_dp_set_clock(struct intel_encoder *encoder, } } -static void snprintf_int_array (char *str,size_t len, -const int *array,int nelem) -{ -int i; - - str[0 ] ='\0' ; - -for (i =0 ; i < nelem; i++) { -int r =snprintf (str, len,"%s%d" , i ?", " :"" , array[i]); -if (r >= len) -return ; - str += r; - len -= r; - } -} +static DEFINE_SNPRINTF_ARRAY(snprintf_int_array, + int, array, i, "%d", array[i]);static void intel_dp_print_rates (struct intel_dp *intel_dp) {Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/12 drm/i915: Make the WM memory latency print more compact
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Print all the latency values on a single line.
--- drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +9 -12
@@ -796,25 +796,22 @@ static bool is_enabling(int old, int new, int threshold)return old < threshold && new >= threshold; } +static DEFINE_SNPRINTF_ARRAY(snprintf_wm_array, + u16, wm, level, "%d.%d", + wm[level] / 10, wm[level] % 10); +static void intel_print_wm_latency (struct drm_i915_private *dev_priv,const char *name,const uint16_t wm[8 ]) { -int level, num_levels = dev_priv->wm.num_levels; +char str[64 ]; -for (level =0 ; level < num_levels; level++) { -unsigned int latency = wm[level]; +if ((drm_debug &DRM_UT_KMS ) ==0 ) +return ; -if (latency ==0 ) { -DRM_ERROR ("%s WM%d latency not provided\n" , - name, level); -continue ; - } +snprintf_wm_array (str,sizeof (str), wm, dev_priv->wm.num_levels); -DRM_DEBUG_KMS ("%s WM%d latency %u (%u.%u usec)\n" , - name, level, wm[level], - latency /10 , latency %10 ); - } +DRM_DEBUG_KMS ("%s: %s (usec)" , name, str); } static int intel_plane_wm_latency(struct intel_plane *plane,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/12 drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
The functions to fix up the sprite and cursor watermarks on ilk are identical. Unify them to one, and give it an ilk_ prefix to make it clear where it should be used.
--- drivers/gpu/drm/i915/intel_pm.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +5 -13
@@ -2942,18 +2942,10 @@ static void intel_read_wm_latency(struct drm_i915_private *dev_priv, } } -static void intel_fixup_spr_wm_latency (struct drm_i915_private *dev_priv, -uint16_t wm[5 ]) +static void ilk_fixup_spr_cur_wm_latency (struct drm_i915_private *dev_priv, +u16 wm[5 ]) { -/* ILK sprite LP0 latency is 1300 ns */ -if (IS_GEN5 (dev_priv)) - wm[0 ] =13 ; -} - -static void intel_fixup_cur_wm_latency (struct drm_i915_private *dev_priv, -uint16_t wm[5 ]) -{ -/* ILK cursor LP0 latency is 1300 ns */ +/* ILK sprite/cursor LP0 latency is 1300 ns */ if (IS_GEN5 (dev_priv)) wm[0 ] =13 ; }
@@ -3026,8 +3018,8 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)memcpy (dev_priv->wm.cur_latency, dev_priv->wm.pri_latency,sizeof (dev_priv->wm.pri_latency)); -intel_fixup_spr_wm_latency (dev_priv, dev_priv->wm.spr_latency); -intel_fixup_cur_wm_latency (dev_priv, dev_priv->wm.cur_latency); +ilk_fixup_spr_cur_wm_latency (dev_priv, dev_priv->wm.spr_latency); +ilk_fixup_spr_cur_wm_latency (dev_priv, dev_priv->wm.cur_latency);intel_print_wm_latency (dev_priv,"Primary" , dev_priv->wm.pri_latency);intel_print_wm_latency (dev_priv,"Sprite" , dev_priv->wm.spr_latency);
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/12 drm/i915: Split skl+ and ilk+ read_wm_latency()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
There's no point it having the skl+ and ilk+ codepaths for reading the wm latency values in the same function. Split them apart.
--- drivers/gpu/drm/i915/intel_pm.c | 197 +++++++++++++++++--------------- 1 file changed, 104 insertions(+), 93 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +104 -93
@@ -2825,95 +2825,10 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)PIPE_WM_LINETIME_TIME (linetime); } -static void intel_read_wm_latency (struct drm_i915_private *dev_priv, -uint16_t wm[8 ]) +static void ilk_read_wm_latency (struct drm_i915_private *dev_priv, +u16 wm[5 ]) { -if (INTEL_GEN (dev_priv) >=9 ) { -uint32_t val; -int ret, i; -int level, num_levels = dev_priv->wm.num_levels; - -/* read the first set of memory latencies[0:3] */ - val =0 ;/* data0 to be programmed to 0 for first set */ -mutex_lock (&dev_priv->pcu_lock); - ret =sandybridge_pcode_read (dev_priv, -GEN9_PCODE_READ_MEM_LATENCY , - &val); -mutex_unlock (&dev_priv->pcu_lock); - -if (ret) { -DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); -return ; - } - - wm[0 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[1 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[2 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[3 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - -/* read the second set of memory latencies[4:7] */ - val =1 ;/* data0 to be programmed to 1 for second set */ -mutex_lock (&dev_priv->pcu_lock); - ret =sandybridge_pcode_read (dev_priv, -GEN9_PCODE_READ_MEM_LATENCY , - &val); -mutex_unlock (&dev_priv->pcu_lock); -if (ret) { -DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); -return ; - } - - wm[4 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[5 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[6 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[7 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - -/* -* If a level n (n > 1) has a 0us latency, all levels m (m >= n) -* need to be disabled. We make sure to sanitize the values out -* of the punit to satisfy this requirement. -*/ -for (level =1 ; level < num_levels; level++) { -if (wm[level] ==0 ) { -for (i = level +1 ; i < num_levels; i++) - wm[i] =0 ; -break ; - } - } - -/* -* WaWmMemoryReadLatency:skl+,glk -* -* punit doesn't take into account the read latency so we need -* to add 2us to the various latency levels we retrieve from the -* punit when level 0 response data us 0us. -*/ -if (wm[0 ] ==0 ) { - wm[0 ] +=2 ; -for (level =1 ; level < num_levels; level++) { -if (wm[level] ==0 ) -break ; - wm[level] +=2 ; - } - } - -/* -* WA Level-0 adjustment for 16GB DIMMs: SKL+ -* If we could not get dimm info enable this WA to prevent from -* any underrun. If not able to get Dimm info assume 16GB dimm -* to avoid any underrun. -*/ -if (!dev_priv->dram_info.valid_dimm || - dev_priv->dram_info.is_16gb_dimm) - wm[0 ] +=1 ; - - }else if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { +if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) {uint64_t sskpd =I915_READ64 (MCH_SSKPD ); wm[0 ] = (sskpd >>56 ) &0xFF ;
@@ -2930,7 +2845,7 @@ static void intel_read_wm_latency(struct drm_i915_private *dev_priv, wm[1 ] = (sskpd >>SSKPD_WM1_SHIFT ) &SSKPD_WM_MASK ; wm[2 ] = (sskpd >>SSKPD_WM2_SHIFT ) &SSKPD_WM_MASK ; wm[3 ] = (sskpd >>SSKPD_WM3_SHIFT ) &SSKPD_WM_MASK ; - }else if (INTEL_GEN (dev_priv) >=5 ) { + }else if (IS_GEN5 (dev_priv)) {uint32_t mltr =I915_READ (MLTR_ILK );/* ILK primary LP0 latency is 700 ns */
@@ -3009,8 +2924,7 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)else dev_priv->wm.num_levels =3 ; -intel_read_wm_latency (dev_priv, dev_priv->wm.pri_latency); - +ilk_read_wm_latency (dev_priv, dev_priv->wm.pri_latency);ilk_fixup_wm_latency_units (dev_priv, dev_priv->wm.pri_latency); memcpy(dev_priv->wm.spr_latency, dev_priv->wm.pri_latency,
@@ -3029,6 +2943,68 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)snb_wm_latency_quirk (dev_priv); } +static void skl_read_wm_latency (struct drm_i915_private *dev_priv, +u16 wm[8 ]) +{ +int level, num_levels = dev_priv->wm.num_levels; +int ret, i; +u32 val; + +/* read the first set of memory latencies[0:3] */ + val =0 ;/* data0 to be programmed to 0 for first set */ +mutex_lock (&dev_priv->pcu_lock); + ret =sandybridge_pcode_read (dev_priv, +GEN9_PCODE_READ_MEM_LATENCY , + &val); +mutex_unlock (&dev_priv->pcu_lock); + +if (ret) { +DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); +return ; + } + + wm[0 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[1 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[2 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[3 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + +/* read the second set of memory latencies[4:7] */ + val =1 ;/* data0 to be programmed to 1 for second set */ +mutex_lock (&dev_priv->pcu_lock); + ret =sandybridge_pcode_read (dev_priv, +GEN9_PCODE_READ_MEM_LATENCY , + &val); +mutex_unlock (&dev_priv->pcu_lock); +if (ret) { +DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); +return ; + } + + wm[4 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[5 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[6 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[7 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + +/* +* If a level n (n > 1) has a 0us latency, all levels m (m >= n) +* need to be disabled. We make sure to sanitize the values out +* of the punit to satisfy this requirement. +*/ +for (level =1 ; level < num_levels; level++) { +if (wm[level] ==0 ) { +for (i = level +1 ; i < num_levels; i++) + wm[i] =0 ; +break ; + } + } +} +static void skl_fixup_wm_latency_units (struct drm_i915_private *dev_priv,u16 wm[8 ]) {
@@ -3039,14 +3015,49 @@ static void skl_fixup_wm_latency_units(struct drm_i915_private *dev_priv, wm[level] *=10 ; } +static void skl_wm_latency_wa (struct drm_i915_private *dev_priv, +u16 wm[8 ]) +{ +/* +* WaWmMemoryReadLatency:skl,glk +* +* punit doesn't take into account the read latency so we need +* to add 2us to the various latency levels we retrieve from the +* punit when level 0 response data us 0us. +*/ +if (wm[0 ] ==0 ) { +int level, num_levels = dev_priv->wm.num_levels; + + wm[0 ] +=20 ; + +for (level =1 ; level < num_levels; level++) { +if (wm[level] ==0 ) +break ; + + wm[level] +=20 ; + } + } + +/* +* WA Level-0 adjustment for 16GB DIMMs: SKL+ +* If we could not get dimm info enable this WA to prevent from +* any underrun. If not able to get Dimm info assume 16GB dimm +* to avoid any underrun. +*/ +if (!dev_priv->dram_info.valid_dimm || + dev_priv->dram_info.is_16gb_dimm) + wm[0 ] +=10 ; +} +static void skl_setup_wm_latency (struct drm_i915_private *dev_priv) { dev_priv->wm.num_levels =8 ; -intel_read_wm_latency (dev_priv, dev_priv->wm.pri_latency); - +skl_read_wm_latency (dev_priv, dev_priv->wm.pri_latency);skl_fixup_wm_latency_units (dev_priv, dev_priv->wm.pri_latency); +skl_wm_latency_wa (dev_priv, dev_priv->wm.pri_latency); +memcpy (dev_priv->wm.spr_latency, dev_priv->wm.pri_latency,sizeof (dev_priv->wm.pri_latency)); memcpy(dev_priv->wm.cur_latency, dev_priv->wm.pri_latency,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 8/12 drm/i915: Split skl+ and ilk+ read_wm_latency()
From: Ville Syrjälä <[email protected]>
There's no point it having the skl+ and ilk+ codepaths for reading the wm latency values in the same function. Split them apart.
v2: <usec> * 10
--- drivers/gpu/drm/i915/intel_pm.c | 195 +++++++++++++++++--------------- 1 file changed, 103 insertions(+), 92 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +103 -92
@@ -2825,94 +2825,10 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)PIPE_WM_LINETIME_TIME (linetime); } -static void intel_read_wm_latency (struct drm_i915_private *dev_priv, -uint16_t wm[8 ]) +static void ilk_read_wm_latency (struct drm_i915_private *dev_priv, +u16 wm[5 ]) { -if (INTEL_GEN (dev_priv) >=9 ) { -uint32_t val; -int ret, i; -int level, num_levels = dev_priv->wm.num_levels; - -/* read the first set of memory latencies[0:3] */ - val =0 ;/* data0 to be programmed to 0 for first set */ -mutex_lock (&dev_priv->pcu_lock); - ret =sandybridge_pcode_read (dev_priv, -GEN9_PCODE_READ_MEM_LATENCY , - &val); -mutex_unlock (&dev_priv->pcu_lock); - -if (ret) { -DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); -return ; - } - - wm[0 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[1 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[2 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[3 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - -/* read the second set of memory latencies[4:7] */ - val =1 ;/* data0 to be programmed to 1 for second set */ -mutex_lock (&dev_priv->pcu_lock); - ret =sandybridge_pcode_read (dev_priv, -GEN9_PCODE_READ_MEM_LATENCY , - &val); -mutex_unlock (&dev_priv->pcu_lock); -if (ret) { -DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); -return ; - } - - wm[4 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[5 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[6 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - wm[7 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & -GEN9_MEM_LATENCY_LEVEL_MASK ; - -/* -* If a level n (n > 1) has a 0us latency, all levels m (m >= n) -* need to be disabled. We make sure to sanitize the values out -* of the punit to satisfy this requirement. -*/ -for (level =1 ; level < num_levels; level++) { -if (wm[level] ==0 ) { -for (i = level +1 ; i < num_levels; i++) - wm[i] =0 ; -break ; - } - } - -/* -* WaWmMemoryReadLatency:skl+,glk -* -* punit doesn't take into account the read latency so we need -* to add 2us to the various latency levels we retrieve from the -* punit when level 0 response data us 0us. -*/ -if (wm[0 ] ==0 ) { - wm[0 ] +=2 ; -for (level =1 ; level < num_levels; level++) { -if (wm[level] ==0 ) -break ; - wm[level] +=2 ; - } - } - -/* -* WA Level-0 adjustment for 16GB DIMMs: SKL+ -* If we could not get dimm info enable this WA to prevent from -* any underrun. If not able to get Dimm info assume 16GB dimm -* to avoid any underrun. -*/ -if (dev_priv->dram_info.is_16gb_dimm) - wm[0 ] +=1 ; - - }else if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) { +if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) {uint64_t sskpd =I915_READ64 (MCH_SSKPD ); wm[0 ] = (sskpd >>56 ) &0xFF ;
@@ -2929,7 +2845,7 @@ static void intel_read_wm_latency(struct drm_i915_private *dev_priv, wm[1 ] = (sskpd >>SSKPD_WM1_SHIFT ) &SSKPD_WM_MASK ; wm[2 ] = (sskpd >>SSKPD_WM2_SHIFT ) &SSKPD_WM_MASK ; wm[3 ] = (sskpd >>SSKPD_WM3_SHIFT ) &SSKPD_WM_MASK ; - }else if (INTEL_GEN (dev_priv) >=5 ) { + }else if (IS_GEN5 (dev_priv)) {uint32_t mltr =I915_READ (MLTR_ILK );/* ILK primary LP0 latency is 700 ns */
@@ -3007,8 +2923,7 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)else dev_priv->wm.num_levels =3 ; -intel_read_wm_latency (dev_priv, dev_priv->wm.pri_latency); - +ilk_read_wm_latency (dev_priv, dev_priv->wm.pri_latency);ilk_fixup_wm_latency_units (dev_priv, dev_priv->wm.pri_latency); memcpy(dev_priv->wm.spr_latency, dev_priv->wm.pri_latency,
@@ -3027,6 +2942,68 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)snb_wm_latency_quirk (dev_priv); } +static void skl_read_wm_latency (struct drm_i915_private *dev_priv, +u16 wm[8 ]) +{ +int level, num_levels = dev_priv->wm.num_levels; +int ret, i; +u32 val; + +/* read the first set of memory latencies[0:3] */ + val =0 ;/* data0 to be programmed to 0 for first set */ +mutex_lock (&dev_priv->pcu_lock); + ret =sandybridge_pcode_read (dev_priv, +GEN9_PCODE_READ_MEM_LATENCY , + &val); +mutex_unlock (&dev_priv->pcu_lock); + +if (ret) { +DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); +return ; + } + + wm[0 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[1 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[2 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[3 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + +/* read the second set of memory latencies[4:7] */ + val =1 ;/* data0 to be programmed to 1 for second set */ +mutex_lock (&dev_priv->pcu_lock); + ret =sandybridge_pcode_read (dev_priv, +GEN9_PCODE_READ_MEM_LATENCY , + &val); +mutex_unlock (&dev_priv->pcu_lock); +if (ret) { +DRM_ERROR ("SKL Mailbox read error = %d\n" , ret); +return ; + } + + wm[4 ] = val &GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[5 ] = (val >>GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[6 ] = (val >>GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + wm[7 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) & +GEN9_MEM_LATENCY_LEVEL_MASK ; + +/* +* If a level n (n > 1) has a 0us latency, all levels m (m >= n) +* need to be disabled. We make sure to sanitize the values out +* of the punit to satisfy this requirement. +*/ +for (level =1 ; level < num_levels; level++) { +if (wm[level] ==0 ) { +for (i = level +1 ; i < num_levels; i++) + wm[i] =0 ; +break ; + } + } +} +static void skl_fixup_wm_latency_units (struct drm_i915_private *dev_priv,u16 wm[8 ]) {
@@ -3037,14 +3014,48 @@ static void skl_fixup_wm_latency_units(struct drm_i915_private *dev_priv, wm[level] *=10 ; } +static void skl_wm_latency_wa (struct drm_i915_private *dev_priv, +u16 wm[8 ]) +{ +/* +* WaWmMemoryReadLatency:skl,glk +* +* punit doesn't take into account the read latency so we need +* to add 2us to the various latency levels we retrieve from the +* punit when level 0 response data us 0us. +*/ +if (wm[0 ] ==0 ) { +int level, num_levels = dev_priv->wm.num_levels; + + wm[0 ] +=2 *10 ; + +for (level =1 ; level < num_levels; level++) { +if (wm[level] ==0 ) +break ; + + wm[level] +=2 *10 ; + } + } + +/* +* WA Level-0 adjustment for 16GB DIMMs: SKL+ +* If we could not get dimm info enable this WA to prevent from +* any underrun. If not able to get Dimm info assume 16GB dimm +* to avoid any underrun. +*/ +if (dev_priv->dram_info.is_16gb_dimm) + wm[0 ] +=1 *10 ; +} +static void skl_setup_wm_latency (struct drm_i915_private *dev_priv) { dev_priv->wm.num_levels =8 ; -intel_read_wm_latency (dev_priv, dev_priv->wm.pri_latency); - +skl_read_wm_latency (dev_priv, dev_priv->wm.pri_latency);skl_fixup_wm_latency_units (dev_priv, dev_priv->wm.pri_latency); +skl_wm_latency_wa (dev_priv, dev_priv->wm.pri_latency); +memcpy (dev_priv->wm.spr_latency, dev_priv->wm.pri_latency,sizeof (dev_priv->wm.pri_latency)); memcpy(dev_priv->wm.cur_latency, dev_priv->wm.pri_latency,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/12 drm/i915: Sanitize wm latency values for ilk+
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
For skl+ we disable all wm levels with a decreasing memory latency value. Let's generalize the same code to work for all platoforms, and let's use it for ilk-bdw as well since those platforms also read the latency values from a scratch register.
--- drivers/gpu/drm/i915/intel_pm.c | 58 ++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +42 -16
@@ -2825,6 +2825,37 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)PIPE_WM_LINETIME_TIME (linetime); } +static void intel_sanitize_wm_latency (struct drm_i915_private *dev_priv, +u16 *wm) +{ +int level, num_levels = dev_priv->wm.num_levels; + +/* +* If we don't have WM0 latency, assume +* 5 usec and disable all WM1+ levels. +* 5 usec seems like a safe(ish) fallback value. +*/ +if (WARN (wm[0 ] ==0 ,"WM0 memory latency value is zero" )) { + wm[0 ] =50 ; + +for (level =1 ; level < num_levels; level++) + wm[level] =0 ; +return ; + } + +/* Make sure the latencies are non-decreasing */ +for (level =1 ; level < num_levels; level++) { +if (wm[level] < wm[level -1 ]) { +WARN (wm[level] !=0 , +"Decreasing WM memory latency value(s)" ); + +for (; level < num_levels; level++) + wm[level] =0 ; +break ; + } + } +} +static void ilk_read_wm_latency (struct drm_i915_private *dev_priv,u16 wm[5 ]) {
@@ -2888,8 +2919,11 @@ static bool ilk_increase_wm_latency(struct drm_i915_private *dev_priv,/* WM1+ latencies must be multiples of .5 usec */ min =roundup (min,5 ); -for (level =1 ; level < num_levels; level++) +for (level =1 ; level < num_levels; level++) { +if (wm[level] ==0 ) +break ; wm[level] =max (wm[level], min); + }return true; }
@@ -2935,6 +2969,10 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)ilk_fixup_spr_cur_wm_latency (dev_priv, dev_priv->wm.spr_latency);ilk_fixup_spr_cur_wm_latency (dev_priv, dev_priv->wm.cur_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.pri_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.spr_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.cur_latency); +intel_print_wm_latency (dev_priv,"Primary" , dev_priv->wm.pri_latency);intel_print_wm_latency (dev_priv,"Sprite" , dev_priv->wm.spr_latency);intel_print_wm_latency (dev_priv,"Cursor" , dev_priv->wm.cur_latency);
@@ -2946,8 +2984,7 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)static void skl_read_wm_latency (struct drm_i915_private *dev_priv,u16 wm[8 ]) { -int level, num_levels = dev_priv->wm.num_levels; -int ret, i; +int ret;u32 val;/* read the first set of memory latencies[0:3] */
@@ -2990,19 +3027,6 @@ static void skl_read_wm_latency(struct drm_i915_private *dev_priv,GEN9_MEM_LATENCY_LEVEL_MASK ; wm[7 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) &GEN9_MEM_LATENCY_LEVEL_MASK ; - -/* -* If a level n (n > 1) has a 0us latency, all levels m (m >= n) -* need to be disabled. We make sure to sanitize the values out -* of the punit to satisfy this requirement. -*/ -for (level =1 ; level < num_levels; level++) { -if (wm[level] ==0 ) { -for (i = level +1 ; i < num_levels; i++) - wm[i] =0 ; -break ; - } - } } static void skl_fixup_wm_latency_units(struct drm_i915_private *dev_priv,
@@ -3058,6 +3082,8 @@ static void skl_setup_wm_latency(struct drm_i915_private *dev_priv)skl_wm_latency_wa (dev_priv, dev_priv->wm.pri_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.pri_latency); +memcpy (dev_priv->wm.spr_latency, dev_priv->wm.pri_latency,sizeof (dev_priv->wm.pri_latency)); memcpy(dev_priv->wm.cur_latency, dev_priv->wm.pri_latency,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 9/12 drm/i915: Sanitize wm latency values for ilk+
From: Ville Syrjälä <[email protected]>
For skl+ we disable all wm levels with a decreasing memory latency value. Let's generalize the same code to work for all platoforms, and let's use it for ilk-bdw as well since those platforms also read the latency values from a scratch register.
v2: n*10 usec, rebase
--- drivers/gpu/drm/i915/intel_pm.c | 57 ++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +42 -15
@@ -2825,6 +2825,41 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate)PIPE_WM_LINETIME_TIME (linetime); } +static void intel_sanitize_wm_latency (struct drm_i915_private *dev_priv, +u16 *wm) +{ +int level, num_levels = dev_priv->wm.num_levels; + +/* +* If we don't have WM0 latency, assume +* 5 usec and disable all WM1+ levels. +* 5 usec seems like a safe(ish) fallback value. +*/ +if (WARN (wm[0 ] ==0 ,"WM0 memory latency value is zero" )) { +intel_print_wm_latency (dev_priv,"Bad" , wm); + + wm[0 ] =5 *10 ; + +for (level =1 ; level < num_levels; level++) + wm[level] =0 ; +return ; + } + +/* Make sure the latencies are non-decreasing */ +for (level =1 ; level < num_levels; level++) { +if (wm[level] >= wm[level -1 ]) +continue ; + +if (WARN (wm[level] !=0 , +"Decreasing WM memory latency value(s)" )) +intel_print_wm_latency (dev_priv,"Bad" , wm); + +for (; level < num_levels; level++) + wm[level] =0 ; +break ; + } +} +static void ilk_read_wm_latency (struct drm_i915_private *dev_priv,u16 wm[5 ]) {
@@ -2934,6 +2969,10 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)ilk_fixup_spr_cur_wm_latency (dev_priv, dev_priv->wm.spr_latency);ilk_fixup_spr_cur_wm_latency (dev_priv, dev_priv->wm.cur_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.pri_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.spr_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.cur_latency); +intel_print_wm_latency (dev_priv,"Primary" , dev_priv->wm.pri_latency);intel_print_wm_latency (dev_priv,"Sprite" , dev_priv->wm.spr_latency);intel_print_wm_latency (dev_priv,"Cursor" , dev_priv->wm.cur_latency);
@@ -2945,8 +2984,7 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv)static void skl_read_wm_latency (struct drm_i915_private *dev_priv,u16 wm[8 ]) { -int level, num_levels = dev_priv->wm.num_levels; -int ret, i; +int ret;u32 val;/* read the first set of memory latencies[0:3] */
@@ -2989,19 +3027,6 @@ static void skl_read_wm_latency(struct drm_i915_private *dev_priv,GEN9_MEM_LATENCY_LEVEL_MASK ; wm[7 ] = (val >>GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT ) &GEN9_MEM_LATENCY_LEVEL_MASK ; - -/* -* If a level n (n > 1) has a 0us latency, all levels m (m >= n) -* need to be disabled. We make sure to sanitize the values out -* of the punit to satisfy this requirement. -*/ -for (level =1 ; level < num_levels; level++) { -if (wm[level] ==0 ) { -for (i = level +1 ; i < num_levels; i++) - wm[i] =0 ; -break ; - } - } } static void skl_fixup_wm_latency_units(struct drm_i915_private *dev_priv,
@@ -3056,6 +3081,8 @@ static void skl_setup_wm_latency(struct drm_i915_private *dev_priv)skl_wm_latency_wa (dev_priv, dev_priv->wm.pri_latency); +intel_sanitize_wm_latency (dev_priv, dev_priv->wm.pri_latency); +memcpy (dev_priv->wm.spr_latency, dev_priv->wm.pri_latency,sizeof (dev_priv->wm.pri_latency)); memcpy(dev_priv->wm.cur_latency, dev_priv->wm.pri_latency,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/12 drm/i915: Drop the funky ilk wm setup
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Currently we try to disable the wm code entirely for ilk if the BIOS doesn't provide proper latency values. Now that we have real fallbacks in place we should be able to alawys rely on the wm code instead.
--- drivers/gpu/drm/i915/intel_display.c | 6 ++---- drivers/gpu/drm/i915/intel_pm.c | 20 ++++---------------- 2 files changed, 6 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -4
@@ -5590,8 +5590,7 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,*/ intel_color_load_luts (&pipe_config->base); -if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, pipe_config); + dev_priv->display.initial_watermarks (old_intel_state, pipe_config);intel_enable_pipe (pipe_config);if (pipe_config->has_pch_encoder)
@@ -5738,8 +5737,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,if (!transcoder_is_dsi (cpu_transcoder))intel_ddi_enable_transcoder_func (pipe_config); -if (dev_priv->display.initial_watermarks !=NULL ) - dev_priv->display.initial_watermarks (old_intel_state, pipe_config); + dev_priv->display.initial_watermarks (old_intel_state, pipe_config);if (INTEL_GEN (dev_priv) >=11 )icl_pipe_mbus_enable (intel_crtc);
drivers/gpu/drm/i915/intel_pm.c +4 -16
@@ -9389,22 +9389,10 @@ void intel_init_pm(struct drm_i915_private *dev_priv) dev_priv->display.compute_global_watermarks = skl_compute_wm; }else if (HAS_PCH_SPLIT (dev_priv)) {ilk_setup_wm_latency (dev_priv); - -if ((IS_GEN5 (dev_priv) && dev_priv->wm.pri_latency[1 ] && - dev_priv->wm.spr_latency[1 ] && dev_priv->wm.cur_latency[1 ]) || - (!IS_GEN5 (dev_priv) && dev_priv->wm.pri_latency[0 ] && - dev_priv->wm.spr_latency[0 ] && dev_priv->wm.cur_latency[0 ])) { - dev_priv->display.compute_pipe_wm = ilk_compute_pipe_wm; - dev_priv->display.compute_intermediate_wm = - ilk_compute_intermediate_wm; - dev_priv->display.initial_watermarks = - ilk_initial_watermarks; - dev_priv->display.optimize_watermarks = - ilk_optimize_watermarks; - }else { -DRM_DEBUG_KMS ("Failed to read display plane latency. " -"Disable CxSR\n" ); - } + dev_priv->display.compute_pipe_wm = ilk_compute_pipe_wm; + dev_priv->display.compute_intermediate_wm = ilk_compute_intermediate_wm; + dev_priv->display.initial_watermarks = ilk_initial_watermarks; + dev_priv->display.optimize_watermarks = ilk_optimize_watermarks; }else if (IS_VALLEYVIEW (dev_priv) ||IS_CHERRYVIEW (dev_priv)) {vlv_setup_wm_latency (dev_priv); dev_priv->display.compute_pipe_wm = vlv_compute_pipe_wm;
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/12 drm/i915: Allow LP3 watermarks on ILK
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
ILK already has the watermark registers for the LP3 level so bump num_levels to 4. The BIOS still does not provide memory latency values for for LP3 though so it will not be used unless the latency values are overridden via debugfs.
This also requires that we check for latency==0 zero when computing the watermarks so that we keep disabling any wm level which isn't supposed to be used. The behaviour now matches that of the g4x/vlv wm code.
--- drivers/gpu/drm/i915/intel_pm.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +10 -3
@@ -2537,6 +2537,9 @@ static uint32_t ilk_compute_pri_wm(const struct intel_crtc_state *cstate,uint32_t method1, method2;int cpp; +if (latency ==0 ) +return USHRT_MAX ; +if (!intel_wm_plane_visible (cstate, pstate))return 0 ;
@@ -2564,6 +2567,9 @@ static uint32_t ilk_compute_spr_wm(const struct intel_crtc_state *cstate,uint32_t method1, method2;int cpp; +if (latency ==0 ) +return USHRT_MAX ; +if (!intel_wm_plane_visible (cstate, pstate))return 0 ;
@@ -2585,6 +2591,9 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate,int latency =intel_plane_wm_latency (plane, level);int cpp; +if (latency ==0 ) +return USHRT_MAX ; +if (!intel_wm_plane_visible (cstate, pstate))return 0 ;
@@ -2953,10 +2962,8 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv) {if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv)) dev_priv->wm.num_levels =5 ; -else if (INTEL_GEN (dev_priv) >=6 ) - dev_priv->wm.num_levels =4 ;else - dev_priv->wm.num_levels =3 ; + dev_priv->wm.num_levels =4 ;ilk_read_wm_latency (dev_priv, dev_priv->wm.pri_latency);ilk_fixup_wm_latency_units (dev_priv, dev_priv->wm.pri_latency);
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 12/12 drm/i915: Remove the remnants of the ilk+ LP0 wm hack
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
In the past we couldn't properly reject the operation if the level 0 watermarks exceeded the limits, thus we had a hack to clamp the values. commit 86c8bbbeb8d1 ("drm/i915: Calculate ILK-style watermarks during atomic check (v3)") changed the behaviour to fail the operation instead, but neglected to remove all the code for the hack. Remove the leftovers.
--- drivers/gpu/drm/i915/intel_pm.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +1 -27
@@ -2746,8 +2746,6 @@ static bool ilk_validate_wm_level(int level, const struct ilk_wm_maximums *max, struct intel_wm_level *result) { - bool ret; - /* already determined to be invalid? */ if (!result->enable) return false;
@@ -2756,31 +2754,7 @@ static bool ilk_validate_wm_level(int level, result->spr_val <= max->spr && result->cur_val <= max->cur; - ret = result->enable; - -/* -* HACK until we can pre-compute everything, -* and thus fail gracefully if LP0 watermarks -* are exceeded... -*/ -if (level ==0 && !result->enable) { -if (result->pri_val > max->pri) -DRM_DEBUG_KMS ("Primary WM%d too large %u (max %u)\n" , - level, result->pri_val, max->pri); -if (result->spr_val > max->spr) -DRM_DEBUG_KMS ("Sprite WM%d too large %u (max %u)\n" , - level, result->spr_val, max->spr); -if (result->cur_val > max->cur) -DRM_DEBUG_KMS ("Cursor WM%d too large %u (max %u)\n" , - level, result->cur_val, max->cur); - - result->pri_val =min_t (uint32_t, result->pri_val, max->pri); - result->spr_val =min_t (uint32_t, result->spr_val, max->spr); - result->cur_val =min_t (uint32_t, result->cur_val, max->cur); - result->enable = true; - } - -return ret; +return result->enable; } static void ilk_compute_wm_level(const struct drm_i915_private *dev_priv,
Signature · 6 lines
2.18.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915: Clean up the wm mem latency stuff
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff
URL : https://patchwork.freedesktop.org/series/50802/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
3acd8b6f70a5 drm/i915: Store all wm memory latency values in .1 usec units
77e42913e7cf drm/i915: Use the spr/cur latencies on vlv/chv/g4x
720e1b59c0b9 drm/i915: Eliminate skl_latency[]
835ecb45c0fd drm/i915: Add dev_priv->wm.num_levels and use it everywhere
56e36d0fdf5f drm/i915: Add DEFINE_SNPRINTF_ARRAY()
-:23: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'values' may be better as '(values)' to avoid precedence issues
#23: FILE: drivers/gpu/drm/i915/i915_utils.h:164:
+#define DEFINE_SNPRINTF_ARRAY(name, type, values, index, fmt, ...) \
+void name(char *_str, size_t _len, const type *values, int _nelems) \
+{ \
+ int index; \
+ if (_len) \
+ _str[0] = '\0'; \
+ for (index = 0; index < _nelems; index++) { \
+ int _r = snprintf(_str, _len, "%s" fmt, \
+ index ? ", " : "", __VA_ARGS__); \
+ if (_r >= _len) \
+ return; \
+ _str += _r; \
+ _len -= _r; \
+ } \
+}-:23: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'index' - possible side-effects? #23: FILE: drivers/gpu/drm/i915/i915_utils.h:164:
+#define DEFINE_SNPRINTF_ARRAY(name, type, values, index, fmt, ...) \
+void name(char *_str, size_t _len, const type *values, int _nelems) \
+{ \
+ int index; \
+ if (_len) \
+ _str[0] = '\0'; \
+ for (index = 0; index < _nelems; index++) { \
+ int _r = snprintf(_str, _len, "%s" fmt, \
+ index ? ", " : "", __VA_ARGS__); \
+ if (_r >= _len) \
+ return; \
+ _str += _r; \
+ _len -= _r; \
+ } \
+}
-:23: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided #23: FILE: drivers/gpu/drm/i915/i915_utils.h:164:
+#define DEFINE_SNPRINTF_ARRAY(name, type, values, index, fmt, ...) \
+void name(char *_str, size_t _len, const type *values, int _nelems) \
+{ \
+ int index; \
+ if (_len) \
+ _str[0] = '\0'; \
+ for (index = 0; index < _nelems; index++) { \
+ int _r = snprintf(_str, _len, "%s" fmt, \
+ index ? ", " : "", __VA_ARGS__); \
+ if (_r >= _len) \
+ return; \
+ _str += _r; \
+ _len -= _r; \
+ } \
+}
-:24: CHECK:SPACING: spaces preferred around that '*' (ctx:WxV) #24: FILE: drivers/gpu/drm/i915/i915_utils.h:165:
+void name(char *_str, size_t _len, const type *values, int _nelems) \
^total: 0 errors, 1 warnings, 3 checks, 43 lines checked f3ddc18d8e10 drm/i915: Make the WM memory latency print more compact 3e81eb4b15b0 drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code aaa6aab9e9f2 drm/i915: Split skl+ and ilk+ read_wm_latency() 2e6e43af1f55 drm/i915: Sanitize wm latency values for ilk+ 4d7823f8cfea drm/i915: Drop the funky ilk wm setup cc9ff8c60c9f drm/i915: Allow LP3 watermarks on ILK 9ca6798844ad drm/i915: Remove the remnants of the ilk+ LP0 wm hack
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm/i915: Clean up the wm mem latency stuff
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff
URL : https://patchwork.freedesktop.org/series/50802/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm/i915: Store all wm memory latency values in .1 usec units -O:drivers/gpu/drm/i915/intel_pm.c:1636:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:1656:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2511:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2511:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2535:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2535:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2528:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2528:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2550:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2550:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2984:17: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2984:17: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2986:29: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2986:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2986:17: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2986:17: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2992:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2992:29: warning: expression using sizeof(void) -drivers/gpu/drm/i915/selftests/../i915_drv.h:3725:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_drv.h:3713:16: warning: expression using sizeof(void)
Commit: drm/i915: Use the spr/cur latencies on vlv/chv/g4x Okay!
Commit: drm/i915: Eliminate skl_latency[]
Okay!
Commit: drm/i915: Add dev_priv->wm.num_levels and use it everywhere -O:drivers/gpu/drm/i915/intel_pm.c:1224:17: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:1219:17: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:3004:29: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:3004:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2988:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2988:29: warning: expression using sizeof(void)
Commit: drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Okay!
Commit: drm/i915: Make the WM memory latency print more compact Okay!
Commit: drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code Okay!
Commit: drm/i915: Split skl+ and ilk+ read_wm_latency() Okay!
Commit: drm/i915: Sanitize wm latency values for ilk+ -O:drivers/gpu/drm/i915/intel_pm.c:2892:29: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2892:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2925:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2925:29: warning: expression using sizeof(void)
Commit: drm/i915: Drop the funky ilk wm setup
Okay!
Commit: drm/i915: Allow LP3 watermarks on ILK
Okay!
Commit: drm/i915: Remove the remnants of the ilk+ LP0 wm hack -O:drivers/gpu/drm/i915/intel_pm.c:2777:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2777:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2778:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2778:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2779:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2779:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6616:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6616:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6616:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6616:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6616:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6616:35: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Clean up the wm mem latency stuff
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff
URL : https://patchwork.freedesktop.org/series/50802/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_4963 -> Patchwork_10414 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_10414 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10414, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/50802/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10414:
=== IGT changes ===
==== Possible regressions ====
igt@drv_selftest@live_hugepages:
fi-glk-dsi: PASS -> DMESG-WARN +18
igt@drv_selftest@live_sanitycheck:
fi-glk-j4005: PASS -> DMESG-WARN +18== Known issues ==
Here are the changes found in Patchwork_10414 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@amdgpu/amd_cs_nop@sync-fork-gfx0:
fi-kbl-8809g: PASS -> DMESG-WARN (fdo#107762)
==== Possible fixes ====
igt@amdgpu/amd_cs_nop@fork-gfx0:
fi-kbl-8809g: DMESG-WARN (fdo#107762) -> PASS
igt@gem_exec_suspend@basic-s4-devices:
fi-kbl-7500u: DMESG-WARN (fdo#105128, fdo#107139) -> PASS fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
fdo#107762 https://bugs.freedesktop.org/show_bug.cgi?id=107762
== Participating hosts (47 -> 42) ==
Additional (1): fi-gdg-551
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-u2 fi-ctg-p8600
== Build changes ==
* Linux: CI_DRM_4963 -> Patchwork_10414
CI_DRM_4963: bc57a8e99f2f81581a9657a02682902f80488bb3 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4673: 54cb1aeb4e50dea9f3abae632e317875d147c4ab @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10414: 9ca6798844ad2db6a72afaf6ac3f6d4c9f36357b @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
9ca6798844ad drm/i915: Remove the remnants of the ilk+ LP0 wm hack cc9ff8c60c9f drm/i915: Allow LP3 watermarks on ILK 4d7823f8cfea drm/i915: Drop the funky ilk wm setup 2e6e43af1f55 drm/i915: Sanitize wm latency values for ilk+ aaa6aab9e9f2 drm/i915: Split skl+ and ilk+ read_wm_latency() 3e81eb4b15b0 drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code f3ddc18d8e10 drm/i915: Make the WM memory latency print more compact 56e36d0fdf5f drm/i915: Add DEFINE_SNPRINTF_ARRAY() 835ecb45c0fd drm/i915: Add dev_priv->wm.num_levels and use it everywhere 720e1b59c0b9 drm/i915: Eliminate skl_latency[]77e42913e7cf drm/i915: Use the spr/cur latencies on vlv/chv/g4x 3acd8b6f70a5 drm/i915: Store all wm memory latency values in .1 usec units
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10414/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Clean up the wm mem latency stuff (rev2)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev2)
URL : https://patchwork.freedesktop.org/series/50802/
State : failure
== Summary ==
Applying: drm/i915: Store all wm memory latency values in .1 usec units
Applying: drm/i915: Use the spr/cur latencies on vlv/chv/g4x
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_debugfs.c
M drivers/gpu/drm/i915/intel_pm.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/intel_pm.c
Auto-merging drivers/gpu/drm/i915/i915_debugfs.c
Applying: drm/i915: Eliminate skl_latency[]
Applying: drm/i915: Add dev_priv->wm.num_levels and use it everywhere
error: sha1 information is lacking or useless (drivers/gpu/drm/i915/i915_drv.h).
error: could not build fake ancestor
Patch failed at 0004 drm/i915: Add dev_priv->wm.num_levels and use it everywhere Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Clean up the wm mem latency stuff (rev3)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev3)
URL : https://patchwork.freedesktop.org/series/50802/
State : failure
== Summary ==
Applying: drm/i915: Store all wm memory latency values in .1 usec units
Applying: drm/i915: Use the spr/cur latencies on vlv/chv/g4x Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_debugfs.c
M drivers/gpu/drm/i915/intel_pm.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/intel_pm.c
Auto-merging drivers/gpu/drm/i915/i915_debugfs.c
Applying: drm/i915: Eliminate skl_latency[]
Applying: drm/i915: Add dev_priv->wm.num_levels and use it everywhere
Applying: drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Applying: drm/i915: Make the WM memory latency print more compact
Applying: drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code
Applying: drm/i915: Split skl+ and ilk+ read_wm_latency() Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/intel_pm.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/intel_pm.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/intel_pm.c
error: Failed to merge in the changes.
Patch failed at 0008 drm/i915: Split skl+ and ilk+ read_wm_latency() Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Clean up the wm mem latency stuff (rev4)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev4)
URL : https://patchwork.freedesktop.org/series/50802/
State : failure
== Summary ==
Applying: drm/i915: Store all wm memory latency values in .1 usec units
Applying: drm/i915: Use the spr/cur latencies on vlv/chv/g4x Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_debugfs.c
M drivers/gpu/drm/i915/intel_pm.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/intel_pm.c
Auto-merging drivers/gpu/drm/i915/i915_debugfs.c
Applying: drm/i915: Eliminate skl_latency[]
Applying: drm/i915: Add dev_priv->wm.num_levels and use it everywhere
Applying: drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Applying: drm/i915: Make the WM memory latency print more compact
Applying: drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code
Applying: drm/i915: Split skl+ and ilk+ read_wm_latency()
Applying: drm/i915: Sanitize wm latency values for ilk+ Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/intel_pm.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/intel_pm.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/intel_pm.c
error: Failed to merge in the changes.
Patch failed at 0009 drm/i915: Sanitize wm latency values for ilk+ Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915: Clean up the wm mem latency stuff (rev5)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev5)
URL : https://patchwork.freedesktop.org/series/50802/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
220f3eac5592 drm/i915: Store all wm memory latency values in .1 usec units
488b0f8bd38a drm/i915: Use the spr/cur latencies on vlv/chv/g4x
85fb6da04007 drm/i915: Eliminate skl_latency[]
d203e7e82c7a drm/i915: Add dev_priv->wm.num_levels and use it everywhere
1d35686d5190 drm/i915: Add DEFINE_SNPRINTF_ARRAY()
-:23: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'values' may be better as '(values)' to avoid precedence issues
#23: FILE: drivers/gpu/drm/i915/i915_utils.h:164:
+#define DEFINE_SNPRINTF_ARRAY(name, type, values, index, fmt, ...) \
+void name(char *_str, size_t _len, const type *values, int _nelems) \
+{ \
+ int index; \
+ if (_len) \
+ _str[0] = '\0'; \
+ for (index = 0; index < _nelems; index++) { \
+ int _r = snprintf(_str, _len, "%s" fmt, \
+ index ? ", " : "", __VA_ARGS__); \
+ if (_r >= _len) \
+ return; \
+ _str += _r; \
+ _len -= _r; \
+ } \
+}-:23: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'index' - possible side-effects? #23: FILE: drivers/gpu/drm/i915/i915_utils.h:164:
+#define DEFINE_SNPRINTF_ARRAY(name, type, values, index, fmt, ...) \
+void name(char *_str, size_t _len, const type *values, int _nelems) \
+{ \
+ int index; \
+ if (_len) \
+ _str[0] = '\0'; \
+ for (index = 0; index < _nelems; index++) { \
+ int _r = snprintf(_str, _len, "%s" fmt, \
+ index ? ", " : "", __VA_ARGS__); \
+ if (_r >= _len) \
+ return; \
+ _str += _r; \
+ _len -= _r; \
+ } \
+}
-:23: WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided #23: FILE: drivers/gpu/drm/i915/i915_utils.h:164:
+#define DEFINE_SNPRINTF_ARRAY(name, type, values, index, fmt, ...) \
+void name(char *_str, size_t _len, const type *values, int _nelems) \
+{ \
+ int index; \
+ if (_len) \
+ _str[0] = '\0'; \
+ for (index = 0; index < _nelems; index++) { \
+ int _r = snprintf(_str, _len, "%s" fmt, \
+ index ? ", " : "", __VA_ARGS__); \
+ if (_r >= _len) \
+ return; \
+ _str += _r; \
+ _len -= _r; \
+ } \
+}
-:24: CHECK:SPACING: spaces preferred around that '*' (ctx:WxV) #24: FILE: drivers/gpu/drm/i915/i915_utils.h:165:
+void name(char *_str, size_t _len, const type *values, int _nelems) \
^total: 0 errors, 1 warnings, 3 checks, 43 lines checked 77b004210eef drm/i915: Make the WM memory latency print more compact 6f3fc5d3ba43 drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code 10560badd17a drm/i915: Split skl+ and ilk+ read_wm_latency() 9ccb87dce343 drm/i915: Sanitize wm latency values for ilk+ 6e843686038c drm/i915: Drop the funky ilk wm setup d470fc61e2ab drm/i915: Allow LP3 watermarks on ILK d0ae9981700d drm/i915: Remove the remnants of the ilk+ LP0 wm hack
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm/i915: Clean up the wm mem latency stuff (rev5)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev5)
URL : https://patchwork.freedesktop.org/series/50802/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm/i915: Store all wm memory latency values in .1 usec units -O:drivers/gpu/drm/i915/intel_pm.c:1636:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:1656:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2511:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2511:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2535:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2535:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2528:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2528:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2550:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2550:16: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2983:17: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2983:17: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2985:29: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2985:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2990:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2990:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6733:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6733:35: warning: expression using sizeof(void) -drivers/gpu/drm/i915/selftests/../i915_drv.h:3707:16: warning: expression using sizeof(void) +drivers/gpu/drm/i915/selftests/../i915_drv.h:3695:16: warning: expression using sizeof(void)
Commit: drm/i915: Use the spr/cur latencies on vlv/chv/g4x Okay!
Commit: drm/i915: Eliminate skl_latency[]
Okay!
Commit: drm/i915: Add dev_priv->wm.num_levels and use it everywhere -O:drivers/gpu/drm/i915/intel_pm.c:1224:17: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:1219:17: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:3002:29: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:3002:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2986:29: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:2986:29: warning: expression using sizeof(void)
Commit: drm/i915: Add DEFINE_SNPRINTF_ARRAY()
Okay!
Commit: drm/i915: Make the WM memory latency print more compact Okay!
Commit: drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code Okay!
Commit: drm/i915: Split skl+ and ilk+ read_wm_latency() Okay!
Commit: drm/i915: Sanitize wm latency values for ilk+ Okay!
Commit: drm/i915: Drop the funky ilk wm setup
Okay!
Commit: drm/i915: Allow LP3 watermarks on ILK
Okay!
Commit: drm/i915: Remove the remnants of the ilk+ LP0 wm hack -O:drivers/gpu/drm/i915/intel_pm.c:2777:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2777:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2778:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2778:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2779:35: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_pm.c:2779:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6753:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6753:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6753:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6753:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6753:35: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_pm.c:6753:35: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Clean up the wm mem latency stuff (rev5)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev5)
URL : https://patchwork.freedesktop.org/series/50802/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_5044 -> Patchwork_10610 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/50802/revisions/5/mbox/
== Known issues ==
Here are the changes found in Patchwork_10610 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-glk-j4005: PASS -> FAIL (fdo#100368)
igt@kms_flip@basic-plain-flip:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106097)
==== Possible fixes ====
igt@gem_exec_suspend@basic-s3:
fi-blb-e6850: INCOMPLETE (fdo#107718) -> PASS
igt@gem_sync@basic-each:
fi-glk-j4005: DMESG-WARN (fdo#105719) -> PASS
igt@kms_flip@basic-flip-vs-modeset:
fi-glk-j4005: DMESG-WARN (fdo#106000) -> PASS
igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
fi-byt-clapper: FAIL (fdo#107362, fdo#103191) -> PASS
igt@kms_pipe_crc_basic@read-crc-pipe-c-frame-sequence:
fi-glk-j4005: DMESG-FAIL (fdo#106000) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#105719 https://bugs.freedesktop.org/show_bug.cgi?id=105719
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
== Participating hosts (47 -> 43) ==
Additional (1): fi-gdg-551
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-icl-u
== Build changes ==
* Linux: CI_DRM_5044 -> Patchwork_10610
CI_DRM_5044: c4487dca27970879bf67f331614142c749984d65 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4698: af57164fcb16950187ad402ed31f565e88c42a78 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10610: d0ae9981700dd232e2e7bd08389fd8fc4343a343 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
d0ae9981700d drm/i915: Remove the remnants of the ilk+ LP0 wm hack d470fc61e2ab drm/i915: Allow LP3 watermarks on ILK 6e843686038c drm/i915: Drop the funky ilk wm setup 9ccb87dce343 drm/i915: Sanitize wm latency values for ilk+ 10560badd17a drm/i915: Split skl+ and ilk+ read_wm_latency() 6f3fc5d3ba43 drm/i915: Eliminate redundant ilk sprite/cursor wm fixup code 77b004210eef drm/i915: Make the WM memory latency print more compact 1d35686d5190 drm/i915: Add DEFINE_SNPRINTF_ARRAY() d203e7e82c7a drm/i915: Add dev_priv->wm.num_levels and use it everywhere 85fb6da04007 drm/i915: Eliminate skl_latency[]488b0f8bd38a drm/i915: Use the spr/cur latencies on vlv/chv/g4x 220f3eac5592 drm/i915: Store all wm memory latency values in .1 usec units
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10610/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: Clean up the wm mem latency stuff (rev5)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Clean up the wm mem latency stuff (rev5)
URL : https://patchwork.freedesktop.org/series/50802/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_5044_full -> Patchwork_10610_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_10610_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10610_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10610_full:
=== IGT changes ===
==== Warnings ====
igt@pm_rc6_residency@rc6-accuracy:
shard-snb: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_10610_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@debugfs_test@emon_crash:
shard-hsw: PASS -> DMESG-WARN (fdo#102614)
igt@gem_ctx_isolation@bcs0-s3:
shard-kbl: PASS -> INCOMPLETE (fdo#103665)
igt@gem_exec_schedule@pi-ringfull-blt:
shard-skl: NOTRUN -> FAIL (fdo#103158) +1
igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
shard-skl: NOTRUN -> DMESG-WARN (fdo#107956) +1
igt@kms_ccs@pipe-a-crc-primary-basic:
shard-skl: NOTRUN -> FAIL (fdo#107725)
igt@kms_cursor_crc@cursor-256x85-random:
shard-apl: PASS -> FAIL (fdo#103232)
igt@kms_cursor_crc@cursor-64x21-offscreen:
shard-skl: NOTRUN -> FAIL (fdo#103232)
igt@kms_flip@2x-flip-vs-wf_vblank-interruptible:
shard-hsw: PASS -> DMESG-FAIL (fdo#102614)
igt@kms_flip@dpms-vs-vblank-race-interruptible:
shard-apl: PASS -> DMESG-WARN (fdo#108549) +11
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-pwrite:
shard-glk: PASS -> FAIL (fdo#103167) +1
igt@kms_frontbuffer_tracking@fbcpsr-rgb565-draw-pwrite:
shard-snb: SKIP -> INCOMPLETE (fdo#105411)
igt@kms_plane@pixel-format-pipe-c-planes:
shard-kbl: NOTRUN -> FAIL (fdo#103166)
igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
shard-skl: NOTRUN -> INCOMPLETE (fdo#107773, fdo#104108)
igt@kms_plane@plane-position-covered-pipe-a-planes:
shard-apl: PASS -> FAIL (fdo#103166)
igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
shard-skl: NOTRUN -> FAIL (fdo#107815, fdo#108145) +1
igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
shard-skl: NOTRUN -> FAIL (fdo#108145) +3
igt@kms_plane_lowres@pipe-c-tiling-y:
shard-kbl: PASS -> DMESG-WARN (fdo#105345)
igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
shard-skl: NOTRUN -> FAIL (fdo#107815, fdo#103166)
igt@kms_setmode@basic:
shard-kbl: PASS -> FAIL (fdo#99912)
igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
shard-apl: PASS -> DMESG-FAIL (fdo#108549)
==== Possible fixes ====
igt@gem_workarounds@suspend-resume-context:
shard-kbl: INCOMPLETE (fdo#103665) -> PASS
igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
shard-glk: FAIL (fdo#108145) -> PASS
igt@kms_color@pipe-b-ctm-max:
shard-apl: DMESG-WARN (fdo#108549) -> PASS +14
igt@kms_cursor_crc@cursor-256x85-onscreen:
shard-glk: FAIL (fdo#103232) -> PASS
igt@kms_cursor_crc@cursor-64x64-onscreen:
shard-apl: FAIL (fdo#103232) -> PASS
igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
shard-glk: DMESG-WARN (fdo#106538, fdo#105763) -> PASS
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
shard-apl: FAIL (fdo#103167) -> PASS +1
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
shard-glk: FAIL (fdo#103167) -> PASS
igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
shard-apl: FAIL (fdo#103375) -> PASS
igt@kms_plane@plane-panning-top-left-pipe-b-planes:
shard-apl: INCOMPLETE (fdo#103927) -> PASS
igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
shard-apl: FAIL (fdo#103166) -> PASS
igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend:
shard-snb: DMESG-WARN (fdo#102365) -> PASS
igt@kms_vblank@pipe-c-ts-continuation-dpms-rpm:
shard-apl: DMESG-FAIL (fdo#108549) -> PASS
==== Warnings ====
igt@kms_cursor_crc@cursor-64x21-sliding:
shard-apl: FAIL (fdo#103232) -> DMESG-WARN (fdo#108549)
igt@kms_cursor_crc@cursor-64x64-sliding:
shard-apl: DMESG-FAIL (fdo#103232, fdo#108549) -> DMESG-WARN (fdo#108549)
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-cpu:
shard-glk: DMESG-WARN (fdo#106538, fdo#105763) -> FAIL (fdo#103167) fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105345 https://bugs.freedesktop.org/show_bug.cgi?id=105345
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#107725 https://bugs.freedesktop.org/show_bug.cgi?id=107725
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108549 https://bugs.freedesktop.org/show_bug.cgi?id=108549
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (6 -> 6) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_5044 -> Patchwork_10610
CI_DRM_5044: c4487dca27970879bf67f331614142c749984d65 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4698: af57164fcb16950187ad402ed31f565e88c42a78 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10610: d0ae9981700dd232e2e7bd08389fd8fc4343a343 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10610/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx