From patchwork Thu Aug 30 11:40:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 1387891 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8FC743FDF5 for ; Thu, 30 Aug 2012 11:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754788Ab2H3Lnb (ORCPT ); Thu, 30 Aug 2012 07:43:31 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:34309 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754772Ab2H3Lna (ORCPT ); Thu, 30 Aug 2012 07:43:30 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7UBhUCW009320; Thu, 30 Aug 2012 06:43:30 -0500 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 q7UBhUsY001584; Thu, 30 Aug 2012 06:43:30 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Thu, 30 Aug 2012 06:43:29 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7UBhTqA005759; Thu, 30 Aug 2012 06:43:29 -0500 Received: from localhost (a0393947pc.apr.dhcp.ti.com [172.24.137.248]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id q7UBhRr25286; Thu, 30 Aug 2012 06:43:28 -0500 (CDT) From: Archit Taneja To: CC: , , , Archit Taneja Subject: [PATCH v2 20/23] OMAPDSS: MANAGER: Update display sysfs store Date: Thu, 30 Aug 2012 17:10:42 +0530 Message-ID: <1346326845-16583-21-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346326845-16583-1-git-send-email-archit@ti.com> References: <1345528711-27801-1-git-send-email-archit@ti.com> <1346326845-16583-1-git-send-email-archit@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 The display sysfs attribute's store function needs to be changed with the introduction of outputs. Providing a manager to the display isn't enough to create a link now, the manager needs and output to connect to. A manager's display store file only has the information of the manager and the desired display, it is not aware of which output should the manager connect to. Because of this, a new constraint needs to be set up when setting a display via this sysfs file. The constraint is that the desired display should already be connected to an output before calling this sysfs function. This might break some existing user space stuff which uses sysfs directly. But in most cases dss_recheck_connections will connect displays to floating outputs. DSS sysfs files are being planned to be remove anyway, so it's not much of a harm. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/manager.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index fd39f66..d808ce2 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -74,18 +74,33 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, if (dssdev) DSSDBG("display %s found\n", dssdev->name); - if (mgr->get_device(mgr)) { - r = mgr->unset_device(mgr); + if (mgr->output) { + if (mgr->output->device) { + r = mgr->output->unset_device(mgr->output); + if (r) { + goto put_device; + DSSERR("failed to unset device from output\n"); + } + } + + r = mgr->unset_output(mgr); if (r) { - DSSERR("failed to unset display\n"); + DSSERR("failed to unset current output\n"); goto put_device; } } if (dssdev) { - r = mgr->set_device(mgr, dssdev); + struct omap_dss_output *out = dssdev->output; + + if (!out) { + DSSERR("no output connected to device\n"); + goto put_device; + } + + r = mgr->set_output(mgr, out); if (r) { - DSSERR("failed to set manager\n"); + DSSERR("failed to set manager output\n"); goto put_device; }