<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi Dan,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thanks for catching this!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
I've removed the extra NULL check as it's not needed.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Cheers,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Eryk Brol<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dan Carpenter <dan.carpenter@oracle.com><br>
<b>Sent:</b> Friday, December 4, 2020 10:18 AM<br>
<b>To:</b> Brol, Eryk <Eryk.Brol@amd.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> [bug report] drm/amd/display: Do full modeset when DSC debugfs is changed</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hello Eryk Brol,<br>
<br>
This is a semi-automatic email about new static checker warnings.<br>
<br>
The patch 115a385c08d8: "drm/amd/display: Do full modeset when DSC<br>
debugfs is changed" from Nov 19, 2020, leads to the following Smatch<br>
complaint:<br>
<br>
    drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9335 amdgpu_dm_atomic_check()<br>
    warn: variable dereferenced before check 'new_crtc_state' (see line 9318)<br>
<br>
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c<br>
  9317  <br>
  9318                  if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&<br>
  9319                      !new_crtc_state->color_mgmt_changed &&<br>
  9320                      old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled &&<br>
  9321                          dm_old_crtc_state->dsc_force_changed == false)<br>
  9322                          continue;<br>
  9323  <br>
  9324                  if (!new_crtc_state->enable)<br>
                             ^^^^^^^^^^^^^^^^^^^^^^<br>
This is already dereferenced<br>
<br>
  9325                          continue;<br>
  9326  <br>
  9327                  ret = drm_atomic_add_affected_connectors(state, crtc);<br>
  9328                  if (ret)<br>
  9329                          return ret;<br>
  9330  <br>
  9331                  ret = drm_atomic_add_affected_planes(state, crtc);<br>
  9332                  if (ret)<br>
  9333                          goto fail;<br>
  9334  <br>
  9335                  if (dm_old_crtc_state->dsc_force_changed && new_crtc_state)<br>
                                                                    ^^^^^^^^^^^^^^<br>
So hopefully this NULL check can be removed?<br>
<br>
  9336                          new_crtc_state->mode_changed = true;<br>
  9337          }<br>
<br>
regards,<br>
dan carpenter<br>
</div>
</span></font></div>
</div>
</body>
</html>