diff options
author | Jon Mayo <jmayo@nvidia.com> | 2011-07-20 13:51:19 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:57 -0800 |
commit | 2121df029ee3dbf8d24780173c9e643bf9b8c49c (patch) | |
tree | 6d5658e0178795a30bb6aa556c15c5c9b279fd79 /drivers/video/tegra/dc/hdmi.c | |
parent | 1ae26709ef296549b90b14e7957e4dbe79365487 (diff) |
video: tegra: dc: fix division by zero
Fixed the issue where comparing the pixel clocks of two modes can have a
subtraction result of 0, when this is passed to PICOS2KHZ a divide by
zero occurs.
Bug 850852
Original-Change-Id: I6cb22af6f1bbadd412d033982cbfb2ae31793b55
Reviewed-on: http://git-master/r/42241
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: Rc46985f9393b16e227aaa3f32d211babd5de1485
Diffstat (limited to 'drivers/video/tegra/dc/hdmi.c')
-rw-r--r-- | drivers/video/tegra/dc/hdmi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index 39b3379eda8b..164ecb26b634 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -652,8 +652,9 @@ static bool tegra_dc_hdmi_mode_equal(const struct fb_videomode *mode1, /* allows up to 1Hz of pixclock difference */ return mode1->xres == mode2->xres && mode1->yres == mode2->yres && + (mode1->pixclock == mode2->pixclock || (abs(PICOS2KHZ(mode1->pixclock - mode2->pixclock)) * - 1000 / clock_per_frame <= 1) && + 1000 / clock_per_frame <= 1)) && mode1->vmode == mode2->vmode; } |