[drm-misc:drm-misc-next 7/10] drivers/gpu/drm/omapdrm/omap_gem.c:757:42: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
kernel test robot
lkp at intel.com
Mon May 13 12:18:53 UTC 2024
Hi Ville,
First bad commit (maybe != root cause):
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: 11cdc8f2bde4bc548da6f995556c4b7183431088
commit: dc6fcaaba5a5411237d042a26c4d46689f3346bb [7/10] drm/omap: Allow build with COMPILE_TEST=y
config: powerpc64-randconfig-r131-20240513 (https://download.01.org/0day-ci/archive/20240513/202405132008.ZKR6oYcm-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240513/202405132008.ZKR6oYcm-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405132008.ZKR6oYcm-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/omapdrm/omap_gem.c:757:42: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
drivers/gpu/drm/omapdrm/omap_gem.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, ...):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
drivers/gpu/drm/omapdrm/omap_gem.c:1503:65: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
vim +757 drivers/gpu/drm/omapdrm/omap_gem.c
8b6b569eac2e74 drivers/staging/omapdrm/omap_gem.c Rob Clark 2012-05-17 744
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 745 static int omap_gem_pin_tiler(struct drm_gem_object *obj)
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 746 {
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 747 struct omap_gem_object *omap_obj = to_omap_bo(obj);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 748 u32 npages = obj->size >> PAGE_SHIFT;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 749 enum tiler_fmt fmt = gem2fmt(omap_obj->flags);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 750 struct tiler_block *block;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 751 int ret;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 752
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 753 BUG_ON(omap_obj->block);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 754
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 755 if (omap_obj->flags & OMAP_BO_TILED_MASK) {
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 756 block = tiler_reserve_2d(fmt, omap_obj->width, omap_obj->height,
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 @757 PAGE_SIZE);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 758 } else {
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 759 block = tiler_reserve_1d(obj->size);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 760 }
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 761
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 762 if (IS_ERR(block)) {
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 763 ret = PTR_ERR(block);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 764 dev_err(obj->dev->dev, "could not remap: %d (%d)\n", ret, fmt);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 765 goto fail;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 766 }
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 767
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 768 /* TODO: enable async refill.. */
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 769 ret = tiler_pin(block, omap_obj->pages, npages, omap_obj->roll, true);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 770 if (ret) {
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 771 tiler_release(block);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 772 dev_err(obj->dev->dev, "could not pin: %d\n", ret);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 773 goto fail;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 774 }
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 775
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 776 omap_obj->dma_addr = tiler_ssptr(block);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 777 omap_obj->block = block;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 778
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 779 DBG("got dma address: %pad", &omap_obj->dma_addr);
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 780
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 781 fail:
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 782 return ret;
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 783 }
86ad0397250c58 drivers/gpu/drm/omapdrm/omap_gem.c Ivaylo Dimitrov 2022-01-19 784
:::::: The code at line 757 was first introduced by commit
:::::: 86ad0397250c585096d242dc3c0f774320ed1a80 drm: omapdrm: simplify omap_gem_pin
:::::: TO: Ivaylo Dimitrov <ivo.g.dimitrov.75 at gmail.com>
:::::: CC: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the dri-devel
mailing list