From patchwork Fri Oct 31 22:54:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207491 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5572B9F318 for ; Fri, 31 Oct 2014 23:57:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FB7A20176 for ; Fri, 31 Oct 2014 23:57:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 94C7F20172 for ; Fri, 31 Oct 2014 23:57:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EDE06E859; Fri, 31 Oct 2014 16:56:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 20B4E6E851 for ; Fri, 31 Oct 2014 15:57:03 -0700 (PDT) Received: by mail-pa0-f53.google.com with SMTP id kx10so8483073pab.26 for ; Fri, 31 Oct 2014 15:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qcupI58dJqtC9ZsQ+tB8DhG/l/ihVMxIXycP8J3AVcM=; b=NZyWxfK5NXTk/T13FM6to2J8TL6bYqpwF0Oi7vF1GELMyZnT6oYFac6DWomOgvRqmv BEScb/+m5u0P035lgehgupILrhIFc2UqhTKTX6LJBX73T4R0iq0ngXNQ9Ux/hNx8qP8u 66NIX+2+FNSqnIWQZ56tawGbogOsH+x6d1wRNGULilen0Hju7tXgietz2lZvQEEJDkzg 7sPkERGKS4J7WHE2dBhuxmKFPz3J2161aG5f55cpOziwkz9ii3/9TAuGYQvcBYYIKeAn J4JKlTcxhWiXqTsOhc67xqsXTmxcClBV9GT3QnxTZePr/0/zLDse6I9PVjP1I3+0/Lva cc9w== X-Received: by 10.70.44.99 with SMTP id d3mr27880619pdm.46.1414796223009; Fri, 31 Oct 2014 15:57:03 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:02 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 18/72] gpu: ipu-v3: Split out DI clock enable/disable Date: Fri, 31 Oct 2014 15:54:01 -0700 Message-Id: <1414796095-10107-19-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:31 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DI clock enable/disable is moved out of ipu_di_enable() and ipu_di_disable() and into (new) ipu_di_enable_clock() and ipu_di_disable_clock(). So ipu_di_enable() and ipu_di_disable() are now pure module enable/disable. The purpose of this change is to more closely emulate the display mode setting sequence in FSL kernels, which enable and disable the DI clock as the very last steps during legacy fbdev set_par(). Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-di.c | 20 +++++++++++++------- drivers/staging/imx-drm/ipuv3-crtc.c | 2 ++ include/video/imx-ipu-v3.h | 2 ++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c index 9841419..7ab19a3 100644 --- a/drivers/gpu/ipu-v3/ipu-di.c +++ b/drivers/gpu/ipu-v3/ipu-di.c @@ -659,14 +659,8 @@ EXPORT_SYMBOL(ipu_di_uninit_sync_panel); int ipu_di_enable(struct ipu_di *di) { - int ret; - WARN_ON(IS_ERR(di->clk_di_pixel)); - ret = clk_prepare_enable(di->clk_di_pixel); - if (ret) - return ret; - dev_dbg(di->ipu->dev, "DI%d enable\n", di->id); ipu_module_enable(di->ipu, di->module); @@ -674,6 +668,12 @@ int ipu_di_enable(struct ipu_di *di) } EXPORT_SYMBOL_GPL(ipu_di_enable); +int ipu_di_enable_clock(struct ipu_di *di) +{ + return clk_prepare_enable(di->clk_di_pixel); +} +EXPORT_SYMBOL_GPL(ipu_di_enable_clock); + int ipu_di_disable(struct ipu_di *di) { WARN_ON(IS_ERR(di->clk_di_pixel)); @@ -681,11 +681,17 @@ int ipu_di_disable(struct ipu_di *di) dev_dbg(di->ipu->dev, "DI%d disable\n", di->id); ipu_module_disable(di->ipu, di->module); + return 0; +} +EXPORT_SYMBOL_GPL(ipu_di_disable); + +int ipu_di_disable_clock(struct ipu_di *di) +{ clk_disable_unprepare(di->clk_di_pixel); return 0; } -EXPORT_SYMBOL_GPL(ipu_di_disable); +EXPORT_SYMBOL_GPL(ipu_di_disable_clock); int ipu_di_get_num(struct ipu_di *di) { diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c index 7053619..be24cb9 100644 --- a/drivers/staging/imx-drm/ipuv3-crtc.c +++ b/drivers/staging/imx-drm/ipuv3-crtc.c @@ -68,6 +68,7 @@ static void ipu_fb_enable(struct ipu_crtc *ipu_crtc) /* Start DC channel and DI after IDMAC */ ipu_dc_enable_channel(ipu_crtc->dc); ipu_di_enable(ipu_crtc->di); + ipu_di_enable_clock(ipu_crtc->di); ipu_crtc->enabled = 1; } @@ -82,6 +83,7 @@ static void ipu_fb_disable(struct ipu_crtc *ipu_crtc) ipu_di_disable(ipu_crtc->di); ipu_plane_disable(ipu_crtc->plane[0]); ipu_dc_disable(ipu_crtc->dc); + ipu_di_disable_clock(ipu_crtc->di); ipu_crtc->enabled = 0; } diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 01ab5e0..31b6fde 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -257,7 +257,9 @@ void ipu_dc_disable(struct ipu_dc *dc); struct ipu_di *ipu_di_get(struct ipu_soc *ipu, int disp); void ipu_di_put(struct ipu_di *); int ipu_di_disable(struct ipu_di *); +int ipu_di_disable_clock(struct ipu_di *di); int ipu_di_enable(struct ipu_di *); +int ipu_di_enable_clock(struct ipu_di *di); int ipu_di_get_num(struct ipu_di *); int ipu_di_init_sync_panel(struct ipu_di *, struct ipu_di_signal_cfg *sig); void ipu_di_uninit_sync_panel(struct ipu_di *di);