[PATCH] drm/exynos: fimd: fix trigger mode change regression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes a regression that Display panel doesn't work
since HW trigger mode was supported.

The trigger mode should be changed on PSR(Panel Self Refresh)
mode of Panel device according to HW guy's saying. However,
with previous HW trigger support, trigger mode could been changed
in normal mode of Panel device.

So this patch makes sure to change the trigger mode after power off
and on again. Later we need to add PSR relevant codes instead.

Signed-off-by: Inki Dae <inki.dae@xxxxxxxxxxx>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 35 ++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 3efe1aa..355149f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -203,6 +203,11 @@ struct fimd_context {
 	atomic_t			wait_vsync_event;
 	atomic_t			win_updated;
 	atomic_t			triggering;
+	/*
+	 * fimd_setup_trigger function will try to change trigger mode
+	 * only in case that this flag is set.
+	 */
+	atomic_t			deferred_tr_mode;
 
 	const struct fimd_driver_data *driver_data;
 	struct drm_encoder *encoder;
@@ -430,11 +435,37 @@ static void fimd_setup_trigger(struct fimd_context *ctx)
 	val &= ~(TRGMODE_ENABLE);
 
 	if (trg_type == I80_HW_TRG) {
+		/*
+		 * change trigger mode after power off and on again.
+		 * deferred_tr_mode will be set when fimd_disable is called.
+		 *
+		 * TODO. Trigger mode should be changed on PSR mode of Panel
+		 * device. So we have to add relevant codes to make sure
+		 * entering into PSR mode later.
+		 */
+		if (val & TRGMODE_ENABLE &&
+		    !atomic_read(&ctx->deferred_tr_mode))
+			return;
+
 		if (ctx->driver_data->has_hw_trigger)
 			val |= HWTRGEN_ENABLE | HWTRGMASK_ENABLE;
 		if (ctx->driver_data->has_trigger_per_te)
 			val |= HWTRIGEN_PER_ENABLE;
 	} else {
+		/*
+		 * change trigger mode after power off and on again.
+		 * deferred_tr_mode will be set when fimd_disable is called.
+		 *
+		 * TODO. Trigger mode should be changed on PSR mode of Panel
+		 * device. So we have to add relevant codes to make sure
+		 * entering into PSR mode later.
+		 */
+		if (ctx->driver_data->has_hw_trigger) {
+			if (val & HWTRGEN_ENABLE &&
+			    !atomic_read(&ctx->deferred_tr_mode))
+				return;
+		}
+
 		val |= TRGMODE_ENABLE;
 	}
 
@@ -864,6 +895,10 @@ static void fimd_disable(struct exynos_drm_crtc *crtc)
 	writel(0, ctx->regs + VIDCON0);
 
 	pm_runtime_put_sync(ctx->dev);
+
+	if (ctx->i80_if)
+		atomic_set(&ctx->deferred_tr_mode, 1);
+
 	ctx->suspended = true;
 }
 
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux