From patchwork Sun Mar 5 00:43:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 9604889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE0B760234 for ; Mon, 6 Mar 2017 00:10:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF98A27D0C for ; Mon, 6 Mar 2017 00:10:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B469D27F82; Mon, 6 Mar 2017 00:10:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4B33D27D0C for ; Mon, 6 Mar 2017 00:10:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EAF3F6E388; Mon, 6 Mar 2017 00:08:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id D79226E2BA for ; Sun, 5 Mar 2017 00:43:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB4D820272; Sun, 5 Mar 2017 00:43:44 +0000 (UTC) Received: from mail.kernel.org (dyndsl-091-248-083-177.ewe-ip-backbone.de [91.248.83.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6646A20251; Sun, 5 Mar 2017 00:43:43 +0000 (UTC) From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , Aaro Koskinen , Tomi Valkeinen , Laurent Pinchart Subject: [PATCHv2 09/10] drm: omapdrm: crtc: get manual mode displays working Date: Sun, 5 Mar 2017 01:43:08 +0100 Message-Id: <20170305004309.28259-9-sre@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170305004309.28259-1-sre@kernel.org> References: <20170304235021.27055-1-sre@kernel.org> <20170305004309.28259-1-sre@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-Mailman-Approved-At: Mon, 06 Mar 2017 00:08:29 +0000 Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Tony Lindgren 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 [On Nokia N950] Tested-By: Sebastian Reichel --- 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);