All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7441 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 7400)
@ 2021-11-26  9:55 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-26  9:55 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Simon Ser <contact@emersion.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a4849f6000e29235a2707f22e39da6b897bb9543
commit: 03a663673063d04c2358be754a08e62a465bb8f0 drm/amd/display: use FB pitch to fill dc_cursor_attributes
date:   12 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 12 months ago
config: x86_64-randconfig-m001-20211116 (https://download.01.org/0day-ci/archive/20211126/202111261753.acm85tTj-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7441 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 7400)

Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1193 amdgpu_dm_fini() warn: variable dereferenced before check 'adev->dm.dc' (see line 1182)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5245 create_stream_for_sink() error: we previously assumed 'aconnector->dc_sink' could be null (see line 5120)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9327 amdgpu_dm_atomic_check() warn: variable dereferenced before check 'new_crtc_state' (see line 9310)

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

2a8f6ccb665c6ac Harry Wentland      2017-07-31  7391  
3ee6b26b78e4782 Alex Deucher        2017-10-10  7392  static void handle_cursor_update(struct drm_plane *plane,
e7b07ceef2a650e Harry Wentland      2017-08-10  7393  				 struct drm_plane_state *old_plane_state)
e7b07ceef2a650e Harry Wentland      2017-08-10  7394  {
1348969ab68cb86 Luben Tuikov        2020-08-24  7395  	struct amdgpu_device *adev = drm_to_adev(plane->dev);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7396  	struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(plane->state->fb);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7397  	struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7398  	struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7399  	struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
2a8f6ccb665c6ac Harry Wentland      2017-07-31 @7400  	uint64_t address = afb ? afb->address : 0;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7401  	struct dc_cursor_position position;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7402  	struct dc_cursor_attributes attributes;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7403  	int ret;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7404  
e7b07ceef2a650e Harry Wentland      2017-08-10  7405  	if (!plane->state->fb && !old_plane_state->fb)
e7b07ceef2a650e Harry Wentland      2017-08-10  7406  		return;
e7b07ceef2a650e Harry Wentland      2017-08-10  7407  
f1ad2f5efd29dc8 Harry Wentland      2017-09-12  7408  	DRM_DEBUG_DRIVER("%s: crtc_id=%d with size %d to %d\n",
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7409  			 __func__,
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7410  			 amdgpu_crtc->crtc_id,
e7b07ceef2a650e Harry Wentland      2017-08-10  7411  			 plane->state->crtc_w,
e7b07ceef2a650e Harry Wentland      2017-08-10  7412  			 plane->state->crtc_h);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7413  
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7414  	ret = get_cursor_position(plane, crtc, &position);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7415  	if (ret)
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7416  		return;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7417  
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7418  	if (!position.enable) {
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7419  		/* turn off cursor */
674e78acae0dfb4 Nicholas Kazlauskas 2018-12-05  7420  		if (crtc_state && crtc_state->stream) {
674e78acae0dfb4 Nicholas Kazlauskas 2018-12-05  7421  			mutex_lock(&adev->dm.dc_lock);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7422  			dc_stream_set_cursor_position(crtc_state->stream,
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7423  						      &position);
674e78acae0dfb4 Nicholas Kazlauskas 2018-12-05  7424  			mutex_unlock(&adev->dm.dc_lock);
674e78acae0dfb4 Nicholas Kazlauskas 2018-12-05  7425  		}
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7426  		return;
e7b07ceef2a650e Harry Wentland      2017-08-10  7427  	}
e7b07ceef2a650e Harry Wentland      2017-08-10  7428  
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7429  	amdgpu_crtc->cursor_width = plane->state->crtc_w;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7430  	amdgpu_crtc->cursor_height = plane->state->crtc_h;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7431  
c1cefe115d1cdc4 tiancyin            2019-04-01  7432  	memset(&attributes, 0, sizeof(attributes));
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7433  	attributes.address.high_part = upper_32_bits(address);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7434  	attributes.address.low_part  = lower_32_bits(address);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7435  	attributes.width             = plane->state->crtc_w;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7436  	attributes.height            = plane->state->crtc_h;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7437  	attributes.color_format      = CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7438  	attributes.rotation_angle    = 0;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7439  	attributes.attribute_flags.value = 0;
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7440  
03a663673063d04 Simon Ser           2020-12-02 @7441  	attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7442  
886daac91d4c794 Jerry Zuo           2017-10-05  7443  	if (crtc_state->stream) {
674e78acae0dfb4 Nicholas Kazlauskas 2018-12-05  7444  		mutex_lock(&adev->dm.dc_lock);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7445  		if (!dc_stream_set_cursor_attributes(crtc_state->stream,
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7446  							 &attributes))
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7447  			DRM_ERROR("DC failed to set cursor attributes\n");
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7448  
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7449  		if (!dc_stream_set_cursor_position(crtc_state->stream,
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7450  						   &position))
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7451  			DRM_ERROR("DC failed to set cursor position\n");
674e78acae0dfb4 Nicholas Kazlauskas 2018-12-05  7452  		mutex_unlock(&adev->dm.dc_lock);
2a8f6ccb665c6ac Harry Wentland      2017-07-31  7453  	}
886daac91d4c794 Jerry Zuo           2017-10-05  7454  }
e7b07ceef2a650e Harry Wentland      2017-08-10  7455  

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7441 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 7400)
@ 2021-11-27 21:19 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-11-27 21:19 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Simon Ser <contact@emersion.fr>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c5c17547b778975b3d83a73c8d84e8fb5ecf3ba5
commit: 03a663673063d04c2358be754a08e62a465bb8f0 drm/amd/display: use FB pitch to fill dc_cursor_attributes
date:   12 months ago
:::::: branch date: 24 hours ago
:::::: commit date: 12 months ago
config: x86_64-randconfig-m001-20211116 (https://download.01.org/0day-ci/archive/20211128/202111280505.IRLKZ2M3-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7441 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 7400)

Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1193 amdgpu_dm_fini() warn: variable dereferenced before check 'adev->dm.dc' (see line 1182)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5245 create_stream_for_sink() error: we previously assumed 'aconnector->dc_sink' could be null (see line 5120)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9327 amdgpu_dm_atomic_check() warn: variable dereferenced before check 'new_crtc_state' (see line 9310)

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

2a8f6ccb665c6a Harry Wentland      2017-07-31  7391  
3ee6b26b78e478 Alex Deucher        2017-10-10  7392  static void handle_cursor_update(struct drm_plane *plane,
e7b07ceef2a650 Harry Wentland      2017-08-10  7393  				 struct drm_plane_state *old_plane_state)
e7b07ceef2a650 Harry Wentland      2017-08-10  7394  {
1348969ab68cb8 Luben Tuikov        2020-08-24  7395  	struct amdgpu_device *adev = drm_to_adev(plane->dev);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7396  	struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(plane->state->fb);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7397  	struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7398  	struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7399  	struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
2a8f6ccb665c6a Harry Wentland      2017-07-31 @7400  	uint64_t address = afb ? afb->address : 0;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7401  	struct dc_cursor_position position;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7402  	struct dc_cursor_attributes attributes;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7403  	int ret;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7404  
e7b07ceef2a650 Harry Wentland      2017-08-10  7405  	if (!plane->state->fb && !old_plane_state->fb)
e7b07ceef2a650 Harry Wentland      2017-08-10  7406  		return;
e7b07ceef2a650 Harry Wentland      2017-08-10  7407  
f1ad2f5efd29dc Harry Wentland      2017-09-12  7408  	DRM_DEBUG_DRIVER("%s: crtc_id=%d with size %d to %d\n",
2a8f6ccb665c6a Harry Wentland      2017-07-31  7409  			 __func__,
2a8f6ccb665c6a Harry Wentland      2017-07-31  7410  			 amdgpu_crtc->crtc_id,
e7b07ceef2a650 Harry Wentland      2017-08-10  7411  			 plane->state->crtc_w,
e7b07ceef2a650 Harry Wentland      2017-08-10  7412  			 plane->state->crtc_h);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7413  
2a8f6ccb665c6a Harry Wentland      2017-07-31  7414  	ret = get_cursor_position(plane, crtc, &position);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7415  	if (ret)
2a8f6ccb665c6a Harry Wentland      2017-07-31  7416  		return;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7417  
2a8f6ccb665c6a Harry Wentland      2017-07-31  7418  	if (!position.enable) {
2a8f6ccb665c6a Harry Wentland      2017-07-31  7419  		/* turn off cursor */
674e78acae0dfb Nicholas Kazlauskas 2018-12-05  7420  		if (crtc_state && crtc_state->stream) {
674e78acae0dfb Nicholas Kazlauskas 2018-12-05  7421  			mutex_lock(&adev->dm.dc_lock);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7422  			dc_stream_set_cursor_position(crtc_state->stream,
2a8f6ccb665c6a Harry Wentland      2017-07-31  7423  						      &position);
674e78acae0dfb Nicholas Kazlauskas 2018-12-05  7424  			mutex_unlock(&adev->dm.dc_lock);
674e78acae0dfb Nicholas Kazlauskas 2018-12-05  7425  		}
2a8f6ccb665c6a Harry Wentland      2017-07-31  7426  		return;
e7b07ceef2a650 Harry Wentland      2017-08-10  7427  	}
e7b07ceef2a650 Harry Wentland      2017-08-10  7428  
2a8f6ccb665c6a Harry Wentland      2017-07-31  7429  	amdgpu_crtc->cursor_width = plane->state->crtc_w;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7430  	amdgpu_crtc->cursor_height = plane->state->crtc_h;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7431  
c1cefe115d1cdc tiancyin            2019-04-01  7432  	memset(&attributes, 0, sizeof(attributes));
2a8f6ccb665c6a Harry Wentland      2017-07-31  7433  	attributes.address.high_part = upper_32_bits(address);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7434  	attributes.address.low_part  = lower_32_bits(address);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7435  	attributes.width             = plane->state->crtc_w;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7436  	attributes.height            = plane->state->crtc_h;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7437  	attributes.color_format      = CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7438  	attributes.rotation_angle    = 0;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7439  	attributes.attribute_flags.value = 0;
2a8f6ccb665c6a Harry Wentland      2017-07-31  7440  
03a663673063d0 Simon Ser           2020-12-02 @7441  	attributes.pitch = afb->base.pitches[0] / afb->base.format->cpp[0];
2a8f6ccb665c6a Harry Wentland      2017-07-31  7442  
886daac91d4c79 Jerry Zuo           2017-10-05  7443  	if (crtc_state->stream) {
674e78acae0dfb Nicholas Kazlauskas 2018-12-05  7444  		mutex_lock(&adev->dm.dc_lock);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7445  		if (!dc_stream_set_cursor_attributes(crtc_state->stream,
2a8f6ccb665c6a Harry Wentland      2017-07-31  7446  							 &attributes))
2a8f6ccb665c6a Harry Wentland      2017-07-31  7447  			DRM_ERROR("DC failed to set cursor attributes\n");
2a8f6ccb665c6a Harry Wentland      2017-07-31  7448  
2a8f6ccb665c6a Harry Wentland      2017-07-31  7449  		if (!dc_stream_set_cursor_position(crtc_state->stream,
2a8f6ccb665c6a Harry Wentland      2017-07-31  7450  						   &position))
2a8f6ccb665c6a Harry Wentland      2017-07-31  7451  			DRM_ERROR("DC failed to set cursor position\n");
674e78acae0dfb Nicholas Kazlauskas 2018-12-05  7452  		mutex_unlock(&adev->dm.dc_lock);
2a8f6ccb665c6a Harry Wentland      2017-07-31  7453  	}
886daac91d4c79 Jerry Zuo           2017-10-05  7454  }
e7b07ceef2a650 Harry Wentland      2017-08-10  7455  

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-27 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  9:55 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7441 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 7400) kernel test robot
2021-11-27 21:19 kernel test robot

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.