Skip to contentSkip to conversation

drm/i915: Add TigerLake bandwidth checking

PATCH Superseded Stanislav Lisovskiy 4 participants 6 messages Sep 17, 2019 – Sep 18, 2019

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Add TigerLake bandwidth checking

Added bandwidth calculation algorithm and checks, similar way as it was done for ICL, some constants were corrected according to BSpec.

---
 drivers/gpu/drm/i915/display/intel_bw.c | 108 +++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_bw.c +107 -1
index 688858ebe4d0..e97d083f4f2a 100644
@@ -132,7 +132,8 @@ static int icl_sagv_max_dclk(const struct intel_qgv_info *qi)
 }
 
 struct intel_sa_info {
-	u8 deburst, mpagesize, deprogbwlimit, displayrtids;
+	u8 deburst, mpagesize, deprogbwlimit;
+	u16 displayrtids;
 };
 
 static const struct intel_sa_info icl_sa_info = {
@@ -142,6 +143,14 @@ static const struct intel_sa_info icl_sa_info = {
 	.displayrtids = 128,
 };
 
+static const struct intel_sa_info tgl_sa_info = {
+	.deburst = 16,
+	.mpagesize = 16,
+	.deprogbwlimit = 34, /* GB/s */
+	.displayrtids = 256,
+};
+
+
 static int icl_get_bw_info(struct drm_i915_private *dev_priv)
 {
 	struct intel_qgv_info qi = {};
@@ -208,6 +217,74 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv)
 	return 0;
 }
 
+static int tgl_get_bw_info(struct drm_i915_private *dev_priv)
+{
+	struct intel_qgv_info qi = {};
+	const struct intel_sa_info *sa = &tgl_sa_info;
+	bool is_y_tile = true; /* assume y tile may be used */
+	int num_channels;
+	int deinterleave;
+	int ipqdepth, ipqdepthpch;
+	int dclk_max;
+	int maxdebw;
+	int c3_derating = 10;
+	int c25_deprogbwpclimit = 60;
+	int i, ret;
+
+	ret = icl_get_qgv_points(dev_priv, &qi);
+	if (ret) {
+		DRM_DEBUG_KMS("Failed to get memory subsystem information, ignoring bandwidth limits");
+		return ret;
+	}
+	num_channels = qi.num_channels;
+
+	deinterleave = DIV_ROUND_UP(num_channels, is_y_tile ? 4 : 2);
+	dclk_max = icl_sagv_max_dclk(&qi);
+
+	ipqdepthpch = 16;
+
+	maxdebw = min(sa->deprogbwlimit * 1000,
+		      icl_calc_bw(dclk_max, 16 * c25_deprogbwpclimit, 100)); /* 60% */
+	ipqdepth = min(ipqdepthpch, sa->displayrtids / num_channels);
+
+	for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
+		struct intel_bw_info *bi = &dev_priv->max_bw[i];
+		int clpchgroup;
+		int j;
+
+		clpchgroup = (sa->deburst * deinterleave / num_channels) << i;
+		bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup;
+
+		bi->num_qgv_points = qi.num_points;
+
+		for (j = 0; j < qi.num_points; j++) {
+			const struct intel_qgv_point *sp = &qi.points[j];
+			int ct, bw;
+
+			/*
+			 * Max row cycle time
+			 *
+			 * FIXME what is the logic behind the
+			 * assumed burst length?
+			 */
+			ct = max_t(int, sp->t_rc, sp->t_rp + sp->t_rcd +
+				   (clpchgroup - 1) * qi.t_bl + sp->t_rdpre);
+			bw = icl_calc_bw(sp->dclk, clpchgroup * 32 * num_channels, ct);
+
+			bi->deratedbw[j] = min(maxdebw,
+					       bw * (100 - c3_derating) / 100); /* 90% */
+
+			DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
+				      i, j, bi->num_planes, bi->deratedbw[j]);
+		}
+
+		if (bi->num_planes == 1)
+			break;
+	}
+
+	return 0;
+}
+
 static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
 			       int num_planes, int qgv_point)
 {
@@ -231,10 +308,35 @@ static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
 	return 0;
 }
 
+static unsigned int tgl_max_bw(struct drm_i915_private *dev_priv,
+			       int num_planes, int qgv_point)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
+		const struct intel_bw_info *bi =
+			&dev_priv->max_bw[i];
+
+		/*
+		 * Pcode will not expose all QGV points when
+		 * SAGV is forced to off/min/med/max.
+		 */
+		if (qgv_point >= bi->num_qgv_points)
+			return UINT_MAX;
+
+		if (num_planes >= bi->num_planes)
+			return bi->deratedbw[qgv_point];
+	}
+
+	return 0;
+}
+
 void intel_bw_init_hw(struct drm_i915_private *dev_priv)
 {
 	if (IS_GEN(dev_priv, 11))
 		icl_get_bw_info(dev_priv);
+	else if (IS_GEN(dev_priv, 12))
+		tgl_get_bw_info(dev_priv);
 }
 
 static unsigned int intel_max_data_rate(struct drm_i915_private *dev_priv,
@@ -249,6 +351,10 @@ static unsigned int intel_max_data_rate(struct drm_i915_private *dev_priv,
 		return min3(icl_max_bw(dev_priv, num_planes, 0),
 			    icl_max_bw(dev_priv, num_planes, 1),
 			    icl_max_bw(dev_priv, num_planes, 2));
+	else if (IS_GEN(dev_priv, 12))
+		return min3(tgl_max_bw(dev_priv, num_planes, 0),
+			    tgl_max_bw(dev_priv, num_planes, 1),
+			    tgl_max_bw(dev_priv, num_planes, 2));
 	else
 		return UINT_MAX;
 }
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 16 lines · Stanislav Lisovskiy

Added bandwidth calculation algorithm and checks, similar way as it was done for ICL, some constants were corrected according to BSpec.

---
 drivers/gpu/drm/i915/display/intel_bw.c | 108 +++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_bw.c +0 -0
index 688858ebe4d0..e97d083f4f2a 100644

drivers/gpu/drm/i915/display/intel_bw.c static int icl_sagv_max_dclk(const struct intel_qgv_info *qi) · line 136

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_bw.c +2 -1
@@ -132,7 +132,8 @@ static int icl_sagv_max_dclk(const struct intel_qgv_info *qi)
 }
 
 struct intel_sa_info {
-	u8 deburst, mpagesize, deprogbwlimit, displayrtids;
+	u8 deburst, mpagesize, deprogbwlimit;
+	u16 displayrtids;

Put the u16 first to avoid holes in the middle of the struct.

Quoted 76 lines
drivers/gpu/drm/i915/display/intel_bw.c +62 -0
 };
 
 static const struct intel_sa_info icl_sa_info = {
@@ -142,6 +143,14 @@ static const struct intel_sa_info icl_sa_info = {
 	.displayrtids = 128,
 };
 
+static const struct intel_sa_info tgl_sa_info = {
+	.deburst = 16,
+	.mpagesize = 16,
+	.deprogbwlimit = 34, /* GB/s */
+	.displayrtids = 256,
+};
+
+
 static int icl_get_bw_info(struct drm_i915_private *dev_priv)
 {
 	struct intel_qgv_info qi = {};
@@ -208,6 +217,74 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv)
 	return 0;
 }
 
+static int tgl_get_bw_info(struct drm_i915_private *dev_priv)
+{
+	struct intel_qgv_info qi = {};
+	const struct intel_sa_info *sa = &tgl_sa_info;
+	bool is_y_tile = true; /* assume y tile may be used */
+	int num_channels;
+	int deinterleave;
+	int ipqdepth, ipqdepthpch;
+	int dclk_max;
+	int maxdebw;
+	int c3_derating = 10;
+	int c25_deprogbwpclimit = 60;
+	int i, ret;
+
+	ret = icl_get_qgv_points(dev_priv, &qi);
+	if (ret) {
+		DRM_DEBUG_KMS("Failed to get memory subsystem information, ignoring bandwidth limits");
+		return ret;
+	}
+	num_channels = qi.num_channels;
+
+	deinterleave = DIV_ROUND_UP(num_channels, is_y_tile ? 4 : 2);
+	dclk_max = icl_sagv_max_dclk(&qi);
+
+	ipqdepthpch = 16;
+
+	maxdebw = min(sa->deprogbwlimit * 1000,
+		      icl_calc_bw(dclk_max, 16 * c25_deprogbwpclimit, 100)); /* 60% */
+	ipqdepth = min(ipqdepthpch, sa->displayrtids / num_channels);
+
+	for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
+		struct intel_bw_info *bi = &dev_priv->max_bw[i];
+		int clpchgroup;
+		int j;
+
+		clpchgroup = (sa->deburst * deinterleave / num_channels) << i;
+		bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup;
+
+		bi->num_qgv_points = qi.num_points;
+
+		for (j = 0; j < qi.num_points; j++) {
+			const struct intel_qgv_point *sp = &qi.points[j];
+			int ct, bw;
+
+			/*
+			 * Max row cycle time
+			 *
+			 * FIXME what is the logic behind the
+			 * assumed burst length?
+			 */
+			ct = max_t(int, sp->t_rc, sp->t_rp + sp->t_rcd +
+				   (clpchgroup - 1) * qi.t_bl + sp->t_rdpre);
+			bw = icl_calc_bw(sp->dclk, clpchgroup * 32 * num_channels, ct);
+

drivers/gpu/drm/i915/display/intel_bw.c static int icl_get_bw_info(struct drm_i915_private *dev_priv) · line 283

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_bw.c +10 -0
+			bi->deratedbw[j] = min(maxdebw,
+					       bw * (100 - c3_derating) / 100); /* 90% */
+
+			DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
+				      i, j, bi->num_planes, bi->deratedbw[j]);
+		}
+
+		if (bi->num_planes == 1)
+			break;
+	}

We don't want to duplicate the entire function. Pretty much the whole point of having the sa_info struct is to make this parametrized.

Quoted 61 lines
drivers/gpu/drm/i915/display/intel_bw.c +33 -0
+
+	return 0;
+}
+
 static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
 			       int num_planes, int qgv_point)
 {
@@ -231,10 +308,35 @@ static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
 	return 0;
 }
 
+static unsigned int tgl_max_bw(struct drm_i915_private *dev_priv,
+			       int num_planes, int qgv_point)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
+		const struct intel_bw_info *bi =
+			&dev_priv->max_bw[i];
+
+		/*
+		 * Pcode will not expose all QGV points when
+		 * SAGV is forced to off/min/med/max.
+		 */
+		if (qgv_point >= bi->num_qgv_points)
+			return UINT_MAX;
+
+		if (num_planes >= bi->num_planes)
+			return bi->deratedbw[qgv_point];
+	}
+
+	return 0;
+}
+
 void intel_bw_init_hw(struct drm_i915_private *dev_priv)
 {
 	if (IS_GEN(dev_priv, 11))
 		icl_get_bw_info(dev_priv);
+	else if (IS_GEN(dev_priv, 12))
+		tgl_get_bw_info(dev_priv);
 }
 
 static unsigned int intel_max_data_rate(struct drm_i915_private *dev_priv,
@@ -249,6 +351,10 @@ static unsigned int intel_max_data_rate(struct drm_i915_private *dev_priv,
 		return min3(icl_max_bw(dev_priv, num_planes, 0),
 			    icl_max_bw(dev_priv, num_planes, 1),
 			    icl_max_bw(dev_priv, num_planes, 2));
+	else if (IS_GEN(dev_priv, 12))
+		return min3(tgl_max_bw(dev_priv, num_planes, 0),
+			    tgl_max_bw(dev_priv, num_planes, 1),
+			    tgl_max_bw(dev_priv, num_planes, 2));
 	else
 		return UINT_MAX;
 }
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add TigerLake bandwidth checking

In reply to Stanislav Lisovskiy
== Series Details ==

== Series Details ==

Series: drm/i915: Add TigerLake bandwidth checking
URL : https://patchwork.freedesktop.org/series/66817/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
b3e5a03f489c drm/i915: Add TigerLake bandwidth checking
-:39: CHECK:LINE_SPACING: Please don't use multiple blank lines
#39: FILE: drivers/gpu/drm/i915/display/intel_bw.c:153:
+
+

total: 0 errors, 0 warnings, 1 checks, 142 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✓ Fi.CI.BAT: success for drm/i915: Add TigerLake bandwidth checking

In reply to Stanislav Lisovskiy
== Series Details ==

== Series Details ==

Series: drm/i915: Add TigerLake bandwidth checking
URL : https://patchwork.freedesktop.org/series/66817/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6910 -> Patchwork_14433
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_14433:

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@gem_render_tiled_blits@basic:
- {fi-tgl-u}: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-tgl-u/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-tgl-u/igt@[email protected]

Known issues
------------

Here are the changes found in Patchwork_14433 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_create@basic-files:
- fi-cml-u2: [PASS][3] -> [INCOMPLETE][4] ([fdo#110566])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-cml-u2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-cml-u2/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- fi-icl-u3: [PASS][5] -> [DMESG-WARN][6] ([fdo#107724]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-icl-u3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-icl-u3/igt@[email protected]

#### Possible fixes ####

* igt@kms_chamelium@dp-edid-read:
- fi-kbl-7500u: [WARN][7] ([fdo#109483]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-kbl-7500u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-kbl-7500u/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-apl-guc: [DMESG-WARN][9] ([fdo#103558]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-apl-guc/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-apl-guc/igt@[email protected]

* igt@prime_busy@basic-wait-before-default:
- fi-icl-u3: [DMESG-WARN][11] ([fdo#107724]) -> [PASS][12] +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-icl-u3/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-icl-u3/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- fi-ilk-650: [DMESG-WARN][13] ([fdo#106387]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-ilk-650/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-ilk-650/igt@[email protected]

#### Warnings ####

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][15] ([fdo#111096]) -> [FAIL][16] ([fdo#111407])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/fi-kbl-7500u/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/fi-kbl-7500u/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#106387]: https://bugs.freedesktop.org/show_bug.cgi?id=106387
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109483]: https://bugs.freedesktop.org/show_bug.cgi?id=109483
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407

Participating hosts (52 -> 48)
------------------------------

Additional (1): fi-kbl-soraka
Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-y fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_6910 -> Patchwork_14433

CI-20190529: 20190529
CI_DRM_6910: 4bed63ef83f108048a4fe3e3ac651ef0a32540ef @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5189: c78b9959fa4050725b16d55a5e56315884a2753d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14433: b3e5a03f489ce9e2ef31dc1afbe533955fd90caa @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

b3e5a03f489c drm/i915: Add TigerLake bandwidth checking

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
In reply to Stanislav Lisovskiy
Quoted 3 lines · Stanislav Lisovskiy

Added bandwidth calculation algorithm and checks, similar way as it was done for ICL, some constants were corrected according to BSpec.

Heh - I'd been working in this same area, and had some code written up, but your patch made it to the list first. :)

Quoted 23 lines
---
 drivers/gpu/drm/i915/display/intel_bw.c | 108 +++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_bw.c +2 -1
index 688858ebe4d0..e97d083f4f2a 100644
@@ -132,7 +132,8 @@ static int icl_sagv_max_dclk(const struct intel_qgv_info *qi)
 }
 
 struct intel_sa_info {
-	u8 deburst, mpagesize, deprogbwlimit, displayrtids;
+	u8 deburst, mpagesize, deprogbwlimit;
+	u16 displayrtids;
 };
 
 static const struct intel_sa_info icl_sa_info = {

drivers/gpu/drm/i915/display/intel_bw.c static const struct intel_sa_info icl_sa_info = { · line 148

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_bw.c +3 -0
@@ -142,6 +143,14 @@ static const struct intel_sa_info icl_sa_info = {
 	.displayrtids = 128,
 };
 
+static const struct intel_sa_info tgl_sa_info = {
+	.deburst = 16,
+	.mpagesize = 16,

This should be 16 only for DDR4, and 32 otherwise - however, it's not actually used anywhere, so it doesn't matter, but a comment (in case it needs to be used in the future) would be good.

Quoted 54 lines
drivers/gpu/drm/i915/display/intel_bw.c +47 -0
+	.deprogbwlimit = 34, /* GB/s */
+	.displayrtids = 256,
+};
+
+
 static int icl_get_bw_info(struct drm_i915_private *dev_priv)
 {
 	struct intel_qgv_info qi = {};
@@ -208,6 +217,74 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv)
 	return 0;
 }
 
+static int tgl_get_bw_info(struct drm_i915_private *dev_priv)
+{
+	struct intel_qgv_info qi = {};
+	const struct intel_sa_info *sa = &tgl_sa_info;
+	bool is_y_tile = true; /* assume y tile may be used */
+	int num_channels;
+	int deinterleave;
+	int ipqdepth, ipqdepthpch;
+	int dclk_max;
+	int maxdebw;
+	int c3_derating = 10;
+	int c25_deprogbwpclimit = 60;
+	int i, ret;
+
+	ret = icl_get_qgv_points(dev_priv, &qi);
+	if (ret) {
+		DRM_DEBUG_KMS("Failed to get memory subsystem information, ignoring bandwidth limits");
+		return ret;
+	}
+	num_channels = qi.num_channels;
+
+	deinterleave = DIV_ROUND_UP(num_channels, is_y_tile ? 4 : 2);
+	dclk_max = icl_sagv_max_dclk(&qi);
+
+	ipqdepthpch = 16;
+
+	maxdebw = min(sa->deprogbwlimit * 1000,
+		      icl_calc_bw(dclk_max, 16 * c25_deprogbwpclimit, 100)); /* 60% */
+	ipqdepth = min(ipqdepthpch, sa->displayrtids / num_channels);
+
+	for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
+		struct intel_bw_info *bi = &dev_priv->max_bw[i];
+		int clpchgroup;
+		int j;
+
+		clpchgroup = (sa->deburst * deinterleave / num_channels) << i;
+		bi->num_planes = (ipqdepth - clpchgroup) / clpchgroup;
+
+		bi->num_qgv_points = qi.num_points;
+
+		for (j = 0; j < qi.num_points; j++) {
+			const struct intel_qgv_point *sp = &qi.points[j];

drivers/gpu/drm/i915/display/intel_bw.c static int icl_get_bw_info(struct drm_i915_private *dev_priv) · line 271

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_bw.c +10 -0
+			int ct, bw;
+
+			/*
+			 * Max row cycle time
+			 *
+			 * FIXME what is the logic behind the
+			 * assumed burst length?
+			 */
+			ct = max_t(int, sp->t_rc, sp->t_rp + sp->t_rcd +
+				   (clpchgroup - 1) * qi.t_bl + sp->t_rdpre);

qi.t_bl also needs to be set dynamically based on memory type - for DDR4, 4, otherwise 16

-James

Quoted 73 lines
drivers/gpu/drm/i915/display/intel_bw.c +45 -0
+			bw = icl_calc_bw(sp->dclk, clpchgroup * 32 * num_channels, ct);
+
+			bi->deratedbw[j] = min(maxdebw,
+					       bw * (100 - c3_derating) / 100); /* 90% */
+
+			DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
+				      i, j, bi->num_planes, bi->deratedbw[j]);
+		}
+
+		if (bi->num_planes == 1)
+			break;
+	}
+
+	return 0;
+}
+
 static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
 			       int num_planes, int qgv_point)
 {
@@ -231,10 +308,35 @@ static unsigned int icl_max_bw(struct drm_i915_private *dev_priv,
 	return 0;
 }
 
+static unsigned int tgl_max_bw(struct drm_i915_private *dev_priv,
+			       int num_planes, int qgv_point)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dev_priv->max_bw); i++) {
+		const struct intel_bw_info *bi =
+			&dev_priv->max_bw[i];
+
+		/*
+		 * Pcode will not expose all QGV points when
+		 * SAGV is forced to off/min/med/max.
+		 */
+		if (qgv_point >= bi->num_qgv_points)
+			return UINT_MAX;
+
+		if (num_planes >= bi->num_planes)
+			return bi->deratedbw[qgv_point];
+	}
+
+	return 0;
+}
+
 void intel_bw_init_hw(struct drm_i915_private *dev_priv)
 {
 	if (IS_GEN(dev_priv, 11))
 		icl_get_bw_info(dev_priv);
+	else if (IS_GEN(dev_priv, 12))
+		tgl_get_bw_info(dev_priv);
 }
 
 static unsigned int intel_max_data_rate(struct drm_i915_private *dev_priv,
@@ -249,6 +351,10 @@ static unsigned int intel_max_data_rate(struct drm_i915_private *dev_priv,
 		return min3(icl_max_bw(dev_priv, num_planes, 0),
 			    icl_max_bw(dev_priv, num_planes, 1),
 			    icl_max_bw(dev_priv, num_planes, 2));
+	else if (IS_GEN(dev_priv, 12))
+		return min3(tgl_max_bw(dev_priv, num_planes, 0),
+			    tgl_max_bw(dev_priv, num_planes, 1),
+			    tgl_max_bw(dev_priv, num_planes, 2));
 	else
 		return UINT_MAX;
 }
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✓ Fi.CI.IGT: success for drm/i915: Add TigerLake bandwidth checking

In reply to Stanislav Lisovskiy
== Series Details ==

== Series Details ==

Series: drm/i915: Add TigerLake bandwidth checking
URL : https://patchwork.freedesktop.org/series/66817/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6910_full -> Patchwork_14433_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Known issues
------------

Here are the changes found in Patchwork_14433_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_isolation@rcs0-s3:
- shard-apl: [PASS][1] -> [DMESG-WARN][2] ([fdo#108566]) +5 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-apl6/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-apl3/igt@[email protected]

* igt@gem_exec_balancer@nop:
- shard-apl: [PASS][3] -> [INCOMPLETE][4] ([fdo#103927]) +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-apl3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-apl4/igt@[email protected]

* igt@gem_exec_schedule@pi-ringfull-bsd:
- shard-iclb: [PASS][5] -> [SKIP][6] ([fdo#111325]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb6/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb4/igt@[email protected]

* igt@gem_softpin@noreloc-s3:
- shard-iclb: [PASS][7] -> [INCOMPLETE][8] ([fdo#107713] / [fdo#109100])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb6/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb3/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-hsw: [PASS][9] -> [FAIL][10] ([fdo#105767])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-hsw5/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-hsw6/igt@[email protected]

* igt@kms_flip@flip-vs-modeset-interruptible:
- shard-iclb: [PASS][11] -> [INCOMPLETE][12] ([fdo#107713])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb7/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb7/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103167]) +2 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html

* igt@kms_frontbuffer_tracking@fbcpsr-1p-rte:
- shard-iclb: [PASS][15] -> [FAIL][16] ([fdo#103167] / [fdo#110378])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb6/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb2/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
- shard-snb: [PASS][17] -> [SKIP][18] ([fdo#109271]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-snb5/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-snb4/igt@[email protected]

* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][19] -> [SKIP][20] ([fdo#109441]) +1 similar issue
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb8/igt@kms_psr@psr2_cursor_render.html

* igt@kms_setmode@basic:
- shard-kbl: [PASS][21] -> [FAIL][22] ([fdo#99912])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-kbl2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-kbl2/igt@[email protected]

* igt@perf@blocking:
- shard-skl: [PASS][23] -> [FAIL][24] ([fdo#110728])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-skl6/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-skl7/igt@[email protected]

* igt@prime_busy@after-bsd2:
- shard-iclb: [PASS][25] -> [SKIP][26] ([fdo#109276]) +12 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb1/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb7/igt@[email protected]

#### Possible fixes ####

* igt@gem_eio@reset-stress:
- shard-glk: [FAIL][27] ([fdo#109661]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-glk2/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-glk8/igt@[email protected]

* igt@gem_eio@unwedge-stress:
- shard-snb: [FAIL][29] ([fdo#109661]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-snb2/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-snb1/igt@[email protected]

* igt@gem_exec_balancer@smoke:
- shard-iclb: [SKIP][31] ([fdo#110854]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb6/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb2/igt@[email protected]

* igt@gem_exec_schedule@preempt-queue-bsd1:
- shard-iclb: [SKIP][33] ([fdo#109276]) -> [PASS][34] +8 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb5/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb2/igt@[email protected]

* igt@gem_exec_schedule@wide-bsd:
- shard-iclb: [SKIP][35] ([fdo#111325]) -> [PASS][36] +3 similar issues
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb1/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb7/igt@[email protected]

* igt@gem_tiled_swapping@non-threaded:
- shard-apl: [DMESG-WARN][37] ([fdo#108686]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-apl3/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-apl2/igt@[email protected]

* igt@i915_suspend@sysfs-reader:
- shard-apl: [DMESG-WARN][39] ([fdo#108566]) -> [PASS][40] +5 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-apl1/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-apl1/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-skl: [INCOMPLETE][41] ([fdo#110741]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-skl10/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-skl3/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
- shard-hsw: [FAIL][43] ([fdo#105767]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-hsw6/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-hsw5/igt@[email protected]

* igt@kms_draw_crc@draw-method-xrgb8888-pwrite-ytiled:
- shard-skl: [FAIL][45] ([fdo#103184] / [fdo#103232] / [fdo#108222]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-skl3/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-skl10/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: [FAIL][47] ([fdo#105363]) -> [PASS][48] +1 similar issue
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-skl6/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-skl3/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: [FAIL][49] ([fdo#105363]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-glk1/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-glk5/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-snb: [INCOMPLETE][51] ([fdo#105411]) -> [PASS][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-snb1/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-snb5/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: [FAIL][53] ([fdo#103167]) -> [PASS][54] +3 similar issues
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [FAIL][55] ([fdo#108145] / [fdo#110403]) -> [PASS][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-skl2/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-skl5/igt@[email protected]

* igt@kms_psr@psr2_cursor_mmap_cpu:
- shard-iclb: [SKIP][57] ([fdo#109441]) -> [PASS][58] +1 similar issue
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb5/igt@kms_psr@psr2_cursor_mmap_cpu.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html

#### Warnings ####

* igt@gem_ctx_isolation@vcs1-nonpriv:
- shard-iclb: [SKIP][59] ([fdo#109276]) -> [FAIL][60] ([fdo#111329])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb6/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb4/igt@[email protected]

* igt@gem_mocs_settings@mocs-isolation-bsd2:
- shard-iclb: [FAIL][61] ([fdo#111330]) -> [SKIP][62] ([fdo#109276])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb2/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb8/igt@[email protected]

* igt@gem_mocs_settings@mocs-reset-bsd2:
- shard-iclb: [SKIP][63] ([fdo#109276]) -> [FAIL][64] ([fdo#111330])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-iclb5/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-iclb2/igt@[email protected]

* igt@kms_vblank@pipe-c-ts-continuation-modeset-hang:
- shard-snb: [SKIP][65] ([fdo#109271] / [fdo#109278]) -> [SKIP][66] ([fdo#109271])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6910/shard-snb5/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14433/shard-snb4/igt@[email protected]

[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108222]: https://bugs.freedesktop.org/show_bug.cgi?id=108222
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#110378]: https://bugs.freedesktop.org/show_bug.cgi?id=110378
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
[fdo#110741]: https://bugs.freedesktop.org/show_bug.cgi?id=110741
[fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
[fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
[fdo#111329]: https://bugs.freedesktop.org/show_bug.cgi?id=111329
[fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_6910 -> Patchwork_14433

CI-20190529: 20190529
CI_DRM_6910: 4bed63ef83f108048a4fe3e3ac651ef0a32540ef @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5189: c78b9959fa4050725b16d55a5e56315884a2753d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14433: b3e5a03f489ce9e2ef31dc1afbe533955fd90caa @ 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_14433/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx