drm/radeon: avoid kernel segfault in vce when gpu fails to resume
authorJérôme Glisse <jglisse@redhat.com>
Mon, 6 Feb 2017 20:13:18 +0000 (15:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Feb 2017 01:59:16 +0000 (20:59 -0500)
commit3b4821f8a4597c01318f3bebe208789bcf80aac9
treec96598ceddd397682b27b96b9dc069b71c6b1c7f
parent5ada90d55f6f652ae1103dac38bb92b445a368c5
drm/radeon: avoid kernel segfault in vce when gpu fails to resume

When GPU fails to resume we can not trust that value we write to GPU
memory will post and we might get garbage (more like 0xffffffff on
x86) when reading them back. This trigger out of range memory access
in the kernel inside the vce resume code path.

This patch use canonical value to compute offset instead of reading
back value from GPU memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/vce_v1_0.c