From patchwork Fri Dec 7 11:55:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1850491 Return-Path: X-Original-To: patchwork-linux-fbdev@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 EAD16DF2EE for ; Fri, 7 Dec 2012 11:55:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933664Ab2LGLzd (ORCPT ); Fri, 7 Dec 2012 06:55:33 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:58707 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932668Ab2LGLzc (ORCPT ); Fri, 7 Dec 2012 06:55:32 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qB7BtWmD029316; Fri, 7 Dec 2012 05:55:32 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qB7BtW07003692; Fri, 7 Dec 2012 05:55:32 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Fri, 7 Dec 2012 05:55:31 -0600 Received: from deskari.tieu.ti.com (h64-8.vpn.ti.com [172.24.64.8]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qB7BtOx1028935; Fri, 7 Dec 2012 05:55:30 -0600 From: Tomi Valkeinen To: Archit Taneja , , CC: Tomi Valkeinen Subject: [PATCH 5/5] OMAPFB: connect ovl managers to all dssdevs Date: Fri, 7 Dec 2012 13:55:09 +0200 Message-ID: <1354881309-17625-5-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1354881309-17625-1-git-send-email-tomi.valkeinen@ti.com> References: <1354881309-17625-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Commit 5d89bcc341771d95e3a2996218e5949a6627f59e (OMAPDSS: remove initial display code from omapdss) moved setting up the initial overlay, overlay manager, output and display connections from omapdss to omapfb. However, currently omapfb only handles the connection related to the default display, which means that no overlay managers are connected to other displays. This patch changes omapfb to go through all dssdevs, and connect an overlay manager to them. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/omapfb/omapfb-main.c | 38 +++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 1df973e..24739fc 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -2353,27 +2353,37 @@ static int omapfb_init_display(struct omapfb2_device *fbdev, } static int omapfb_init_connections(struct omapfb2_device *fbdev, - struct omap_dss_device *dssdev) + struct omap_dss_device *def_dssdev) { int i, r; - struct omap_overlay_manager *mgr = NULL; + struct omap_overlay_manager *mgr; - for (i = 0; i < fbdev->num_managers; i++) { - mgr = fbdev->managers[i]; - - if (dssdev->channel == mgr->id) - break; + if (!def_dssdev->output) { + dev_err(fbdev->dev, "no output for the default display\n"); + return -EINVAL; } - if (i == fbdev->num_managers) - return -ENODEV; + for (i = 0; i < fbdev->num_displays; ++i) { + struct omap_dss_device *dssdev = fbdev->displays[i].dssdev; + struct omap_dss_output *out = dssdev->output; - if (mgr->output) - mgr->unset_output(mgr); + mgr = omap_dss_get_overlay_manager(dssdev->channel); - r = mgr->set_output(mgr, dssdev->output); - if (r) - return r; + if (!mgr || !out) + continue; + + if (mgr->output) + mgr->unset_output(mgr); + + mgr->set_output(mgr, out); + } + + mgr = def_dssdev->output->manager; + + if (!mgr) { + dev_err(fbdev->dev, "no ovl manager for the default display\n"); + return -EINVAL; + } for (i = 0; i < fbdev->num_overlays; i++) { struct omap_overlay *ovl = fbdev->overlays[i];