OSDN Git Service

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:26:36 +0000 (11:26 +0100)
commit8153a0fc1212157a4bf8b303cbf51993ff87aa7c
tree755cb11aadc80c1b2e44d1ce1ee47b0ba201695b
parente3c5870862d95ff198a1902c3d7bd2a548b89ea7
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