From patchwork Mon May 11 01:38:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Zhang X-Patchwork-Id: 470580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3EFA114018C for ; Mon, 11 May 2015 11:38:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752108AbbEKBiq (ORCPT ); Sun, 10 May 2015 21:38:46 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:11429 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752088AbbEKBin (ORCPT ); Sun, 10 May 2015 21:38:43 -0400 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Sun, 10 May 2015 18:38:44 -0700 Received: from hqemhub03.nvidia.com ([172.20.150.15]) by hqnvupgp07.nvidia.com (PGP Universal service); Sun, 10 May 2015 18:37:05 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Sun, 10 May 2015 18:37:05 -0700 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQEMHUB03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.342.0; Sun, 10 May 2015 18:38:42 -0700 Received: from markz-hp6200.nvidia.com (Not Verified[10.19.224.127]) by hqnvemgw01.nvidia.com with MailMarshal (v7,1,2,5326) id ; Sun, 10 May 2015 18:38:42 -0700 From: Mark Zhang To: thierry.reding@gmail.com CC: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 08/12] drm/panel: Add panel func: idle/busy Date: Mon, 11 May 2015 09:38:27 +0800 Message-ID: <1431308311-4470-9-git-send-email-markz@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431308311-4470-1-git-send-email-markz@nvidia.com> References: <1431308311-4470-1-git-send-email-markz@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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 13ff44b28893..0025cd020c40 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -66,6 +66,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); @@ -85,6 +87,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)