drm/radeon: fix atombios on big endian
authorRoman Kapl <rka@sysgo.com>
Mon, 30 Oct 2017 10:56:13 +0000 (11:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2017 10:24:34 +0000 (11:24 +0100)
commit3405805db8bbe72e831059f93775e7048d5f742d
tree33e4e99ebe7b9b4e669ae76a9818ac64536b1e50
parent9cd48ba5fc9d1699fce31b625c32fd8bc77a28c0
drm/radeon: fix atombios on big endian

commit 4f626a4ac8f57ddabf06d03870adab91e463217f upstream.

The function for byteswapping the data send to/from atombios was buggy for
num_bytes not divisible by four. The function must be aware of the fact
that after byte-swapping the u32 units, valid bytes might end up after the
num_bytes boundary.

This patch was tested on kernel 3.12 and allowed us to sucesfully use
DisplayPort on and Radeon SI card. Namely it fixed the link training and
EDID readout.

The function is patched both in radeon and amd drivers, since the functions
and the fixes are identical.

Signed-off-by: Roman Kapl <rka@sysgo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
drivers/gpu/drm/radeon/atombios_dp.c