All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Sebastian Reichel <sre@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: David Airlie <airlied@linux.ie>,
	linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCHv2 09/10] drm: omapdrm: crtc: get manual mode displays working
Date: Sun,  5 Mar 2017 01:43:08 +0100	[thread overview]
Message-ID: <20170305004309.28259-9-sre@kernel.org> (raw)
In-Reply-To: <20170305004309.28259-1-sre@kernel.org>

From: Tony Lindgren <tony@atomide.com>

With manual mode displays we need to flush the panel manually.

Let's add flushing so we get Tomi's fbtest, kmstest, kmstest --flip,
and X and wayland working.

Signed-off-by: Tony Lindgren <tony@atomide.com>
[On Nokia N950]
Tested-By: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 4601533215d6..e07b0a0be4bf 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -97,6 +97,11 @@ bool omap_crtc_is_manual_updated(struct drm_crtc *crtc)
 	return omap_crtc->manually_updated;
 }
 
+static void omap_crtc_manual_needs_flush(struct drm_crtc *crtc)
+{
+	omap_crtc_flush(crtc, 0, 0, 0, 0);
+}
+
 /* -----------------------------------------------------------------------------
  * DSS Manager Functions
  */
@@ -139,7 +144,11 @@ static void omap_crtc_dss_disconnect(enum omap_channel channel,
 
 static void omap_crtc_dss_start_update(enum omap_channel channel)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[channel];
+	struct drm_crtc *crtc = &omap_crtc->base;
+
 	dispc_mgr_enable(channel, true);
+	omap_crtc_manual_needs_flush(crtc);
 }
 
 /* Called only from the encoder enable/disable and suspend/resume handlers. */
@@ -155,11 +164,12 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
 	if (WARN_ON(omap_crtc->enabled == enable))
 		return;
 
-	if (omap_crtc_output[channel]->output_type == OMAP_DISPLAY_TYPE_HDMI) {
-		dispc_mgr_enable(channel, enable);
-		omap_crtc->enabled = enable;
+	dispc_mgr_enable(channel, enable);
+	omap_crtc->enabled = enable;
+	omap_crtc_manual_needs_flush(crtc);
+
+	if (omap_crtc_output[channel]->output_type == OMAP_DISPLAY_TYPE_HDMI)
 		return;
-	}
 
 	if (omap_crtc->channel == OMAP_DSS_CHANNEL_DIGIT) {
 		/*
@@ -190,9 +200,6 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
 			wait = omap_irq_wait_init(dev, vsync_irq, 2);
 	}
 
-	dispc_mgr_enable(channel, enable);
-	omap_crtc->enabled = enable;
-
 	ret = omap_irq_wait(dev, wait, msecs_to_jiffies(100));
 	if (ret) {
 		dev_err(dev->dev, "%s: timeout waiting for %s\n",
@@ -554,6 +561,7 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
 		ret = drm_crtc_vblank_get(crtc);
 		WARN_ON(ret != 0);
 	}
+	omap_crtc_flush(&omap_crtc->base, 0, 0, 0, 0);
 
 	spin_lock_irq(&crtc->dev->event_lock);
 	dispc_mgr_enable(omap_crtc->channel, true);
-- 
2.11.0

  parent reply	other threads:[~2017-03-05  0:43 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-04 23:50 [PATCHv2 00/10] Nokia N950 basic display support Sebastian Reichel
2017-03-05  0:43 ` [PATCHv2 01/10] drm: omapdrm: panel-dsi-cm: Fix probe for device tree Sebastian Reichel
2017-03-05  0:43   ` [PATCHv2 02/10] drm: omapdrm: panel-dsi-cm: add regulator support Sebastian Reichel
2017-03-05  5:40     ` Tony Lindgren
2017-03-17 15:26     ` Pavel Machek
2017-03-17 15:26       ` Pavel Machek
2017-03-05  0:43   ` [PATCHv2 03/10] Revert "drm: omapdrm: Remove manual update display support" Sebastian Reichel
2017-03-20 11:07     ` Tomi Valkeinen
2017-03-20 11:07       ` Tomi Valkeinen
2017-03-20 16:14       ` Tony Lindgren
2017-03-20 16:35         ` Tomi Valkeinen
2017-03-20 16:35           ` Tomi Valkeinen
2017-03-20 16:43           ` Tony Lindgren
2017-03-05  0:43   ` [PATCHv2 04/10] drm: omapdrm: crtc: save framedone callback from dss Sebastian Reichel
2017-03-05  5:41     ` Tony Lindgren
2017-03-05  0:43   ` [PATCHv2 05/10] drm: omapdrm: crtc: detect manually updated displays Sebastian Reichel
2017-03-05  5:42     ` Tony Lindgren
2017-03-05  0:43   ` [PATCHv2 06/10] drm: omapdrm: crtc: add support for manual " Sebastian Reichel
2017-03-05  0:43   ` [PATCHv2 07/10] drm: omapdrm: plane: update fifo size on atomic update Sebastian Reichel
2017-03-05  0:43   ` [PATCHv2 08/10] drm: omapdrm: crtc: handle framedone directly Sebastian Reichel
2017-03-17 15:26     ` Pavel Machek
2017-03-17 15:26       ` Pavel Machek
2017-03-05  0:43   ` Sebastian Reichel [this message]
2017-03-05  5:39     ` [PATCHv2 09/10] drm: omapdrm: crtc: get manual mode displays working Tony Lindgren
2017-03-20 11:19     ` Tomi Valkeinen
2017-03-20 11:19       ` Tomi Valkeinen
2017-03-05  0:43   ` [PATCHv2 10/10] ARM: dts: n950: add display support Sebastian Reichel
2017-03-24 14:29     ` Tony Lindgren
2017-03-24 14:58       ` Tomi Valkeinen
2017-03-24 14:58         ` Tomi Valkeinen
2017-03-24 15:12         ` Tony Lindgren
2017-03-24 15:20           ` Tomi Valkeinen
2017-03-24 15:20             ` Tomi Valkeinen
2017-03-24 15:44             ` Tony Lindgren
2017-03-17 15:26   ` [PATCHv2 01/10] drm: omapdrm: panel-dsi-cm: Fix probe for device tree Pavel Machek
2017-03-17 15:26     ` Pavel Machek
2017-03-20 11:29 ` [PATCHv2 00/10] Nokia N950 basic display support Tomi Valkeinen
2017-03-20 11:29   ` Tomi Valkeinen
2017-03-21  9:38   ` Tomi Valkeinen
2017-03-21  9:38     ` Tomi Valkeinen
2017-03-21  9:54     ` Tomi Valkeinen
2017-03-21  9:54       ` Tomi Valkeinen

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=20170305004309.28259-9-sre@kernel.org \
    --to=sre@kernel.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    /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.