Skip to contentSkip to conversation

C20 Computed HDMI TMDS pixel clocks

PATCH Applied Clint Taylor 3 participants 11 messages May 15, 2023 – May 19, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover C20 Computed HDMI TMDS pixel clocks

Use computed C20 HDMI TMDS pixel clocks to support 25.175MHz to 594000MHz modes. Add 16 Bit mask operators to support C20 phy programming.

v2: checkpatch fixes
BSPEC: 64568

Cc Imre Deak <[email protected]>
Cc Mika Kahola <[email protected]>
Cc Radhakrishna Sripada <[email protected]>
Cc Gustavo Sousa <[email protected]>

Clint Taylor (2):
drm/i915: Add 16bit register/mask operators
drm/i915/hdmi: C20 computed PLL frequencies

 drivers/gpu/drm/i915/display/intel_cx0_phy.c  | 89 +++++++++++++++++--
 .../gpu/drm/i915/display/intel_cx0_phy_regs.h | 53 +++++++++++
 drivers/gpu/drm/i915/i915_reg_defs.h          | 48 ++++++++++
 3 files changed, 184 insertions(+), 6 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/2 drm/i915: Add 16bit register/mask operators

Add the support macros to define/extract bits as 16bits.

v2: checkpatch fixes

---
 drivers/gpu/drm/i915/i915_reg_defs.h | 48 ++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
drivers/gpu/drm/i915/i915_reg_defs.h +48 -0
index 622d603080f9..a685db1e815d 100644
@@ -143,6 +143,54 @@
  */
 #define REG_FIELD_GET64(__mask, __val)	((u64)FIELD_GET(__mask, __val))
 
+/**
+ * REG_BIT16() - Prepare a u16 bit value
+ * @__n: 0-based bit number
+ *
+ * Local wrapper for BIT() to force u16, with compile time
+ * checks.
+ *
+ * @return: Value with bit @__n set.
+ */
+#define REG_BIT16(__n)                                                   \
+	((u16)(BIT(__n) +                                                \
+	       BUILD_BUG_ON_ZERO(__is_constexpr(__n) &&         \
+				 ((__n) < 0 || (__n) > 15))))
+
+/**
+ * REG_GENMASK16() - Prepare a continuous u8 bitmask
+ * @__high: 0-based high bit
+ * @__low: 0-based low bit
+ *
+ * Local wrapper for GENMASK() to force u16, with compile time
+ * checks.
+ *
+ * @return: Continuous bitmask from @__high to @__low, inclusive.
+ */
+#define REG_GENMASK16(__high, __low)                                     \
+	((u16)(GENMASK(__high, __low) +                                  \
+	       BUILD_BUG_ON_ZERO(__is_constexpr(__high) &&      \
+				 __is_constexpr(__low) &&               \
+				 ((__low) < 0 || (__high) > 15 || (__low) > (__high)))))
+
+/**
+ * REG_FIELD_PREP16() - Prepare a u16 bitfield value
+ * @__mask: shifted mask defining the field's length and position
+ * @__val: value to put in the field
+ *
+ * Local copy of FIELD_PREP16() to generate an integer constant
+ * expression, force u8 and for consistency with
+ * REG_FIELD_GET16(), REG_BIT16() and REG_GENMASK16().
+ *
+ * @return: @__val masked and shifted into the field defined by @__mask.
+ */
+#define REG_FIELD_PREP16(__mask, __val)                                          \
+	((u16)((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) +      \
+	       BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) +             \
+	       BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U16_MAX) +          \
+	       BUILD_BUG_ON_ZERO(!IS_POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	       BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))
+
 #define __MASKED_FIELD(mask, value) ((mask) << 16 | (value))
 #define _MASKED_FIELD(mask, value) ({					   \
 	if (__builtin_constant_p(mask))					   \
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/2 drm/i915/hdmi: C20 computed PLL frequencies

In reply to Clint Taylor

Use algorithm to generate HDMI C20 PLL clock frequencies. i
v2: checkpatch fixes
BSPEC: 64568

Cc Radhakrishna Sripada <[email protected]>
Cc Mika Kahola <[email protected]>
Cc Anusha Srivatsa <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_cx0_phy.c  | 89 +++++++++++++++++--
 .../gpu/drm/i915/display/intel_cx0_phy_regs.h | 53 +++++++++++
 2 files changed, 136 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/display/intel_cx0_phy.c +83 -6
index ef0615cdc8a0..e04cdf89dbe9 100644
@@ -3,6 +3,8 @@
  * Copyright © 2023 Intel Corporation
  */
 
+#include <linux/log2.h>
+#include <linux/math64.h>
 #include "i915_reg.h"
 #include "intel_cx0_phy.h"
 #include "intel_cx0_phy_regs.h"
@@ -1901,6 +1903,74 @@ void intel_c10pll_dump_hw_state(struct drm_i915_private *i915,
 			    i + 2, hw_state->pll[i + 2], i + 3, hw_state->pll[i + 3]);
 }
 
+static int intel_c20_compute_hdmi_tmds_pll(u64 pixel_clock, struct intel_c20pll_state *pll_state)
+{
+	u64 datarate;
+	u64 mpll_tx_clk_div;
+	u64 vco_freq_shift;
+	u64 vco_freq;
+	u64 multiplier;
+	u64 mpll_multiplier;
+	u64 mpll_fracn_quot;
+	u64 mpll_fracn_rem;
+	u8  mpllb_ana_freq_vco;
+	u8  mpll_div_multiplier;
+
+	if (pixel_clock < 25175 || pixel_clock > 600000)
+		return -EINVAL;
+
+	datarate = ((u64)pixel_clock * 1000) * 10;
+	mpll_tx_clk_div = ilog2(div64_u64((u64)CLOCK_9999MHZ, (u64)datarate));
+	vco_freq_shift = ilog2(div64_u64((u64)CLOCK_4999MHZ * (u64)256, (u64)datarate));
+	vco_freq = (datarate << vco_freq_shift) >> 8;
+	multiplier = div64_u64((vco_freq << 28), (REFCLK_38_4_MHZ >> 4));
+	mpll_multiplier = 2 * (multiplier >> 32);
+
+	mpll_fracn_quot = (multiplier >> 16) & 0xFFFF;
+	mpll_fracn_rem  = multiplier & 0xFFFF;
+
+	mpll_div_multiplier = min_t(u8, div64_u64((vco_freq * 16 + (datarate >> 1)), datarate), 255);
+
+	if (vco_freq <= DATARATE_3000000000)
+		mpllb_ana_freq_vco = MPLLB_ANA_FREQ_VCO_3;
+	else if (vco_freq <= DATARATE_3500000000)
+		mpllb_ana_freq_vco = MPLLB_ANA_FREQ_VCO_2;
+	else if (vco_freq <= DATARATE_4000000000)
+		mpllb_ana_freq_vco = MPLLB_ANA_FREQ_VCO_1;
+	else
+		mpllb_ana_freq_vco = MPLLB_ANA_FREQ_VCO_0;
+
+	pll_state->link_bit_rate	= pixel_clock;
+	pll_state->clock	= pixel_clock;
+	pll_state->tx[0]	= 0xbe88;
+	pll_state->tx[1]	= 0x9800;
+	pll_state->tx[2]	= 0x0000;
+	pll_state->cmn[0]	= 0x0500;
+	pll_state->cmn[1]	= 0x0005;
+	pll_state->cmn[2]	= 0x0000;
+	pll_state->cmn[3]	= 0x0000;
+	pll_state->mpllb[0]	= (MPLL_TX_CLK_DIV(mpll_tx_clk_div) |
+				   MPLL_MULTIPLIER(mpll_multiplier));
+	pll_state->mpllb[1]	= (CAL_DAC_CODE(CAL_DAC_CODE_31) |
+				   WORD_CLK_DIV |
+				   MPLL_DIV_MULTIPLIER(mpll_div_multiplier));
+	pll_state->mpllb[2]	= (MPLLB_ANA_FREQ_VCO(mpllb_ana_freq_vco) |
+				   CP_PROP(CP_PROP_20) |
+				   CP_INT(CP_INT_6));
+	pll_state->mpllb[3]	= (V2I(V2I_2) |
+				   CP_PROP_GS(CP_PROP_GS_30) |
+				   CP_INT_GS(CP_INT_GS_28));
+	pll_state->mpllb[4]	= 0x0000;
+	pll_state->mpllb[5]	= 0x0000;
+	pll_state->mpllb[6]	= (C20_MPLLB_FRACEN | SSC_UP_SPREAD);
+	pll_state->mpllb[7]	= MPLL_FRACN_DEN;
+	pll_state->mpllb[8]	= mpll_fracn_quot;
+	pll_state->mpllb[9]	= mpll_fracn_rem;
+	pll_state->mpllb[10]	= HDMI_DIV(HDMI_DIV_1);
+
+	return 0;
+}
+
 static int intel_c20_phy_check_hdmi_link_rate(int clock)
 {
 	const struct intel_c20pll_state * const *tables = mtl_c20_hdmi_tables;
@@ -1911,6 +1981,9 @@ static int intel_c20_phy_check_hdmi_link_rate(int clock)
 			return MODE_OK;
 	}
 
+	if (clock >= 25175 && clock <= 594000)
+		return MODE_OK;
+
 	return MODE_CLOCK_RANGE;
 }
 
@@ -1944,6 +2017,13 @@ static int intel_c20pll_calc_state(struct intel_crtc_state *crtc_state,
 	const struct intel_c20pll_state * const *tables;
 	int i;
 
+	/* try computed C20 HDMI tables before using consolidated tables */
+	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) {
+		if (intel_c20_compute_hdmi_tmds_pll(crtc_state->port_clock,
+						    &crtc_state->cx0pll_state.c20) == 0)
+			return 0;
+	}
+
 	tables = intel_c20_pll_tables_get(crtc_state, encoder);
 	if (!tables)
 		return -EINVAL;
@@ -2093,13 +2173,10 @@ static u8 intel_c20_get_dp_rate(u32 clock)
 
 static u8 intel_c20_get_hdmi_rate(u32 clock)
 {
-	switch (clock) {
-	case 25175:
-	case 27000:
-	case 74250:
-	case 148500:
-	case 594000:
+	if (clock >= 25175 && clock <= 600000)
 		return 0;
+
+	switch (clock) {
 	case 166670: /* 3 Gbps */
 	case 333330: /* 6 Gbps */
 	case 666670: /* 12 Gbps */
drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h +53 -0

57 lines not on this page · raw message

Signature · 1 line
2.25.1
#3 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for C20 Computed HDMI TMDS pixel clocks (rev2)

In reply to Clint Taylor
== Series Details ==

== Series Details ==

Series: C20 Computed HDMI TMDS pixel clocks (rev2)
URL : https://patchwork.freedesktop.org/series/117399/
State : warning

== Summary ==

Error: dim checkpatch failed
7374d5d94fea drm/i915: Add 16bit register/mask operators
-:29: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__n' - possible side-effects? #29: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:155:
+#define REG_BIT16(__n) \
+ ((u16)(BIT(__n) + \
+ BUILD_BUG_ON_ZERO(__is_constexpr(__n) && \
+ ((__n) < 0 || (__n) > 15))))

-:44: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__high' - possible side-effects? #44: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:170:
+#define REG_GENMASK16(__high, __low) \
+ ((u16)(GENMASK(__high, __low) + \
+ BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \
+ __is_constexpr(__low) && \
+ ((__low) < 0 || (__high) > 15 || (__low) > (__high)))))

-:44: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__low' - possible side-effects? #44: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:170:
+#define REG_GENMASK16(__high, __low) \
+ ((u16)(GENMASK(__high, __low) + \
+ BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \
+ __is_constexpr(__low) && \
+ ((__low) < 0 || (__high) > 15 || (__low) > (__high)))))

-:61: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__mask' - possible side-effects? #61: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:187:
+#define REG_FIELD_PREP16(__mask, __val) \
+ ((u16)((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) + \

+	       BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) +             \
+	       BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U16_MAX) +          \
+	       BUILD_BUG_ON_ZERO(!IS_POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	       BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))

-:61: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__val' - possible side-effects? #61: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:187:
+#define REG_FIELD_PREP16(__mask, __val) \
+ ((u16)((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) + \

+	       BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) +             \
+	       BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U16_MAX) +          \
+	       BUILD_BUG_ON_ZERO(!IS_POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	       BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))

-:66: WARNING:LONG_LINE: line length of 128 exceeds 100 columns #66: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:192:
+ BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))

total: 0 errors, 1 warnings, 5 checks, 54 lines checked f585a9123138 drm/i915/hdmi: C20 computed PLL frequencies -:59: WARNING:LONG_LINE: line length of 101 exceeds 100 columns #59: FILE: drivers/gpu/drm/i915/display/intel_cx0_phy.c:1932:
+ mpll_div_multiplier = min_t(u8, div64_u64((vco_freq * 16 + (datarate >> 1)), datarate), 255);

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

#5 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for C20 Computed HDMI TMDS pixel clocks (rev2)

In reply to Clint Taylor
== Series Details ==

== Series Details ==

Series: C20 Computed HDMI TMDS pixel clocks (rev2)
URL : https://patchwork.freedesktop.org/series/117399/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13149 -> Patchwork_117399v2
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_117399v2 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_117399v2, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/index.html

Participating hosts (38 -> 37)
------------------------------

Missing (1): fi-snb-2520m

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_module_load@load:
- bat-adls-5: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13149/bat-adls-5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-adls-5/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_backlight@basic-brightness@edp-1:
- bat-rplp-1: NOTRUN -> [ABORT][3] ([i915#7077])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-rplp-1/igt@i915_pm_backlight@[email protected]

* igt@i915_selftest@live@requests:
- bat-rpls-2: [PASS][4] -> [ABORT][5] ([i915#4983] / [i915#7913])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13149/bat-rpls-2/igt@i915_selftest@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-rpls-2/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- bat-rpls-1: NOTRUN -> [DMESG-WARN][6] ([i915#6367] / [i915#7953])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@i915_suspend@basic-s3-without-i915:
- bat-rpls-1: NOTRUN -> [ABORT][7] ([i915#6687] / [i915#7953] / [i915#7978])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-rpls-1/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc:
- bat-adlp-9: NOTRUN -> [SKIP][8] ([i915#3546]) +1 similar issue
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-adlp-9/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@gt_heartbeat:
- fi-kbl-soraka: [DMESG-FAIL][9] ([i915#5334] / [i915#7872]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13149/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_selftest@live@requests:
- {bat-mtlp-6}: [ABORT][11] ([i915#4983] / [i915#7920] / [i915#7953]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13149/bat-mtlp-6/igt@i915_selftest@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-mtlp-6/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@reset:
- bat-rpls-1: [ABORT][13] ([i915#4983] / [i915#7461] / [i915#7953] / [i915#8347] / [i915#8384]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13149/bat-rpls-1/igt@i915_selftest@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-rpls-1/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@kms_setmode@basic-clone-single-crtc:
- bat-rplp-1: [ABORT][15] ([i915#4579] / [i915#8260]) -> [SKIP][16] ([i915#3555] / [i915#4579])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13149/bat-rplp-1/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/bat-rplp-1/igt@[email protected]

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

[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#7077]: https://gitlab.freedesktop.org/drm/intel/issues/7077
[i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920
[i915#7953]: https://gitlab.freedesktop.org/drm/intel/issues/7953
[i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
[i915#8260]: https://gitlab.freedesktop.org/drm/intel/issues/8260
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
[i915#8384]: https://gitlab.freedesktop.org/drm/intel/issues/8384

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

* Linux: CI_DRM_13149 -> Patchwork_117399v2

CI-20190529: 20190529
CI_DRM_13149: 9bebeeea1972b311c83012ed7507a34bc4b6a723 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7292: 9d9475ffd3b5ae18fd8ec120595385f6c562f249 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117399v2: 9bebeeea1972b311c83012ed7507a34bc4b6a723 @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

d03ab88884e5 drm/i915/hdmi: C20 computed PLL frequencies 4f762ac1cd43 drm/i915: Add 16bit register/mask operators

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v2/index.html

#6 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for C20 Computed HDMI TMDS pixel clocks (rev3)

In reply to Clint Taylor
== Series Details ==

== Series Details ==

Series: C20 Computed HDMI TMDS pixel clocks (rev3)
URL : https://patchwork.freedesktop.org/series/117399/
State : warning

== Summary ==

Error: dim checkpatch failed
eb47be209dd5 drm/i915: Add 16bit register/mask operators
-:29: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__n' - possible side-effects? #29: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:155:
+#define REG_BIT16(__n) \
+ ((u16)(BIT(__n) + \
+ BUILD_BUG_ON_ZERO(__is_constexpr(__n) && \
+ ((__n) < 0 || (__n) > 15))))

-:44: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__high' - possible side-effects? #44: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:170:
+#define REG_GENMASK16(__high, __low) \
+ ((u16)(GENMASK(__high, __low) + \
+ BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \
+ __is_constexpr(__low) && \
+ ((__low) < 0 || (__high) > 15 || (__low) > (__high)))))

-:44: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__low' - possible side-effects? #44: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:170:
+#define REG_GENMASK16(__high, __low) \
+ ((u16)(GENMASK(__high, __low) + \
+ BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \
+ __is_constexpr(__low) && \
+ ((__low) < 0 || (__high) > 15 || (__low) > (__high)))))

-:61: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__mask' - possible side-effects? #61: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:187:
+#define REG_FIELD_PREP16(__mask, __val) \
+ ((u16)((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) + \

+	       BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) +             \
+	       BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U16_MAX) +          \
+	       BUILD_BUG_ON_ZERO(!IS_POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	       BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))

-:61: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__val' - possible side-effects? #61: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:187:
+#define REG_FIELD_PREP16(__mask, __val) \
+ ((u16)((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) + \

+	       BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) +             \
+	       BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U16_MAX) +          \
+	       BUILD_BUG_ON_ZERO(!IS_POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	       BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))

-:66: WARNING:LONG_LINE: line length of 128 exceeds 100 columns #66: FILE: drivers/gpu/drm/i915/i915_reg_defs.h:192:
+ BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))

total: 0 errors, 1 warnings, 5 checks, 54 lines checked c95baea0d04b drm/i915/hdmi: C20 computed PLL frequencies -:59: WARNING:LONG_LINE: line length of 101 exceeds 100 columns #59: FILE: drivers/gpu/drm/i915/display/intel_cx0_phy.c:1932:
+ mpll_div_multiplier = min_t(u8, div64_u64((vco_freq * 16 + (datarate >> 1)), datarate), 255);

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

#8 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for C20 Computed HDMI TMDS pixel clocks (rev3)

In reply to Clint Taylor
== Series Details ==

== Series Details ==

Series: C20 Computed HDMI TMDS pixel clocks (rev3)
URL : https://patchwork.freedesktop.org/series/117399/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13164 -> Patchwork_117399v3
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_117399v3 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_117399v3, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/index.html

Participating hosts (39 -> 36)
------------------------------

Missing (3): fi-kbl-soraka fi-snb-2520m fi-bsw-n3050

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

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

### IGT changes ###

#### Possible regressions ####

* igt@kms_pipe_crc_basic@read-crc@pipe-c-edp-1:
- bat-adlp-6: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-adlp-6/igt@kms_pipe_crc_basic@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-adlp-6/igt@kms_pipe_crc_basic@[email protected]

#### Suppressed ####

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

* igt@i915_selftest@live@migrate:
- {bat-mtlp-8}: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-mtlp-8/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-mtlp-8/igt@i915_selftest@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@gt_engines:
- bat-atsm-1: [PASS][5] -> [FAIL][6] ([i915#6268])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-atsm-1/igt@i915_selftest@live@gt_engines.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-atsm-1/igt@i915_selftest@live@gt_engines.html

* igt@i915_selftest@live@gt_pm:
- bat-rpls-2: NOTRUN -> [DMESG-FAIL][7] ([i915#4258] / [i915#7913])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-rpls-2/igt@i915_selftest@live@gt_pm.html

* igt@i915_selftest@live@requests:
- bat-rpls-2: NOTRUN -> [ABORT][8] ([i915#7913] / [i915#7982])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-rpls-2/igt@i915_selftest@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@gt_heartbeat:
- fi-glk-j4005: [DMESG-FAIL][9] ([i915#5334]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_selftest@live@gt_lrc:
- bat-rpls-2: [INCOMPLETE][11] ([i915#4983] / [i915#7913]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-rpls-2/igt@i915_selftest@live@gt_lrc.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-rpls-2/igt@i915_selftest@live@gt_lrc.html

* igt@i915_selftest@live@gt_mocs:
- {bat-mtlp-8}: [DMESG-FAIL][13] -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-mtlp-8/igt@i915_selftest@live@gt_mocs.html

* igt@i915_suspend@basic-s3-without-i915:
- bat-adls-5: [FAIL][15] ([fdo#103375]) -> [PASS][16] +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-adls-5/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-adls-5/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc@pipe-c-dp-1:
- bat-dg2-8: [FAIL][17] ([i915#7932]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_pipe_crc_basic@read-crc@pipe-b-edp-1:
- bat-adlp-6: [ABORT][19] -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-adlp-6/igt@kms_pipe_crc_basic@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-adlp-6/igt@kms_pipe_crc_basic@[email protected]

#### Warnings ####

* igt@i915_selftest@live@requests:
- bat-rpls-1: [ABORT][21] ([i915#7911] / [i915#7920] / [i915#7982]) -> [ABORT][22] ([i915#7911] / [i915#7920])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-rpls-1/igt@i915_selftest@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@kms_setmode@basic-clone-single-crtc:
- bat-rplp-1: [SKIP][23] ([i915#3555] / [i915#4579]) -> [ABORT][24] ([i915#4579] / [i915#8260])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13164/bat-rplp-1/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/bat-rplp-1/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#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920
[i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
[i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982
[i915#8260]: https://gitlab.freedesktop.org/drm/intel/issues/8260

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

* Linux: CI_DRM_13164 -> Patchwork_117399v3

CI-20190529: 20190529
CI_DRM_13164: 30793067f161dfcbaca1b0249d919c9fc306754e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7296: f58eaf30c30c1cc9f00c8b5c596ee5c94d054198 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117399v3: 30793067f161dfcbaca1b0249d919c9fc306754e @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

e2b63090a956 drm/i915/hdmi: C20 computed PLL frequencies 273769d73c7b drm/i915: Add 16bit register/mask operators

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/index.html

#9 lore raw

Re: [Intel-gfx] ✗ Fi.CI.BAT: failure for C20 Computed HDMI TMDS pixel clocks (rev3)

Quoted 21 lines · Patchwork

Patch Details
Series: C20 Computed HDMI TMDS pixel clocks (rev3)
URL: https://patchwork.freedesktop.org/series/117399/
State: failure
Details: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/index.html
CI Bug Log - changes from CI_DRM_13164 -> Patchwork_117399v3 Summary
FAILURE

Serious unknown changes coming with Patchwork_117399v3 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_117399v3, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/index.html

Participating hosts (39 -> 36)
Missing (3): fi-kbl-soraka fi-snb-2520m fi-bsw-n3050

Quoted 7 lines

Possible new issues
Here are the unknown changes that may have been introduced in Patchwork_117399v3:

IGT changes
Possible regressions
igt@kms_pipe_crc_basic@read-crc@pipe-c-edp-1:
bat-adlp-6: PASS -> ABORT

Changes in this patch series not relevant to ADLP (v3) or ADLS (v2) platforms. Series can only cause regressions on MTL platform with C20 HDMI output.

-Clint

Quoted 62 lines

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

igt@i915_selftest@live@migrate:
{bat-mtlp-8}: PASS -> DMESG-FAIL
Known issues
Here are the changes found in Patchwork_117399v3 that come from known issues:

IGT changes
Issues hit
igt@i915_selftest@live@gt_engines:

bat-atsm-1: PASS -> FAIL (i915#6268)
igt@i915_selftest@live@gt_pm:

bat-rpls-2: NOTRUN -> DMESG-FAIL (i915#4258 / i915#7913) igt@i915_selftest@live@requests:

bat-rpls-2: NOTRUN -> ABORT (i915#7913 / i915#7982) Possible fixes igt@i915_selftest@live@gt_heartbeat:

fi-glk-j4005: DMESG-FAIL (i915#5334) -> PASS
igt@i915_selftest@live@gt_lrc:

bat-rpls-2: INCOMPLETE (i915#4983 / i915#7913) -> PASS igt@i915_selftest@live@gt_mocs:

{bat-mtlp-8}: DMESG-FAIL -> PASS
igt@i915_suspend@basic-s3-without-i915:

bat-adls-5: FAIL (fdo#103375) -> PASS +3 similar issues igt@kms_pipe_crc_basic@nonblocking-crc@pipe-c-dp-1:

bat-dg2-8: FAIL (i915#7932) -> PASS
igt@kms_pipe_crc_basic@read-crc@pipe-b-edp-1:

bat-adlp-6: ABORT -> PASS
Warnings
igt@i915_selftest@live@requests:

bat-rpls-1: ABORT (i915#7911 / i915#7920 / i915#7982) -> ABORT (i915#7911 / i915#7920) igt@kms_setmode@basic-clone-single-crtc:

bat-rplp-1: SKIP (i915#3555 / i915#4579) -> ABORT (i915#4579 / i915#8260) {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE).

Build changes
Linux: CI_DRM_13164 -> Patchwork_117399v3
CI-20190529: 20190529
CI_DRM_13164: 30793067f161dfcbaca1b0249d919c9fc306754e @
git://anongit.freedesktop.org/gfx-ci/linux
IGT_7296: f58eaf30c30c1cc9f00c8b5c596ee5c94d054198 @
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117399v3: 30793067f161dfcbaca1b0249d919c9fc306754e @
git://anongit.freedesktop.org/gfx-ci/linux

Linux commits
e2b63090a956 drm/i915/hdmi: C20 computed PLL frequencies 273769d73c7b drm/i915: Add 16bit register/mask operators

Applied
#10 lore raw

Re: [Intel-gfx] ✗ Fi.CI.BAT: failure for C20 Computed HDMI TMDS pixel clocks (rev3)

Quoted 25 lines · Clinton A
Quoted 24 lines · Patchwork

Patch Details
Series: C20 Computed HDMI TMDS pixel clocks (rev3)
URL: https://patchwork.freedesktop.org/series/117399/
State: failure
Details: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/index.html
CI Bug Log - changes from CI_DRM_13164 -> Patchwork_117399v3 Summary
FAILURE

Serious unknown changes coming with Patchwork_117399v3 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_117399v3, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_117399v3/index.html

Participating hosts (39 -> 36)
Missing (3): fi-kbl-soraka fi-snb-2520m fi-bsw-n3050

Possible new issues
Here are the unknown changes that may have been introduced in Patchwork_117399v3:

Quoted 7 lines
Quoted 4 lines

IGT changes
Possible regressions
igt@kms_pipe_crc_basic@read-crc@pipe-c-edp-1:
bat-adlp-6: PASS -> ABORT

Changes in this patch series not relevant to ADLP (v3) or ADLS (v2) platforms. Series can only cause regressions on MTL platform with C20 HDMI output.

And we have no MTL machines in the shards pool yet, so that means these patches can't impact shard results and we don't need to worry about the fact we never got them.

Applied to drm-intel-next (with a small tweak to wrap one overly long line). Thanks for the patches and reviews.

Matt

Quoted 65 lines

-Clint

Quoted 62 lines

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

igt@i915_selftest@live@migrate:
{bat-mtlp-8}: PASS -> DMESG-FAIL
Known issues
Here are the changes found in Patchwork_117399v3 that come from known issues:

IGT changes
Issues hit
igt@i915_selftest@live@gt_engines:

bat-atsm-1: PASS -> FAIL (i915#6268)
igt@i915_selftest@live@gt_pm:

bat-rpls-2: NOTRUN -> DMESG-FAIL (i915#4258 / i915#7913) igt@i915_selftest@live@requests:

bat-rpls-2: NOTRUN -> ABORT (i915#7913 / i915#7982) Possible fixes igt@i915_selftest@live@gt_heartbeat:

fi-glk-j4005: DMESG-FAIL (i915#5334) -> PASS
igt@i915_selftest@live@gt_lrc:

bat-rpls-2: INCOMPLETE (i915#4983 / i915#7913) -> PASS igt@i915_selftest@live@gt_mocs:

{bat-mtlp-8}: DMESG-FAIL -> PASS
igt@i915_suspend@basic-s3-without-i915:

bat-adls-5: FAIL (fdo#103375) -> PASS +3 similar issues igt@kms_pipe_crc_basic@nonblocking-crc@pipe-c-dp-1:

bat-dg2-8: FAIL (i915#7932) -> PASS
igt@kms_pipe_crc_basic@read-crc@pipe-b-edp-1:

bat-adlp-6: ABORT -> PASS
Warnings
igt@i915_selftest@live@requests:

bat-rpls-1: ABORT (i915#7911 / i915#7920 / i915#7982) -> ABORT (i915#7911 / i915#7920) igt@kms_setmode@basic-clone-single-crtc:

bat-rplp-1: SKIP (i915#3555 / i915#4579) -> ABORT (i915#4579 / i915#8260) {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE).

Build changes
Linux: CI_DRM_13164 -> Patchwork_117399v3
CI-20190529: 20190529
CI_DRM_13164: 30793067f161dfcbaca1b0249d919c9fc306754e @
git://anongit.freedesktop.org/gfx-ci/linux
IGT_7296: f58eaf30c30c1cc9f00c8b5c596ee5c94d054198 @
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_117399v3: 30793067f161dfcbaca1b0249d919c9fc306754e @
git://anongit.freedesktop.org/gfx-ci/linux

Linux commits
e2b63090a956 drm/i915/hdmi: C20 computed PLL frequencies 273769d73c7b drm/i915: Add 16bit register/mask operators

Signature · 4 lines
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation