All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Kumar, Mahesh" <mahesh1.kumar@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Nathan Ciobanu" <nathan.d.ciobanu@intel.com>,
	"Stéphane Marchesin" <marcheu@chromium.org>
Subject: [jsarha:topic/cros-sof-v4.14 1494/9354] drivers/gpu/drm/i915/intel_pm.c:4646:6: error: variable 'trans_min' is used uninitialized whenever 'if' condition is false
Date: Sat, 15 Apr 2023 08:43:05 +0800	[thread overview]
Message-ID: <202304150842.WRIIpHTO-lkp@intel.com> (raw)

tree:   https://github.com/jsarha/linux topic/cros-sof-v4.14
head:   6f750b16c322c9191168a3a97c427c90581d9144
commit: 0fa25d216a15c82850d864b488389c2bb81a0e2a [1494/9354] UPSTREAM: drm/i915/gen10: Calculate and enable transition WM
config: x86_64-randconfig-a005-20230410 (https://download.01.org/0day-ci/archive/20230415/202304150842.WRIIpHTO-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/jsarha/linux/commit/0fa25d216a15c82850d864b488389c2bb81a0e2a
        git remote add jsarha https://github.com/jsarha/linux
        git fetch --no-tags jsarha topic/cros-sof-v4.14
        git checkout 0fa25d216a15c82850d864b488389c2bb81a0e2a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash LDFLAGS=-z max-page-size=0x200000  drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304150842.WRIIpHTO-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/intel_pm.c:30:
   In file included from drivers/gpu/drm/i915/i915_drv.h:61:
   In file included from drivers/gpu/drm/i915/intel_uc.h:31:
   In file included from drivers/gpu/drm/i915/i915_vma.h:34:
   drivers/gpu/drm/i915/i915_gem_object.h:290:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
   __deprecated
   ^
   include/linux/compiler-gcc.h:91:37: note: expanded from macro '__deprecated'
   #define __deprecated    __attribute__((deprecated))
                                          ^
   include/drm/drm_gem.h:247:20: note: previous definition is here
   static inline void drm_gem_object_reference(struct drm_gem_object *obj)
                      ^
   In file included from drivers/gpu/drm/i915/intel_pm.c:30:
   In file included from drivers/gpu/drm/i915/i915_drv.h:61:
   In file included from drivers/gpu/drm/i915/intel_uc.h:31:
   In file included from drivers/gpu/drm/i915/i915_vma.h:34:
   drivers/gpu/drm/i915/i915_gem_object.h:300:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
   __deprecated
   ^
   include/linux/compiler-gcc.h:91:37: note: expanded from macro '__deprecated'
   #define __deprecated    __attribute__((deprecated))
                                          ^
   include/drm/drm_gem.h:285:20: note: previous definition is here
   static inline void drm_gem_object_unreference(struct drm_gem_object *obj)
                      ^
   In file included from drivers/gpu/drm/i915/intel_pm.c:30:
   In file included from drivers/gpu/drm/i915/i915_drv.h:61:
   In file included from drivers/gpu/drm/i915/intel_uc.h:31:
   In file included from drivers/gpu/drm/i915/i915_vma.h:34:
   drivers/gpu/drm/i915/i915_gem_object.h:303:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
   __deprecated
   ^
   include/linux/compiler-gcc.h:91:37: note: expanded from macro '__deprecated'
   #define __deprecated    __attribute__((deprecated))
                                          ^
   include/drm/drm_gem.h:273:1: note: previous definition is here
   drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
   ^
   In file included from drivers/gpu/drm/i915/intel_pm.c:30:
   drivers/gpu/drm/i915/i915_drv.h:3627:9: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
           return i915_reset_backoff(error) | i915_terminally_wedged(error);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                            ||
   drivers/gpu/drm/i915/i915_drv.h:3627:9: note: cast one or both operands to int to silence this warning
   drivers/gpu/drm/i915/intel_pm.c:2977:12: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
           changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) |
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/intel_pm.c:2977:12: note: cast one or both operands to int to silence this warning
   drivers/gpu/drm/i915/intel_pm.c:2977:12: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
           changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) |
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                     ||
   drivers/gpu/drm/i915/intel_pm.c:2977:12: note: cast one or both operands to int to silence this warning
   drivers/gpu/drm/i915/intel_pm.c:4080:18: error: variable 'src_h' set but not used [-Werror,-Wunused-but-set-variable]
           uint32_t src_w, src_h;
                           ^
>> drivers/gpu/drm/i915/intel_pm.c:4646:6: error: variable 'trans_min' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
           if (INTEL_GEN(dev_priv) >= 10)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/i915_drv.h:2868:29: note: expanded from macro 'INTEL_GEN'
   #define INTEL_GEN(dev_priv)     ((dev_priv)->info.gen)
                                   ^
   drivers/gpu/drm/i915/intel_pm.c:4649:19: note: uninitialized use occurs here
           trans_offset_b = trans_min + trans_amount;
                            ^~~~~~~~~
   drivers/gpu/drm/i915/intel_pm.c:4646:2: note: remove the 'if' if its condition is always true
           if (INTEL_GEN(dev_priv) >= 10)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/intel_pm.c:4631:20: note: initialize the variable 'trans_min' to silence this warning
           uint16_t trans_min, trans_y_tile_min;
                             ^
                              = 0
   8 errors generated.


vim +4646 drivers/gpu/drm/i915/intel_pm.c

  4622	
  4623	static void skl_compute_transition_wm(struct intel_crtc_state *cstate,
  4624					      struct skl_wm_params *wp,
  4625					      struct skl_wm_level *wm_l0,
  4626					      uint16_t ddb_allocation,
  4627					      struct skl_wm_level *trans_wm /* out */)
  4628	{
  4629		struct drm_device *dev = cstate->base.crtc->dev;
  4630		const struct drm_i915_private *dev_priv = to_i915(dev);
  4631		uint16_t trans_min, trans_y_tile_min;
  4632		const uint16_t trans_amount = 10; /* This is configurable amount */
  4633		uint16_t trans_offset_b, res_blocks;
  4634	
  4635		if (!cstate->base.active)
  4636			goto exit;
  4637	
  4638		/* Transition WM are not recommended by HW team for GEN9 */
  4639		if (INTEL_GEN(dev_priv) <= 9)
  4640			goto exit;
  4641	
  4642		/* Transition WM don't make any sense if ipc is disabled */
  4643		if (!dev_priv->ipc_enabled)
  4644			goto exit;
  4645	
> 4646		if (INTEL_GEN(dev_priv) >= 10)
  4647			trans_min = 4;
  4648	
  4649		trans_offset_b = trans_min + trans_amount;
  4650	
  4651		if (wp->y_tiled) {
  4652			trans_y_tile_min = (uint16_t) mul_round_up_u32_fixed16(2,
  4653								wp->y_tile_minimum);
  4654			res_blocks = max(wm_l0->plane_res_b, trans_y_tile_min) +
  4655					trans_offset_b;
  4656		} else {
  4657			res_blocks = wm_l0->plane_res_b + trans_offset_b;
  4658	
  4659			/* WA BUG:1938466 add one block for non y-tile planes */
  4660			if (IS_CNL_REVID(dev_priv, CNL_REVID_A0, CNL_REVID_A0))
  4661				res_blocks += 1;
  4662	
  4663		}
  4664	
  4665		res_blocks += 1;
  4666	
  4667		if (res_blocks < ddb_allocation) {
  4668			trans_wm->plane_res_b = res_blocks;
  4669			trans_wm->plane_en = true;
  4670			return;
  4671		}
  4672	
  4673	exit:
  4674		trans_wm->plane_en = false;
  4675	}
  4676	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

                 reply	other threads:[~2023-04-15  0:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202304150842.WRIIpHTO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mahesh1.kumar@intel.com \
    --cc=marcheu@chromium.org \
    --cc=nathan.d.ciobanu@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.