All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com
Cc: marcheu@chromium.org
Subject: [PATCH v4 08/34] drm/exynos: Remove apply manager callback
Date: Thu, 30 Jan 2014 16:19:07 -0500	[thread overview]
Message-ID: <1391116773-28471-9-git-send-email-seanpaul@chromium.org> (raw)
In-Reply-To: <1391116773-28471-1-git-send-email-seanpaul@chromium.org>

This patch removes the apply() manager callback in favor of putting the
relevant commits in the individual drivers. This will mitigate some of
the difference between the suspend/resume path and the dpms path

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---

Changes in v2:
 - This was previously in another patch, but moved since it warrants its own
Changes in v3:
 - Removed apply() from vidi
Changes in v4: None

 drivers/gpu/drm/exynos/exynos_drm_drv.h     |  2 --
 drivers/gpu/drm/exynos/exynos_drm_encoder.c |  6 ------
 drivers/gpu/drm/exynos/exynos_drm_fimd.c    | 22 +++++-----------------
 drivers/gpu/drm/exynos/exynos_drm_hdmi.c    | 17 -----------------
 drivers/gpu/drm/exynos/exynos_drm_vidi.c    |  1 -
 drivers/gpu/drm/exynos/exynos_hdmi.c        |  1 +
 drivers/gpu/drm/exynos/exynos_mixer.c       |  2 ++
 7 files changed, 8 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 5e82dc9..5912841 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -146,7 +146,6 @@ struct exynos_drm_display_ops {
  *
  * @initialize: initializes the manager with drm_dev
  * @dpms: control device power.
- * @apply: set timing, vblank and overlay data to registers.
  * @mode_fixup: fix mode data comparing to hw specific display mode.
  * @mode_set: convert drm_display_mode to hw specific display mode and
  *	      would be called by encoder->mode_set().
@@ -166,7 +165,6 @@ struct exynos_drm_manager_ops {
 	int (*initialize)(struct exynos_drm_manager *mgr,
 				struct drm_device *drm_dev);
 	void (*dpms)(struct exynos_drm_manager *mgr, int mode);
-	void (*apply)(struct exynos_drm_manager *mgr);
 	void (*mode_fixup)(struct exynos_drm_manager *mgr,
 				struct drm_connector *connector,
 				const struct drm_display_mode *mode,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index ec627fa..19ee84d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -57,8 +57,6 @@ static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode)
 static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 {
 	struct drm_device *dev = encoder->dev;
-	struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
-	struct exynos_drm_manager_ops *manager_ops = manager->ops;
 	struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
 
 	DRM_DEBUG_KMS("encoder dpms: %d\n", mode);
@@ -72,10 +70,6 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
 
 	switch (mode) {
 	case DRM_MODE_DPMS_ON:
-		if (manager_ops && manager_ops->apply)
-			if (!exynos_encoder->updated)
-				manager_ops->apply(manager);
-
 		exynos_drm_connector_power(encoder, mode);
 		exynos_encoder->dpms = mode;
 		break;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 411e90a..810c61f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -672,7 +672,6 @@ static void fimd_win_disable(struct exynos_drm_manager *mgr, int zpos)
 static struct exynos_drm_manager_ops fimd_manager_ops = {
 	.initialize = fimd_mgr_initialize,
 	.dpms = fimd_dpms,
-	.apply = fimd_apply,
 	.commit = fimd_commit,
 	.enable_vblank = fimd_enable_vblank,
 	.disable_vblank = fimd_disable_vblank,
@@ -883,6 +882,8 @@ static int fimd_activate(struct exynos_drm_manager *mgr, bool enable)
 			fimd_enable_vblank(mgr);
 
 		fimd_window_resume(dev);
+
+		fimd_apply(mgr);
 	} else {
 		fimd_window_suspend(dev);
 
@@ -1037,23 +1038,10 @@ static int fimd_resume(struct device *dev)
 	 * of pm runtime would still be 1 so in this case, fimd driver
 	 * should be on directly not drawing on pm runtime interface.
 	 */
-	if (!pm_runtime_suspended(dev)) {
-		int ret;
+	if (pm_runtime_suspended(dev))
+		return 0;
 
-		ret = fimd_activate(mgr, true);
-		if (ret < 0)
-			return ret;
-
-		/*
-		 * in case of dpms on(standby), fimd_apply function will
-		 * be called by encoder's dpms callback to update fimd's
-		 * registers but in case of sleep wakeup, it's not.
-		 * so fimd_apply function should be called at here.
-		 */
-		fimd_apply(mgr);
-	}
-
-	return 0;
+	return fimd_activate(mgr, true);
 }
 #endif
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index ca0a87f..c5de00a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -302,22 +302,6 @@ static void drm_hdmi_dpms(struct exynos_drm_manager *mgr, int mode)
 		hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode);
 }
 
-static void drm_hdmi_apply(struct exynos_drm_manager *mgr)
-{
-	struct drm_hdmi_context *ctx = mgr->ctx;
-	int i;
-
-	for (i = 0; i < MIXER_WIN_NR; i++) {
-		if (!ctx->enabled[i])
-			continue;
-		if (mixer_ops && mixer_ops->win_commit)
-			mixer_ops->win_commit(ctx->mixer_ctx->ctx, i);
-	}
-
-	if (hdmi_ops && hdmi_ops->commit)
-		hdmi_ops->commit(ctx->hdmi_ctx->ctx);
-}
-
 static void drm_mixer_win_mode_set(struct exynos_drm_manager *mgr,
 				struct exynos_drm_overlay *overlay)
 {
@@ -362,7 +346,6 @@ static void drm_mixer_win_disable(struct exynos_drm_manager *mgr, int zpos)
 static struct exynos_drm_manager_ops drm_hdmi_manager_ops = {
 	.initialize = drm_hdmi_mgr_initialize,
 	.dpms = drm_hdmi_dpms,
-	.apply = drm_hdmi_apply,
 	.enable_vblank = drm_hdmi_enable_vblank,
 	.disable_vblank = drm_hdmi_disable_vblank,
 	.wait_for_vblank = drm_hdmi_wait_for_vblank,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index e458b26..838edb0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -333,7 +333,6 @@ static void vidi_win_disable(struct exynos_drm_manager *mgr, int zpos)
 
 static struct exynos_drm_manager_ops vidi_manager_ops = {
 	.dpms = vidi_dpms,
-	.apply = vidi_apply,
 	.commit = vidi_commit,
 	.enable_vblank = vidi_enable_vblank,
 	.disable_vblank = vidi_disable_vblank,
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 9837926..520aafd 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1700,6 +1700,7 @@ static void hdmi_poweron(struct hdmi_context *hdata)
 	clk_prepare_enable(res->sclk_hdmi);
 
 	hdmiphy_poweron(hdata);
+	hdmi_commit(hdata);
 }
 
 static void hdmi_poweroff(struct hdmi_context *hdata)
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 23b9407..25a440a 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1058,6 +1058,8 @@ static void mixer_window_resume(struct mixer_context *ctx)
 		win_data = &ctx->win_data[i];
 		win_data->enabled = win_data->resume;
 		win_data->resume = false;
+		if (win_data->enabled)
+			mixer_win_commit(ctx, i);
 	}
 }
 
-- 
1.8.5.1

  parent reply	other threads:[~2014-01-30 21:20 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 21:18 [PATCH v4 00/34] drm/exynos: Refactor parts of the exynos driver Sean Paul
2014-01-30 21:19 ` [PATCH v4 01/34] drm/exynos: Rename hdmi_infoframe to avoid collision Sean Paul
2014-01-30 21:19 ` [PATCH v4 02/34] drm/exynos: Remove useless slab.h include Sean Paul
2014-01-30 21:19 ` [PATCH v4 03/34] drm/exynos: Merge overlay_ops into manager_ops Sean Paul
2014-01-30 21:19 ` [PATCH v4 04/34] drm/exynos: Add an initialize function to manager and display Sean Paul
2014-01-30 21:19 ` [PATCH v4 05/34] drm/exynos: Use manager_op initialize in fimd Sean Paul
2014-01-30 21:19 ` [PATCH v4 06/34] drm/exynos: hdmi: Implement initialize op for hdmi Sean Paul
2014-01-30 21:19 ` [PATCH v4 07/34] drm/exynos: Pass exynos_drm_manager in manager ops instead of dev Sean Paul
2014-01-30 21:19 ` Sean Paul [this message]
2014-01-30 21:19 ` [PATCH v4 09/34] drm/exynos: Remove dpms link between encoder/connector Sean Paul
2014-01-30 21:19 ` [PATCH v4 10/34] drm/exynos: Rename display_op power_on to dpms Sean Paul
2014-01-30 21:19 ` [PATCH v4 11/34] drm/exynos: Don't keep dpms state in encoder Sean Paul
2014-01-30 21:19 ` [PATCH v4 12/34] drm/exynos: Use unsigned long for possible_crtcs Sean Paul
2014-01-30 21:19 ` [PATCH v4 13/34] drm/exynos: Split manager/display/subdrv Sean Paul
2014-01-30 21:19 ` [PATCH v4 14/34] drm/exynos: hdmi: remove the i2c drivers and use devtree Sean Paul
2014-02-08  2:52   ` Tomasz Figa
2014-02-10  7:30     ` Inki Dae
2014-02-11 14:13       ` Tomasz Figa
2014-02-11 23:02     ` Olof Johansson
2014-02-12  0:44       ` Tomasz Figa
2014-02-14 14:13   ` Tomasz Stanislawski
2014-02-19 11:14     ` Inki Dae
2014-04-04 14:04       ` Tomasz Stanislawski
2014-02-19 11:43   ` Inki Dae
2014-01-30 21:19 ` [PATCH v4 15/34] ARM: dts: exynos: Add i2c phandles to hdmi node Sean Paul
2014-01-30 21:19 ` [PATCH v4 16/34] drm/exynos: Remove exynos_drm_hdmi shim Sean Paul
2014-01-30 21:19 ` [PATCH v4 17/34] drm/exynos: Use drm_mode_copy to copy modes Sean Paul
2014-01-30 21:19 ` [PATCH v4 18/34] drm/exynos: Disable unused crtc planes from crtc Sean Paul
2014-01-30 21:19 ` [PATCH v4 19/34] drm/exynos: Add mode_set manager operation Sean Paul
2014-01-30 21:19 ` [PATCH v4 20/34] drm/exynos: Implement mode_fixup " Sean Paul
2014-01-30 21:19 ` [PATCH v4 21/34] drm/exynos: Use mode_set to configure fimd Sean Paul
2014-02-10 10:36   ` Andrzej Hajda
2014-01-30 21:19 ` [PATCH v4 22/34] drm/exynos: Remove unused/useless fimd_context members Sean Paul
2014-01-30 21:19 ` [PATCH v4 23/34] drm/exynos: Move dp driver from video/ to drm/ Sean Paul
2014-01-30 21:19 ` [PATCH v4 24/34] drm/exynos: Move display implementation into dp Sean Paul
2014-01-30 21:19 ` [PATCH v4 25/34] ARM: dts: Move display-timings node from fimd to dp Sean Paul
2014-01-30 21:19 ` [PATCH v4 26/34] drm/exynos: Implement dpms display callback in DP Sean Paul
2014-01-30 21:19 ` [PATCH v4 27/34] drm/exynos: Clean up FIMD power on/off routines Sean Paul
2014-01-30 21:19 ` [PATCH v4 28/34] drm/exynos: Consolidate suspend/resume in drm_drv Sean Paul
2014-01-30 21:19 ` [PATCH v4 29/34] drm/exynos: Add create_connector callback Sean Paul
2014-01-30 21:19 ` [PATCH v4 30/34] drm/exynos: Implement drm_connector in hdmi directly Sean Paul
2014-01-30 21:19 ` [PATCH v4 31/34] drm/exynos: Implement drm_connector directly in dp driver Sean Paul
2014-01-30 21:19 ` [PATCH v4 32/34] drm/exynos: Implement drm_connector directly in vidi driver Sean Paul
2014-01-30 21:38   ` [PATCH v5 " Sean Paul
2014-01-30 21:19 ` [PATCH v4 33/34] drm/exynos: Move lvds bridge discovery into DP driver Sean Paul
2014-01-30 21:19 ` [PATCH v4 34/34] drm/exynos: Remove the exynos_drm_connector shim Sean Paul
2014-02-06 19:54 ` [PATCH v4 00/34] drm/exynos: Refactor parts of the exynos driver Olof Johansson
2014-02-07  4:13   ` Inki Dae
2014-02-08  2:48   ` Tomasz Figa
2014-02-27  4:43     ` Inki Dae
2014-02-27 13:49       ` Tomasz Figa
2014-02-27 17:09         ` Inki Dae
2014-02-28  2:28           ` Inki Dae
2014-03-04 11:03             ` Andrzej Hajda
2014-03-04 13:57               ` Inki Dae
2014-03-06 15:39                 ` Andrzej Hajda
2014-02-07 10:29 ` Tomasz Figa
2014-03-13  7:33 ` Inki Dae
2014-03-13 14:05   ` Tomasz Figa
2014-03-13 15:48     ` Inki Dae
2014-03-13 18:10       ` Tomasz Figa
2014-03-14 11:02         ` Inki Dae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391116773-28471-9-git-send-email-seanpaul@chromium.org \
    --to=seanpaul@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=marcheu@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.