drm/amd/display: System crashes when add_ptb_to_table() gets called
authorPeikang Zhang <peikang.zhang@amd.com>
Fri, 7 Feb 2020 21:53:28 +0000 (16:53 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Feb 2020 16:03:54 +0000 (11:03 -0500)
commit0062972b9d9f888d0273c6496769d02e8f509135
treeba1e6accd537dbca70ed54ad1387b12cffd057ee
parent586ec5dc5c8ea28f46b9e27415dfd0f4de01849e
drm/amd/display: System crashes when add_ptb_to_table() gets called

[Why]
Unused VMIDs were not evicted correctly

[How]
1. evict_vmids() logic was fixed;
2. Added boundary check for add_ptb_to_table() and
   clear_entry_from_vmid_table() to avoid crash caused by array out of
   boundary;
3. For mod_vmid_get_for_ptb(), vimd is changed from unsigned to signed
   due to vimd is signed.

Signed-off-by: Peikang Zhang <peikang.zhang@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/vmid/vmid.c