From patchwork Tue Mar 8 16:39:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 8539931 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AC8B99F46A for ; Wed, 9 Mar 2016 00:50:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C943220218 for ; Wed, 9 Mar 2016 00:50:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DECE8201FE for ; Wed, 9 Mar 2016 00:50:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD4C26E7C5; Wed, 9 Mar 2016 00:49:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from ring0.de (ring0.de [IPv6:2a03:4000:6:1a1::1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44C846E73D for ; Tue, 8 Mar 2016 16:50:04 +0000 (UTC) Received: by ring0.de (Postfix, from userid 110) id 621E4A4A845; Tue, 8 Mar 2016 17:40:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from sre.ring0.de (host-091-097-051-039.ewe-ip-backbone.de [91.97.51.39]) by ring0.de (Postfix) with ESMTPSA id D2C27A4A807; Tue, 8 Mar 2016 17:40:19 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , Aaro Koskinen , Tomi Valkeinen Subject: [PATCH 10/23] drm: omapdrm: crtc: detect manually updated displays Date: Tue, 8 Mar 2016 17:39:42 +0100 Message-Id: <1457455195-1938-11-git-send-email-sre@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457455195-1938-1-git-send-email-sre@kernel.org> References: <1457455195-1938-1-git-send-email-sre@kernel.org> X-Mailman-Approved-At: Wed, 09 Mar 2016 00:49:40 +0000 Cc: linux-omap@vger.kernel.org, Laurent Pinchart , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.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 Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_crtc.c | 31 ++++++++++++++++++++++++++++++- drivers/gpu/drm/omapdrm/omap_drv.h | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 78ef9773cca1..8967013c1fb5 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -48,6 +48,7 @@ struct omap_crtc { struct omap_overlay_manager *mgr; struct omap_video_timings timings; + bool manually_updated; struct omap_drm_irq vblank_irq; struct omap_drm_irq error_irq; @@ -90,6 +91,12 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc) msecs_to_jiffies(50)); } +bool omap_crtc_is_manual_updated(struct drm_crtc *crtc) +{ + struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + return omap_crtc->manually_updated; +} + /* ----------------------------------------------------------------------------- * DSS Manager Functions */ @@ -154,6 +161,11 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable) omap_crtc->ignore_digit_sync_lost = true; } + if (omap_crtc->manually_updated) { + dev_dbg(dev->dev, "stallmode detected, not waiting for irq"); + return; + } + framedone_irq = dispc_mgr_get_framedone_irq(channel); vsync_irq = dispc_mgr_get_vsync_irq(channel); @@ -233,7 +245,13 @@ static void omap_crtc_dss_set_lcd_config(struct omap_overlay_manager *mgr, const struct dss_lcd_mgr_config *config) { struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; - DBG("%s", omap_crtc->name); + struct drm_device *dev = omap_crtc->base.dev; + struct drm_plane *plane; + + dev_dbg(dev->dev, "set lcd config for %s", omap_crtc->name); + + omap_crtc->manually_updated = dss_lcd_mgr_config_get_stallmode(config); + dispc_mgr_set_lcd_config(omap_crtc->channel, config); } @@ -358,10 +376,18 @@ static bool omap_crtc_mode_fixup(struct drm_crtc *crtc, static void omap_crtc_enable(struct drm_crtc *crtc) { struct omap_crtc *omap_crtc = to_omap_crtc(crtc); + struct omap_dss_device *display = omap_crtc->mgr->output->dst; struct drm_device *dev = crtc->dev; DBG("%s", omap_crtc->name); + /* manual updated display will not trigger vsync irq */ + /* omap_crtc->manually_updated is not yet set */ + if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { + dev_dbg(dev->dev, "manual update display detected!"); + return; + } + if (test_and_set_bit(crtc_pending, &omap_crtc->state)) dev_warn(dev->dev, "crtc enable while pending bit set!"); @@ -407,6 +433,9 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc, WARN_ON(omap_crtc->vblank_irq.registered); + if (omap_crtc->manually_updated) + return; + if (dispc_mgr_is_enabled(omap_crtc->channel)) { DBG("%s: GO", omap_crtc->name); diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index 5dfa93a3b505..71e2c2284b86 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h @@ -155,6 +155,7 @@ void omap_crtc_pre_uninit(void); struct drm_crtc *omap_crtc_init(struct drm_device *dev, struct drm_plane *plane, enum omap_channel channel, int id); int omap_crtc_wait_pending(struct drm_crtc *crtc); +bool omap_crtc_is_manual_updated(struct drm_crtc *crtc); struct drm_plane *omap_plane_init(struct drm_device *dev, int id, enum drm_plane_type type);