mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dmitry Baryshkov <lumag@kernel.org>,
	Rob Clark <robin.clark@oss.qualcomm.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Jordan Crouse <jordan@cosmicpenguin.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 11/12] drm/msm/dpu: rewrite _dpu_format_populate_plane_sizes_ubwc()
Date: Sun, 6 Jul 2025 01:53:51 +0800	[thread overview]
Message-ID: <202507060149.j2XwjHut-lkp@intel.com> (raw)
In-Reply-To: <20250705-dpu-formats-v1-11-40f0bb31b8c8@oss.qualcomm.com>

Hi Dmitry,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a]

url:    https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/drm-msm-disp-set-num_planes-to-1-for-interleaved-YUV-formats/20250705-104933
base:   26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
patch link:    https://lore.kernel.org/r/20250705-dpu-formats-v1-11-40f0bb31b8c8%40oss.qualcomm.com
patch subject: [PATCH 11/12] drm/msm/dpu: rewrite _dpu_format_populate_plane_sizes_ubwc()
config: powerpc64-randconfig-003-20250705 (https://download.01.org/0day-ci/archive/20250706/202507060149.j2XwjHut-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250706/202507060149.j2XwjHut-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507060149.j2XwjHut-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:79:7: warning: variable 'sclines' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      79 |                 if (fmt->pixel_format == DRM_FORMAT_NV12 ||
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      80 |                     fmt->pixel_format == DRM_FORMAT_P010) {
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:104:4: note: uninitialized use occurs here
     104 |                         sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
         |                         ^~~~~~~
   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:79:3: note: remove the 'if' if its condition is always true
      79 |                 if (fmt->pixel_format == DRM_FORMAT_NV12 ||
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      80 |                     fmt->pixel_format == DRM_FORMAT_P010) {
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:74:31: note: initialize the variable 'sclines' to silence this warning
      74 |                 unsigned int stride, sclines;
         |                                             ^
         |                                              = 0
>> drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:79:7: warning: variable 'stride' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      79 |                 if (fmt->pixel_format == DRM_FORMAT_NV12 ||
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      80 |                     fmt->pixel_format == DRM_FORMAT_P010) {
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:102:28: note: uninitialized use occurs here
     102 |                 layout->plane_pitch[0] = stride;
         |                                          ^~~~~~
   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:79:3: note: remove the 'if' if its condition is always true
      79 |                 if (fmt->pixel_format == DRM_FORMAT_NV12 ||
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      80 |                     fmt->pixel_format == DRM_FORMAT_P010) {
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c:74:22: note: initialize the variable 'stride' to silence this warning
      74 |                 unsigned int stride, sclines;
         |                                    ^
         |                                     = 0
   2 warnings generated.


vim +79 drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c

    65	
    66	static int _dpu_format_populate_plane_sizes_ubwc(
    67			const struct msm_format *fmt,
    68			struct drm_framebuffer *fb,
    69			struct dpu_hw_fmt_layout *layout)
    70	{
    71		bool meta = MSM_FORMAT_IS_UBWC(fmt);
    72	
    73		if (MSM_FORMAT_IS_YUV(fmt)) {
    74			unsigned int stride, sclines;
    75			unsigned int y_tile_width, y_tile_height;
    76			unsigned int y_meta_stride, y_meta_scanlines;
    77			unsigned int uv_meta_stride, uv_meta_scanlines;
    78	
  > 79			if (fmt->pixel_format == DRM_FORMAT_NV12 ||
    80			    fmt->pixel_format == DRM_FORMAT_P010) {
    81				if (MSM_FORMAT_IS_DX(fmt)) {
    82					if (fmt->flags & MSM_FORMAT_FLAG_UNPACK_TIGHT) {
    83						stride = MSM_MEDIA_ALIGN(fb->width, 192);
    84						stride = MSM_MEDIA_ALIGN(stride * 4 / 3, 256);
    85						y_tile_width = 48;
    86					} else {
    87						stride = MSM_MEDIA_ALIGN(fb->width * 2, 256);
    88						y_tile_width = 32;
    89					}
    90	
    91					sclines = MSM_MEDIA_ALIGN(fb->height, 16);
    92					y_tile_height = 4;
    93				} else {
    94					stride = MSM_MEDIA_ALIGN(fb->width, 128);
    95					y_tile_width = 32;
    96	
    97					sclines = MSM_MEDIA_ALIGN(fb->height, 32);
    98					y_tile_height = 8;
    99				}
   100			}
   101	
   102			layout->plane_pitch[0] = stride;
   103			layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] *
   104				sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
   105	
   106			layout->plane_pitch[1] = stride;
   107			layout->plane_size[1] = MSM_MEDIA_ALIGN(layout->plane_pitch[1] *
   108				sclines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
   109	
   110			if (!meta)
   111				return 0;
   112	
   113			y_meta_stride = MSM_MEDIA_ROUNDUP(fb->width, y_tile_width);
   114			layout->plane_pitch[2] = MSM_MEDIA_ALIGN(y_meta_stride, 64);
   115	
   116			y_meta_scanlines = MSM_MEDIA_ROUNDUP(fb->height, y_tile_height);
   117			y_meta_scanlines = MSM_MEDIA_ALIGN(y_meta_scanlines, 16);
   118			layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] *
   119				y_meta_scanlines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
   120	
   121			uv_meta_stride = MSM_MEDIA_ROUNDUP((fb->width+1)>>1, y_tile_width / 2);
   122			layout->plane_pitch[3] = MSM_MEDIA_ALIGN(uv_meta_stride, 64);
   123	
   124			uv_meta_scanlines = MSM_MEDIA_ROUNDUP((fb->height+1)>>1, y_tile_height);
   125			uv_meta_scanlines = MSM_MEDIA_ALIGN(uv_meta_scanlines, 16);
   126			layout->plane_size[3] = MSM_MEDIA_ALIGN(layout->plane_pitch[3] *
   127				uv_meta_scanlines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
   128		} else {
   129			unsigned int rgb_scanlines, rgb_meta_scanlines, rgb_meta_stride;
   130	
   131			layout->plane_pitch[0] = MSM_MEDIA_ALIGN(fb->width * fmt->bpp, 256);
   132			rgb_scanlines = MSM_MEDIA_ALIGN(fb->height, 16);
   133			layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] *
   134				rgb_scanlines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
   135	
   136			if (!meta)
   137				return 0;
   138	
   139			/* uAPI leaves plane[1] empty and plane[2] as meta */
   140			layout->num_planes += 1;
   141	
   142			rgb_meta_stride = MSM_MEDIA_ROUNDUP(fb->width, 16);
   143			layout->plane_pitch[2] = MSM_MEDIA_ALIGN(rgb_meta_stride, 64);
   144	
   145			rgb_meta_scanlines = MSM_MEDIA_ROUNDUP(fb->height, 4);
   146			rgb_meta_scanlines = MSM_MEDIA_ALIGN(rgb_meta_scanlines, 16);
   147	
   148			layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] *
   149				rgb_meta_scanlines, DPU_UBWC_PLANE_SIZE_ALIGNMENT);
   150		}
   151	
   152		return 0;
   153	}
   154	

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

  reply	other threads:[~2025-07-05 17:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-05  2:47 [PATCH 00/12] drm/msm/dpu: rework format handling code Dmitry Baryshkov
2025-07-05  2:47 ` [PATCH 01/12] drm/msm/disp: set num_planes to 1 for interleaved YUV formats Dmitry Baryshkov
2025-09-04 18:39   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 02/12] drm/msm/disp: set num_planes and fetch_mode in INTERLEAVED_RGB_FMT Dmitry Baryshkov
2025-09-04 21:35   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 03/12] drm/msm/disp: set num_planes, fetch_mode and tile_height in INTERLEAVED_RGB_FMT_TILED Dmitry Baryshkov
2025-07-05  2:47 ` [PATCH 04/12] drm/msm/disp: simplify RGB{,A,X} formats definitions Dmitry Baryshkov
2025-09-04 23:05   ` Jessica Zhang
2025-09-04 23:06   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 05/12] drm/msm/disp: simplify tiled " Dmitry Baryshkov
2025-09-04 23:06   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 06/12] drm/msm/disp: pull in common YUV format parameters Dmitry Baryshkov
2025-09-04 23:07   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 07/12] drm/msm/disp: pull in common tiled " Dmitry Baryshkov
2025-09-04 22:22   ` Jessica Zhang
2025-09-04 22:37     ` Dmitry Baryshkov
2025-07-05  2:47 ` [PATCH 08/12] drm/msm/disp: drop PSEUDO_YUV_FMT_LOOSE_TILED Dmitry Baryshkov
2025-09-04 23:04   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 09/12] drm/msm/dpu: simplify _dpu_format_populate_plane_sizes_* Dmitry Baryshkov
2025-09-04 23:19   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 10/12] drm/msm/dpu: drop redundant num_planes assignment in _dpu_format_populate_plane_sizes*() Dmitry Baryshkov
2025-09-04 23:19   ` Jessica Zhang
2025-07-05  2:47 ` [PATCH 11/12] drm/msm/dpu: rewrite _dpu_format_populate_plane_sizes_ubwc() Dmitry Baryshkov
2025-07-05 17:53   ` kernel test robot [this message]
2025-07-05  2:47 ` [PATCH 12/12] drm/msm/dpu: use standard functions in _dpu_format_populate_plane_sizes_ubwc() Dmitry Baryshkov
2025-09-04 18:38   ` Jessica Zhang
2025-09-04 20:19     ` Dmitry Baryshkov

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=202507060149.j2XwjHut-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=jordan@cosmicpenguin.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®