From patchwork Thu May 30 09:35:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2634881 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 13764DF2A1 for ; Thu, 30 May 2013 09:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030406Ab3E3Jgw (ORCPT ); Thu, 30 May 2013 05:36:52 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:42822 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030397Ab3E3Jgv (ORCPT ); Thu, 30 May 2013 05:36:51 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4U9apRo024724; Thu, 30 May 2013 04:36:51 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4U9apEd006683; Thu, 30 May 2013 04:36:51 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Thu, 30 May 2013 04:36:50 -0500 Received: from deskari.tieu.ti.com (h64-9.vpn.ti.com [172.24.64.9]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4U9ahnZ003302; Thu, 30 May 2013 04:36:49 -0500 From: Tomi Valkeinen To: , , Archit Taneja CC: Tomi Valkeinen Subject: [PATCH 02/27] OMAPDSS: modify get/find functions to go through the device chain Date: Thu, 30 May 2013 12:35:55 +0300 Message-ID: <1369906580-27585-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369906580-27585-1-git-send-email-tomi.valkeinen@ti.com> References: <1369906580-27585-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org In the future will have arbitrarily long video pipeline chains, instead of the current two-entities-per-pipeline model. This patch changes the affected get/find style functions so that they properly go through the video pipeline chain, for example when getting the overlay manager connected to a given display. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/apply.c | 14 +++++++++++++- drivers/video/omap2/dss/output.c | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 752b985..d6212d63 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -422,7 +422,19 @@ static void wait_pending_extra_info_updates(void) static struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr) { - return mgr->output ? mgr->output->device : NULL; + struct omap_dss_device *dssdev; + + dssdev = mgr->output; + if (dssdev == NULL) + return NULL; + + while (dssdev->device) + dssdev = dssdev->device; + + if (dssdev->driver) + return dssdev; + else + return NULL; } static struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl) diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index 0ba168e..3f5c0a7 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c @@ -146,7 +146,13 @@ EXPORT_SYMBOL(omap_dss_find_output_by_node); struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev) { - return omap_dss_get_device(dssdev->output); + while (dssdev->output) + dssdev = dssdev->output; + + if (dssdev->id != 0) + return omap_dss_get_device(dssdev); + + return NULL; } EXPORT_SYMBOL(omapdss_find_output_from_display);