drm/radeon: fix atombios on big endian
authorRoman Kapl <rka@sysgo.com>
Mon, 30 Oct 2017 10:56:13 +0000 (11:56 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 31 Oct 2017 22:24:59 +0000 (18:24 -0400)
commit4f626a4ac8f57ddabf06d03870adab91e463217f
tree96f38adcabc68d8934f4235ebe7bf77f6db400c3
parentbbb4d8d9ee81714b98c25df39a1ed90fa075e90a
drm/radeon: fix atombios on big endian

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>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
drivers/gpu/drm/radeon/atombios_dp.c