From patchwork Wed Jul 1 08:21:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Zhang X-Patchwork-Id: 6704371 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 CA608C05AC for ; Wed, 1 Jul 2015 15:48:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2421220225 for ; Wed, 1 Jul 2015 15:48:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2D2A220458 for ; Wed, 1 Jul 2015 15:48:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 55CDF6EBA0; Wed, 1 Jul 2015 08:48:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hqemgate15.nvidia.com (hqemgate15.nvidia.com [216.228.121.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FB9F6EA8C for ; Wed, 1 Jul 2015 01:22:22 -0700 (PDT) Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Wed, 01 Jul 2015 01:22:43 -0700 Received: from HQMAIL105.nvidia.com ([172.20.187.12]) by hqnvupgp07.nvidia.com (PGP Universal service); Wed, 01 Jul 2015 01:22:05 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 01 Jul 2015 01:22:05 -0700 Received: from HQMAIL106.nvidia.com (172.18.146.12) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Wed, 1 Jul 2015 08:22:21 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server id 15.0.1044.25 via Frontend Transport; Wed, 1 Jul 2015 08:22:21 +0000 Received: from markz-home.nvidia.com (Not Verified[10.19.244.138]) by hqnvemgw01.nvidia.com with MailMarshal (v7, 1, 2, 5326) id ; Wed, 01 Jul 2015 01:22:20 -0700 From: Mark Zhang To: , Subject: [PATCH v2 07/12] drm/panel: Add panel func: idle/busy Date: Wed, 1 Jul 2015 16:21:50 +0800 Message-ID: <1435738915-31973-8-git-send-email-markz@nvidia.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1435738915-31973-1-git-send-email-markz@nvidia.com> References: <1435738915-31973-1-git-send-email-markz@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 01 Jul 2015 08:48:33 -0700 Cc: linux-tegra@vger.kernel.org, Mark Zhang , 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The "idle" function of a drm panel is used to tell panel there are no more frames coming in and it should remain the last frame it gets. Normally this only makes sense for smart panels which has internal framebuffer. The "busy" function is opposite to "idle". Signed-off-by: Mark Zhang --- include/drm/drm_panel.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index e53f48aa070f..77da292ad2fb 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -70,6 +70,8 @@ struct display_timing; * the panel. This is the job of the .unprepare() function. */ struct drm_panel_funcs { + int (*idle)(struct drm_panel *panel); + int (*busy)(struct drm_panel *panel); int (*disable)(struct drm_panel *panel); int (*unprepare)(struct drm_panel *panel); int (*prepare)(struct drm_panel *panel); @@ -89,6 +91,22 @@ struct drm_panel { struct list_head list; }; +static inline int drm_panel_idle(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->idle) + return panel->funcs->idle(panel); + + return panel ? -ENOSYS : -EINVAL; +} + +static inline int drm_panel_busy(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->busy) + return panel->funcs->busy(panel); + + return panel ? -ENOSYS : -EINVAL; +} + static inline int drm_panel_unprepare(struct drm_panel *panel) { if (panel && panel->funcs && panel->funcs->unprepare)