]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Fix overflow of watermark calcs at > 4k resolutions.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Tue, 13 Jun 2017 05:17:10 +0000 (07:17 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Jun 2017 13:25:05 +0000 (09:25 -0400)
commit12132c2cd7582103e445a59ccfce90c7383d479f
treefb212e9eb3c8a951b71dbcbd292fe4d633b9a57b
parentab7b3fddc45ba7b6d38b67945894da94488042f1
drm/amdgpu: Fix overflow of watermark calcs at > 4k resolutions.

Commit 860f071f79838a
("drm/amdgpu: Make display watermark calculations more accurate")
made watermark calculations more accurate, but not for > 4k
resolutions on 32-Bit architectures, as it introduced an integer
overflow for those setups and resolutions.

Fix this by proper u64 casting and division.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Fixes: 860f071f7983 ("drm/amdgpu: Make display watermark calculations more accurate")
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c