drm/arm/hdlcd: Actually validate CRTC modes
authorRobin Murphy <robin.murphy@arm.com>
Fri, 17 May 2019 16:37:21 +0000 (17:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jun 2019 03:35:58 +0000 (11:35 +0800)
commit7c7c88deb14d9295931a3be55c3fa08cb1ea91ea
tree8887f95044c95378df4833a88ffe8c4f48fdca3e
parent1fcb0e389538fc751ce092756f0564593b4dca20
drm/arm/hdlcd: Actually validate CRTC modes

[ Upstream commit b96151edced4edb6a18aa89a5fa02c7066efff45 ]

Rather than allowing any old mode through, then subsequently refusing
unmatchable clock rates in atomic_check when it's too late to back out
and pick a different mode, let's do that validation up-front where it
will cause unsupported modes to be correctly pruned in the first place.

This also eliminates an issue whereby a perceived clock rate of 0 would
cause atomic disable to fail and prevent the module from being unloaded.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/arm/hdlcd_crtc.c