[PATCH 05/35] drm/amd/display: Initialize stream_update to zero
Nils Wallménius
nils.wallmenius at gmail.com
Sun Feb 3 17:45:18 UTC 2019
Hi,
Recently several locations initing structs to zero have been changed to use
memset [1]. Might want to do that here as well.
[1] https://lists.freedesktop.org/archives/amd-gfx/2019-February/031116.html
Regards
Nils
Den fre 1 feb. 2019 16:29 skrev Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com
>:
> From: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
>
> [Why]
> The stream_update struct is left unitialized but DC will access
> its fields. This usually results in global state validation occur
> during any atomic commit with state->allow_modeset = true.
>
> [How]
> Initialize the struct to zero for every stream we check.
>
> Change-Id: Ib7f435cc2c045fc43496bea35d08a14ce8193c33
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
> Reviewed-by: David Francis <David.Francis at amd.com>
> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index d7e5391eb432..6550d00128dc 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5868,7 +5868,6 @@ dm_determine_update_type_for_commit(struct dc *dc,
>
> struct dc_surface_update *updates;
> struct dc_plane_state *surface;
> - struct dc_stream_update stream_update;
> enum surface_update_type update_type = UPDATE_TYPE_FAST;
>
> updates = kcalloc(MAX_SURFACES, sizeof(*updates), GFP_KERNEL);
> @@ -5882,6 +5881,8 @@ dm_determine_update_type_for_commit(struct dc *dc,
> }
>
> for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
> new_crtc_state, i) {
> + struct dc_stream_update stream_update = { 0 };
> +
> new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);
> old_dm_crtc_state = to_dm_crtc_state(old_crtc_state);
> num_plane = 0;
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190203/e061179d/attachment.html>
More information about the amd-gfx
mailing list