]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0525c24d1e488a30f491ef4ebcb472df5dde252f
treefbd311bb3a3f0fa113f15ef8682893754e3f2322
parent6856b0f7ac22017f8de73c5786c3a921dd9bb68d
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