diff mbox series

[1/2] drm/i915/dsi/xelpd: Add WA to program LP to HS wakeup guardband

Message ID 20210823032136.2564-2-vandita.kulkarni@intel.com (mailing list archive)
State New, archived
Headers show
Series Enable mipi dsi on XELPD | expand

Commit Message

Kulkarni, Vandita Aug. 23, 2021, 3:21 a.m. UTC
Wa_16012360555 SW will have to program the "LP to HS Wakeup Guardband"
field to account for the repeaters on the HS Request/Ready PPI signaling
between the Display engine and the DPHY.

Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
---
 drivers/gpu/drm/i915/display/icl_dsi.c | 24 ++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_reg.h        |  8 ++++++++
 2 files changed, 32 insertions(+)

Comments

kernel test robot Aug. 23, 2021, 6:54 a.m. UTC | #1
Hi Vandita,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on drm-tip/drm-tip next-20210820]
[cannot apply to v5.14-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vandita-Kulkarni/Enable-mipi-dsi-on-XELPD/20210823-112313
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a006-20210822 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/d75ce0657c5bed32b206ab0461ea42eea7514436
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vandita-Kulkarni/Enable-mipi-dsi-on-XELPD/20210823-112313
        git checkout d75ce0657c5bed32b206ab0461ea42eea7514436
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/display/intel_ddi.h:10,
                    from drivers/gpu/drm/i915/display/icl_dsi.c:35:
   drivers/gpu/drm/i915/display/icl_dsi.c: In function 'adlp_set_lp_hs_wakeup_gb':
   drivers/gpu/drm/i915/i915_reg.h:11619:11: error: '_TGL_DSI_CHKN_REG_0' undeclared (first use in this function); did you mean 'TGL_DSI_CHKN_REG_0'?
   11619 |           _TGL_DSI_CHKN_REG_0, \
         |           ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:185:47: note: in definition of macro '_MMIO'
     185 | #define _MMIO(r) ((const i915_reg_t){ .reg = (r) })
         |                                               ^
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
     231 | #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
         |                            ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:238:39: note: in expansion of macro '_PORT'
     238 | #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
         |                                       ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:11618:33: note: in expansion of macro '_MMIO_PORT'
   11618 | #define TGL_DSI_CHKN_REG(port)  _MMIO_PORT(port, \
         |                                 ^~~~~~~~~~
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: note: in expansion of macro 'TGL_DSI_CHKN_REG'
    1290 |    intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
         |                           ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:11619:11: note: each undeclared identifier is reported only once for each function it appears in
   11619 |           _TGL_DSI_CHKN_REG_0, \
         |           ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:185:47: note: in definition of macro '_MMIO'
     185 | #define _MMIO(r) ((const i915_reg_t){ .reg = (r) })
         |                                               ^
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
     231 | #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
         |                            ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:238:39: note: in expansion of macro '_PORT'
     238 | #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
         |                                       ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:11618:33: note: in expansion of macro '_MMIO_PORT'
   11618 | #define TGL_DSI_CHKN_REG(port)  _MMIO_PORT(port, \
         |                                 ^~~~~~~~~~
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: note: in expansion of macro 'TGL_DSI_CHKN_REG'
    1290 |    intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
         |                           ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:11620:11: error: '_TGL_DSI_CHKN_REG_1' undeclared (first use in this function); did you mean 'TGL_DSI_CHKN_REG_1'?
   11620 |           _TGL_DSI_CHKN_REG_1)
         |           ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:185:47: note: in definition of macro '_MMIO'
     185 | #define _MMIO(r) ((const i915_reg_t){ .reg = (r) })
         |                                               ^
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
     231 | #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
         |                            ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:238:39: note: in expansion of macro '_PORT'
     238 | #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
         |                                       ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:11618:33: note: in expansion of macro '_MMIO_PORT'
   11618 | #define TGL_DSI_CHKN_REG(port)  _MMIO_PORT(port, \
         |                                 ^~~~~~~~~~
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: note: in expansion of macro 'TGL_DSI_CHKN_REG'
    1290 |    intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
         |                           ^~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/display/icl_dsi.c:1288:5: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=dangling-else]
    1288 |  if (DISPLAY_VER(dev_priv) == 13)
         |     ^
   cc1: all warnings being treated as errors


vim +/else +1288 drivers/gpu/drm/i915/display/icl_dsi.c

  1273	
  1274	/*
  1275	 * Wa_16012360555:ADLP
  1276	 * SW will have to program the "LP to HS Wakeup Guardband"
  1277	 * field (bits 15:12) of register offset 0x6B0C0 (DSI0)
  1278	 * and 0x6B8C0 (DSI1) to a value of 4 to account for the repeaters
  1279	 * on the HS Request/Ready PPI signaling between
  1280	 * the Display engine and the DPHY.
  1281	 */
  1282	static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder)
  1283	{
  1284		struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
  1285		struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
  1286		enum port port;
  1287	
> 1288		if (DISPLAY_VER(dev_priv) == 13)
  1289			for_each_dsi_port(port, intel_dsi->ports)
> 1290				intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
  1291					     TGL_DSI_CHKN_LSHS_GB, 0x4);
  1292	}
  1293	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Aug. 23, 2021, 7:40 a.m. UTC | #2
Hi Vandita,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip next-20210820]
[cannot apply to v5.14-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vandita-Kulkarni/Enable-mipi-dsi-on-XELPD/20210823-112313
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a015-20210822 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 79b55e5038324e61a3abf4e6a9a949c473edd858)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/d75ce0657c5bed32b206ab0461ea42eea7514436
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vandita-Kulkarni/Enable-mipi-dsi-on-XELPD/20210823-112313
        git checkout d75ce0657c5bed32b206ab0461ea42eea7514436
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: error: use of undeclared identifier '_TGL_DSI_CHKN_REG_0'
                           intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
                                                  ^
   drivers/gpu/drm/i915/i915_reg.h:11619:11: note: expanded from macro 'TGL_DSI_CHKN_REG'
                                                       _TGL_DSI_CHKN_REG_0, \
                                                       ^
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: error: use of undeclared identifier '_TGL_DSI_CHKN_REG_1'
   drivers/gpu/drm/i915/i915_reg.h:11620:11: note: expanded from macro 'TGL_DSI_CHKN_REG'
                                                       _TGL_DSI_CHKN_REG_1)
                                                       ^
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: error: use of undeclared identifier '_TGL_DSI_CHKN_REG_0'
   drivers/gpu/drm/i915/i915_reg.h:11619:11: note: expanded from macro 'TGL_DSI_CHKN_REG'
                                                       _TGL_DSI_CHKN_REG_0, \
                                                       ^
>> drivers/gpu/drm/i915/display/icl_dsi.c:1289:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                   for_each_dsi_port(port, intel_dsi->ports)
                   ^
   drivers/gpu/drm/i915/display/intel_dsi.h:145:2: note: expanded from macro 'for_each_dsi_port'
           for_each_port_masked(__port, __ports_mask)
           ^
   drivers/gpu/drm/i915/display/intel_display.h:374:3: note: expanded from macro 'for_each_port_masked'
                   for_each_if((__ports_mask) & BIT(__port))
                   ^
   include/drm/drm_util.h:63:53: note: expanded from macro 'for_each_if'
   #define for_each_if(condition) if (!(condition)) {} else
                                                       ^
   1 warning and 3 errors generated.


vim +1289 drivers/gpu/drm/i915/display/icl_dsi.c

  1273	
  1274	/*
  1275	 * Wa_16012360555:ADLP
  1276	 * SW will have to program the "LP to HS Wakeup Guardband"
  1277	 * field (bits 15:12) of register offset 0x6B0C0 (DSI0)
  1278	 * and 0x6B8C0 (DSI1) to a value of 4 to account for the repeaters
  1279	 * on the HS Request/Ready PPI signaling between
  1280	 * the Display engine and the DPHY.
  1281	 */
  1282	static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder)
  1283	{
  1284		struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
  1285		struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
  1286		enum port port;
  1287	
  1288		if (DISPLAY_VER(dev_priv) == 13)
> 1289			for_each_dsi_port(port, intel_dsi->ports)
  1290				intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
  1291					     TGL_DSI_CHKN_LSHS_GB, 0x4);
  1292	}
  1293	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Aug. 23, 2021, 7:47 a.m. UTC | #3
Hi Vandita,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on drm-tip/drm-tip next-20210820]
[cannot apply to v5.14-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vandita-Kulkarni/Enable-mipi-dsi-on-XELPD/20210823-112313
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a005-20210822 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/d75ce0657c5bed32b206ab0461ea42eea7514436
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vandita-Kulkarni/Enable-mipi-dsi-on-XELPD/20210823-112313
        git checkout d75ce0657c5bed32b206ab0461ea42eea7514436
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/display/intel_ddi.h:10,
                    from drivers/gpu/drm/i915/display/icl_dsi.c:35:
   drivers/gpu/drm/i915/display/icl_dsi.c: In function 'adlp_set_lp_hs_wakeup_gb':
>> drivers/gpu/drm/i915/i915_reg.h:11619:11: error: '_TGL_DSI_CHKN_REG_0' undeclared (first use in this function); did you mean 'TGL_DSI_CHKN_REG_0'?
   11619 |           _TGL_DSI_CHKN_REG_0, \
         |           ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:185:47: note: in definition of macro '_MMIO'
     185 | #define _MMIO(r) ((const i915_reg_t){ .reg = (r) })
         |                                               ^
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
     231 | #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
         |                            ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:238:39: note: in expansion of macro '_PORT'
     238 | #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
         |                                       ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:11618:33: note: in expansion of macro '_MMIO_PORT'
   11618 | #define TGL_DSI_CHKN_REG(port)  _MMIO_PORT(port, \
         |                                 ^~~~~~~~~~
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: note: in expansion of macro 'TGL_DSI_CHKN_REG'
    1290 |    intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
         |                           ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:11619:11: note: each undeclared identifier is reported only once for each function it appears in
   11619 |           _TGL_DSI_CHKN_REG_0, \
         |           ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:185:47: note: in definition of macro '_MMIO'
     185 | #define _MMIO(r) ((const i915_reg_t){ .reg = (r) })
         |                                               ^
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
     231 | #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
         |                            ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:238:39: note: in expansion of macro '_PORT'
     238 | #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
         |                                       ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:11618:33: note: in expansion of macro '_MMIO_PORT'
   11618 | #define TGL_DSI_CHKN_REG(port)  _MMIO_PORT(port, \
         |                                 ^~~~~~~~~~
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: note: in expansion of macro 'TGL_DSI_CHKN_REG'
    1290 |    intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
         |                           ^~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/i915_reg.h:11620:11: error: '_TGL_DSI_CHKN_REG_1' undeclared (first use in this function); did you mean 'TGL_DSI_CHKN_REG_1'?
   11620 |           _TGL_DSI_CHKN_REG_1)
         |           ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:185:47: note: in definition of macro '_MMIO'
     185 | #define _MMIO(r) ((const i915_reg_t){ .reg = (r) })
         |                                               ^
   drivers/gpu/drm/i915/i915_reg.h:231:28: note: in expansion of macro '_PICK_EVEN'
     231 | #define _PORT(port, a, b)  _PICK_EVEN(port, a, b)
         |                            ^~~~~~~~~~
   drivers/gpu/drm/i915/i915_reg.h:238:39: note: in expansion of macro '_PORT'
     238 | #define _MMIO_PORT(port, a, b)  _MMIO(_PORT(port, a, b))
         |                                       ^~~~~
   drivers/gpu/drm/i915/i915_reg.h:11618:33: note: in expansion of macro '_MMIO_PORT'
   11618 | #define TGL_DSI_CHKN_REG(port)  _MMIO_PORT(port, \
         |                                 ^~~~~~~~~~
   drivers/gpu/drm/i915/display/icl_dsi.c:1290:27: note: in expansion of macro 'TGL_DSI_CHKN_REG'
    1290 |    intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
         |                           ^~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/display/icl_dsi.c:1288:5: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
    1288 |  if (DISPLAY_VER(dev_priv) == 13)
         |     ^


vim +11619 drivers/gpu/drm/i915/i915_reg.h

 11614	
 11615	/* TGL DSI Chicken register */
 11616	#define TGL_DSI_CHKN_REG_0			0x6B0C0
 11617	#define TGL_DSI_CHKN_REG_1			0x6B8C0
 11618	#define TGL_DSI_CHKN_REG(port)		_MMIO_PORT(port,	\
 11619							    _TGL_DSI_CHKN_REG_0, \
 11620							    _TGL_DSI_CHKN_REG_1)
 11621	#define TGL_DSI_CHKN_LSHS_GB			(0xF << 12)
 11622	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
index 43ec7fcd3f5d..61aea695c565 100644
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
@@ -1270,6 +1270,27 @@  static void icl_apply_kvmr_pipe_a_wa(struct intel_encoder *encoder,
 			     IGNORE_KVMR_PIPE_A,
 			     enable ? IGNORE_KVMR_PIPE_A : 0);
 }
+
+/*
+ * Wa_16012360555:ADLP
+ * SW will have to program the "LP to HS Wakeup Guardband"
+ * field (bits 15:12) of register offset 0x6B0C0 (DSI0)
+ * and 0x6B8C0 (DSI1) to a value of 4 to account for the repeaters
+ * on the HS Request/Ready PPI signaling between
+ * the Display engine and the DPHY.
+ */
+static void adlp_set_lp_hs_wakeup_gb(struct intel_encoder *encoder)
+{
+	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+	struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
+	enum port port;
+
+	if (DISPLAY_VER(dev_priv) == 13)
+		for_each_dsi_port(port, intel_dsi->ports)
+			intel_de_rmw(dev_priv, TGL_DSI_CHKN_REG(port),
+				     TGL_DSI_CHKN_LSHS_GB, 0x4);
+}
+
 static void gen11_dsi_enable(struct intel_atomic_state *state,
 			     struct intel_encoder *encoder,
 			     const struct intel_crtc_state *crtc_state,
@@ -1283,6 +1304,9 @@  static void gen11_dsi_enable(struct intel_atomic_state *state,
 	/* Wa_1409054076:icl,jsl,ehl */
 	icl_apply_kvmr_pipe_a_wa(encoder, crtc->pipe, true);
 
+	/* Wa_16012360555: adlp */
+	adlp_set_lp_hs_wakeup_gb(encoder);
+
 	/* step6d: enable dsi transcoder */
 	gen11_dsi_enable_transcoder(encoder);
 
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 72dd3a6d205d..34ad288de748 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -11614,6 +11614,14 @@  enum skl_power_gate {
 						    _ICL_DSI_IO_MODECTL_1)
 #define  COMBO_PHY_MODE_DSI				(1 << 0)
 
+/* TGL DSI Chicken register */
+#define TGL_DSI_CHKN_REG_0			0x6B0C0
+#define TGL_DSI_CHKN_REG_1			0x6B8C0
+#define TGL_DSI_CHKN_REG(port)		_MMIO_PORT(port,	\
+						    _TGL_DSI_CHKN_REG_0, \
+						    _TGL_DSI_CHKN_REG_1)
+#define TGL_DSI_CHKN_LSHS_GB			(0xF << 12)
+
 /* Display Stream Splitter Control */
 #define DSS_CTL1				_MMIO(0x67400)
 #define  SPLITTER_ENABLE			(1 << 31)