From patchwork Tue Mar 8 16:39:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 8539981 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 84626C0553 for ; Wed, 9 Mar 2016 00:50:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B488C201D3 for ; Wed, 9 Mar 2016 00:50:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BBE6A20251 for ; Wed, 9 Mar 2016 00:50:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC35A6E7D0; Wed, 9 Mar 2016 00:49:45 +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 5DC396E734 for ; Tue, 8 Mar 2016 16:50:03 +0000 (UTC) Received: by ring0.de (Postfix, from userid 110) id B48A2A4A848; Tue, 8 Mar 2016 17:40:51 +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 77A88A4A80A; Tue, 8 Mar 2016 17:40:22 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , Aaro Koskinen , Tomi Valkeinen Subject: [PATCH 14/23] drm: omapdrm: crtc: save framedone callback from dss Date: Tue, 8 Mar 2016 17:39:46 +0100 Message-Id: <1457455195-1938-15-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 Save the framedone callback supplied by dss for later usage. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/omap_crtc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 094e89a2fa94..3ce7143e5a5f 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -57,6 +57,9 @@ struct omap_crtc { unsigned long state; wait_queue_head_t pending_wait; + + void (*framedone_handler)(void *); + void *framedone_handler_data; }; /* ----------------------------------------------------------------------------- @@ -263,6 +266,17 @@ static int omap_crtc_dss_register_framedone( struct omap_overlay_manager *mgr, void (*handler)(void *), void *data) { + struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; + struct drm_device *dev = omap_crtc->base.dev; + + if (omap_crtc->framedone_handler) + return -EBUSY; + + dev_dbg(dev->dev, "register framedone %s", omap_crtc->name); + + omap_crtc->framedone_handler = handler; + omap_crtc->framedone_handler_data = data; + return 0; } @@ -270,6 +284,16 @@ static void omap_crtc_dss_unregister_framedone( struct omap_overlay_manager *mgr, void (*handler)(void *), void *data) { + struct omap_crtc *omap_crtc = omap_crtcs[mgr->id]; + struct drm_device *dev = omap_crtc->base.dev; + + dev_dbg(dev->dev, "unregister framedone %s", omap_crtc->name); + + WARN_ON(omap_crtc->framedone_handler != handler); + WARN_ON(omap_crtc->framedone_handler_data != data); + + omap_crtc->framedone_handler = NULL; + omap_crtc->framedone_handler_data = NULL; } static const struct dss_mgr_ops mgr_ops = {