All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Saurabh Sengar <saurabh.singh@xilinx.com>
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
	Michal Simek <monstr@monstr.eu>
Subject: [xilinx-xlnx:xlnx_rebase_v5.10 240/1981] drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size
Date: Wed, 15 Dec 2021 03:48:07 +0800	[thread overview]
Message-ID: <202112150334.bpLUKdSA-lkp@intel.com> (raw)

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head:   87ec9a2d98a7a7dfc98b57348a0ec310fd170e4b
commit: f44962ff80bcd41ca6c29caabecbf21fbc4f95a1 [240/1981] drm: xlnx: mixer: Initial video mixer driver
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211215/202112150334.bpLUKdSA-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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/Xilinx/linux-xlnx/commit/f44962ff80bcd41ca6c29caabecbf21fbc4f95a1
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.10
        git checkout f44962ff80bcd41ca6c29caabecbf21fbc4f95a1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/clk/ drivers/fpga/ drivers/gpu/drm/vc4/ drivers/gpu/drm/xlnx/ drivers/infiniband/hw/mlx5/ drivers/media/platform/xilinx/ drivers/memory/samsung/ drivers/misc/ drivers/mtd/nand/raw/brcmnand/ drivers/mtd/spi-nor/controllers/ drivers/net/ drivers/of/ drivers/ptp/ drivers/remoteproc/ drivers/spi/ drivers/staging/ drivers/thunderbolt/ drivers/uio/ drivers/usb/cdns3/ sound/hda/ sound/pci/hda/

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/xlnx/xlnx_mixer.c: In function 'xlnx_mix_logo_load':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1339:20: warning: variable 'height' set but not used [-Wunused-but-set-variable]
    1339 |         u32 width, height, curr_x_pos, curr_y_pos;
         |                    ^~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1339:13: warning: variable 'width' set but not used [-Wunused-but-set-variable]
    1339 |         u32 width, height, curr_x_pos, curr_y_pos;
         |             ^~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_update_logo_img':
>> drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1443 |         if ((phys_addr_t)buffer->vaddr == logo_layer->layer_regs.buff_addr1 &&
         |             ^
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1449:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1449 |         logo_layer->layer_regs.buff_addr1 = (phys_addr_t)buffer->vaddr;
         |                                             ^
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1397:13: warning: variable 'logo_cmp_cnt' set but not used [-Wunused-but-set-variable]
    1397 |         u32 logo_cmp_cnt;
         |             ^~~~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_plane_create':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2049:42: warning: variable 'layer_data' set but not used [-Wunused-but-set-variable]
    2049 |         struct xlnx_mix_layer_data      *layer_data;
         |                                          ^~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_crtc_create':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2418:27: warning: variable 'cursor_plane' set but not used [-Wunused-but-set-variable]
    2418 |         struct drm_plane *cursor_plane = NULL;
         |                           ^~~~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2417:27: warning: variable 'primary_plane' set but not used [-Wunused-but-set-variable]
    2417 |         struct drm_plane *primary_plane = NULL;
         |                           ^~~~~~~~~~~~~


vim +1443 drivers/gpu/drm/xlnx/xlnx_mixer.c

  1388	
  1389	static int xlnx_mix_update_logo_img(struct xlnx_mix_plane *plane,
  1390					    struct drm_gem_cma_object *buffer,
  1391					     u32 src_w, u32 src_h)
  1392	{
  1393		struct xlnx_mix_layer_data *logo_layer = plane->mixer_layer;
  1394		size_t pixel_cnt = src_h * src_w;
  1395		/* color comp defaults to offset in RG24 buffer */
  1396		u32 pix_cmp_cnt;
  1397		u32 logo_cmp_cnt;
  1398		bool per_pixel_alpha = false;
  1399		u32 max_width = logo_layer->hw_config.max_width;
  1400		u32 max_height = logo_layer->hw_config.max_height;
  1401		u32 min_width = logo_layer->hw_config.min_width;
  1402		u32 min_height = logo_layer->hw_config.min_height;
  1403		u8 *r_data = NULL;
  1404		u8 *g_data = NULL;
  1405		u8 *b_data = NULL;
  1406		u8 *a_data = NULL;
  1407		size_t el_size = sizeof(u8);
  1408		u8 *pixel_mem_data;
  1409		int ret, i, j;
  1410	
  1411		/* ensure valid conditions for update */
  1412		if (logo_layer->id != XVMIX_LAYER_LOGO)
  1413			return 0;
  1414	
  1415		if (src_h > max_height || src_w > max_width ||
  1416		    src_h < min_height || src_w < min_width) {
  1417			DRM_ERROR("Mixer logo/cursor layer dimensions illegal.\n");
  1418			return -EINVAL;
  1419		}
  1420	
  1421		if (!xlnx_mix_isfmt_support(plane->mixer_layer->hw_config.vid_fmt)) {
  1422			DRM_ERROR("DRM color format not supported for logo layer\n");
  1423			return -EINVAL;
  1424		}
  1425		per_pixel_alpha = (logo_layer->hw_config.vid_fmt ==
  1426				   DRM_FORMAT_RGBA8888) ? false : true;
  1427		r_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1428		g_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1429		b_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1430		if (per_pixel_alpha)
  1431			a_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1432	
  1433		if (!r_data || !g_data || !b_data || (per_pixel_alpha && !a_data)) {
  1434			DRM_ERROR("Unable to allocate memory for logo layer data\n");
  1435			ret = -ENOMEM;
  1436			goto free;
  1437		}
  1438		pix_cmp_cnt = per_pixel_alpha ? 4 : 3;
  1439		logo_cmp_cnt = pixel_cnt * pix_cmp_cnt;
  1440		/* ensure buffer attributes have changed to indicate new logo
  1441		 * has been created
  1442		 */
> 1443		if ((phys_addr_t)buffer->vaddr == logo_layer->layer_regs.buff_addr1 &&
  1444		    src_w == logo_layer->layer_regs.width &&
  1445		    src_h == logo_layer->layer_regs.height)
  1446			return 0;
  1447	
  1448		/* cache buffer address for future comparison */
  1449		logo_layer->layer_regs.buff_addr1 = (phys_addr_t)buffer->vaddr;
  1450		pixel_mem_data = (u8 *)(buffer->vaddr);
  1451		for (i = 0, j = 0; j < pixel_cnt; j++) {
  1452			if (per_pixel_alpha && a_data)
  1453				a_data[j] = pixel_mem_data[i++];
  1454	
  1455			b_data[j] = pixel_mem_data[i++];
  1456			g_data[j] = pixel_mem_data[i++];
  1457			r_data[j] = pixel_mem_data[i++];
  1458		}
  1459		ret = xlnx_mix_logo_load(to_mixer_hw(plane), src_w, src_h, r_data,
  1460					 g_data, b_data,
  1461					 per_pixel_alpha ? a_data : NULL);
  1462	free:
  1463		kfree(r_data);
  1464		kfree(g_data);
  1465		kfree(b_data);
  1466		kfree(a_data);
  1467	
  1468		return ret;
  1469	}
  1470	

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [xilinx-xlnx:xlnx_rebase_v5.10 240/1981] drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size
Date: Wed, 15 Dec 2021 03:48:07 +0800	[thread overview]
Message-ID: <202112150334.bpLUKdSA-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 7165 bytes --]

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.10
head:   87ec9a2d98a7a7dfc98b57348a0ec310fd170e4b
commit: f44962ff80bcd41ca6c29caabecbf21fbc4f95a1 [240/1981] drm: xlnx: mixer: Initial video mixer driver
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211215/202112150334.bpLUKdSA-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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/Xilinx/linux-xlnx/commit/f44962ff80bcd41ca6c29caabecbf21fbc4f95a1
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.10
        git checkout f44962ff80bcd41ca6c29caabecbf21fbc4f95a1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/clk/ drivers/fpga/ drivers/gpu/drm/vc4/ drivers/gpu/drm/xlnx/ drivers/infiniband/hw/mlx5/ drivers/media/platform/xilinx/ drivers/memory/samsung/ drivers/misc/ drivers/mtd/nand/raw/brcmnand/ drivers/mtd/spi-nor/controllers/ drivers/net/ drivers/of/ drivers/ptp/ drivers/remoteproc/ drivers/spi/ drivers/staging/ drivers/thunderbolt/ drivers/uio/ drivers/usb/cdns3/ sound/hda/ sound/pci/hda/

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/xlnx/xlnx_mixer.c: In function 'xlnx_mix_logo_load':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1339:20: warning: variable 'height' set but not used [-Wunused-but-set-variable]
    1339 |         u32 width, height, curr_x_pos, curr_y_pos;
         |                    ^~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1339:13: warning: variable 'width' set but not used [-Wunused-but-set-variable]
    1339 |         u32 width, height, curr_x_pos, curr_y_pos;
         |             ^~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_update_logo_img':
>> drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1443 |         if ((phys_addr_t)buffer->vaddr == logo_layer->layer_regs.buff_addr1 &&
         |             ^
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1449:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    1449 |         logo_layer->layer_regs.buff_addr1 = (phys_addr_t)buffer->vaddr;
         |                                             ^
   drivers/gpu/drm/xlnx/xlnx_mixer.c:1397:13: warning: variable 'logo_cmp_cnt' set but not used [-Wunused-but-set-variable]
    1397 |         u32 logo_cmp_cnt;
         |             ^~~~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_plane_create':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2049:42: warning: variable 'layer_data' set but not used [-Wunused-but-set-variable]
    2049 |         struct xlnx_mix_layer_data      *layer_data;
         |                                          ^~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c: In function 'xlnx_mix_crtc_create':
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2418:27: warning: variable 'cursor_plane' set but not used [-Wunused-but-set-variable]
    2418 |         struct drm_plane *cursor_plane = NULL;
         |                           ^~~~~~~~~~~~
   drivers/gpu/drm/xlnx/xlnx_mixer.c:2417:27: warning: variable 'primary_plane' set but not used [-Wunused-but-set-variable]
    2417 |         struct drm_plane *primary_plane = NULL;
         |                           ^~~~~~~~~~~~~


vim +1443 drivers/gpu/drm/xlnx/xlnx_mixer.c

  1388	
  1389	static int xlnx_mix_update_logo_img(struct xlnx_mix_plane *plane,
  1390					    struct drm_gem_cma_object *buffer,
  1391					     u32 src_w, u32 src_h)
  1392	{
  1393		struct xlnx_mix_layer_data *logo_layer = plane->mixer_layer;
  1394		size_t pixel_cnt = src_h * src_w;
  1395		/* color comp defaults to offset in RG24 buffer */
  1396		u32 pix_cmp_cnt;
  1397		u32 logo_cmp_cnt;
  1398		bool per_pixel_alpha = false;
  1399		u32 max_width = logo_layer->hw_config.max_width;
  1400		u32 max_height = logo_layer->hw_config.max_height;
  1401		u32 min_width = logo_layer->hw_config.min_width;
  1402		u32 min_height = logo_layer->hw_config.min_height;
  1403		u8 *r_data = NULL;
  1404		u8 *g_data = NULL;
  1405		u8 *b_data = NULL;
  1406		u8 *a_data = NULL;
  1407		size_t el_size = sizeof(u8);
  1408		u8 *pixel_mem_data;
  1409		int ret, i, j;
  1410	
  1411		/* ensure valid conditions for update */
  1412		if (logo_layer->id != XVMIX_LAYER_LOGO)
  1413			return 0;
  1414	
  1415		if (src_h > max_height || src_w > max_width ||
  1416		    src_h < min_height || src_w < min_width) {
  1417			DRM_ERROR("Mixer logo/cursor layer dimensions illegal.\n");
  1418			return -EINVAL;
  1419		}
  1420	
  1421		if (!xlnx_mix_isfmt_support(plane->mixer_layer->hw_config.vid_fmt)) {
  1422			DRM_ERROR("DRM color format not supported for logo layer\n");
  1423			return -EINVAL;
  1424		}
  1425		per_pixel_alpha = (logo_layer->hw_config.vid_fmt ==
  1426				   DRM_FORMAT_RGBA8888) ? false : true;
  1427		r_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1428		g_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1429		b_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1430		if (per_pixel_alpha)
  1431			a_data = kcalloc(pixel_cnt, el_size, GFP_KERNEL);
  1432	
  1433		if (!r_data || !g_data || !b_data || (per_pixel_alpha && !a_data)) {
  1434			DRM_ERROR("Unable to allocate memory for logo layer data\n");
  1435			ret = -ENOMEM;
  1436			goto free;
  1437		}
  1438		pix_cmp_cnt = per_pixel_alpha ? 4 : 3;
  1439		logo_cmp_cnt = pixel_cnt * pix_cmp_cnt;
  1440		/* ensure buffer attributes have changed to indicate new logo
  1441		 * has been created
  1442		 */
> 1443		if ((phys_addr_t)buffer->vaddr == logo_layer->layer_regs.buff_addr1 &&
  1444		    src_w == logo_layer->layer_regs.width &&
  1445		    src_h == logo_layer->layer_regs.height)
  1446			return 0;
  1447	
  1448		/* cache buffer address for future comparison */
  1449		logo_layer->layer_regs.buff_addr1 = (phys_addr_t)buffer->vaddr;
  1450		pixel_mem_data = (u8 *)(buffer->vaddr);
  1451		for (i = 0, j = 0; j < pixel_cnt; j++) {
  1452			if (per_pixel_alpha && a_data)
  1453				a_data[j] = pixel_mem_data[i++];
  1454	
  1455			b_data[j] = pixel_mem_data[i++];
  1456			g_data[j] = pixel_mem_data[i++];
  1457			r_data[j] = pixel_mem_data[i++];
  1458		}
  1459		ret = xlnx_mix_logo_load(to_mixer_hw(plane), src_w, src_h, r_data,
  1460					 g_data, b_data,
  1461					 per_pixel_alpha ? a_data : NULL);
  1462	free:
  1463		kfree(r_data);
  1464		kfree(g_data);
  1465		kfree(b_data);
  1466		kfree(a_data);
  1467	
  1468		return ret;
  1469	}
  1470	

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

             reply	other threads:[~2021-12-14 19:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 19:48 kernel test robot [this message]
2021-12-14 19:48 ` [xilinx-xlnx:xlnx_rebase_v5.10 240/1981] drivers/gpu/drm/xlnx/xlnx_mixer.c:1443:13: warning: cast from pointer to integer of different size kernel test robot

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=202112150334.bpLUKdSA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=monstr@monstr.eu \
    --cc=saurabh.singh@xilinx.com \
    /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.