drm/amd/display: Fix ABM memory alignment issue
authorWyatt Wood <wyatt.wood@amd.com>
Fri, 1 May 2020 00:04:47 +0000 (20:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 May 2020 18:00:48 +0000 (14:00 -0400)
commit1db14695929f26a8f524f5c7af7d30265374b51d
treefbd311bb3a3f0fa113f15ef8682893754e3f2322
parent7b8a6362fa146b78398d2cb9380cc7f3cb2145d3
drm/amd/display: Fix ABM memory alignment issue

[Why]
Due to packing of abm_config_table, memory addresses aren't aligned to
32 bit boundary dmcub prefers.  Therefore when using pointers to this
structure, it's possible that dmcub will automatically align the data
read from that address, yielding incorrect values.

[How]
Instead of packing 1 byte boundary, explicitly pack values to 4 byte
boundary. Since there is a dependency on the existing iram table
structure on driver side, we must copy to a second structure, which is
aligned correctly, before passing to fw.

Signed-off-by: Wyatt Wood <wyatt.wood@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/power/power_helpers.c