[03/18] drm/i915/display/ddi: Prefer drm_WARN* over WARN*
diff mbox series

Message ID 20200406112800.23762-4-pankaj.laxminarayan.bharadiya@intel.com
State New
Headers show
Series
  • Prefer drm_WARN* over WARN*
Related show

Commit Message

Laxminarayan Bharadiya, Pankaj April 6, 2020, 11:27 a.m. UTC
struct drm_device specific drm_WARN* macros include device information
in the backtrace, so we know what device the warnings originate from.

Prefer drm_WARN* over WARN* calls.

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

kbuild test robot April 6, 2020, 8:21 p.m. UTC | #1
Hi Pankaj,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on next-20200406]
[cannot apply to v5.6]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Pankaj-Bharadiya/Prefer-drm_WARN-over-WARN/20200406-210932
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-f002-20200406 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project a43e23360657e3df82af6b96b403d1a5a3174744)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER=clang make.cross ARCH=x86_64 

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

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/display/intel_ddi.c:3624:14: error: use of undeclared identifier 'state'
           drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
                       ^
>> drivers/gpu/drm/i915/display/intel_ddi.c:3624:14: error: use of undeclared identifier 'state'
   2 errors generated.

vim +/state +3624 drivers/gpu/drm/i915/display/intel_ddi.c

  3619	
  3620	static void intel_enable_ddi(struct intel_encoder *encoder,
  3621				     const struct intel_crtc_state *crtc_state,
  3622				     const struct drm_connector_state *conn_state)
  3623	{
> 3624		drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
  3625	
  3626		intel_enable_pipe(crtc_state);
  3627	
  3628		intel_crtc_vblank_on(crtc_state);
  3629	
  3630		if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
  3631			intel_enable_ddi_hdmi(encoder, crtc_state, conn_state);
  3632		else
  3633			intel_enable_ddi_dp(encoder, crtc_state, conn_state);
  3634	
  3635		/* Enable hdcp if it's desired */
  3636		if (conn_state->content_protection ==
  3637		    DRM_MODE_CONTENT_PROTECTION_DESIRED)
  3638			intel_hdcp_enable(to_intel_connector(conn_state->connector),
  3639					  crtc_state->cpu_transcoder,
  3640					  (u8)conn_state->hdcp_content_type);
  3641	}
  3642	

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

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 7184f3b8f091..353a32f5bf46 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2654,8 +2654,9 @@  static void tgl_ddi_vswing_sequence(struct intel_encoder *encoder,
 		tgl_dkl_phy_ddi_vswing_sequence(encoder, link_clock, level);
 }
 
-static u32 translate_signal_level(int signal_levels)
+static u32 translate_signal_level(struct intel_dp *intel_dp, int signal_levels)
 {
+	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(index_to_dp_signal_levels); i++) {
@@ -2663,8 +2664,9 @@  static u32 translate_signal_level(int signal_levels)
 			return i;
 	}
 
-	WARN(1, "Unsupported voltage swing/pre-emphasis level: 0x%x\n",
-	     signal_levels);
+	drm_WARN(&i915->drm, 1,
+		 "Unsupported voltage swing/pre-emphasis level: 0x%x\n",
+		 signal_levels);
 
 	return 0;
 }
@@ -2675,7 +2677,7 @@  static u32 intel_ddi_dp_level(struct intel_dp *intel_dp)
 	int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK |
 					 DP_TRAIN_PRE_EMPHASIS_MASK);
 
-	return translate_signal_level(signal_levels);
+	return translate_signal_level(intel_dp, signal_levels);
 }
 
 u32 bxt_signal_levels(struct intel_dp *intel_dp)
@@ -3766,7 +3768,7 @@  static void intel_enable_ddi(struct intel_atomic_state *state,
 			     const struct intel_crtc_state *crtc_state,
 			     const struct drm_connector_state *conn_state)
 {
-	WARN_ON(crtc_state->has_pch_encoder);
+	drm_WARN_ON(state->base.dev, crtc_state->has_pch_encoder);
 
 	intel_enable_pipe(crtc_state);
 
@@ -3877,7 +3879,7 @@  intel_ddi_update_prepare(struct intel_atomic_state *state,
 		crtc ? intel_atomic_get_new_crtc_state(state, crtc) : NULL;
 	int required_lanes = crtc_state ? crtc_state->lane_count : 1;
 
-	WARN_ON(crtc && crtc->active);
+	drm_WARN_ON(state->base.dev, crtc && crtc->active);
 
 	intel_tc_port_get_link(enc_to_dig_port(encoder),
 		               required_lanes);