[radeon-alex:amd-20.45 2016/2427] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:62: warning: passing argument 1 of 'drm_gem_fb_get_obj' discards 'const' qualifier from pointer target type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://people.freedesktop.org/~agd5f/linux.git amd-20.45
head:   a3950d94b046fb206e58fd3ec717f071c0203ba3
commit: e1357d7a01b8b3bf23e71415eb7ca101902ee6b4 [2016/2427] drm/amdkcl: fake drm_gem_fb_get_obj & kcl_drm_gem_fb_set_obj
config: i386-randconfig-r022-20201214 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
        git fetch --no-tags radeon-alex amd-20.45
        git checkout e1357d7a01b8b3bf23e71415eb7ca101902ee6b4
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from drivers/gpu/drm/amd/display/dmub/dmub_srv.h:67,
                    from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:33:
   drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h: In function 'dmub_rb_flush_pending':
   drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h:785:12: warning: variable 'temp' set but not used [-Wunused-but-set-variable]
     785 |   uint64_t temp;
         |            ^~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_notify_freesync':
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3659:30: warning: variable 'old_con_state' set but not used [-Wunused-but-set-variable]
    3659 |  struct drm_connector_state *old_con_state, *new_con_state;
         |                              ^~~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:19,
                    from arch/x86/include/asm/bug.h:83,
                    from include/linux/bug.h:5,
                    from include/linux/jump_label.h:250,
                    from include/linux/static_key.h:1,
                    from arch/x86/include/asm/nospec-branch.h:6,
                    from arch/x86/include/asm/irqflags.h:9,
                    from include/linux/irqflags.h:16,
                    from include/linux/rcupdate.h:26,
                    from include/kcl/kcl_rcupdate.h:5,
                    from include/kcl/kcl_fence.h:6,
                    from include/kcl/backport/kcl_fence_backport.h:4,
                    from drivers/gpu/drm/amd/backport/backport.h:11,
                    from <command-line>:
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'get_fb_info':
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:62: warning: passing argument 1 of 'drm_gem_fb_get_obj' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    3987 |  struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
         |                                                              ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
     986 |  void *__mptr = (void *)(ptr);     \
         |                          ^~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:26: note: in expansion of macro 'gem_to_amdgpu_bo'
    3987 |  struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
         |                          ^~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/amd/backport/include/kcl/kcl_amdgpu_drm_fb_helper.h:6,
                    from drivers/gpu/drm/amd/backport/backport.h:59,
                    from <command-line>:
   include/drm/drm_gem_framebuffer_helper.h:15:24: note: expected 'struct drm_framebuffer *' but argument is of type 'const struct drm_framebuffer *'
      15 | struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
         |                        ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/rcupdate.h:24,
                    from include/kcl/kcl_rcupdate.h:5,
                    from include/kcl/kcl_fence.h:6,
                    from include/kcl/backport/kcl_fence_backport.h:4,
                    from drivers/gpu/drm/amd/backport/backport.h:11,
                    from <command-line>:
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:62: warning: passing argument 1 of 'drm_gem_fb_get_obj' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    3987 |  struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
         |                                                              ^~~~~~~~~~~~~~~~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
     330 |   if (!(condition))     \
         |         ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
         |  ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |  ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                    ^~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h:34:32: note: in expansion of macro 'container_of'
      34 | #define gem_to_amdgpu_bo(gobj) container_of((gobj), struct amdgpu_bo, tbo.base)
         |                                ^~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:26: note: in expansion of macro 'gem_to_amdgpu_bo'
    3987 |  struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
         |                          ^~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/amd/backport/include/kcl/kcl_amdgpu_drm_fb_helper.h:6,
                    from drivers/gpu/drm/amd/backport/backport.h:59,
                    from <command-line>:
   include/drm/drm_gem_framebuffer_helper.h:15:24: note: expected 'struct drm_framebuffer *' but argument is of type 'const struct drm_framebuffer *'
      15 | struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
         |                        ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/rcupdate.h:24,
                    from include/kcl/kcl_rcupdate.h:5,
                    from include/kcl/kcl_fence.h:6,
                    from include/kcl/backport/kcl_fence_backport.h:4,
                    from drivers/gpu/drm/amd/backport/backport.h:11,
                    from <command-line>:
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:62: warning: passing argument 1 of 'drm_gem_fb_get_obj' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    3987 |  struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
         |                                                              ^~~~~~~~~~~~~~~~
   include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
     330 |   if (!(condition))     \
         |         ^~~~~~~~~
   include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
     350 |  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
         |  ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     987 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |  ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
     988 |     !__same_type(*(ptr), void),   \
         |      ^~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h:34:32: note: in expansion of macro 'container_of'
      34 | #define gem_to_amdgpu_bo(gobj) container_of((gobj), struct amdgpu_bo, tbo.base)
         |                                ^~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3987:26: note: in expansion of macro 'gem_to_amdgpu_bo'
    3987 |  struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
         |                          ^~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/amd/backport/include/kcl/kcl_amdgpu_drm_fb_helper.h:6,
                    from drivers/gpu/drm/amd/backport/backport.h:59,
                    from <command-line>:
   include/drm/drm_gem_framebuffer_helper.h:15:24: note: expected 'struct drm_framebuffer *' but argument is of type 'const struct drm_framebuffer *'
      15 | struct drm_gem_object *drm_gem_fb_get_obj(struct drm_framebuffer *fb,
         |                        ^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'dm_update_mst_vcpi_slots_for_dsc':
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6227:46: warning: variable 'old_con_state' set but not used [-Wunused-but-set-variable]
    6227 |  struct drm_connector_state *new_con_state, *old_con_state;
         |                                              ^~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_commit_cursors':
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7680:44: warning: variable 'new_plane_state' set but not used [-Wunused-but-set-variable]
    7680 |  struct drm_plane_state *old_plane_state, *new_plane_state;
         |                                            ^~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_atomic_check':
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9643:25: warning: unused variable 'dm_old_crtc_state' [-Wunused-variable]
    9643 |   struct dm_crtc_state *dm_old_crtc_state  = to_dm_crtc_state(old_crtc_state);
         |                         ^~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9642:25: warning: unused variable 'dm_new_crtc_state' [-Wunused-variable]
    9642 |   struct dm_crtc_state *dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
         |                         ^~~~~~~~~~~~~~~~~
   At top level:
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3598:11: warning: 'dm_get_backlight_level' defined but not used [-Wunused-function]
    3598 | static u8 dm_get_backlight_level(struct amdgpu_encoder *amdgpu_encoder)
         |           ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3592:13: warning: 'dm_set_backlight_level' defined but not used [-Wunused-function]
    3592 | static void dm_set_backlight_level(struct amdgpu_encoder *amdgpu_encoder,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:93:
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:208:29: warning: 'FUSE_BASE' defined but not used [-Wunused-const-variable=]
     208 | static const struct IP_BASE FUSE_BASE   = { { { { 0x00017400, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:203:29: warning: 'CLK_BASE' defined but not used [-Wunused-const-variable=]
     203 | static const struct IP_BASE CLK_BASE   = { { { { 0x00016C00, 0, 0, 0, 0 } },
         |                             ^~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:198:29: warning: 'PWR_BASE' defined but not used [-Wunused-const-variable=]
     198 | static const struct IP_BASE PWR_BASE   = { { { { 0x00016A00, 0, 0, 0, 0 } },
         |                             ^~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:193:29: warning: 'SMUIO_BASE' defined but not used [-Wunused-const-variable=]
     193 | static const struct IP_BASE SMUIO_BASE   = { { { { 0x00016800, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:188:29: warning: 'THM_BASE' defined but not used [-Wunused-const-variable=]
     188 | static const struct IP_BASE THM_BASE   = { { { { 0x00016600, 0, 0, 0, 0 } },
         |                             ^~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:183:29: warning: 'UMC_BASE' defined but not used [-Wunused-const-variable=]
     183 | static const struct IP_BASE UMC_BASE   = { { { { 0x00014000, 0, 0, 0, 0 } },
         |                             ^~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:178:29: warning: 'XDMA_BASE' defined but not used [-Wunused-const-variable=]
     178 | static const struct IP_BASE XDMA_BASE   = { { { { 0x00003400, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:173:29: warning: 'SDMA1_BASE' defined but not used [-Wunused-const-variable=]
     173 | static const struct IP_BASE SDMA1_BASE   = { { { { 0x00001460, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:168:29: warning: 'SDMA0_BASE' defined but not used [-Wunused-const-variable=]
     168 | static const struct IP_BASE SDMA0_BASE   = { { { { 0x00001260, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:163:29: warning: 'OSSSYS_BASE' defined but not used [-Wunused-const-variable=]
     163 | static const struct IP_BASE OSSSYS_BASE  = { { { { 0x000010A0, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:158:29: warning: 'HDP_BASE' defined but not used [-Wunused-const-variable=]
     158 | static const struct IP_BASE HDP_BASE   = { { { { 0x00000F20, 0, 0, 0, 0 } },
         |                             ^~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:153:29: warning: 'RSMU_BASE' defined but not used [-Wunused-const-variable=]
     153 | static const struct IP_BASE RSMU_BASE   = { { { { 0x00012000, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:148:29: warning: 'MMHUB_BASE' defined but not used [-Wunused-const-variable=]
     148 | static const struct IP_BASE MMHUB_BASE   = { { { { 0x0001A000, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:143:29: warning: 'GC_BASE' defined but not used [-Wunused-const-variable=]
     143 | static const struct IP_BASE GC_BASE   = { { { { 0x00002000, 0x0000A000, 0, 0, 0 } },
         |                             ^~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:138:29: warning: 'VCE_BASE' defined but not used [-Wunused-const-variable=]
     138 | static const struct IP_BASE VCE_BASE   = { { { { 0x00007E00, 0x00048800, 0, 0, 0 } },
         |                             ^~~~~~~~
   drivers/gpu/drm/amd/include/vega10_ip_offset.h:133:29: warning: 'ATHUB_BASE' defined but not used [-Wunused-const-variable=]
     133 | static const struct IP_BASE ATHUB_BASE   = { { { { 0x00000C20, 0, 0, 0, 0 } },
         |                             ^~~~~~~~~~

vim +3987 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c

  3983	
  3984	static int get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb,
  3985			       uint64_t *tiling_flags, bool *tmz_surface)
  3986	{
> 3987		struct amdgpu_bo *rbo = gem_to_amdgpu_bo(drm_gem_fb_get_obj(&amdgpu_fb->base, 0));
  3988		int r = amdgpu_bo_reserve(rbo, false);
  3989	
  3990		if (unlikely(r)) {
  3991			/* Don't show error message when returning -ERESTARTSYS */
  3992			if (r != -ERESTARTSYS)
  3993				DRM_ERROR("Unable to reserve buffer: %d\n", r);
  3994			return r;
  3995		}
  3996	
  3997		if (tiling_flags)
  3998			amdgpu_bo_get_tiling_flags(rbo, tiling_flags);
  3999	
  4000		if (tmz_surface)
  4001			*tmz_surface = amdgpu_bo_encrypted(rbo);
  4002	
  4003		amdgpu_bo_unreserve(rbo);
  4004	
  4005		return r;
  4006	}
  4007	

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux