* [bug report] drm/amd/display: Do full modeset when DSC debugfs is changed
@ 2020-12-04 15:18 Dan Carpenter
2020-12-08 15:54 ` Brol, Eryk
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-12-04 15:18 UTC (permalink / raw)
To: eryk.brol; +Cc: amd-gfx
Hello Eryk Brol,
This is a semi-automatic email about new static checker warnings.
The patch 115a385c08d8: "drm/amd/display: Do full modeset when DSC
debugfs is changed" from Nov 19, 2020, leads to the following Smatch
complaint:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9335 amdgpu_dm_atomic_check()
warn: variable dereferenced before check 'new_crtc_state' (see line 9318)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
9317
9318 if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&
9319 !new_crtc_state->color_mgmt_changed &&
9320 old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled &&
9321 dm_old_crtc_state->dsc_force_changed == false)
9322 continue;
9323
9324 if (!new_crtc_state->enable)
^^^^^^^^^^^^^^^^^^^^^^
This is already dereferenced
9325 continue;
9326
9327 ret = drm_atomic_add_affected_connectors(state, crtc);
9328 if (ret)
9329 return ret;
9330
9331 ret = drm_atomic_add_affected_planes(state, crtc);
9332 if (ret)
9333 goto fail;
9334
9335 if (dm_old_crtc_state->dsc_force_changed && new_crtc_state)
^^^^^^^^^^^^^^
So hopefully this NULL check can be removed?
9336 new_crtc_state->mode_changed = true;
9337 }
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] drm/amd/display: Do full modeset when DSC debugfs is changed
2020-12-04 15:18 [bug report] drm/amd/display: Do full modeset when DSC debugfs is changed Dan Carpenter
@ 2020-12-08 15:54 ` Brol, Eryk
0 siblings, 0 replies; 2+ messages in thread
From: Brol, Eryk @ 2020-12-08 15:54 UTC (permalink / raw)
To: Dan Carpenter; +Cc: amd-gfx
[-- Attachment #1.1: Type: text/plain, Size: 2190 bytes --]
[AMD Official Use Only - Internal Distribution Only]
Hi Dan,
Thanks for catching this!
I've removed the extra NULL check as it's not needed.
Cheers,
Eryk Brol
________________________________
From: Dan Carpenter <dan.carpenter@oracle.com>
Sent: Friday, December 4, 2020 10:18 AM
To: Brol, Eryk <Eryk.Brol@amd.com>
Cc: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Subject: [bug report] drm/amd/display: Do full modeset when DSC debugfs is changed
Hello Eryk Brol,
This is a semi-automatic email about new static checker warnings.
The patch 115a385c08d8: "drm/amd/display: Do full modeset when DSC
debugfs is changed" from Nov 19, 2020, leads to the following Smatch
complaint:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9335 amdgpu_dm_atomic_check()
warn: variable dereferenced before check 'new_crtc_state' (see line 9318)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
9317
9318 if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&
9319 !new_crtc_state->color_mgmt_changed &&
9320 old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled &&
9321 dm_old_crtc_state->dsc_force_changed == false)
9322 continue;
9323
9324 if (!new_crtc_state->enable)
^^^^^^^^^^^^^^^^^^^^^^
This is already dereferenced
9325 continue;
9326
9327 ret = drm_atomic_add_affected_connectors(state, crtc);
9328 if (ret)
9329 return ret;
9330
9331 ret = drm_atomic_add_affected_planes(state, crtc);
9332 if (ret)
9333 goto fail;
9334
9335 if (dm_old_crtc_state->dsc_force_changed && new_crtc_state)
^^^^^^^^^^^^^^
So hopefully this NULL check can be removed?
9336 new_crtc_state->mode_changed = true;
9337 }
regards,
dan carpenter
[-- Attachment #1.2: Type: text/html, Size: 6453 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-08 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 15:18 [bug report] drm/amd/display: Do full modeset when DSC debugfs is changed Dan Carpenter
2020-12-08 15:54 ` Brol, Eryk
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.