From patchwork Wed Sep 5 08:25:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1406311 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 69374DF264 for ; Wed, 5 Sep 2012 08:27:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318Ab2IEI1Z (ORCPT ); Wed, 5 Sep 2012 04:27:25 -0400 Received: from na3sys009aog128.obsmtp.com ([74.125.149.141]:34310 "EHLO na3sys009aog128.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758122Ab2IEI0e (ORCPT ); Wed, 5 Sep 2012 04:26:34 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob128.postini.com ([74.125.148.12]) with SMTP ID DSNKUEcMuYisP1/QuK8ehWNQNtW8XPfbH6k4@postini.com; Wed, 05 Sep 2012 01:26:34 PDT Received: by lbbgj3 with SMTP id gj3so189918lbb.19 for ; Wed, 05 Sep 2012 01:26:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=DtuSdKRxI/k5Z/m2XtVJSB36zcfmlbDFa/ugFgp46Y0=; b=IeS6I4iDKaSo/3P3eBD97/VOt7WNhoX34wTk7pdGjBhB6fQF0RH55WiDLEdhBUi3YH CANvAgVymlN17XFhDfuscANmlD27vbfQ+rOejxlbS+6WHK7F/AdrJ5j4b/+AYGr5/U6G MUG3MoZ5R4bNp6Q/DKtvETlwSeKM2+f8NzyjRUVJbK7yDMuYb0rSz5nvCi2Vy+Qz+p95 IMwrwDu6JFdRx9rRWOyW2E1OoDMW4BfrYJ8XqLB3d/bvai+4XZrIAYpKxM3qMPFmteNA pgmqs5qm/PSY0e0PoId7p72rwIJiESvVvrgdCXap2oKJtqfEEJ6JtSlq45OQezAW2tCG Dwwg== Received: by 10.112.29.232 with SMTP id n8mr5728389lbh.122.1346833592283; Wed, 05 Sep 2012 01:26:32 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id bc2sm279735lbb.3.2012.09.05.01.26.30 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 01:26:31 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, archit@ti.com Cc: Tomi Valkeinen Subject: [PATCH 12/17] OMAPDSS: clean up dss_mgr_set_timings Date: Wed, 5 Sep 2012 11:25:50 +0300 Message-Id: <1346833555-31258-13-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346833555-31258-1-git-send-email-tomi.valkeinen@ti.com> References: <1346833555-31258-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQkSJn5xBaEekM8ycXqVbWEzGARRXvdTet9iiJQ1/qk0ytiMhQeaObJvtzjMnqHhHQ2oVMrC Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org dss_mgr_set_timings() can only be called when the output is not active. This means that most of the code in the function is extra, as there's no need to write the values to registers, etc, because that will be handled when the output will be enabled. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/apply.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 53629dd..1b49019 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -1314,21 +1314,19 @@ void dss_mgr_set_timings(struct omap_overlay_manager *mgr, const struct omap_video_timings *timings) { unsigned long flags; - - mutex_lock(&apply_lock); + struct mgr_priv_data *mp = get_mgr_priv(mgr); spin_lock_irqsave(&data_lock, flags); - dss_apply_mgr_timings(mgr, timings); - - dss_write_regs(); - dss_set_go_bits(); + if (mp->enabled) { + DSSERR("cannot set timings for %s: manager needs to be disabled\n", + mgr->name); + goto out; + } + dss_apply_mgr_timings(mgr, timings); +out: spin_unlock_irqrestore(&data_lock, flags); - - wait_pending_extra_info_updates(); - - mutex_unlock(&apply_lock); } static void dss_apply_mgr_lcd_config(struct omap_overlay_manager *mgr,