From 93502b984119af556f8a204bf80a62bc1c21fbfd Mon Sep 17 00:00:00 2001
From: Sandor Yu <Sandor.yu@nxp.com>
Date: Tue, 17 Nov 2020 15:47:36 +0800
Subject: [PATCH 36/49] LF-2744: drm: cdns: reset force_mode_set flag in
 atomic_check

Reset force_mode_set flag in atomic_check function
to avoid set mode_changed flag multi times when cable plugin.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
---
 drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c
index cc429fe48abd..9fa0df74ad7c 100644
--- a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c
+++ b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 NXP semiconductor, inc.
+ * Copyright (c) 2019-2020 NXP semiconductor, inc.
  *
  * this program is free software; you can redistribute it and/or modify
  * it under the terms of the gnu general public license version 2 as
@@ -44,8 +44,11 @@ static int cdns_mhdp_imx_encoder_atomic_check(struct drm_encoder *encoder,
 	if (mhdp->plat_data->video_format != 0)
 		imx_crtc_state->bus_format = mhdp->plat_data->video_format;
 
-	if (mhdp->force_mode_set)
+	if (mhdp->force_mode_set) {
 		crtc_state->mode_changed = true;
+		/* reset force mode set flag */
+		mhdp->force_mode_set = false;
+	}
 
 	return 0;
 }
-- 
2.29.2

