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: 1406301 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 DE8AADF264 for ; Wed, 5 Sep 2012 08:27:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757462Ab2IEI1Z (ORCPT ); Wed, 5 Sep 2012 04:27:25 -0400 Received: from na3sys009aog130.obsmtp.com ([74.125.149.143]:48762 "EHLO na3sys009aog130.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758035Ab2IEI0e (ORCPT ); Wed, 5 Sep 2012 04:26:34 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob130.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 gj3so189919lbb.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=O61eLiJ4fE8SxKgOk0p3h79lMC3HvDdHY+AZC4YWplebBakqMcYXXvhE1vuV9uGW3i 3nBSUbuwL1OnWP81gEWNTjgRxq8DaaNFJ2YikEPqkntSk8TdN6i95lU4wmwTvwBDw3Il VvFuY9M3RKjOx0NnsLtsZamaX/7nAaZz8bwXONdRWxBSS/0yRpUvDoTEttt1me4UaToV 3PghnnyQmoi1naYdcdzeXs5OskHXpxQGddVLZ9Fs7KCyphVeVOvXi9Vjk3EZ+C0/5IR9 weJi6t45/2uW0HrDGw3uYwxK5UU5JhQKJtU/jTDMeef6hjb1Zr2+SZc/mUrr1rCLCnVR OwTA== 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: ALoCoQn0oCD9brO2TDfWCKaFtj9KfLipJ0A94NMCXieuqd7nvv62DwL4xFWEg2rlScox0y/2zU1T Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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,