From patchwork Wed Nov 14 22:24:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Marek X-Patchwork-Id: 10683215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD8E814DB for ; Wed, 14 Nov 2018 22:28:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D07A529D13 for ; Wed, 14 Nov 2018 22:28:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C46A829D40; Wed, 14 Nov 2018 22:28:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5818C29D13 for ; Wed, 14 Nov 2018 22:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388342AbeKOIch (ORCPT ); Thu, 15 Nov 2018 03:32:37 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:37494 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726644AbeKOIch (ORCPT ); Thu, 15 Nov 2018 03:32:37 -0500 Received: by mail-qk1-f195.google.com with SMTP id 131so28781392qkd.4 for ; Wed, 14 Nov 2018 14:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek-ca.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=otHAAoJeXEc/P3G/AXr3bWGwZWsjr5VuAddyjFBEbz8=; b=W2PSZmkgLl+pPs0SdDeahlYMhhbo867cs819v+QI1hfxY9SoEqnEp8/HZBwOs5tKzb 2EFqlrw98eJ03EdrIwxJJ0EaMpHsOWrNW9sTGyuvo1eG259wELmgjbIcMOguxmW7BzlW hHYzlLiSBY4G2q8IkjnPOQsXE19nYX6w/VTbAGjyPkAMv42GyXOH6IVCJ55EqRWkwY1O AXAP5WspptyRPdJ4qlNNbdI9RIAv0JElgkYA3srGWeyGtyOgxsnlb0Igk1J43YAgfBlT stqTDbFYOnydQgPxzPvbXpcEegVipDzvWgPJfpKglV8XpvvXCVi7eM3Fp2HQD6/RI4gt j+4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=otHAAoJeXEc/P3G/AXr3bWGwZWsjr5VuAddyjFBEbz8=; b=qavXupURJouG7pPQcysQ64RLLchd9jCDMG2bXC3qstHJz/hXwp3Bwk3/5yGkqUnezO dWC6DdWUcRJ69PTS9sip2KpPUMPqEgu6WFXdKJFETHqES4nT+HpUAaNCfziig8H8aa8Z w8djzWptCJ5w0tLNHI6vojw+PCJCXOc62VCGr10SPbvAmGSAzjuPYre8g4FS9FYsMbkZ +zM32ho0m5lQTyXbxGeZN07qDoveZCgOIzYfH0a62s7HsxT9nvN38paCH3T2onQCsFcU oQV1dTD8bKErOeIRj9vR77hHog9uZzvWaF3rXB/06FwvlsLSg2JbCkorsQU6jemgfaYE 8kuQ== X-Gm-Message-State: AGRZ1gLZ/KSXwZtjnJKeTUA17Z7WRTp7t6we1sY8lqA+mQsl9JwtKsYt pVk9kxB00HiHivSEF7Qt7eaGYw== X-Google-Smtp-Source: AJdET5eTcpb9V7jPmDwJDLI0vCTjGj6rVW8niA3U3Mjyb5HBRRdHhsvcTsWtNry9/xjtPmf+yLdngw== X-Received: by 2002:a0c:afd1:: with SMTP id t17mr3745998qvc.93.1542234451549; Wed, 14 Nov 2018 14:27:31 -0800 (PST) Received: from localhost.localdomain (modemcable014.247-57-74.mc.videotron.ca. [74.57.247.14]) by smtp.gmail.com with ESMTPSA id 24sm24067595qkp.65.2018.11.14.14.27.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 14:27:30 -0800 (PST) From: Jonathan Marek To: freedreno@lists.freedesktop.org Cc: Rob Clark , David Airlie , Sean Paul , Steve Kowalik , Rajesh Yadav , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), dri-devel@lists.freedesktop.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/9] drm/msm/mdp4: only use lut_clk on mdp4.2+ Date: Wed, 14 Nov 2018 17:24:08 -0500 Message-Id: <20181114222418.15960-1-jonathan@marek.ca> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jonathan Marek --- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index ae25d763cd8c..8f765f284d11 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -206,7 +206,8 @@ int mdp4_disable(struct mdp4_kms *mdp4_kms) clk_disable_unprepare(mdp4_kms->clk); if (mdp4_kms->pclk) clk_disable_unprepare(mdp4_kms->pclk); - clk_disable_unprepare(mdp4_kms->lut_clk); + if (mdp4_kms->lut_clk) + clk_disable_unprepare(mdp4_kms->lut_clk); if (mdp4_kms->axi_clk) clk_disable_unprepare(mdp4_kms->axi_clk); @@ -220,7 +221,8 @@ int mdp4_enable(struct mdp4_kms *mdp4_kms) clk_prepare_enable(mdp4_kms->clk); if (mdp4_kms->pclk) clk_prepare_enable(mdp4_kms->pclk); - clk_prepare_enable(mdp4_kms->lut_clk); + if (mdp4_kms->lut_clk) + clk_prepare_enable(mdp4_kms->lut_clk); if (mdp4_kms->axi_clk) clk_prepare_enable(mdp4_kms->axi_clk); @@ -472,12 +474,13 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev) if (IS_ERR(mdp4_kms->pclk)) mdp4_kms->pclk = NULL; - // XXX if (rev >= MDP_REV_42) { ??? - mdp4_kms->lut_clk = devm_clk_get(&pdev->dev, "lut_clk"); - if (IS_ERR(mdp4_kms->lut_clk)) { - dev_err(dev->dev, "failed to get lut_clk\n"); - ret = PTR_ERR(mdp4_kms->lut_clk); - goto fail; + if (mdp4_kms->rev >= 2) { + mdp4_kms->lut_clk = devm_clk_get(&pdev->dev, "lut_clk"); + if (IS_ERR(mdp4_kms->lut_clk)) { + dev_err(dev->dev, "failed to get lut_clk\n"); + ret = PTR_ERR(mdp4_kms->lut_clk); + goto fail; + } } mdp4_kms->axi_clk = devm_clk_get(&pdev->dev, "bus_clk"); @@ -488,7 +491,8 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev) } clk_set_rate(mdp4_kms->clk, config->max_clk); - clk_set_rate(mdp4_kms->lut_clk, config->max_clk); + if (mdp4_kms->lut_clk) + clk_set_rate(mdp4_kms->lut_clk, config->max_clk); pm_runtime_enable(dev->dev); mdp4_kms->rpm_enabled = true;