From patchwork Thu Jun 9 13:56:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 865462 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p59DwhHE025840 for ; Thu, 9 Jun 2011 13:58:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932084Ab1FIN6l (ORCPT ); Thu, 9 Jun 2011 09:58:41 -0400 Received: from na3sys009aog103.obsmtp.com ([74.125.149.71]:39141 "EHLO na3sys009aog103.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757989Ab1FIN6K (ORCPT ); Thu, 9 Jun 2011 09:58:10 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]) (using TLSv1) by na3sys009aob103.postini.com ([74.125.148.12]) with SMTP ID DSNKTfDRbtDIIRrcJEY/CRnCdLfcrQ3pO/ie@postini.com; Thu, 09 Jun 2011 06:58:08 PDT Received: by mail-fx0-f46.google.com with SMTP id 17so1326984fxm.5 for ; Thu, 09 Jun 2011 06:58:06 -0700 (PDT) Received: by 10.223.76.219 with SMTP id d27mr843496fak.87.1307627886656; Thu, 09 Jun 2011 06:58:06 -0700 (PDT) Received: from localhost.localdomain (a62-248-131-233.elisa-laajakaista.fi [62.248.131.233]) by mx.google.com with ESMTPS id q10sm669900fan.8.2011.06.09.06.58.04 (version=SSLv3 cipher=OTHER); Thu, 09 Jun 2011 06:58:05 -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: [PATCHv2 28/28] OMAP: DSS2: DSS: Fix context save/restore Date: Thu, 9 Jun 2011 16:56:50 +0300 Message-Id: <1307627810-3768-29-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1307627810-3768-1-git-send-email-tomi.valkeinen@ti.com> References: <1307627810-3768-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]); Thu, 09 Jun 2011 13:58:44 +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 21c8389..5c6499a 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -74,6 +74,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; @@ -109,12 +110,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) & @@ -122,6 +130,8 @@ static void dss_restore_context(void) RR(SDI_CONTROL); RR(PLL_CONTROL); } + + DSSDBG("context restored\n"); } #undef SR