diff options
author | Vincent Abriou <vincent.abriou@st.com> | 2017-02-02 03:49:02 -0500 |
---|---|---|
committer | Vincent Abriou <vincent.abriou@st.com> | 2017-02-10 03:34:39 -0500 |
commit | c5649ee49761f5367c46c5ae6579ab8e8b03575d (patch) | |
tree | 6bf45a1847cb24c9720e14565b6c59605cd8ec77 | |
parent | 1b7f145123f4d59e6b88a83b507c7981df0ee701 (diff) |
drm/sti: do not set gdp pixel clock rate if mode is not set
Fix a division by 0 case : in some cases, when the GDP plane is being
disabled atomic_check() is called with "mode->clock = 0".
In that case, do not set parent and pixel clock rate.
Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
-rw-r--r-- | drivers/gpu/drm/sti/sti_gdp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index 7255234670c0..7f6d0790cca6 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c | |||
@@ -648,7 +648,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane, | |||
648 | } | 648 | } |
649 | 649 | ||
650 | /* Set gdp clock */ | 650 | /* Set gdp clock */ |
651 | if (gdp->clk_pix) { | 651 | if (mode->clock && gdp->clk_pix) { |
652 | struct clk *clkp; | 652 | struct clk *clkp; |
653 | int rate = mode->clock * 1000; | 653 | int rate = mode->clock * 1000; |
654 | int res; | 654 | int res; |