• P
    [media] v4l2-dv-timings: fix rounding error in vsync_bp calculation · f6747658
    Prashant Laddha 提交于
    Changed the rounding offsets used in vsync_bp calculation in cvt and
    gtf timings. The results for vsync_bp should now match with results
    from timing generator spreadsheets for cvt and gtf standards.
    
    In the vsync_bp calculation for cvt, always round down the value of
    (CVT_MIN_VSYNC_BP / h_period_est) and then add 1. It thus, reflects
    the equation used in timing generator spreadsheet. Using 1999999 as
    rounding offset, could pontentially lead to bumping up the vsync_bp
    value by extra 1.
    
    In the vsync_bp calculations for gtf, instead of round up or round
    down, round the (CVT_MIN_VSYNC_BP / h_period_est) to the nearest
    integer.
    
    Thanks to Martin Bugge <marbugge@cisco.com> for validating with
    standards and suggestions on equations.
    
    Cc: Martin Bugge <marbugge@cisco.com>
    Signed-off-by: NPrashant Laddha <prladdha@cisco.com>
    Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
    f6747658
v4l2-dv-timings.c 19.8 KB