CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Alex Deucher <[email protected]>
CC: Roman Li <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   38f80f42147ff658aff218edb0a88c37e58bf44f
commit: 7fd13baeb7a3a48cae12c36c52f06bf4e9e7d728 drm/amdgpu/display: add 
support for multiple backlights
date:   7 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 7 months ago
config: powerpc-randconfig-m031-20220301 
(https://download.01.org/0day-ci/archive/20220304/[email protected]/config)
compiler: powerpc-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3552 
amdgpu_dm_backlight_update_status() error: testing array offset 'i' after use.
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:3594 
amdgpu_dm_backlight_get_brightness() error: testing array offset 'i' after use.

Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1336 
amdgpu_dm_fini() error: we previously assumed 'adev->dm.dc' could be null (see 
line 1324)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1349 
amdgpu_dm_fini() warn: variable dereferenced before check 'adev->dm.dc' (see 
line 1336)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5888 
create_stream_for_sink() error: we previously assumed 'aconnector->dc_sink' 
could be null (see line 5786)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8194 
handle_cursor_update() error: we previously assumed 'afb' could be null (see 
line 8153)

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

4562236b3bc0a2 Harry Wentland 2017-09-12  3542  
3d6c91641bc8a8 Alex Deucher   2021-05-11  3543  static int 
amdgpu_dm_backlight_update_status(struct backlight_device *bd)
4562236b3bc0a2 Harry Wentland 2017-09-12  3544  {
620a0d27b211aa David Francis  2018-07-19  3545          struct 
amdgpu_display_manager *dm = bl_get_data(bd);
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3546          int i;
3d6c91641bc8a8 Alex Deucher   2021-05-11  3547  
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3548          for (i = 0; i < 
dm->num_of_edps; i++) {
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3549                  if (bd == 
dm->backlight_dev[i])
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3550                          break;
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3551          }
7fd13baeb7a3a4 Alex Deucher   2021-07-08 @3552          if (i >= 
AMDGPU_DM_MAX_NUM_EDP)
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3553                  i = 0;
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3554          
amdgpu_dm_backlight_set_level(dm, i, bd->props.brightness);
3d6c91641bc8a8 Alex Deucher   2021-05-11  3555  
3d6c91641bc8a8 Alex Deucher   2021-05-11  3556          return 0;
3d6c91641bc8a8 Alex Deucher   2021-05-11  3557  }
3d6c91641bc8a8 Alex Deucher   2021-05-11  3558  
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3559  static u32 
amdgpu_dm_backlight_get_level(struct amdgpu_display_manager *dm,
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3560                                  
         int bl_idx)
3d6c91641bc8a8 Alex Deucher   2021-05-11  3561  {
0ad3e64eb46d8c Alex Deucher   2020-12-10  3562          struct 
amdgpu_dm_backlight_caps caps;
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3563          struct dc_link *link = 
(struct dc_link *)dm->backlight_link[bl_idx];
0ad3e64eb46d8c Alex Deucher   2020-12-10  3564  
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3565          
amdgpu_dm_update_backlight_caps(dm, bl_idx);
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3566          caps = 
dm->backlight_caps[bl_idx];
0ad3e64eb46d8c Alex Deucher   2020-12-10  3567  
0ad3e64eb46d8c Alex Deucher   2020-12-10  3568          if (caps.aux_support) {
0ad3e64eb46d8c Alex Deucher   2020-12-10  3569                  u32 avg, peak;
0ad3e64eb46d8c Alex Deucher   2020-12-10  3570                  bool rc;
0ad3e64eb46d8c Alex Deucher   2020-12-10  3571  
0ad3e64eb46d8c Alex Deucher   2020-12-10  3572                  rc = 
dc_link_get_backlight_level_nits(link, &avg, &peak);
0ad3e64eb46d8c Alex Deucher   2020-12-10  3573                  if (!rc)
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3574                          return 
dm->brightness[bl_idx];
0ad3e64eb46d8c Alex Deucher   2020-12-10  3575                  return 
convert_brightness_to_user(&caps, avg);
0ad3e64eb46d8c Alex Deucher   2020-12-10  3576          } else {
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3577                  int ret = 
dc_link_get_backlight_level(link);
620a0d27b211aa David Francis  2018-07-19  3578  
620a0d27b211aa David Francis  2018-07-19  3579                  if (ret == 
DC_ERROR_UNEXPECTED)
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3580                          return 
dm->brightness[bl_idx];
0ad3e64eb46d8c Alex Deucher   2020-12-10  3581                  return 
convert_brightness_to_user(&caps, ret);
0ad3e64eb46d8c Alex Deucher   2020-12-10  3582          }
4562236b3bc0a2 Harry Wentland 2017-09-12  3583  }
4562236b3bc0a2 Harry Wentland 2017-09-12  3584  
3d6c91641bc8a8 Alex Deucher   2021-05-11  3585  static int 
amdgpu_dm_backlight_get_brightness(struct backlight_device *bd)
3d6c91641bc8a8 Alex Deucher   2021-05-11  3586  {
3d6c91641bc8a8 Alex Deucher   2021-05-11  3587          struct 
amdgpu_display_manager *dm = bl_get_data(bd);
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3588          int i;
3d6c91641bc8a8 Alex Deucher   2021-05-11  3589  
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3590          for (i = 0; i < 
dm->num_of_edps; i++) {
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3591                  if (bd == 
dm->backlight_dev[i])
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3592                          break;
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3593          }
7fd13baeb7a3a4 Alex Deucher   2021-07-08 @3594          if (i >= 
AMDGPU_DM_MAX_NUM_EDP)
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3595                  i = 0;
7fd13baeb7a3a4 Alex Deucher   2021-07-08  3596          return 
amdgpu_dm_backlight_get_level(dm, i);
3d6c91641bc8a8 Alex Deucher   2021-05-11  3597  }
3d6c91641bc8a8 Alex Deucher   2021-05-11  3598  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to