Check for valid hsync to declare sync detected for VGA

Checking for the sync bits of the sync detect register does not always
work reliably, as the bit is sometimes set before a mode is detected.
Subsequently detecting the mode will fail.

This adds a check for a valid hsync to declare sync as detected, which
ensures that the following mode detection will not fail.

While at it, this moves the modes data to a tuples array so that it can
be used without duplication for all mode-detection-related methods.

Test=Apply various mode and check that mode detection works every time

Change-Id: Id0d8c5ae88a08237d0da6d420baa00ee2ada615c
Signed-off-by: Paul Kocialkowski <>
Reviewed-by: Hsu Wei-Cheng <>
1 file changed