From patchwork Tue Mar 8 16:39:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 8539901 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CACEAC0553 for ; Wed, 9 Mar 2016 00:50:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 096B320211 for ; Wed, 9 Mar 2016 00:50:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D436420218 for ; Wed, 9 Mar 2016 00:49:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23BBC6E7C1; 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 [5.45.101.7]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B85A6E73B for ; Tue, 8 Mar 2016 16:50:04 +0000 (UTC) Received: by ring0.de (Postfix, from userid 110) id 8060CA4A840; Tue, 8 Mar 2016 17:40:47 +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 29221A4A81C; Tue, 8 Mar 2016 17:40:21 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , Aaro Koskinen , Tomi Valkeinen Subject: [PATCH 12/23] drm: omapdrm: plane: update fifo size on atomic update Date: Tue, 8 Mar 2016 17:39:44 +0100 Message-Id: <1457455195-1938-13-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:41 +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 This is a workaround for a hardware bug occuring on OMAP3 with manually updated panels. Signed-off-By: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_drv.h | 1 + drivers/gpu/drm/omapdrm/omap_plane.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index 71e2c2284b86..3ab4919aff4b 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h @@ -161,6 +161,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, int id, enum drm_plane_type type); void omap_plane_install_properties(struct drm_plane *plane, struct drm_mode_object *obj); +void omap_plane_update_fifo(struct drm_plane *plane); struct drm_encoder *omap_encoder_init(struct drm_device *dev, struct omap_dss_device *dssdev); diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index d75b197eff46..0147e416140c 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -75,6 +75,28 @@ static void omap_plane_cleanup_fb(struct drm_plane *plane, omap_framebuffer_unpin(old_state->fb); } +void omap_plane_update_fifo(struct drm_plane *plane) +{ + struct omap_plane *omap_plane = to_omap_plane(plane); + struct drm_plane_state *state = plane->state; + struct drm_device *dev = plane->dev; + bool use_fifo_merge = false; + u32 fifo_low, fifo_high; + bool use_manual_update; + + if (!dispc_ovl_enabled(omap_plane->id)) + return; + + use_manual_update = omap_crtc_is_manual_updated(state->crtc); + + dispc_ovl_compute_fifo_thresholds(omap_plane->id, &fifo_low, &fifo_high, + use_fifo_merge, use_manual_update); + + dev_dbg(dev->dev, "update fifo: %d %d", fifo_low, fifo_high); + + dispc_ovl_set_fifo_threshold(omap_plane->id, fifo_low, fifo_high); +} + static void omap_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *old_state) { @@ -141,6 +163,7 @@ static void omap_plane_atomic_update(struct drm_plane *plane, } dispc_ovl_enable(omap_plane->id, true); + omap_plane_update_fifo(plane); } static void omap_plane_atomic_disable(struct drm_plane *plane,