From patchwork Fri Jun 3 10:00:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 846412 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p53An0jE017589 for ; Fri, 3 Jun 2011 10:49:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754415Ab1FCKCA (ORCPT ); Fri, 3 Jun 2011 06:02:00 -0400 Received: from na3sys009aog115.obsmtp.com ([74.125.149.238]:45533 "EHLO na3sys009aog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754392Ab1FCKCA (ORCPT ); Fri, 3 Jun 2011 06:02:00 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]) (using TLSv1) by na3sys009aob115.postini.com ([74.125.148.12]) with SMTP ID DSNKTeixF20PgEM4I4oDg8mnNA8VKNLprdol@postini.com; Fri, 03 Jun 2011 03:02:00 PDT Received: by mail-fx0-f41.google.com with SMTP id 18so1709861fxm.14 for ; Fri, 03 Jun 2011 03:01:59 -0700 (PDT) Received: by 10.223.59.146 with SMTP id l18mr1897109fah.58.1307095319075; Fri, 03 Jun 2011 03:01:59 -0700 (PDT) Received: from localhost.localdomain (a62-248-131-233.elisa-laajakaista.fi [62.248.131.233]) by mx.google.com with ESMTPS id b22sm445843fak.1.2011.06.03.03.01.57 (version=SSLv3 cipher=OTHER); Fri, 03 Jun 2011 03:01:58 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: b-cousson@ti.com, paul@pwsan.com, khilman@ti.com, Tomi Valkeinen Subject: [PATCH 27/27] OMAP: DSS2: DSS: Fix context save/restore Date: Fri, 3 Jun 2011 13:00:37 +0300 Message-Id: <1307095237-14805-28-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1307095237-14805-1-git-send-email-tomi.valkeinen@ti.com> References: <1307095237-14805-1-git-send-email-tomi.valkeinen@ti.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 03 Jun 2011 10:49:09 +0000 (UTC) The current method of saving and restoring the context could cause a restore before saving, effectively "restoring" zero values to registers. Add ctx_valid field to indicate if the saved context is valid and can be restored. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 91572b6..964eb08 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -77,6 +77,7 @@ static struct { enum omap_dss_clk_source dispc_clk_source; enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS]; + bool ctx_valid; u32 ctx[DSS_SZ_REGS / sizeof(u32)]; } dss; @@ -112,12 +113,19 @@ static void dss_save_context(void) SR(SDI_CONTROL); SR(PLL_CONTROL); } + + dss.ctx_valid = true; + + DSSDBG("context saved\n"); } static void dss_restore_context(void) { DSSDBG("dss_restore_context\n"); + if (!dss.ctx_valid) + return; + RR(CONTROL); if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) & @@ -125,6 +133,8 @@ static void dss_restore_context(void) RR(SDI_CONTROL); RR(PLL_CONTROL); } + + DSSDBG("context restored\n"); } #undef SR