From patchwork Wed Jul 25 20:34:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10544643 X-Patchwork-Delegate: agross@codeaurora.org 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 497BC9093 for ; Wed, 25 Jul 2018 20:35:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 392512AB3D for ; Wed, 25 Jul 2018 20:35:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D5522AB4D; Wed, 25 Jul 2018 20:35:33 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 CA7272AB3D for ; Wed, 25 Jul 2018 20:35:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730357AbeGYVsv (ORCPT ); Wed, 25 Jul 2018 17:48:51 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:37691 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730305AbeGYVsv (ORCPT ); Wed, 25 Jul 2018 17:48:51 -0400 Received: by mail-yb0-f193.google.com with SMTP id r3-v6so3512867ybo.4 for ; Wed, 25 Jul 2018 13:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=6ZTac85IUMF64cfhKWN5Z291977FjMugrxItjI79ay0=; b=KDnrBmaLCJZ/VOY1SNDDiT4jf81d5XMBfUk5dXtjPrMPkbbGgDLeAaJSW6VBWW9Q2o 5AMif2AZEq9imvCtDPCp25lIqiRrw5LzIBWKU1ZxXbdDbc7HtpWQqzhjL+MZZF0kwt7E D4YFPh/pTgVp+WGQ9PHzmhlOKQpMgWj5kacvg= 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=6ZTac85IUMF64cfhKWN5Z291977FjMugrxItjI79ay0=; b=EnUjtcEsd5rJcpp5Z/nAcSS2WQm+RlDo05sdjea/x0q4M2/BArOzVN8yZ98jE1Vm/1 919aYgYti3sIHiMla7V5LTf+JsnQbKpFS2WuceCDaBWeGZdd3e6/GKmTlPhdMIX7MRAb N6gXeUwLkskJ2RgkNYelc5yN9WNgHNvNz2bbs9v2sKSkAr4yH9r4SQaJCltTMkoOd3P2 1i62Fr3Qjysg+gsReIzeqVnsV6K5MI/BISpH7bv8LCxQe420pYDloPCx8TAF2t7r111E 8J1GrviyY6wpNA8lN6N97DQOixUfO29IjFmaCCgbuMtXsaJSxca36mJ4HH10XC2PtGNQ Y+nA== X-Gm-Message-State: AOUpUlF3bcS1fpUVlYnwJUIs5p8jmuSpPhQvUE2/DAiTI+7j5d68hWXK zbcVbnhLcPeaIMQXua4N3YfW8W1sLZY= X-Google-Smtp-Source: AAOMgpe6GufHfU7lcap6leuefB82lkDIrIKgbXrYnnaFW+iQd+8QcX011pKE/nu0h7DJpCvidh6MXw== X-Received: by 2002:a25:1b42:: with SMTP id b63-v6mr12279823ybb.385.1532550931388; Wed, 25 Jul 2018 13:35:31 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id f137-v6sm14692568ywb.52.2018.07.25.13.35.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 13:35:30 -0700 (PDT) From: Sean Paul Cc: Sean Paul , Rob Clark , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 1/3] drm/msm: dpu: Use 'vsync' instead of 'vsync_clk' in cmdmode encoder Date: Wed, 25 Jul 2018 16:34:43 -0400 Message-Id: <20180725203529.164928-1-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog To: unlisted-recipients:; (no To-header on input) 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 Should work with the legacy handling in of, but we shouldn't rely on that. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index 035a5fbe1435..e6d02c6947b4 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -424,7 +424,7 @@ static void dpu_encoder_phys_cmd_tearcheck_config( * vsync_count is ratio of MDP VSYNC clock frequency to LCD panel * frequency divided by the no. of rows (lines) in the LCDpanel. */ - vsync_hz = dpu_kms_get_clk_rate(dpu_kms, "vsync_clk"); + vsync_hz = dpu_kms_get_clk_rate(dpu_kms, "vsync"); if (vsync_hz <= 0) { DPU_DEBUG_CMDENC(cmd_enc, "invalid - vsync_hz %u\n", vsync_hz); From patchwork Wed Jul 25 20:34:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10544647 X-Patchwork-Delegate: agross@codeaurora.org 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 7692314E2 for ; Wed, 25 Jul 2018 20:35:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 669742AB64 for ; Wed, 25 Jul 2018 20:35:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AF3F2AB68; Wed, 25 Jul 2018 20:35:51 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 0CB402AB64 for ; Wed, 25 Jul 2018 20:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730305AbeGYVtJ (ORCPT ); Wed, 25 Jul 2018 17:49:09 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:44979 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbeGYVtJ (ORCPT ); Wed, 25 Jul 2018 17:49:09 -0400 Received: by mail-yb0-f194.google.com with SMTP id l16-v6so3510599ybk.11 for ; Wed, 25 Jul 2018 13:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MlyuJVDQeAUxfZ1k6RXnMoxz17jBygBu1WOVxhRzWkU=; b=PDnJtM3yRFJ9KVlrtGq63u0RzM04TJ/2bH9tBzt5ru0erzGN4UnKzWuDbkn/D7B4Ti 31jug1OBqucMILp0hajW768SERCrwZngStdsquf7CtHT7mHo0rc1oNdM++lrrTIkcbz9 Px8aGN8DjuXE86KRFQP5uEaU+kVZnf8vvBX10= 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:in-reply-to :references; bh=MlyuJVDQeAUxfZ1k6RXnMoxz17jBygBu1WOVxhRzWkU=; b=Q6SwIQaBvqGntPoNgCrXvR3nr+1tHqlwbaYJ3GaoGJkea9U6x73OX/7/xFKOUVlwa8 sVmYMXmCnmfw+7o9wquk/X/pKLNSOTDPE7diGRIpbHue/tNEVlGNYKE0VPCO0y0wzhT7 FUWD+yaEzFbJd7snsbP1fPN1gRwOucY9ctTPnVW5y4uSN4wehQKftBGmaspRyoosLUBI VFKkXLhky3i5tE+K8tE4e0G0d3RdGCauYSSV/psBzioSKZw+a96mRsX8i9Nhby2iRXRj qKiQtQgDtQ9KmG26k96YU7TzY8EnaZ45PxHhOH/7vc6gvmaa3P9LXgstIAHDzJ/2Bboh 588Q== X-Gm-Message-State: AOUpUlF/Hi1m9YPsIWQt/LO8PNhSD0K6+NzLxZQIJQs3bxdxRxfPcOm5 h2cw6gwzW3AgUj4SDwEghTJ1uA== X-Google-Smtp-Source: AAOMgpewY7scfiQI0n7rW2B50JWQEf/TxdbL9tvtOCNLSsj7WNriV2hmCLaJgO4fSvf4uq1LzI7fag== X-Received: by 2002:a25:9d0d:: with SMTP id i13-v6mr12377359ybp.104.1532550949697; Wed, 25 Jul 2018 13:35:49 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id f137-v6sm14692568ywb.52.2018.07.25.13.35.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 13:35:49 -0700 (PDT) From: Sean Paul Cc: Sean Paul , Rob Clark , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 2/3] drm/msm: dpu: Use clock-names instead of assigned-clock-names Date: Wed, 25 Jul 2018 16:34:44 -0400 Message-Id: <20180725203529.164928-2-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog In-Reply-To: <20180725203529.164928-1-seanpaul@chromium.org> References: <20180725203529.164928-1-seanpaul@chromium.org> To: unlisted-recipients:; (no To-header on input) 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 In these cases, we want to enumerate _all_ clocks, not just the ones that are assigned a rate. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c index 8d907faa7496..c1d7eac4fa25 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c @@ -147,8 +147,7 @@ int msm_dss_parse_clock(struct platform_device *pdev, return -EINVAL; mp->num_clk = 0; - num_clk = of_property_count_strings(pdev->dev.of_node, - "assigned-clock-names"); + num_clk = of_property_count_strings(pdev->dev.of_node, "clock-names"); if (num_clk <= 0) { pr_debug("clocks are not defined\n"); return 0; @@ -162,7 +161,7 @@ int msm_dss_parse_clock(struct platform_device *pdev, for (i = 0; i < num_clk; i++) { rc = of_property_read_string_index(pdev->dev.of_node, - "assigned-clock-names", i, + "clock-names", i, &clock_name); if (rc) { dev_err(&pdev->dev, "Failed to get clock name for %d\n", From patchwork Wed Jul 25 20:34:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10544651 X-Patchwork-Delegate: agross@codeaurora.org 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 363EA9093 for ; Wed, 25 Jul 2018 20:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 268862AB3D for ; Wed, 25 Jul 2018 20:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AC422AB4D; Wed, 25 Jul 2018 20:36:15 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A16A32AB3D for ; Wed, 25 Jul 2018 20:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730535AbeGYVtd (ORCPT ); Wed, 25 Jul 2018 17:49:33 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:45307 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbeGYVtd (ORCPT ); Wed, 25 Jul 2018 17:49:33 -0400 Received: by mail-yb0-f194.google.com with SMTP id h127-v6so3505350ybg.12 for ; Wed, 25 Jul 2018 13:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fNeUTlJ4GhpcI96stLqkvrFGlBMidcc1UWinuiedkOM=; b=RBdZ0gAvAROj3CjRPl5DVFRlkX9Kr0cZlJMUWbYAB6iEN6xzqLrAnfi90ias66TGgw 4BozGFUvmEz4QkJgFBxfGoDDz9HbFqqueOg3S/SySrFWxshNI1vkFflgERpOnlrTF3Ki V4/wx4/Xq1iKkQ/M2tix7zitHc+VGlDLL6Zec= 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:in-reply-to :references; bh=fNeUTlJ4GhpcI96stLqkvrFGlBMidcc1UWinuiedkOM=; b=VwbsBxVu0iX6atL7xmH4+mSN2Pd8CdMEu8XXMo56pbg+gKD2ihYmKlTo7bQW6zkwot UzfQUZDVQA2Eruvn6ByXXSeDtmQ0KY9Gynzw0BLXfdvj9hYVT8gtO0AjFtZEEbYBpgZ0 klebk6CUjV0vkon732QAb24SL7xIf26awbij+fNq0o+SH3XDJQ1I/G8KgMPXv3FN908c yGVh2YvhDBBEKbTlxYWzApezsz/GEsC3tH+TwrDxW0WZMjj++D0XiO4vqM0Q3Y0D1HZF PVDg7yP/ZUcxdbgfguF0KN0xqQ7pzc5oRX05St0AbFZQHZkK+3bY5JSozkWWQTs/Txew CHpQ== X-Gm-Message-State: AOUpUlFLAMxeU2Fn/aH3lKMFrh1oZO9Hf45ZEOjY1zlTGg6mbYnEE+0+ fdTyGgOX2yuKgBtx5mLlMfLfew== X-Google-Smtp-Source: AAOMgpfVjnL+pED6r8ueR8oK+1+6VAYDKIVDDnesE4vDLzQPR3M1DqzI/bMoEevYJQCHRrYlns1+5A== X-Received: by 2002:a25:ddc1:: with SMTP id u184-v6mr11405709ybg.457.1532550972869; Wed, 25 Jul 2018 13:36:12 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id f137-v6sm14692568ywb.52.2018.07.25.13.36.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 13:36:12 -0700 (PDT) From: Sean Paul Cc: Sean Paul , Rob Clark , Sibi Sankar , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 3/3] drm/msm: dsi: Handle dual-channel for 6G as well Date: Wed, 25 Jul 2018 16:34:45 -0400 Message-Id: <20180725203529.164928-3-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog In-Reply-To: <20180725203529.164928-1-seanpaul@chromium.org> References: <20180725203529.164928-1-seanpaul@chromium.org> To: unlisted-recipients:; (no To-header on input) 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 This fixes up a collision between introducing dual-channel support and the dsi refactors. This patch applies the same dual-channel considerations and pclk calculations to both v2 and 6G, with a bit of abstracting for good measure. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/dsi/dsi_host.c | 72 +++++++++++++++--------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 319501dcc083..96fb5f635314 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -664,11 +664,9 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host) clk_disable_unprepare(msm_host->byte_clk); } -int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi) +static u32 dsi_get_pclk_rate(struct msm_dsi_host *msm_host, bool is_dual_dsi) { struct drm_display_mode *mode = msm_host->mode; - u8 lanes = msm_host->lanes; - u32 bpp = dsi_get_bpp(msm_host->format); u32 pclk_rate; pclk_rate = mode->clock * 1000; @@ -676,61 +674,61 @@ int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi) /* * For dual DSI mode, the current DRM mode has the complete width of the * panel. Since, the complete panel is driven by two DSI controllers, - * theclock rates have to be split between the two dsi controllers. + * the clock rates have to be split between the two dsi controllers. * Adjust the byte and pixel clock rates for each dsi host accordingly. */ if (is_dual_dsi) pclk_rate /= 2; - if (lanes > 0) { - msm_host->byte_clk_rate = (pclk_rate * bpp) / (8 * lanes); - } else { + return pclk_rate; +} + +static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_dual_dsi) +{ + u8 lanes = msm_host->lanes; + u32 bpp = dsi_get_bpp(msm_host->format); + u32 pclk_rate = dsi_get_pclk_rate(msm_host, is_dual_dsi); + u64 pclk_bpp = (u64)pclk_rate * bpp; + + if (lanes == 0) { pr_err("%s: forcing mdss_dsi lanes to 1\n", __func__); - msm_host->byte_clk_rate = (pclk_rate * bpp) / 8; + lanes = 1; } - DBG("pclk=%d, bclk=%d", pclk_rate, msm_host->byte_clk_rate); + do_div(pclk_bpp, (8 * lanes)); - msm_host->esc_clk_rate = clk_get_rate(msm_host->esc_clk); + msm_host->pixel_clk_rate = pclk_rate; + msm_host->byte_clk_rate = pclk_bpp; + + DBG("pclk=%d, bclk=%d", msm_host->pixel_clk_rate, + msm_host->byte_clk_rate); + +} + +int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi) +{ + if (!msm_host->mode) { + pr_err("%s: mode not set\n", __func__); + return -EINVAL; + } + dsi_calc_pclk(msm_host, is_dual_dsi); + msm_host->esc_clk_rate = clk_get_rate(msm_host->esc_clk); return 0; } int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_dual_dsi) { - struct drm_display_mode *mode = msm_host->mode; - u8 lanes = msm_host->lanes; u32 bpp = dsi_get_bpp(msm_host->format); - u32 pclk_rate; u64 pclk_bpp; unsigned int esc_mhz, esc_div; unsigned long byte_mhz; - pclk_rate = mode->clock * 1000; - - /* - * For dual DSI mode, the current DRM mode has the complete width of the - * panel. Since, the complete panel is driven by two DSI controllers, - * theclock rates have to be split between the two dsi controllers. - * Adjust the byte and pixel clock rates for each dsi host accordingly. - */ - if (is_dual_dsi) - pclk_rate /= 2; - - pclk_bpp = pclk_rate * bpp; - if (lanes > 0) { - do_div(pclk_bpp, (8 * lanes)); - } else { - pr_err("%s: forcing mdss_dsi lanes to 1\n", __func__); - do_div(pclk_bpp, 8); - } - msm_host->pixel_clk_rate = pclk_rate; - msm_host->byte_clk_rate = pclk_bpp; - - DBG("pclk=%d, bclk=%d", msm_host->pixel_clk_rate, - msm_host->byte_clk_rate); + dsi_calc_pclk(msm_host, is_dual_dsi); - msm_host->src_clk_rate = (pclk_rate * bpp) / 8; + pclk_bpp = (u64)dsi_get_pclk_rate(msm_host, is_dual_dsi) * bpp; + do_div(pclk_bpp, 8); + msm_host->src_clk_rate = pclk_bpp; /* * esc clock is byte clock followed by a 4 bit divider,