[PATCH 2/3] drm/sti: do not set gdp pixel clock rate if mode is not set

Vincent Abriou vincent.abriou at st.com
Fri Feb 3 09:51:23 UTC 2017


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 at st.com>
---
 drivers/gpu/drm/sti/sti_gdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 7255234..7f6d079 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,
 	}
 
 	/* Set gdp clock */
-	if (gdp->clk_pix) {
+	if (mode->clock && gdp->clk_pix) {
 		struct clk *clkp;
 		int rate = mode->clock * 1000;
 		int res;
-- 
2.7.4



More information about the dri-devel mailing list