<div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto">Recently several locations initing structs to zero have been changed to use memset [1]. Might want to do that here as well.</div><div dir="auto"><br></div><div dir="auto">[1] <a href="https://lists.freedesktop.org/archives/amd-gfx/2019-February/031116.html">https://lists.freedesktop.org/archives/amd-gfx/2019-February/031116.html</a></div><div dir="auto"><br></div><div dir="auto">Regards</div><div dir="auto">Nils</div></div><br><div class="gmail_quote"><div dir="ltr">Den fre 1 feb. 2019 16:29 skrev Bhawanpreet Lakha <<a href="mailto:Bhawanpreet.Lakha@amd.com">Bhawanpreet.Lakha@amd.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Nicholas Kazlauskas <<a href="mailto:nicholas.kazlauskas@amd.com" target="_blank" rel="noreferrer">nicholas.kazlauskas@amd.com</a>><br>
<br>
[Why]<br>
The stream_update struct is left unitialized but DC will access<br>
its fields. This usually results in global state validation occur<br>
during any atomic commit with state->allow_modeset = true.<br>
<br>
[How]<br>
Initialize the struct to zero for every stream we check.<br>
<br>
Change-Id: Ib7f435cc2c045fc43496bea35d08a14ce8193c33<br>
Signed-off-by: Nicholas Kazlauskas <<a href="mailto:nicholas.kazlauskas@amd.com" target="_blank" rel="noreferrer">nicholas.kazlauskas@amd.com</a>><br>
Reviewed-by: David Francis <<a href="mailto:David.Francis@amd.com" target="_blank" rel="noreferrer">David.Francis@amd.com</a>><br>
Acked-by: Bhawanpreet Lakha <<a href="mailto:Bhawanpreet.Lakha@amd.com" target="_blank" rel="noreferrer">Bhawanpreet.Lakha@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-<br>
1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index d7e5391eb432..6550d00128dc 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -5868,7 +5868,6 @@ dm_determine_update_type_for_commit(struct dc *dc,<br>
<br>
struct dc_surface_update *updates;<br>
struct dc_plane_state *surface;<br>
- struct dc_stream_update stream_update;<br>
enum surface_update_type update_type = UPDATE_TYPE_FAST;<br>
<br>
updates = kcalloc(MAX_SURFACES, sizeof(*updates), GFP_KERNEL);<br>
@@ -5882,6 +5881,8 @@ dm_determine_update_type_for_commit(struct dc *dc,<br>
}<br>
<br>
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {<br>
+ struct dc_stream_update stream_update = { 0 };<br>
+<br>
new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);<br>
old_dm_crtc_state = to_dm_crtc_state(old_crtc_state);<br>
num_plane = 0;<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank" rel="noreferrer">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</blockquote></div>